Ticket #11644: 11644.6.diff
File 11644.6.diff, 7.2 KB (added by , 15 years ago) |
---|
-
wp-admin/includes/ms.php
576 576 add_filter( 'whitelist_options', 'mu_options' ); 577 577 578 578 function check_import_new_users( $permission ) { 579 if ( !is_s ite_admin() )579 if ( !is_super_admin() ) 580 580 return false; 581 581 return true; 582 582 } … … 648 648 649 649 /* Warn the admin if SECRET SALT information is missing from wp-config.php */ 650 650 function secret_salt_warning() { 651 if( !is_s ite_admin() )651 if( !is_super_admin() ) 652 652 return; 653 653 $secret_keys = array( 'NONCE_KEY', 'AUTH_KEY', 'AUTH_SALT', 'LOGGED_IN_KEY', 'LOGGED_IN_SALT', 'SECURE_AUTH_KEY', 'SECURE_AUTH_SALT' ); 654 654 $out = ''; … … 714 714 $link = clean_url( strip_tags( $item['link'] ) ); 715 715 $msg .= "<p>" . $content . " <a href='$link'>" . __( 'Read More' ) . "</a> <a href='index.php?feed_dismiss=" . md5( $item[ 'title' ] ) . "'>" . __( "Dismiss" ) . "</a></p>"; 716 716 echo "<div class='updated fade'>$msg</div>"; 717 } elseif( is_s ite_admin() ) {717 } elseif( is_super_admin() ) { 718 718 printf("<div id='update-nag'>" . __("Your feed at %s is empty.") . "</div>", wp_specialchars( $url )); 719 719 } 720 720 } … … 722 722 723 723 function site_admin_notice() { 724 724 global $current_user, $wp_db_version; 725 if( !is_s ite_admin() )725 if( !is_super_admin() ) 726 726 return false; 727 727 printf("<div id='update-nag'>" . __("Hi %s! You're logged in as a site administrator.") . "</div>", $current_user->user_login); 728 728 if ( get_site_option( 'wpmu_upgrade_site' ) != $wp_db_version ) { … … 809 809 * Adds the "Activate plugin site wide" row for each plugin in the inactive plugins list. 810 810 */ 811 811 function add_sitewide_activate_row( $file, $plugin_data, $context ) { 812 if ( !is_s ite_admin() )812 if ( !is_super_admin() ) 813 813 return false; 814 814 815 815 if ( 'sitewide-active' == $context ) … … 856 856 function list_activate_sitewide_plugins() { 857 857 $all_plugins = get_plugins(); 858 858 859 if ( !is_s ite_admin() )859 if ( !is_super_admin() ) 860 860 return false; 861 861 862 862 $active_sitewide_plugins = maybe_unserialize( get_site_option( 'active_sitewide_plugins') ); … … 960 960 } 961 961 962 962 /* Now unset any sitewide only plugins if the user is not a site admin */ 963 if ( !is_s ite_admin() ) {963 if ( !is_super_admin() ) { 964 964 foreach ( $inactive_plugins as $plugin_name => $activated_time ) { 965 965 if ( is_wpmu_sitewide_plugin( $plugin_name ) ) 966 966 unset( $inactive_plugins[ $plugin_name ] ); … … 1003 1003 deactivate_plugins( $_GET['plugin'], true ); 1004 1004 1005 1005 /* Silently activate because the activate_* hook has already run. */ 1006 if ( is_s ite_admin() ) {1006 if ( is_super_admin() ) { 1007 1007 $_GET['sitewide'] = true; 1008 1008 activate_sitewide_plugin( $_GET['plugin'], true ); 1009 1009 } … … 1020 1020 if ( is_wpmu_sitewide_plugin( $plugin ) ) { 1021 1021 deactivate_plugins( $plugin ); 1022 1022 1023 if ( is_s ite_admin() )1023 if ( is_super_admin() ) 1024 1024 activate_sitewide_plugin( $plugin ); 1025 1025 } 1026 1026 } … … 1086 1086 global $messages; 1087 1087 1088 1088 if ( strpos( $_SERVER['PHP_SELF'], 'user-new.php' ) && !get_site_option( 'add_new_users' ) ) { 1089 if ( is_s ite_admin() ) {1089 if ( is_super_admin() ) { 1090 1090 $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>'; 1091 1091 } else { 1092 1092 wp_die( __('Page disabled by the administrator') ); … … 1102 1102 1103 1103 $pages = array( 'theme-install.php', 'plugin-install.php' ); 1104 1104 foreach( $pages as $page ) { 1105 if ( strpos( $_SERVER['PHP_SELF'], $page ) && !is_s ite_admin() ) {1105 if ( strpos( $_SERVER['PHP_SELF'], $page ) && !is_super_admin() ) { 1106 1106 wp_die( __( "Sorry, you're not allowed here." ) ); 1107 1107 } 1108 1108 } … … 1243 1243 add_action( 'wpmu_upgrade_site', 'stripslashes_from_options' ); 1244 1244 1245 1245 function show_post_thumbnail_warning() { 1246 if ( false == is_s ite_admin() ) {1246 if ( false == is_super_admin() ) { 1247 1247 return; 1248 1248 } 1249 1249 $mu_media_buttons = get_site_option( 'mu_media_buttons', array() ); -
wp-includes/ms-functions.php
1025 1025 if( in_array( $blogname, $illegal_names ) == true ) { 1026 1026 $errors->add('blogname', __("That name is not allowed")); 1027 1027 } 1028 if( strlen( $blogname ) < 4 && !is_s ite_admin() ) {1028 if( strlen( $blogname ) < 4 && !is_super_admin() ) { 1029 1029 $errors->add('blogname', __("Blog name must be at least 4 characters")); 1030 1030 } 1031 1031 … … 1305 1305 1306 1306 update_option( 'blog_public', $meta['public'] ); 1307 1307 1308 if ( !is_s ite_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 ) ) 1309 1309 update_usermeta( $user_id, 'primary_blog', $blog_id ); 1310 1310 1311 1311 restore_current_blog(); … … 1522 1522 $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id != %d AND meta_key = %s", $user_id, $table_prefix.'capabilities') ); 1523 1523 1524 1524 // Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.) TODO: Get previous_blog_id. 1525 if ( !is_s ite_admin( $user->user_login ) && $user_id != 1 )1525 if ( !is_super_admin( $user->user_login ) && $user_id != 1 ) 1526 1526 $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $wpdb->base_prefix.'1_capabilities') ); 1527 1527 1528 1528 $wpdb->suppress_errors( false ); … … 1927 1927 } 1928 1928 1929 1929 function wordpressmu_authenticate_siteadmin( $user, $password = '' ) { 1930 if( is_s ite_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" ) ) ) { 1931 1931 $details = get_blog_details( $primary_blog ); 1932 1932 if( is_object( $details ) && $details->spam == 1 ) { 1933 1933 return new WP_Error('blog_suspended', __('Blog Suspended.')); -
wp-signup.php
374 374 375 375 $active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user" 376 376 377 if( is_s ite_admin() )377 if( is_super_admin() ) 378 378 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>'; 379 379 380 380 $newblogname = isset($_GET['new']) ? strtolower(preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'])) : null; -
xmlrpc.php
443 443 */ 444 444 function wp_getUsersBlogs( $args ) { 445 445 // If this isn't on WPMU then just use blogger_getUsersBlogs 446 if( ! function_exists( 'is_site_admin') ) {446 if( !is_multisite() ) { 447 447 array_unshift( $args, 1 ); 448 448 return $this->blogger_getUsersBlogs( $args ); 449 449 }