Make WordPress Core

Changeset 12672


Ignore:
Timestamp:
01/08/2010 08:29:56 PM (15 years ago)
Author:
ryan
Message:

Use is_super_admin() instead of is_site_admin(). Props GIGALinux see #11644

Location:
trunk
Files:
4 edited

Legend:

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

    r12670 r12672  
    577577
    578578function check_import_new_users( $permission ) {
    579     if ( !is_site_admin() )
     579    if ( !is_super_admin() )
    580580        return false;
    581581    return true;
     
    649649/* Warn the admin if SECRET SALT information is missing from wp-config.php */
    650650function secret_salt_warning() {
    651     if( !is_site_admin() )
     651    if( !is_super_admin() )
    652652        return;
    653653    $secret_keys = array( 'NONCE_KEY', 'AUTH_KEY', 'AUTH_SALT', 'LOGGED_IN_KEY', 'LOGGED_IN_SALT', 'SECURE_AUTH_KEY', 'SECURE_AUTH_SALT' );
     
    715715        $msg .= "<p>" . $content . " <a href='$link'>" . __( 'Read More' ) . "</a> <a href='index.php?feed_dismiss=" . md5( $item[ 'title' ] ) . "'>" . __( "Dismiss" ) . "</a></p>";
    716716        echo "<div class='updated fade'>$msg</div>";
    717     } elseif( is_site_admin() ) {
     717    } elseif( is_super_admin() ) {
    718718        printf("<div id='update-nag'>" . __("Your feed at %s is empty.") . "</div>", wp_specialchars( $url ));
    719719    }
     
    723723function site_admin_notice() {
    724724    global $current_user, $wp_db_version;
    725     if( !is_site_admin() )
     725    if( !is_super_admin() )
    726726        return false;
    727727    printf("<div id='update-nag'>" . __("Hi %s! You're logged in as a site administrator.") . "</div>", $current_user->user_login);
     
    813813 */
    814814function add_sitewide_activate_row( $file, $plugin_data, $context ) {
    815     if ( !is_site_admin() )
     815    if ( !is_super_admin() )
    816816        return false;
    817817
     
    860860    $all_plugins = get_plugins();
    861861
    862     if ( !is_site_admin() )
     862    if ( !is_super_admin() )
    863863        return false;
    864864
     
    964964
    965965    /* Now unset any sitewide only plugins if the user is not a site admin */
    966     if ( !is_site_admin() ) {
     966    if ( !is_super_admin() ) {
    967967        foreach ( $inactive_plugins as $plugin_name => $activated_time ) {
    968968            if ( is_wpmu_sitewide_plugin( $plugin_name ) )
     
    10071007
    10081008        /* Silently activate because the activate_* hook has already run. */
    1009         if ( is_site_admin() ) {
     1009        if ( is_super_admin() ) {
    10101010            $_GET['sitewide'] = true;
    10111011            activate_sitewide_plugin( $_GET['plugin'], true );
     
    10251025                deactivate_plugins( $plugin );
    10261026
    1027                 if ( is_site_admin() )
     1027                if ( is_super_admin() )
    10281028                    activate_sitewide_plugin( $plugin );
    10291029            }
     
    10911091
    10921092    if ( strpos( $_SERVER['PHP_SELF'], 'user-new.php' ) && !get_site_option( 'add_new_users' ) ) {
    1093         if ( is_site_admin() ) {
     1093        if ( is_super_admin() ) {
    10941094            $messages[] = '<div id="message" class="updated fade"><p>' . __( 'Warning! Only site administrators may see this page. Everyone else will see a <em>page disabled</em> message. Enable it again on <a href="ms-options.php#addnewusers">the options page</a>.' ) . '</p></div>';
    10951095        } else {
     
    11071107    $pages = array( 'theme-install.php', 'plugin-install.php' );
    11081108    foreach( $pages as $page ) {
    1109         if ( strpos( $_SERVER['PHP_SELF'], $page ) && !is_site_admin() ) {
     1109        if ( strpos( $_SERVER['PHP_SELF'], $page ) && !is_super_admin() ) {
    11101110            wp_die( __( "Sorry, you're not allowed here." ) );
    11111111        }
     
    12481248
    12491249function show_post_thumbnail_warning() {
    1250     if ( false == is_site_admin() ) {
     1250    if ( false == is_super_admin() ) {
    12511251        return;
    12521252    }
  • trunk/wp-includes/ms-functions.php

    r12645 r12672  
    10261026        $errors->add('blogname',  __("That name is not allowed"));
    10271027    }
    1028     if( strlen( $blogname ) < 4 && !is_site_admin() ) {
     1028    if( strlen( $blogname ) < 4 && !is_super_admin() ) {
    10291029        $errors->add('blogname',  __("Blog name must be at least 4 characters"));
    10301030    }
     
    13061306    update_option( 'blog_public', $meta['public'] );
    13071307
    1308     if ( !is_site_admin() && get_usermeta( $user_id, 'primary_blog' ) == get_site_option( 'dashboard_blog', 1 ) )
     1308    if ( !is_super_admin() && get_usermeta( $user_id, 'primary_blog' ) == get_site_option( 'dashboard_blog', 1 ) )
    13091309        update_usermeta( $user_id, 'primary_blog', $blog_id );
    13101310
     
    15231523
    15241524    // Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.) TODO: Get previous_blog_id.
    1525     if ( !is_site_admin( $user->user_login ) && $user_id != 1 )
     1525    if ( !is_super_admin( $user->user_login ) && $user_id != 1 )
    15261526        $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $wpdb->base_prefix.'1_capabilities') );
    15271527
     
    19281928
    19291929function wordpressmu_authenticate_siteadmin( $user, $password = '' ) {
    1930     if( is_site_admin( $user->user_login ) == false && ( $primary_blog = get_usermeta( $user->user_id, "primary_blog" ) ) ) {
     1930    if( is_super_admin( $user->user_login ) == false && ( $primary_blog = get_usermeta( $user->user_id, "primary_blog" ) ) ) {
    19311931        $details = get_blog_details( $primary_blog );
    19321932        if( is_object( $details ) && $details->spam == 1 ) {
  • trunk/wp-signup.php

    r12628 r12672  
    375375$active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user"
    376376
    377 if( is_site_admin() )
     377if( is_super_admin() )
    378378    echo '<div class="mu_alert">' . sprintf( __( "Greetings Site Administrator! You are currently allowing '%s' registrations. To change or disable registration go to your <a href='wp-admin/ms-options.php'>Options page</a>." ), $active_signup ) . '</div>';
    379379
  • trunk/xmlrpc.php

    r12515 r12672  
    444444    function wp_getUsersBlogs( $args ) {
    445445        // If this isn't on WPMU then just use blogger_getUsersBlogs
    446         if( !function_exists( 'is_site_admin' ) ) {
     446        if( !is_multisite() ) {
    447447            array_unshift( $args, 1 );
    448448            return $this->blogger_getUsersBlogs( $args );
Note: See TracChangeset for help on using the changeset viewer.