Make WordPress Core

Changeset 14011


Ignore:
Timestamp:
04/05/2010 10:28:21 PM (15 years ago)
Author:
wpmuguru
Message:

add permission checks to grant/revoke_super_admin(), see #12109, related #12460

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ms.php

    r14007 r14011  
    808808 */
    809809function grant_super_admin( $user_id ) {
     810    global $current_user;
     811
     812    if ( $current_user->ID == $user_id || !current_user_can( 'manage_network_options' ) )
     813        return;
     814
    810815    $super_admins = get_site_option( 'site_admins', array( 'admin' ) );
    811816
     
    824829 */
    825830function revoke_super_admin( $user_id ) {
     831    global $current_user;
     832
     833    if ( $current_user->ID == $user_id || !current_user_can( 'manage_network_options' ) )
     834        return;
     835
    826836    $super_admins = get_site_option( 'site_admins', array( 'admin' ) );
     837    if ( count( $super_admins ) < 2 )
     838        return;
     839
    827840    $admin_email = get_site_option( 'admin_email' );
    828841   
Note: See TracChangeset for help on using the changeset viewer.