#19122 closed defect (bug) (fixed)
Always show "My Sites", sometimes hide "Site Name" menu
Reported by: | duck_ | Owned by: | duck_ |
---|---|---|---|
Milestone: | 3.3 | Priority: | normal |
Severity: | normal | Version: | 3.3 |
Component: | General | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
Non-super-admin who is member of only one site visits a site they're not associated with.
- They see the "Site Name" menu and it's linked to the dashboard of the current site which they don't have access to
- No "My Sites" menu for quick access to dashboard of the user's site
Point 1. can be fixed by hiding the "Site Name" site when the current blog ID isn't in the user's blogs array and they're not a super-admin.
Point 2. proposed fixed is to always show the "My Sites" menu.
Also stopped the removal of the current site from "My Sites" to fix issue of empty "My Sites" drop down. This could probably also be fixed by some more complicated logic earlier in the function, but the 'now it's here, now it isn't' nature seems a little strange to me.
Related: #18197, #18990 (proposed fix would invalidate the latter)
Attachments (3)
Change History (14)
#3
@
13 years ago
Thoughts:
We should always show My Sites (if they have a site, or are a super admin).
We should always show the Site Name, and if they're not a member, it takes them to home_url(). It's not elegant, but it's probably better to be inconsistent in where things link rather than whether it shows.
Also, having "My Sites" on the left may be good for hierarchy, but I keep thinking it should be on the right (it is user-specific) or in the profile menu. And "Network Admin" feels more hidden than "Screen Options" did.
#4
in reply to:
↑ 2
@
13 years ago
Replying to nacin:
On WP.com, the name still shows, but it links to the public site. This is helpful since someone may use it to grab a shortlink.
Wait, where did shortlinks go?
Cancel that, I had default permalinks on, so the shortlink API wasn't returning anything.
#5
@
13 years ago
19122.2.diff always shows the Site Name, but links to home_url() and doesn't add the default submenu items if not a member, and always shows My Sites if they have a site or they're a super admin.
#6
@
13 years ago
- current site should not be removed from my sites if it is a site they have a role on
- site name menu should not show if no role on that site
- yes, my sites should always be there if they have sites on the network
- i would prefer to keep my sites on the left
#7
@
13 years ago
Following Jane's comment.
19122.3.diff refreshes the original patch with the following changes:
- Use API, is_user_member_of_blog(), rather than plain array_key_exists(). See #19160 for why $blog_id has to be specified in the patch.
- Don't show My Sites when the user has 0 sites and isn't a super admin.
#8
@
13 years ago
Can we split line 214 into two different bail conditions? The $a || $b && $c
can be tough to read.
On WP.com, the name still shows, but it links to the public site. This is helpful since someone may use it to grab a shortlink.
Wait, where did shortlinks go?