• Resolved rosbiffer

    (@rosbiffer)


    I tried to access my admin pages today (as I do most days) and I suddenly get an error

    “Sorry, you are not allowed to access this page.”.

    This is the same for every admin page. The website loads OK to visitors, and when logged in it works on non-admin pages. Usually on the front end when I click on my account pic top right it has an option to edit user or edit profile, but it now doesn’t. So far troubleshooting:

    1) I’ve checked error logs – nothing there to say there’s been an error.
    2) I’ve renamed the plugins folder – same problem
    3) I’ve removed AOIWPS plug in via FTP and cleaned entries from the database
    4) I’ve removed the W3 Top Cache plugin via FTP and the database
    5) Via PHPMyadmin I’ve added another admin user, same result
    6) Used a basic htaccess file – no difference.
    7) checked cpanel for server side errors – none there
    8) restored to yesterday’s version (I think it worked yesterday?), no change

    I’m at a bit of loss what to do next. Any ideas where else to look?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Alan Fuller

    (@alanfuller)

    Sounds like the user capabilities which are held in the database have somehow become corrupted. Let me Google a few searches around that and get back to you.

    Alan Fuller

    (@alanfuller)

    I would suggest resetting user roles in the options table, after ensuring you have a backup.

    The option is wp_user_roles in wp_options

    This is from one of my test sites

    a:5:{s:13:"administrator";a:2:{s:4:"name";s:13:"Administrator";s:12:"capabilities";a:61:{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:11:"update_core";b:1;s:10:"list_users";b:1;s:12:"remove_users";b:1;s:13:"promote_users";b:1;s:18:"edit_theme_options";b:1;s:13:"delete_themes";b:1;s:6:"export";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;}}}

    Thread Starter rosbiffer

    (@rosbiffer)

    Thank you Alan, I think you’re on to something. My field entry is this:
    a:3:{s:12:"mphb_manager";a:2:{s:4:"name";s:13:"Hotel Manager";s:12:"capabilities";a:0:{}}s:11:"mphb_worker";a:2:{s:4:"name";s:12:"Hotel Worker";s:12:"capabilities";a:0:{}}s:13:"mphb_customer";a:2:{s:4:"name";s:14:"Hotel Customer";s:12:"capabilities";a:0:{}}}

    So it looks like mphb (a hotel booking plugin), has overwritten the initial value of that field rather than appending. So I’ll try and integrate the two and get it working. Will get back to you.

    Thread Starter rosbiffer

    (@rosbiffer)

    Fantastic, that worked! I edited the wp_user_roles to be the default WP one and it gave me back my access. I then deactivated then reactivated the hotel booking plugin and it added those roles to that field, so all good!

    Thanks for taking the time to point me in the right direction

    Alan Fuller

    (@alanfuller)

    You are welcome

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can’t access admin pages’ is closed to new replies.