Changeset 527 for trunk/xpressme_integration_kit/xoops_version.php
- Timestamp:
- Mar 9, 2010, 8:30:49 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/xoops_version.php
r522 r527 20 20 } 21 21 22 if (!function_exists('mod_access_level')){ 23 function mod_access_level(){ 24 global $current_user; 25 26 $level = @$current_user->user_level; 27 $role = @$current_user->roles[0]; 28 switch ($role){ 29 case 'administrator': 30 $role_level = 10; 31 break; 32 case 'editor': 33 $role_level = 7; 34 break; 35 case 'author': 36 $role_level = 2; 37 break; 38 case 'contributor': 39 $role_level = 1; 40 break; 41 default: 42 $role_level = 0; 43 } 44 45 if ($level > $role_level){ 46 return $level; 47 } else { 48 return $role_level; 49 } 50 } 51 } 52 22 53 $mydirpath = dirname(__FILE__); 23 54 $mydirname = basename($mydirpath); … … 71 102 */ 72 103 73 104 74 105 // Search 75 106 $modversion['hasSearch'] = 1 ; … … 94 125 if(is_object($GLOBALS["xoopsUser"])){ 95 126 global $current_user , $xoops_config; 96 if ( @$current_user->user_level> 0) {127 if (mod_access_level() > 0) { 97 128 $modversion['sub'][1]['name'] = constant( '_MI_XP2_MENU_POST_NEW'); 98 129 if (wp_version_compare($wp_version, '>=','2.1')) … … 105 136 $modversion['sub'][3]['url'] = $add_url . "wp-admin/"; 106 137 } 107 if ( @$current_user->user_level> 9) {138 if (mod_access_level() > 9) { 108 139 $modversion['sub'][4]['name'] = constant( '_MI_XP2_MENU_XPRESS'); 109 140 $modversion['sub'][4]['url'] = $add_url . "wp-admin/admin.php?page=xpressme" . DIRECTORY_SEPARATOR . "xpressme.php";
Note: See TracChangeset
for help on using the changeset viewer.