- Timestamp:
- Mar 9, 2010, 8:30:49 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php
r524 r527 1 1 <?php 2 function xpress_user_access_level(){ 3 global $current_user; 4 5 $level = @$current_user->user_level; 6 $role = @$current_user->roles[0]; 7 switch ($role){ 8 case 'administrator': 9 $role_level = 10; 10 break; 11 case 'editor': 12 $role_level = 7; 13 break; 14 case 'author': 15 $role_level = 2; 16 break; 17 case 'contributor': 18 $role_level = 1; 19 break; 20 default: 21 $role_level = 0; 22 } 23 24 if ($level > $role_level){ 25 return $level; 26 } else { 27 return $role_level; 28 } 29 } 30 31 32 2 33 function xpress_is_contributor() 3 34 { 4 35 global $current_user; 5 36 get_currentuserinfo(); 6 if ( $current_user->user_level> 3)37 if (xpress_user_access_level() > 3) 7 38 return true; 8 39 else … … 21 52 if (defined('MULTISITE')) return MULTISITE; 22 53 return $xoops_config->multiblog; 54 } 55 56 function xpress_is_multiblog_root() { 57 global $blog_id; 58 if (defined('MULTISITE') && MULTISITE && $blog_id == 1){ 59 return true; 60 } else { 61 return false; 62 } 23 63 } 24 64 … … 143 183 extract( $r ); 144 184 145 $output = @$current_user->user_level;185 $output = xpress_user_access_level(); 146 186 if ($echo) 147 187 echo $output;
Note: See TracChangeset
for help on using the changeset viewer.