Make WordPress Core


Ignore:
Timestamp:
07/26/2006 10:56:56 PM (20 years ago)
Author:
ryan
Message:

Menu and plugin tweaks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/wp-admin/admin-functions.php

    r4036 r4051  
    362362        $pass2 = $_POST['pass2'];
    363363
    364     if (isset ($_POST['role'])) {
     364    if (isset ($_POST['role']) && current_user_can('edit_users')) {
    365365        if($user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap('edit_users'))
    366366            $user->role = $_POST['role'];
     
    12151215    global $menu;
    12161216    global $submenu;
     1217    global $plugin_page;
    12171218
    12181219    $parent = get_admin_page_parent();
     
    12301231
    12311232    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) {     
    12331243            if ($submenu_array[2] == $pagenow) {
    1234                 if (!current_user_can($submenu_array[1])) {
     1244                if (!current_user_can($submenu_array[1]))
    12351245                    return false;
    1236                 } else {
     1246                else
    12371247                    return true;
    1238                 }
    12391248            }
    12401249        }
Note: See TracChangeset for help on using the changeset viewer.