• MrPeteH

    (@mrpeteh)


    On a fresh install of WordPress, the admin user begins with user_level == 0

    This seems rather serious to me.

    It’s easy to check:

    global $current_user;
        get_currentuserinfo();
        echo "level:".$user_level."<br />";
        exit;

    This was not a problem in 2.3.3; it is a problem from 2.5 onward at least through the current trunk.

    All of my test systems have user level 10, so it somehow gets “fixed” after running a while. However, in the first week of my plugin’s use, I have had several reports that my plugin is broken, and I traced it down to this issue.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter MrPeteH

    (@mrpeteh)

    BTW, current_user_can('level_10') works fine.

    bonaireguy

    (@bonaireguy)

    This is still an issue with WP 2.8.5. The default admin user does not have a “wp_user_level” field in the WP database created for him. I worked around it by adding that field to the wp_usermeta table:

    user_id 1
    meta_key wp_user_level
    meta_value 10

    This also fixes the problem with WordPress Email Notification Plugin v2.3.1 reporting a “Sorry, you must be logged in and at least a level 8 user to access admin setup” error after you install this plugin.

    MichaelH

    (@michaelh)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘New installs: admin has user_level 0’ is closed to new replies.