WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#9575 closed defect (bug) (invalid)

Can't access profile.php: Unauthorized

Reported by: deziiner Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.7.1
Component: Role/Capability Keywords: reporter-feedback
Focuses: Cc:

Description

I am in the backend and view Users > profile.php I get the following error:

You are not authorized to view this page.

I've tried deactivating all of my plugins and that's not the problem. Also, I've found that it's not a cookies problem. I am the top admin, so this definitely shouldn't happen... also, all of my other authors are having the same issue as well.

So, can this be fixed?

Change History (17)

comment:1 DD325 years ago

  • Milestone Unassigned deleted
  • Priority changed from high to normal
  • Resolution set to invalid
  • Severity changed from major to normal
  • Status changed from new to closed
  • Version 2.7.1 deleted

Sounds like this should be posted in the Support Forums instead (http://wordpress.org/support/)

If you've had a plugin activated which manages roles, its easy to remove the ability for users to access that page, It would be unlikely that the database would be corrupted, or a bug would cause it to specifically happen.

I'd suggest taking this to the support forums, and if a bug is found in WP, feel free to re-open this ticket with extra information.

comment:2 deziiner5 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

There's already a support topic opened, and it looks as though few people have been having this issue.

http://wordpress.org/support/topic/261373

As mentioned in the topic, we've tried disabling plugins, and nothing worked.

comment:3 DD325 years ago

WordPress Version? Internationalized package?

Clean install? (Or upgrade?)

PHP Version?

Check the value of the wp_user_roles option, if you can load it via PhpMyAdmin, You can paste the contents of it here if you want (Options table, then look through for it)

comment:4 DD325 years ago

  • Component changed from Users to Role/Capability
  • Keywords reporter-feedback added; profile.php Unauthorized removed
  • Milestone set to Unassigned
  • Version set to 2.7.1

comment:5 Denis-de-Bernardy5 years ago

I see this happen often when sharing users tables between installs. The reason usually goes down to users being created on one site, with the default role. But no roles on the other -- and they cannot access any page in the admin area as a result.

I had opened a separate ticket for this. I can't remember which one, but basically the suggested fix was to check, when a user was loaded, for a role. And if none was present, to assign the default role to that user.

comment:6 Denis-de-Bernardy5 years ago

  • Milestone changed from Unassigned to 2.8

comment:7 deziiner5 years ago

Version: 2.7.1
Clean Install: No, was at 2.8-bleeding-edge, but I downgraded via Subversion
PHP Version: 5.2
And I don't know how to find that

wp_user_roles

in phpMyAdmin.

comment:8 DD325 years ago

And I don't know how to find that

Open your database, select the options table, search through for 'wp_user_roles', Click Edit, Copy value to here.

Hm. A Downgrade from 2.8 to 2.7.1 shouldn't really cause that, theres no major changes to capabilities.

comment:9 Denis-de-Bernardy5 years ago

@deziiner: Can you post a means to reproduce?

comment:10 deziiner5 years ago

DD32, here is the value under wp_user-roles:

a:5:{s:13:"administrator";a:2:{s:4:"name";s:13:"Administrator";s:12:"capabilities";a:56:{s:13:"switch_themes";b:1;s:11:"edit_themes";b:1;s:16:"activate_plugins";b:1;s:12:"edit_plugins";b:1;s:10:"edit_users";b:1;s:10:"edit_files";b:1;s:14:"manage_options";b:1;s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:6:"import";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:8:"level_10";b:1;s:7:"level_9";b:1;s:7:"level_8";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"delete_private_posts";b:1;s:18:"edit_private_posts";b:1;s:18:"read_private_posts";b:1;s:20:"delete_private_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"read_private_pages";b:1;s:12:"delete_users";b:1;s:12:"create_users";b:1;s:17:"unfiltered_upload";b:1;s:14:"edit_dashboard";b:1;s:14:"update_plugins";b:1;s:14:"delete_plugins";b:1;s:15:"install_plugins";b:1;s:13:"update_themes";b:1;s:14:"install_themes";b:1;s:12:"manage_email";b:1;s:21:"access_on_maintenance";b:1;}}s:6:"editor";a:2:{s:4:"name";s:6:"Editor";s:12:"capabilities";a:34:{s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"delete_private_posts";b:1;s:18:"edit_private_posts";b:1;s:18:"read_private_posts";b:1;s:20:"delete_private_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"read_private_pages";b:1;}}s:6:"author";a:2:{s:4:"name";s:6:"Author";s:12:"capabilities";a:10:{s:12:"upload_files";b:1;s:10:"edit_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:4:"read";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:12:"delete_posts";b:1;s:22:"delete_published_posts";b:1;}}s:11:"contributor";a:2:{s:4:"name";s:11:"Contributor";s:12:"capabilities";a:5:{s:10:"edit_posts";b:1;s:4:"read";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:12:"delete_posts";b:1;}}s:10:"subscriber";a:2:{s:4:"name";s:10:"Subscriber";s:12:"capabilities";a:2:{s:4:"read";b:1;s:7:"level_0";b:1;}}}

Also, I don't think it was the downgrade that caused it, as I had a separate install of 2.7.1 and got the same error.

Denis-de-Bernardy, I'm sorry please explain?

comment:11 Denis-de-Bernardy5 years ago

here's the array in wikicode:

array(5) {
  ["administrator"]=>
  array(2) {
    ["name"]=>
    string(13) "Administrator"
    ["capabilities"]=>
    array(56) {
      ["switch_themes"]=>
      bool(true)
      ["edit_themes"]=>
      bool(true)
      ["activate_plugins"]=>
      bool(true)
      ["edit_plugins"]=>
      bool(true)
      ["edit_users"]=>
      bool(true)
      ["edit_files"]=>
      bool(true)
      ["manage_options"]=>
      bool(true)
      ["moderate_comments"]=>
      bool(true)
      ["manage_categories"]=>
      bool(true)
      ["manage_links"]=>
      bool(true)
      ["upload_files"]=>
      bool(true)
      ["import"]=>
      bool(true)
      ["unfiltered_html"]=>
      bool(true)
      ["edit_posts"]=>
      bool(true)
      ["edit_others_posts"]=>
      bool(true)
      ["edit_published_posts"]=>
      bool(true)
      ["publish_posts"]=>
      bool(true)
      ["edit_pages"]=>
      bool(true)
      ["read"]=>
      bool(true)
      ["level_10"]=>
      bool(true)
      ["level_9"]=>
      bool(true)
      ["level_8"]=>
      bool(true)
      ["level_7"]=>
      bool(true)
      ["level_6"]=>
      bool(true)
      ["level_5"]=>
      bool(true)
      ["level_4"]=>
      bool(true)
      ["level_3"]=>
      bool(true)
      ["level_2"]=>
      bool(true)
      ["level_1"]=>
      bool(true)
      ["level_0"]=>
      bool(true)
      ["edit_others_pages"]=>
      bool(true)
      ["edit_published_pages"]=>
      bool(true)
      ["publish_pages"]=>
      bool(true)
      ["delete_pages"]=>
      bool(true)
      ["delete_others_pages"]=>
      bool(true)
      ["delete_published_pages"]=>
      bool(true)
      ["delete_posts"]=>
      bool(true)
      ["delete_others_posts"]=>
      bool(true)
      ["delete_published_posts"]=>
      bool(true)
      ["delete_private_posts"]=>
      bool(true)
      ["edit_private_posts"]=>
      bool(true)
      ["read_private_posts"]=>
      bool(true)
      ["delete_private_pages"]=>
      bool(true)
      ["edit_private_pages"]=>
      bool(true)
      ["read_private_pages"]=>
      bool(true)
      ["delete_users"]=>
      bool(true)
      ["create_users"]=>
      bool(true)
      ["unfiltered_upload"]=>
      bool(true)
      ["edit_dashboard"]=>
      bool(true)
      ["update_plugins"]=>
      bool(true)
      ["delete_plugins"]=>
      bool(true)
      ["install_plugins"]=>
      bool(true)
      ["update_themes"]=>
      bool(true)
      ["install_themes"]=>
      bool(true)
      ["manage_email"]=>
      bool(true)
      ["access_on_maintenance"]=>
      bool(true)
    }
  }
  ["editor"]=>
  array(2) {
    ["name"]=>
    string(6) "Editor"
    ["capabilities"]=>
    array(34) {
      ["moderate_comments"]=>
      bool(true)
      ["manage_categories"]=>
      bool(true)
      ["manage_links"]=>
      bool(true)
      ["upload_files"]=>
      bool(true)
      ["unfiltered_html"]=>
      bool(true)
      ["edit_posts"]=>
      bool(true)
      ["edit_others_posts"]=>
      bool(true)
      ["edit_published_posts"]=>
      bool(true)
      ["publish_posts"]=>
      bool(true)
      ["edit_pages"]=>
      bool(true)
      ["read"]=>
      bool(true)
      ["level_7"]=>
      bool(true)
      ["level_6"]=>
      bool(true)
      ["level_5"]=>
      bool(true)
      ["level_4"]=>
      bool(true)
      ["level_3"]=>
      bool(true)
      ["level_2"]=>
      bool(true)
      ["level_1"]=>
      bool(true)
      ["level_0"]=>
      bool(true)
      ["edit_others_pages"]=>
      bool(true)
      ["edit_published_pages"]=>
      bool(true)
      ["publish_pages"]=>
      bool(true)
      ["delete_pages"]=>
      bool(true)
      ["delete_others_pages"]=>
      bool(true)
      ["delete_published_pages"]=>
      bool(true)
      ["delete_posts"]=>
      bool(true)
      ["delete_others_posts"]=>
      bool(true)
      ["delete_published_posts"]=>
      bool(true)
      ["delete_private_posts"]=>
      bool(true)
      ["edit_private_posts"]=>
      bool(true)
      ["read_private_posts"]=>
      bool(true)
      ["delete_private_pages"]=>
      bool(true)
      ["edit_private_pages"]=>
      bool(true)
      ["read_private_pages"]=>
      bool(true)
    }
  }
  ["author"]=>
  array(2) {
    ["name"]=>
    string(6) "Author"
    ["capabilities"]=>
    array(10) {
      ["upload_files"]=>
      bool(true)
      ["edit_posts"]=>
      bool(true)
      ["edit_published_posts"]=>
      bool(true)
      ["publish_posts"]=>
      bool(true)
      ["read"]=>
      bool(true)
      ["level_2"]=>
      bool(true)
      ["level_1"]=>
      bool(true)
      ["level_0"]=>
      bool(true)
      ["delete_posts"]=>
      bool(true)
      ["delete_published_posts"]=>
      bool(true)
    }
  }
  ["contributor"]=>
  array(2) {
    ["name"]=>
    string(11) "Contributor"
    ["capabilities"]=>
    array(5) {
      ["edit_posts"]=>
      bool(true)
      ["read"]=>
      bool(true)
      ["level_1"]=>
      bool(true)
      ["level_0"]=>
      bool(true)
      ["delete_posts"]=>
      bool(true)
    }
  }
  ["subscriber"]=>
  array(2) {
    ["name"]=>
    string(10) "Subscriber"
    ["capabilities"]=>
    array(2) {
      ["read"]=>
      bool(true)
      ["level_0"]=>
      bool(true)
    }
  }
}

comment:12 Denis-de-Bernardy5 years ago

in case it makes a difference, can you browse users / edit, and reassign yourself the administrator role? there are no obvious reasons why your caps array would prevent you from browsing your profile's page.

comment:13 deziiner5 years ago

I, myself, can access all of users profile settings (and manage/change/re-assign/etc. them), except for myself. Also, my authors can't edit their own profiles.

Also, sorry about the long code. I'll WikiCode it next time.

comment:14 deziiner5 years ago

I don't know if this will help with the issue (I'll also be posting this in the support forums) but I just noticed that the last two posts I made were automatically assigned as written by another author of mine, and not as myself. As in, when I posted the last 2 times, it said Cassidy posted it instead of Jody (me).
I tried going back to the post and changing the author, but my account isn't showing up in the "Post Author" drop-down in Edit post mode.

What's Up?!?!

comment:15 Denis-de-Bernardy5 years ago

please check that these issues continue with *all* plugins disabled and the default theme enabled?

comment:16 deziiner5 years ago

Okay, good news!
I deactivated everything and checked it out, and I found that without my theme on, the Profiles page works again! But with it on... Profile page doesn't work. I guess I'll have to head to the theme support forum? Or possibly the theme developer site?
BUT, my name still doesn't appear in the author's list! So that is still an issue.

Also, I almost fainted because I found that Matrix egg while comparing post revisions. That was not funny, it scared the bejesus out of me.

comment:17 Denis-de-Bernardy5 years ago

  • Milestone 2.8 deleted
  • Resolution set to invalid
  • Status changed from reopened to closed

please open a separate ticket on "my name still doesn't appear in the author's list!", with steps to reproduce,

Note: See TracTickets for help on using tickets.