New installs: admin has user_level 0 (4 posts)

  1. MrPeteH
    Posted 7 years ago #

    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;
        echo "level:".$user_level."<br />";

    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.

  2. MrPeteH
    Posted 7 years ago #

    BTW, current_user_can('level_10') works fine.

  3. bonaireguy
    Posted 6 years ago #

    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.

  4. MichaelH
    Posted 6 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic