Changeset 4051 for branches/2.0/wp-admin/admin-functions.php
- Timestamp:
- 07/26/2006 10:56:56 PM (20 years ago)
- File:
-
- 1 edited
-
branches/2.0/wp-admin/admin-functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/wp-admin/admin-functions.php
r4036 r4051 362 362 $pass2 = $_POST['pass2']; 363 363 364 if (isset ($_POST['role']) ) {364 if (isset ($_POST['role']) && current_user_can('edit_users')) { 365 365 if($user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap('edit_users')) 366 366 $user->role = $_POST['role']; … … 1215 1215 global $menu; 1216 1216 global $submenu; 1217 global $plugin_page; 1217 1218 1218 1219 $parent = get_admin_page_parent(); … … 1230 1231 1231 1232 if (isset ($submenu[$parent])) { 1232 foreach ($submenu[$parent] as $submenu_array) { 1233 if ( isset($plugin_page) ) { 1234 foreach ($submenu[$parent] as $submenu_array) { 1235 if ( $submenu_array[2] == $plugin_page ) { 1236 if (!current_user_can($submenu_array[1])) 1237 return false; 1238 } 1239 } 1240 } 1241 1242 foreach ($submenu[$parent] as $submenu_array) { 1233 1243 if ($submenu_array[2] == $pagenow) { 1234 if (!current_user_can($submenu_array[1])) {1244 if (!current_user_can($submenu_array[1])) 1235 1245 return false; 1236 } else {1246 else 1237 1247 return true; 1238 }1239 1248 } 1240 1249 }
Note: See TracChangeset
for help on using the changeset viewer.