• Resolved hawkeye126

    (@hawkeye126)


    When I try and navigate to /wp-admin/network, I get:

    You do not have sufficient permissions to access this page.

    I have read as many forum posts and support threads pertaining to this as I could possibly find but can’t seem to fix the error.

    in wp_sitemeta site_admins I have
    a:1:{i:0;s:17:"Peet77-metermedia";}
    this is the name I use to log in.

    I made a plugin to help diagnose the problem.
    When I echo get_super_admins() I get my username (exactly as shown above)
    After I check current_user_can('manage_network') which returns false

    What may I be over looking?
    Thank You!

Viewing 15 replies - 1 through 15 (of 16 total)
  • Have you recently updated or installed any plugins recently? Also, are you using the current version of WordPress?

    Thread Starter hawkeye126

    (@hawkeye126)

    I am using 3.9.1, no new plugins have been installed.

    This started when I made a new subsite with a primary user that is different from my super admin (user which I have always used before).
    When I logged back in as my super admin account I noticed the network options above my sites in the sites dropdown menu did not appear.

    Thanks for the help Marc.

    No problem πŸ™‚

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    πŸ³οΈβ€πŸŒˆ Advisor and Activist

    Are you absolutely, 100% sure, you’re logged in as Peet77-metermedia ? Have you deleted your cookies and made sure?

    Thread Starter hawkeye126

    (@hawkeye126)

    I am 99% sure as I am outputting my current user to the screen and it matches.
    I am not totally sure because I am using Quick Cache on my multisite and attempts to deactivate it have failed.

    Could this be a caching issue?

    Do you advise renaming my plugins folder to disable the module?

    Thank you @ipstenu I have scoured your site and most of your wp multisite talks to fix this issue and for reference in the past. You rock.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    πŸ³οΈβ€πŸŒˆ Advisor and Activist

    I am not totally sure because I am using Quick Cache on my multisite and attempts to deactivate it have failed.

    Well … that doesn’t really sound good, though it shouldn’t matter. I would rename plugins to plugins-off and see if that gets you in.

    The last time I saw that kind of error, the theme was hacked… Are you any good with command line? I’d run the following to see if I can spot any WP files that look ‘weird’

    grep -rI --exclude=*.{pem,py,svn,crt,git,sql} --exclude-dir="cache" "[0-9A-Za-z]\{30,\}" . | grep "[a-zA-Z][0-9]" | grep "[0-9][a-zA-Z]" | cut -c -80

    Thread Starter hawkeye126

    (@hawkeye126)

    That command returns a lot of information.
    What should I be looking for?
    Should I post it here or send it to you?

    One thing that jumps out is a
    WordPress Database error Table ' meterme1_
    I recognize meterme1_ as the ssh username.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    πŸ³οΈβ€πŸŒˆ Advisor and Activist

    I’m generally looking for any code in a theme or a plugin that looks outright wrong.

    One thing that jumps out is a
    WordPress Database error Table ‘ meterme1_
    I recognize meterme1_ as the ssh username.

    That’s also your table prefix. Mine, on a server where my ssh ID is ipstenu, is ipstenu.wp_options and so on.

    Where did that show, though? In a cache file or something?

    Thread Starter hawkeye126

    (@hawkeye126)

    Here are two sample lines.
    ./error_log:[22-Jul-2013 18:31:41 UTC] WordPress database error Table ‘lowerme1_
    ./error_log:[26-Sep-2013 04:44:47 UTC] WordPress database error MySQL server has

    A text file of the full error list can be accessed here:
    http://s17717848.onlinehome-server.com/wptermout.txt

    I also just added a new user via phpmyadmin. I am able to log in with this user but only to the user’s profile page. I cannot access the network admin or any site admin section.

    Thread Starter hawkeye126

    (@hawkeye126)

    I have been able to access the main site’s admin dashboard by adding
    a:1:{s:13:”administrator”;b:1;}
    to wrd_capablities (normally wp_capablities)
    and setting
    wrd_user_level to 10

    I am noticing that my there are several wrd_[changing number]_user_level fields set to 0 and 10 randomly. ie wrd_user_level wrd_4_user_level wrd_5_user_level

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    πŸ³οΈβ€πŸŒˆ Advisor and Activist

    to wrd_capablities (normally wp_capablities)

    Ah, okay, so THAT is because your table is named wrd_ and not wp_ and that’s normal.

    I am noticing that my there are several wrd_[changing number]_user_level fields set to 0 and 10 randomly. ie wrd_user_level wrd_4_user_level wrd_5_user_level

    That’s also okay, because those are per-site roles.

    Thread Starter hawkeye126

    (@hawkeye126)

    Thanks again for all the help.
    Here is a summary of what has done so far to debug this.

    In phpmyadmin database: meterme1_wor1

    wrd_usersmeta where id is 3
    wrd_user_level 10
    wrd_capabilities a:2:{s:13:"administrator";b:1;s:10:"superadmin";b:1;}
    
    wrd_sitemeta
    site_admins a:2:{i:0;s:17:"Pete99-metermedia";i:1;s:9"petefix99";}
    admin_user_id 3

    I have changed the theme to the twentytwelve theme. This did not solve my problem.

    I have downloaded the latest version of wordpress and replaced wp-admin and wp-content. This did not solve my problem.

    I have disabled all plugins by renaming plugins to OFFplugins and mu-plugins to OFFmu-plugins. This did not solve my problem.

    I have logged in as other super admin users and added a new admin user. These users can not access the network admin either.

    I can update (or at least check to see if updates are needed on) plugins with wp-cli. I believe this means wp-cli still has network admin access, which makes sense to me.

    Bulletproof Security needs an update but I’m not sure if this is the issue because turning off all plugins does not fix the problem.

    I have created a plugin to help debug and output information.
    Which is this:

    if (is_admin()) {
    	echo 'SUPER ADMINS:'.get_super_admins().'<br />';
    
    	global $current_user;
    	get_currentuserinfo();
    
    	echo 'Username: ' . $current_user->user_login . "\n";
    	echo 'User email: ' . $current_user->user_email . "\n";
    	echo 'User first name: ' . $current_user->user_firstname . "\n";
    	echo 'User last name: ' . $current_user->user_lastname . "\n";
    	echo 'User display name: ' . $current_user->display_name . "\n";
    	echo 'User ID: ' . $current_user->ID . "<br />";
    
    	echo 'Capabilities:'.$current_user->wp_capabilities."<br />";
    
    	echo 'CURRENT USER CAN:'.current_user_can( 'manage_network' ).'<br />';
    
    	if ( current_user_can('manage_network') ) {
    	 echo 'The current user can manage the network'.'<br />';
    	} else {echo 'The current user can not manage the network'.'<br />';}
    
    	if ( current_user_can('manage_network') ) {
    	 echo '1'.'<br />';
    	} else {echo '0'.'<br />';}
    
    	$user_info = get_userdata(3);
        echo 'Capabilities:'.$user_info->wp_capabilities .  ", " . $user_info->first_name . "\n";
    
    }

    and outputs this:

    SUPER ADMINS:Pete99-metermedia
    Username: Pete99-metermedia User email: pete.lower@gmail.com User first name: Pete User last name: Lower User display name: Pete User ID: 3
    Capabilities:
    CURRENT USER CAN:
    The current user can not manage the network
    0
    Capabilities:, Pete

    When I use wp-cli and run wp user list I get this:

    +----+-------------------+--------------+------------------------+---------------------+--------------------------+
    | ID | user_login        | display_name | user_email             | user_registered     | roles                    |
    +----+-------------------+--------------+------------------------+---------------------+--------------------------+
    | 10 | removedusername          | removedusername     | -----@site.com     | 2013-03-11 17:53:46 |                          |
    | 5  | removedusername         | removedusername       | -----@site.com | 2013-01-23 00:35:11 | administrator            |
    | 28 | removedusername           | removedusername      | -----@site.com    | 2014-01-15 18:48:46 | subscriber               |
    | 2  | removedusername             | removedusername         | -----@site.com  | 2013-01-21 17:13:25 | administrator            |
    | 3  | Pete99-metermedia | Pete         | -----@site.com   | 2013-01-21 17:14:53 | administrator,superadmin |
    | 99 | petefix99         | fixerpete    | -----@site.com    | 2014-07-11 09:00:00 | administrator,superadmin |
    +----+-------------------+--------------+------------------------+---------------------+--------------------------+

    With WP-CLI
    When I run wp site-admin list I get nothing returned.
    wp site-admin add 3 AND wp site-admin Pete99-metermedia returns this
    Fatal error: [] operator not supported for strings in phar:///usr/local/bin/wp/php/commands/super-admin.php on line 41

    Please let me know if there is any information I can provide to help debug.
    If it’s not the information in the database, the plugins, the theme, or the core code, what could it be?

    Thread Starter hawkeye126

    (@hawkeye126)

    @ipstenu

    I backtracked a little and found I caused this by trying to add a super admin via wp-cli.

    wp network meta update 1 site_admins UserNameToAdd

    When I did this I removed all the info that was previously in the super_admin meta value array, which was something like this:

    array (
    0 => ‘Pete99-metermedia’,
    )

    I feel I can fix this problem if I know how to format the entry correctly
    wp network meta update 1 site_admins pete99-metermedia

    What do I need to use for the –format parameter?
    How to I enter the site admin into the site_admin network meta table?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    πŸ³οΈβ€πŸŒˆ Advisor and Activist

    There is, literally, one and only one location where the superadmin information is stored.

    in wp_sitemeta site_admins I have
    a:1:{i:0;s:17:"Peet77-metermedia";}

    That’s it. That’s the only place you should have it. My account is ‘admin’ (on localhost) and mine is this: a:1:{i:0;s:5:"admin";}

    Dunno the –format on thatone. I would have thought –format=serialized but … who knows.

    Thread Starter hawkeye126

    (@hawkeye126)

    SOLUTION
    I was able to fix this by add the following to my wp-config.php file:

    $super_admins =array( Peet77-metermedia' );

    Thanks a lot for taking the time to help @ipstenu! I’ve learned a lot about multisite users and permissions.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Unable to Access /wp-admin/network’ is closed to new replies.