Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#22569 closed defect (bug) (fixed)

Show a better message on link-manager.php when links are disabled

Reported by: nacin's profile nacin Owned by: ryan's profile ryan
Milestone: 3.5 Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

We enforce the disabling of links via map_meta_cap(), since it's easy and clean. But it does mean that cap checks fail, which usually produces "You do not have sufficient permissions".

I meant to add a second message, but never did. Let's do that.

Attachments (4)

22569.diff (3.8 KB) - added by nacin 11 years ago.
If we went all out, here's how I'd do it.
22569.2.diff (3.7 KB) - added by nacin 11 years ago.
22569.3.diff (1.2 KB) - added by nacin 11 years ago.
22569.4.diff (1.8 KB) - added by nacin 11 years ago.

Download all attachments as: .zip

Change History (12)

@nacin
11 years ago

If we went all out, here's how I'd do it.

#1 @nacin
11 years ago

  • Keywords has-patch added

#2 @TobiasBg
11 years ago

Are those localhost URLs in the patch correct?

#3 @nacin
11 years ago

Hah. Clearly not. :)

@nacin
11 years ago

#4 @ryan
11 years ago

In multisite, a regular admin has manage_links but not install_plugins yet they still get a "please install" message that they cannot act upon themselves. Show the install message only if the user has both caps, otherwise the permissions error?

#5 @ryan
11 years ago

I think the call to user_can_access_admin_page() in wp-admin/includes/menu.php slams the door before these checks run.

@nacin
11 years ago

#6 @nacin
11 years ago

Good points. 22569.3.diff.

@nacin
11 years ago

#7 @ryan
11 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In 22855:

Show a better message ondmins on link-manager.php, link-add.php, link.php when links are disabled.

Props nacin
fixes #22569

#8 @ryan
11 years ago

Tested with super admin, normal admin, editor, and logged out.

Last edited 11 years ago by ryan (previous) (diff)
Note: See TracTickets for help on using tickets.