[wp-trac] Re: [WordPress Trac] #8317: New installs: admin has user_level 0

WordPress Trac wp-trac at lists.automattic.com
Sun Nov 23 14:37:11 GMT 2008


#8317: New installs: admin has user_level 0
-------------------------------+--------------------------------------------
 Reporter:  Mr Pete            |        Owner:  westi   
     Type:  defect             |       Status:  assigned
 Priority:  normal             |    Milestone:  2.7     
Component:  General            |      Version:  2.5     
 Severity:  normal             |   Resolution:          
 Keywords:  reporter-feedback  |  
-------------------------------+--------------------------------------------
Comment (by Mr Pete):

 Sure! How about the following. I saved as a php file in wp-content/plugins
 in yesterday's trunk download, in 2.5, and in 2.3.3. Works fine in 2.3.3,
 not after. Remember to use a clean new database... your existing tables
 probably already have some value for admin user_level :) Just activate the
 plugin and then look at the bottom of the page.

 {{{
 <?php
 /*
 Plugin Name: UserLevel Test
 Plugin URI: http://blogs.icta.net/plugins/
 Description: Generic simple test plugin
 Version: 0.1
 Author: Mr Pete
 Author URI: http://blogs.icta.net/plugins/
 */


 add_action('wp_footer', 'test_foot', 9999999999);
 add_action('admin_footer', 'test_foot', 999999999);
 function test_foot()
 {
         global $user_level;
         get_currentuserinfo();

         echo "<div>User level is: $user_level<br/>User can level_10:
 ".(current_user_can('level_10') ? "yes" : "no")."</div>";
 }
 ?>
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8317#comment:6>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list