WordPress.org

WordPress MU

Changeset 1594


Ignore:
Timestamp:
01/15/09 14:16:25 (5 years ago)
Author:
donncha
Message:

Only check role if user is being edited by another user (a site admin obviously)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/user-edit.php

    r1590 r1594  
    143143    do_action('edit_user_profile_update'); 
    144144 
    145 $cap = $wpdb->get_var( "SELECT meta_value FROM {$wpdb->usermeta} WHERE user_id = '{$user_id}' AND meta_key = '{$wpdb->base_prefix}{$wpdb->blogid}_capabilities' AND meta_value = 'a:0:{}'" ); 
    146145$delete_role = false; 
    147 if( $null == $cap && $_POST[ 'role' ] == '' ) { 
    148     $_POST[ 'role' ] = 'contributor'; 
    149     $delete_role = true; 
     146if( $user_id != $current_user->ID ) { 
     147    $cap = $wpdb->get_var( "SELECT meta_value FROM {$wpdb->usermeta} WHERE user_id = '{$user_id}' AND meta_key = '{$wpdb->base_prefix}{$wpdb->blogid}_capabilities' AND meta_value = 'a:0:{}'" ); 
     148    if( $null == $cap && $_POST[ 'role' ] == '' ) { 
     149        $_POST[ 'role' ] = 'contributor'; 
     150        $delete_role = true; 
     151    } 
    150152} 
    151153$errors = edit_user($user_id); 
Note: See TracChangeset for help on using the changeset viewer.