<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[15481] trunk: Network Admin, first pass.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/15481">15481</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-07-30 20:34:54 +0000 (Fri, 30 Jul 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Network Admin, first pass. see <a href="http://trac.wordpress.org/ticket/14435">#14435</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminadminheaderphp">trunk/wp-admin/admin-header.php</a></li>
<li><a href="#trunkwpadminadminphp">trunk/wp-admin/admin.php</a></li>
<li><a href="#trunkwpadminmenuphp">trunk/wp-admin/menu.php</a></li>
<li><a href="#trunkwpadminpluginsphp">trunk/wp-admin/plugins.php</a></li>
<li><a href="#trunkwpadminusereditphp">trunk/wp-admin/user-edit.php</a></li>
<li><a href="#trunkwpincludeslinktemplatephp">trunk/wp-includes/link-template.php</a></li>
<li><a href="#trunkwpincludesloadphp">trunk/wp-includes/load.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesmenuphp">trunk/wp-admin/includes/menu.php</a></li>
<li><a href="#trunkwpadminmsadminphp">trunk/wp-admin/ms-admin.php</a></li>
<li><a href="#trunkwpadminmseditphp">trunk/wp-admin/ms-edit.php</a></li>
<li><a href="#trunkwpadminmsoptionsphp">trunk/wp-admin/ms-options.php</a></li>
<li><a href="#trunkwpadminmssitesphp">trunk/wp-admin/ms-sites.php</a></li>
<li><a href="#trunkwpadminmsthemesphp">trunk/wp-admin/ms-themes.php</a></li>
<li><a href="#trunkwpadminmsupgradenetworkphp">trunk/wp-admin/ms-upgrade-network.php</a></li>
<li><a href="#trunkwpadminmsusersphp">trunk/wp-admin/ms-users.php</a></li>
<li>trunk/wp-admin/network/</li>
<li><a href="#trunkwpadminnetworkadminphp">trunk/wp-admin/network/admin.php</a></li>
<li><a href="#trunkwpadminnetworkeditphp">trunk/wp-admin/network/edit.php</a></li>
<li><a href="#trunkwpadminnetworkindexphp">trunk/wp-admin/network/index.php</a></li>
<li><a href="#trunkwpadminnetworkmenuphp">trunk/wp-admin/network/menu.php</a></li>
<li><a href="#trunkwpadminnetworkpluginsphp">trunk/wp-admin/network/plugins.php</a></li>
<li><a href="#trunkwpadminnetworkprofilephp">trunk/wp-admin/network/profile.php</a></li>
<li><a href="#trunkwpadminnetworksettingsphp">trunk/wp-admin/network/settings.php</a></li>
<li><a href="#trunkwpadminnetworksitesphp">trunk/wp-admin/network/sites.php</a></li>
<li><a href="#trunkwpadminnetworkthemesphp">trunk/wp-admin/network/themes.php</a></li>
<li><a href="#trunkwpadminnetworkupgradephp">trunk/wp-admin/network/upgrade.php</a></li>
<li><a href="#trunkwpadminnetworkusereditphp">trunk/wp-admin/network/user-edit.php</a></li>
<li><a href="#trunkwpadminnetworkusersphp">trunk/wp-admin/network/users.php</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkwpadminmsadminphp">trunk/wp-admin/ms-admin.php</a></li>
<li><a href="#trunkwpadminmseditphp">trunk/wp-admin/ms-edit.php</a></li>
<li><a href="#trunkwpadminmsoptionsphp">trunk/wp-admin/ms-options.php</a></li>
<li><a href="#trunkwpadminmssitesphp">trunk/wp-admin/ms-sites.php</a></li>
<li><a href="#trunkwpadminmsthemesphp">trunk/wp-admin/ms-themes.php</a></li>
<li><a href="#trunkwpadminmsupgradenetworkphp">trunk/wp-admin/ms-upgrade-network.php</a></li>
<li><a href="#trunkwpadminmsusersphp">trunk/wp-admin/ms-users.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminadminheaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-header.php (15480 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-header.php        2010-07-29 21:58:58 UTC (rev 15480)
+++ trunk/wp-admin/admin-header.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -11,9 +11,20 @@
</span><span class="cx">         require_once( './admin.php' );
</span><span class="cx"> 
</span><span class="cx"> get_admin_page_title();
</span><ins>+
</ins><span class="cx"> $title = esc_html( strip_tags( $title ) );
</span><ins>+
</ins><span class="cx"> wp_user_settings();
</span><span class="cx"> wp_menu_unfold();
</span><ins>+
+// Save the ID of the last blog admin area visited if super admin.
+if ( is_multisite() &amp;&amp; !is_network_admin() &amp;&amp; is_super_admin() ) {
+        $last_blog = get_user_option('last-blog-admin-visited');
+        if ( $last_blog != $blog_id )
+                update_user_option(get_current_user_id(), 'last-blog-admin-visited', $blog_id, true);
+        unset($last_blog);
+}
+
</ins><span class="cx"> ?&gt;
</span><span class="cx"> &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
</span><span class="cx"> &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &lt;?php do_action('admin_xml_ns'); ?&gt; &lt;?php language_attributes(); ?&gt;&gt;
</span><span class="lines">@@ -86,7 +97,11 @@
</span><span class="cx"> &lt;div id=&quot;wpcontent&quot;&gt;
</span><span class="cx"> &lt;div id=&quot;wphead&quot;&gt;
</span><span class="cx"> &lt;?php
</span><del>-$blog_name = get_bloginfo('name', 'display');
</del><ins>+
+if ( is_network_admin() )
+        $blog_name = esc_html($current_site-&gt;site_name);
+else
+        $blog_name = get_bloginfo('name', 'display');
</ins><span class="cx"> if ( '' == $blog_name ) {
</span><span class="cx">         $blog_name = '&amp;nbsp;';
</span><span class="cx"> } else {
</span><span class="lines">@@ -111,7 +126,7 @@
</span><span class="cx">         &lt;a href=&quot;&lt;?php echo trailingslashit( get_bloginfo( 'url' ) ); ?&gt;&quot; title=&quot;&lt;?php esc_attr_e('Visit Site') ?&gt;&quot;&gt;
</span><span class="cx">                 &lt;span id=&quot;site-title&quot;&gt;&lt;?php echo $blog_name ?&gt;&lt;/span&gt;
</span><span class="cx">         &lt;/a&gt;
</span><del>-&lt;?php if ( current_user_can('manage_options') &amp;&amp; '1' != get_option('blog_public') ): ?&gt;
</del><ins>+&lt;?php if ( !is_network_admin() &amp;&amp; current_user_can('manage_options') &amp;&amp; '1' != get_option('blog_public') ): ?&gt;
</ins><span class="cx">         &lt;a id=&quot;privacy-on-link&quot; href=&quot;options-privacy.php&quot; title=&quot;&lt;?php echo esc_attr( apply_filters('privacy_on_link_title', __('Your site is asking search engines not to index its content') ) ); ?&gt;&quot;&gt;&lt;?php echo apply_filters('privacy_on_link_text', __('Search Engines Blocked') ); ?&gt;&lt;/a&gt;
</span><span class="cx"> &lt;?php endif; ?&gt;
</span><span class="cx"> &lt;/h1&gt;
</span><span class="lines">@@ -123,7 +138,13 @@
</span><span class="cx"> &lt;p&gt;&lt;?php
</span><span class="cx"> $links = array();
</span><span class="cx"> $links[5] = sprintf(__('Howdy, &lt;a href=&quot;%1$s&quot; title=&quot;Edit your profile&quot;&gt;%2$s&lt;/a&gt;'), 'profile.php', $user_identity);
</span><del>-$links[15] = '| &lt;a href=&quot;' . wp_logout_url() . '&quot; title=&quot;' . __('Log Out') . '&quot;&gt;' . __('Log Out') . '&lt;/a&gt;';
</del><ins>+if ( is_multisite() &amp;&amp; is_super_admin() ) {
+        if ( !is_network_admin() )
+                $links[10] = '| &lt;a href=&quot;' . network_admin_url() . '&quot; title=&quot;' . esc_attr__('Network Admin') . '&quot;&gt;' . __('Network Admin') . '&lt;/a&gt;';
+        elseif ($last_blog = get_user_option('last-blog-admin-visited') )
+                $links[10] = '| &lt;a href=&quot;' . get_admin_url($last_blog) . '&quot; title=&quot;' . esc_attr__('Site Admin') . '&quot;&gt;' . __('Site Admin') . '&lt;/a&gt;';
+}
+$links[15] = '| &lt;a href=&quot;' . wp_logout_url() . '&quot; title=&quot;' . esc_attr__('Log Out') . '&quot;&gt;' . __('Log Out') . '&lt;/a&gt;';
</ins><span class="cx"> 
</span><span class="cx"> $links = apply_filters('admin_user_info_links', $links, $current_user);
</span><span class="cx"> ksort($links);
</span><span class="lines">@@ -132,7 +153,7 @@
</span><span class="cx"> ?&gt;&lt;/p&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;?php favorite_actions($current_screen); ?&gt;
</del><ins>+&lt;?php !is_network_admin() ? favorite_actions($current_screen) : ''; ?&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminadminphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin.php (15480 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin.php        2010-07-29 21:58:58 UTC (rev 15480)
+++ trunk/wp-admin/admin.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -14,6 +14,9 @@
</span><span class="cx"> if ( !defined('WP_ADMIN') )
</span><span class="cx">         define('WP_ADMIN', TRUE);
</span><span class="cx"> 
</span><ins>+if ( !defined('WP_NETWORK_ADMIN') )
+        define('WP_NETWORK_ADMIN', FALSE);
+
</ins><span class="cx"> if ( isset($_GET['import']) &amp;&amp; !defined('WP_LOAD_IMPORTERS') )
</span><span class="cx">         define('WP_LOAD_IMPORTERS', true);
</span><span class="cx"> 
</span><span class="lines">@@ -90,7 +93,10 @@
</span><span class="cx"> else
</span><span class="cx">         $taxnow = '';
</span><span class="cx"> 
</span><del>-require(ABSPATH . 'wp-admin/menu.php');
</del><ins>+if ( WP_NETWORK_ADMIN )
+        require(ABSPATH . 'wp-admin/network/menu.php');
+else
+        require(ABSPATH . 'wp-admin/menu.php');
</ins><span class="cx"> 
</span><span class="cx"> if ( current_user_can( 'manage_options' ) )
</span><span class="cx">         @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', '256M' ) );
</span></span></pre></div>
<a id="trunkwpadminincludesmenuphp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/includes/menu.php (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/menu.php                                (rev 0)
+++ trunk/wp-admin/includes/menu.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,211 @@
</span><ins>+&lt;?php
+
+/**
+ * Build Administration Menu.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+if ( is_network_admin() )
+        do_action('_network_admin_menu');
+else
+        do_action('_admin_menu');
+
+// Create list of page plugin hook names.
+foreach ($menu as $menu_page) {
+        if ( false !== $pos = strpos($menu_page[2], '?') ) {
+                // Handle post_type=post|page|foo pages.
+                $hook_name = substr($menu_page[2], 0, $pos);
+                $hook_args = substr($menu_page[2], $pos + 1);
+                wp_parse_str($hook_args, $hook_args);
+                // Set the hook name to be the post type.
+                if ( isset($hook_args['post_type']) )
+                        $hook_name = $hook_args['post_type'];
+                else
+                        $hook_name = basename($hook_name, '.php');
+                unset($hook_args);
+        } else {
+                $hook_name = basename($menu_page[2], '.php');
+        }
+        $hook_name = sanitize_title($hook_name);
+
+        if ( isset($compat[$hook_name]) )
+                $hook_name = $compat[$hook_name];
+        elseif ( !$hook_name )
+                continue;
+
+        $admin_page_hooks[$menu_page[2]] = $hook_name;
+}
+unset($menu_page, $compat);
+
+$_wp_submenu_nopriv = array();
+$_wp_menu_nopriv = array();
+// Loop over submenus and remove pages for which the user does not have privs.
+foreach ( array( 'submenu' ) as $sub_loop ) {
+        foreach ($$sub_loop as $parent =&gt; $sub) {
+                foreach ($sub as $index =&gt; $data) {
+                        if ( ! current_user_can($data[1]) ) {
+                                unset(${$sub_loop}[$parent][$index]);
+                                $_wp_submenu_nopriv[$parent][$data[2]] = true;
+                        }
+                }
+                unset($index, $data);
+
+                if ( empty(${$sub_loop}[$parent]) )
+                        unset(${$sub_loop}[$parent]);
+        }
+        unset($sub, $parent);
+}
+unset($sub_loop);
+
+// Loop over the top-level menu.
+// Menus for which the original parent is not accessible due to lack of privs will have the next
+// submenu in line be assigned as the new menu parent.
+foreach ( $menu as $id =&gt; $data ) {
+        if ( empty($submenu[$data[2]]) )
+                continue;
+        $subs = $submenu[$data[2]];
+        $first_sub = array_shift($subs);
+        $old_parent = $data[2];
+        $new_parent = $first_sub[2];
+        // If the first submenu is not the same as the assigned parent,
+        // make the first submenu the new parent.
+        if ( $new_parent != $old_parent ) {
+                $_wp_real_parent_file[$old_parent] = $new_parent;
+                $menu[$id][2] = $new_parent;
+
+                foreach ($submenu[$old_parent] as $index =&gt; $data) {
+                        $submenu[$new_parent][$index] = $submenu[$old_parent][$index];
+                        unset($submenu[$old_parent][$index]);
+                }
+                unset($submenu[$old_parent], $index);
+
+                if ( isset($_wp_submenu_nopriv[$old_parent]) )
+                        $_wp_submenu_nopriv[$new_parent] = $_wp_submenu_nopriv[$old_parent];
+        }
+}
+unset($id, $data, $subs, $first_sub, $old_parent, $new_parent);
+
+if ( is_network_admin() )
+        do_action('network_admin_menu', '');
+else
+        do_action('admin_menu', '');
+
+// Remove menus that have no accessible submenus and require privs that the user does not have.
+// Run re-parent loop again.
+foreach ( $menu as $id =&gt; $data ) {
+        if ( ! current_user_can($data[1]) )
+                $_wp_menu_nopriv[$data[2]] = true;
+
+        // If submenu is empty...
+        if ( empty($submenu[$data[2]]) ) {
+                // And user doesn't have privs, remove menu.
+                if ( isset( $_wp_menu_nopriv[$data[2]] ) ) {
+                        unset($menu[$id]);
+                }
+        }
+}
+unset($id, $data);
+
+// Remove any duplicated seperators
+$seperator_found = false;
+foreach ( $menu as $id =&gt; $data ) {
+        if ( 0 == strcmp('wp-menu-separator', $data[4] ) ) {
+                if (false == $seperator_found) {
+                        $seperator_found = true;
+                } else {
+                        unset($menu[$id]);
+                        $seperator_found = false;
+                }
+        } else {
+                $seperator_found = false;
+        }
+}
+unset($id, $data);
+
+function add_cssclass($add, $class) {
+        $class = empty($class) ? $add : $class .= ' ' . $add;
+        return $class;
+}
+
+function add_menu_classes($menu) {
+
+        $first = $lastorder = false;
+        $i = 0;
+        $mc = count($menu);
+        foreach ( $menu as $order =&gt; $top ) {
+                $i++;
+
+                if ( 0 == $order ) { // dashboard is always shown/single
+                        $menu[0][4] = add_cssclass('menu-top-first', $top[4]);
+                        $lastorder = 0;
+                        continue;
+                }
+
+                if ( 0 === strpos($top[2], 'separator') ) { // if separator
+                        $first = true;
+                        $c = $menu[$lastorder][4];
+                        $menu[$lastorder][4] = add_cssclass('menu-top-last', $c);
+                        continue;
+                }
+
+                if ( $first ) {
+                        $c = $menu[$order][4];
+                        $menu[$order][4] = add_cssclass('menu-top-first', $c);
+                        $first = false;
+                }
+
+                if ( $mc == $i ) { // last item
+                        $c = $menu[$order][4];
+                        $menu[$order][4] = add_cssclass('menu-top-last', $c);
+                }
+
+                $lastorder = $order;
+        }
+
+        return apply_filters( 'add_menu_classes', $menu );
+}
+
+uksort($menu, &quot;strnatcasecmp&quot;); // make it all pretty
+
+if ( apply_filters('custom_menu_order', false) ) {
+        $menu_order = array();
+        foreach ( $menu as $menu_item ) {
+                $menu_order[] = $menu_item[2];
+        }
+        unset($menu_item);
+        $default_menu_order = $menu_order;
+        $menu_order = apply_filters('menu_order', $menu_order);
+        $menu_order = array_flip($menu_order);
+        $default_menu_order = array_flip($default_menu_order);
+
+        function sort_menu($a, $b) {
+                global $menu_order, $default_menu_order;
+                $a = $a[2];
+                $b = $b[2];
+                if ( isset($menu_order[$a]) &amp;&amp; !isset($menu_order[$b]) ) {
+                        return -1;
+                } elseif ( !isset($menu_order[$a]) &amp;&amp; isset($menu_order[$b]) ) {
+                        return 1;
+                } elseif ( isset($menu_order[$a]) &amp;&amp; isset($menu_order[$b]) ) {
+                        if ( $menu_order[$a] == $menu_order[$b] )
+                                return 0;
+                        return ($menu_order[$a] &lt; $menu_order[$b]) ? -1 : 1;
+                } else {
+                        return ($default_menu_order[$a] &lt;= $default_menu_order[$b]) ? -1 : 1;
+                }
+        }
+
+        usort($menu, 'sort_menu');
+        unset($menu_order, $default_menu_order);
+}
+
+$menu = add_menu_classes($menu);
+
+if ( !user_can_access_admin_page() ) {
+        do_action('admin_page_access_denied');
+        wp_die( __('You do not have sufficient permissions to access this page.') );
+}
+
+?&gt;
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-admin/includes/menu.php
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:eol-style
</span><span class="cx">   + native
</span></span></pre></div>
<a id="trunkwpadminmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/menu.php (15480 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/menu.php        2010-07-29 21:58:58 UTC (rev 15480)
+++ trunk/wp-admin/menu.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -25,24 +25,8 @@
</span><span class="cx"> $awaiting_mod = wp_count_comments();
</span><span class="cx"> $awaiting_mod = $awaiting_mod-&gt;moderated;
</span><span class="cx"> 
</span><del>-if ( is_multisite() &amp;&amp; is_super_admin() ) {
-        /* translators: Network menu item */
-        $menu[0] = array(__('Super Admin'), 'manage_network', 'ms-admin.php', '', 'menu-top menu-top-first menu-icon-site', 'menu-site', 'div');
-        $submenu[ 'ms-admin.php' ][1] = array( __('Admin'), 'manage_network', 'ms-admin.php' );
-        /* translators: Sites menu item */
-        $submenu[ 'ms-admin.php' ][5] = array( __('Sites'), 'manage_sites', 'ms-sites.php' );
-        $submenu[ 'ms-admin.php' ][10] = array( __('Users'), 'manage_network_users', 'ms-users.php' );
-        $submenu[ 'ms-admin.php' ][20] = array( __('Themes'), 'manage_network_themes', 'ms-themes.php' );
-        $submenu[ 'ms-admin.php' ][25] = array( __('Options'), 'manage_network_options', 'ms-options.php' );
-        $submenu[ 'ms-admin.php' ][30] = array( __('Update'), 'manage_network', 'ms-upgrade-network.php' );
</del><ins>+$menu[2] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'div' );
</ins><span class="cx"> 
</span><del>-        $menu[1] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
-
-        $menu[2] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top menu-icon-dashboard', 'menu-dashboard', 'div' );
-} else {
-        $menu[2] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'div' );
-}
-
</del><span class="cx"> if ( is_multisite() || is_super_admin() ) {
</span><span class="cx">         $submenu[ 'index.php' ][0] = array( __('Dashboard'), 'read', 'index.php' );
</span><span class="cx"> 
</span><span class="lines">@@ -234,213 +218,20 @@
</span><span class="cx"> $_wp_real_parent_file['page-new.php'] = 'edit.php?post_type=page';
</span><span class="cx"> $_wp_real_parent_file['wpmu-admin.php'] = 'ms-admin.php';
</span><span class="cx"> 
</span><del>-do_action('_admin_menu');
</del><ins>+// ensure we're backwards compatible
+$compat = array(
+        'index' =&gt; 'dashboard',
+        'edit' =&gt; 'posts',
+        'post' =&gt; 'posts',
+        'upload' =&gt; 'media',
+        'link-manager' =&gt; 'links',
+        'edit-pages' =&gt; 'pages',
+        'page' =&gt; 'pages',
+        'edit-comments' =&gt; 'comments',
+        'options-general' =&gt; 'settings',
+        'themes' =&gt; 'appearance',
+        );
</ins><span class="cx"> 
</span><del>-// Create list of page plugin hook names.
-foreach ($menu as $menu_page) {
-        if ( false !== $pos = strpos($menu_page[2], '?') ) {
-                // Handle post_type=post|page|foo pages.
-                $hook_name = substr($menu_page[2], 0, $pos);
-                $hook_args = substr($menu_page[2], $pos + 1);
-                wp_parse_str($hook_args, $hook_args);
-                // Set the hook name to be the post type.
-                if ( isset($hook_args['post_type']) )
-                        $hook_name = $hook_args['post_type'];
-                else
-                        $hook_name = basename($hook_name, '.php');
-                unset($hook_args);
-        } else {
-                $hook_name = basename($menu_page[2], '.php');
-        }
-        $hook_name = sanitize_title($hook_name);
</del><ins>+require(ABSPATH . 'wp-admin/includes/menu.php');
</ins><span class="cx"> 
</span><del>-        // ensure we're backwards compatible
-        $compat = array(
-                'index' =&gt; 'dashboard',
-                'edit' =&gt; 'posts',
-                'post' =&gt; 'posts',
-                'upload' =&gt; 'media',
-                'link-manager' =&gt; 'links',
-                'edit-pages' =&gt; 'pages',
-                'page' =&gt; 'pages',
-                'edit-comments' =&gt; 'comments',
-                'options-general' =&gt; 'settings',
-                'themes' =&gt; 'appearance',
-                );
-
-        if ( isset($compat[$hook_name]) )
-                $hook_name = $compat[$hook_name];
-        elseif ( !$hook_name )
-                continue;
-
-        $admin_page_hooks[$menu_page[2]] = $hook_name;
-}
-unset($menu_page);
-
-$_wp_submenu_nopriv = array();
-$_wp_menu_nopriv = array();
-// Loop over submenus and remove pages for which the user does not have privs.
-foreach ( array( 'submenu' ) as $sub_loop ) {
-        foreach ($$sub_loop as $parent =&gt; $sub) {
-                foreach ($sub as $index =&gt; $data) {
-                        if ( ! current_user_can($data[1]) ) {
-                                unset(${$sub_loop}[$parent][$index]);
-                                $_wp_submenu_nopriv[$parent][$data[2]] = true;
-                        }
-                }
-                unset($index, $data);
-
-                if ( empty(${$sub_loop}[$parent]) )
-                        unset(${$sub_loop}[$parent]);
-        }
-        unset($sub, $parent);
-}
-unset($sub_loop);
-
-// Loop over the top-level menu.
-// Menus for which the original parent is not accessible due to lack of privs will have the next
-// submenu in line be assigned as the new menu parent.
-foreach ( $menu as $id =&gt; $data ) {
-        if ( empty($submenu[$data[2]]) )
-                continue;
-        $subs = $submenu[$data[2]];
-        $first_sub = array_shift($subs);
-        $old_parent = $data[2];
-        $new_parent = $first_sub[2];
-        // If the first submenu is not the same as the assigned parent,
-        // make the first submenu the new parent.
-        if ( $new_parent != $old_parent ) {
-                $_wp_real_parent_file[$old_parent] = $new_parent;
-                $menu[$id][2] = $new_parent;
-
-                foreach ($submenu[$old_parent] as $index =&gt; $data) {
-                        $submenu[$new_parent][$index] = $submenu[$old_parent][$index];
-                        unset($submenu[$old_parent][$index]);
-                }
-                unset($submenu[$old_parent], $index);
-
-                if ( isset($_wp_submenu_nopriv[$old_parent]) )
-                        $_wp_submenu_nopriv[$new_parent] = $_wp_submenu_nopriv[$old_parent];
-        }
-}
-unset($id, $data, $subs, $first_sub, $old_parent, $new_parent);
-
-do_action('admin_menu', '');
-
-// Remove menus that have no accessible submenus and require privs that the user does not have.
-// Run re-parent loop again.
-foreach ( $menu as $id =&gt; $data ) {
-        if ( ! current_user_can($data[1]) )
-                $_wp_menu_nopriv[$data[2]] = true;
-
-        // If submenu is empty...
-        if ( empty($submenu[$data[2]]) ) {
-                // And user doesn't have privs, remove menu.
-                if ( isset( $_wp_menu_nopriv[$data[2]] ) ) {
-                        unset($menu[$id]);
-                }
-        }
-}
-unset($id, $data);
-
-// Remove any duplicated seperators
-$seperator_found = false;
-foreach ( $menu as $id =&gt; $data ) {
-        if ( 0 == strcmp('wp-menu-separator', $data[4] ) ) {
-                if (false == $seperator_found) {
-                        $seperator_found = true;
-                } else {
-                        unset($menu[$id]);
-                        $seperator_found = false;
-                }
-        } else {
-                $seperator_found = false;
-        }
-}
-unset($id, $data);
-
-function add_cssclass($add, $class) {
-        $class = empty($class) ? $add : $class .= ' ' . $add;
-        return $class;
-}
-
-function add_menu_classes($menu) {
-
-        $first = $lastorder = false;
-        $i = 0;
-        $mc = count($menu);
-        foreach ( $menu as $order =&gt; $top ) {
-                $i++;
-
-                if ( 0 == $order ) { // dashboard is always shown/single
-                        $menu[0][4] = add_cssclass('menu-top-first', $top[4]);
-                        $lastorder = 0;
-                        continue;
-                }
-
-                if ( 0 === strpos($top[2], 'separator') ) { // if separator
-                        $first = true;
-                        $c = $menu[$lastorder][4];
-                        $menu[$lastorder][4] = add_cssclass('menu-top-last', $c);
-                        continue;
-                }
-
-                if ( $first ) {
-                        $c = $menu[$order][4];
-                        $menu[$order][4] = add_cssclass('menu-top-first', $c);
-                        $first = false;
-                }
-
-                if ( $mc == $i ) { // last item
-                        $c = $menu[$order][4];
-                        $menu[$order][4] = add_cssclass('menu-top-last', $c);
-                }
-
-                $lastorder = $order;
-        }
-
-        return apply_filters( 'add_menu_classes', $menu );
-}
-
-uksort($menu, &quot;strnatcasecmp&quot;); // make it all pretty
-
-if ( apply_filters('custom_menu_order', false) ) {
-        $menu_order = array();
-        foreach ( $menu as $menu_item ) {
-                $menu_order[] = $menu_item[2];
-        }
-        unset($menu_item);
-        $default_menu_order = $menu_order;
-        $menu_order = apply_filters('menu_order', $menu_order);
-        $menu_order = array_flip($menu_order);
-        $default_menu_order = array_flip($default_menu_order);
-
-        function sort_menu($a, $b) {
-                global $menu_order, $default_menu_order;
-                $a = $a[2];
-                $b = $b[2];
-                if ( isset($menu_order[$a]) &amp;&amp; !isset($menu_order[$b]) ) {
-                        return -1;
-                } elseif ( !isset($menu_order[$a]) &amp;&amp; isset($menu_order[$b]) ) {
-                        return 1;
-                } elseif ( isset($menu_order[$a]) &amp;&amp; isset($menu_order[$b]) ) {
-                        if ( $menu_order[$a] == $menu_order[$b] )
-                                return 0;
-                        return ($menu_order[$a] &lt; $menu_order[$b]) ? -1 : 1;
-                } else {
-                        return ($default_menu_order[$a] &lt;= $default_menu_order[$b]) ? -1 : 1;
-                }
-        }
-
-        usort($menu, 'sort_menu');
-        unset($menu_order, $default_menu_order);
-}
-
-$menu = add_menu_classes($menu);
-
-if ( !user_can_access_admin_page() ) {
-        do_action('admin_page_access_denied');
-        wp_die( __('You do not have sufficient permissions to access this page.') );
-}
-
</del><span class="cx"> ?&gt;
</span></span></pre></div>
<a id="trunkwpadminmsadminphp"></a>
<div class="delfile"><h4>Deleted: trunk/wp-admin/ms-admin.php (15480 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-admin.php        2010-07-29 21:58:58 UTC (rev 15480)
+++ trunk/wp-admin/ms-admin.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -1,76 +0,0 @@
</span><del>-&lt;?php
-/**
- * Multisite administration panel.
- *
- * @package WordPress
- * @subpackage Multisite
- * @since 3.0.0
- */
-
-require_once( './admin.php' );
-
-if ( !is_multisite() )
-        wp_die( __( 'Multisite support is not enabled.' ) );
-
-if ( ! current_user_can( 'manage_network' ) )
-        wp_die( __( 'You do not have permission to access this page.' ) );
-
-$title = __( 'Network Admin' );
-$parent_file = 'ms-admin.php';
-
-add_contextual_help($current_screen,
-        '&lt;p&gt;' . __('Until WordPress 3.0, running multiple sites required using WordPress MU instead of regular WordPress. In version 3.0, these applications have merged. If you are a former MU user, you should be aware of the following changes:') . '&lt;/p&gt;' .
-        '&lt;ul&gt;&lt;li&gt;' . __('Site Admin is now Super Admin (we highly encourage you to get yourself a cape!).') . '&lt;/li&gt;' .
-        '&lt;li&gt;' . __('Blogs are now called Sites; Site is now called Network.') . '&lt;/li&gt;&lt;/ul&gt;' .
-        '&lt;p&gt;' . __('This screen provides the network administrator with links to the screens for Sites and Users to either create a new site or user, or to search existing users and sites. Those screens are also accessible through the left-hand navigation in the Super Admin section.') . '&lt;/p&gt;' .
-        '&lt;p&gt;&lt;strong&gt;' . __('For more information:') . '&lt;/strong&gt;&lt;/p&gt;' .
-        '&lt;p&gt;' . __('&lt;a href=&quot;http://codex.wordpress.org/Super_Admin_Super_Admin_Menu&quot; target=&quot;_blank&quot;&gt;Documentation on Super Admin Menu&lt;/a&gt;') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('&lt;a href=&quot;http://wordpress.org/support/&quot; target=&quot;_blank&quot;&gt;Support Forums&lt;/a&gt;') . '&lt;/p&gt;'
-);
-
-require_once( './admin-header.php' );
-
-$c_users = get_user_count();
-$c_blogs = get_blog_count();
-
-$user_text = sprintf( _n( '%s user', '%s users', $c_users ), number_format_i18n( $c_users ) );
-$blog_text = sprintf( _n( '%s site', '%s sites', $c_blogs ), number_format_i18n( $c_blogs ) );
-
-$sentence = sprintf( __( 'You have %1$s and %2$s.' ), $blog_text, $user_text );
-?&gt;
-
-&lt;div class=&quot;wrap&quot;&gt;
-        &lt;?php screen_icon(); ?&gt;
-        &lt;h2&gt;&lt;?php echo esc_html( $title ); ?&gt;&lt;/h2&gt;
-
-        &lt;ul class=&quot;subsubsub&quot;&gt;
-        &lt;li&gt;&lt;a href=&quot;ms-sites.php#form-add-site&quot;&gt;&lt;?php _e( 'Create a New Site' ); ?&gt;&lt;/a&gt; |&lt;/li&gt;
-        &lt;li&gt;&lt;a href=&quot;ms-users.php#form-add-user&quot;&gt;&lt;?php _e( 'Create a New User' ); ?&gt;&lt;/a&gt;&lt;/li&gt;
-        &lt;/ul&gt;
-        &lt;br class=&quot;clear&quot; /&gt;
-
-        &lt;p class=&quot;youhave&quot;&gt;&lt;?php echo $sentence; ?&gt;&lt;/p&gt;
-        &lt;?php do_action( 'wpmuadminresult', '' ); ?&gt;
-
-        &lt;form name=&quot;searchform&quot; action=&quot;ms-users.php&quot; method=&quot;get&quot;&gt;
-                &lt;p&gt;
-                        &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;users&quot; /&gt;
-                        &lt;input type=&quot;text&quot; name=&quot;s&quot; value=&quot;&quot; size=&quot;17&quot; /&gt;
-                        &lt;input class=&quot;button&quot; type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e( 'Search Users' ); ?&gt;&quot; /&gt;
-                &lt;/p&gt;
-        &lt;/form&gt;
-
-        &lt;form name=&quot;searchform&quot; action=&quot;ms-sites.php&quot; method=&quot;get&quot;&gt;
-                &lt;p&gt;
-                        &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;blogs&quot; /&gt;
-                        &lt;input type=&quot;hidden&quot; name=&quot;searchaction&quot; value=&quot;name&quot; /&gt;
-                        &lt;input type=&quot;text&quot; name=&quot;s&quot; value=&quot;&quot; size=&quot;17&quot; /&gt;
-                        &lt;input class=&quot;button&quot; type=&quot;submit&quot; name=&quot;blog_name&quot; value=&quot;&lt;?php esc_attr_e( 'Search Sites' ); ?&gt;&quot; /&gt;
-                &lt;/p&gt;
-        &lt;/form&gt;
-
-        &lt;?php do_action( 'mu_rightnow_end' ); ?&gt;
-        &lt;?php do_action( 'mu_activity_box_end' ); ?&gt;
-&lt;/div&gt;
-
-&lt;?php include( './admin-footer.php' ); ?&gt;
</del></span></pre></div>
<a id="trunkwpadminmsadminphp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/ms-admin.php (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-admin.php                                (rev 0)
+++ trunk/wp-admin/ms-admin.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+&lt;?php
+/**
+ * Multisite administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( './admin.php' );
+
+wp_redirect( network_admin_url() );
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-admin/ms-admin.php
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:eol-style
</span><span class="cx">   + native
</span></span></pre></div>
<a id="trunkwpadminmseditphp"></a>
<div class="delfile"><h4>Deleted: trunk/wp-admin/ms-edit.php (15480 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-edit.php        2010-07-29 21:58:58 UTC (rev 15480)
+++ trunk/wp-admin/ms-edit.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -1,637 +0,0 @@
</span><del>-&lt;?php
-/**
- * Action handler for Multisite administration panels.
- *
- * @package WordPress
- * @subpackage Multisite
- * @since 3.0.0
- */
-
-require_once( './admin.php' );
-
-if ( ! is_multisite() )
-        wp_die( __( 'Multisite support is not enabled.' ) );
-
-if ( empty( $_GET['action'] ) )
-        wp_redirect( admin_url( 'ms-admin.php' ) );
-
-do_action( 'wpmuadminedit' , '');
-
-if ( isset( $_GET['id' ]) )
-        $id = intval( $_GET['id'] );
-elseif ( isset( $_POST['id'] ) )
-        $id = intval( $_POST['id'] );
-
-switch ( $_GET['action'] ) {
-        case 'siteoptions':
-                check_admin_referer( 'siteoptions' );
-                if ( ! current_user_can( 'manage_network_options' ) )
-                        wp_die( __( 'You do not have permission to access this page.' ) );
-
-                if ( empty( $_POST ) )
-                        wp_die( sprintf( __( 'You probably need to go back to the &lt;a href=&quot;%s&quot;&gt;options page&lt;/a&gt;.', esc_url( admin_url( 'ms-options.php' ) ) ) ) );
-
-                if ( isset($_POST['WPLANG']) &amp;&amp; ( '' === $_POST['WPLANG'] || in_array( $_POST['WPLANG'], get_available_languages() ) ) )
-                        update_site_option( 'WPLANG', $_POST['WPLANG'] );
-
-                if ( is_email( $_POST['admin_email'] ) )
-                        update_site_option( 'admin_email', $_POST['admin_email'] );
-
-                $illegal_names = split( ' ', $_POST['illegal_names'] );
-                foreach ( (array) $illegal_names as $name ) {
-                        $name = trim( $name );
-                        if ( $name != '' )
-                                $names[] = trim( $name );
-                }
-                update_site_option( 'illegal_names', $names );
-
-                if ( $_POST['limited_email_domains'] != '' ) {
-                        $limited_email_domains = str_replace( ' ', &quot;\n&quot;, $_POST['limited_email_domains'] );
-                        $limited_email_domains = split( &quot;\n&quot;, stripslashes( $limited_email_domains ) );
-                        $limited_email = array();
-                        foreach ( (array) $limited_email_domains as $domain ) {
-                                        $domain = trim( $domain );
-                                if ( ! preg_match( '/(--|\.\.)/', $domain ) &amp;&amp; preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
-                                        $limited_email[] = trim( $domain );
-                        }
-                        update_site_option( 'limited_email_domains', $limited_email );
-                } else {
-                        update_site_option( 'limited_email_domains', '' );
-                }
-
-                if ( $_POST['banned_email_domains'] != '' ) {
-                        $banned_email_domains = split( &quot;\n&quot;, stripslashes( $_POST['banned_email_domains'] ) );
-                        $banned = array();
-                        foreach ( (array) $banned_email_domains as $domain ) {
-                                $domain = trim( $domain );
-                                if ( ! preg_match( '/(--|\.\.)/', $domain ) &amp;&amp; preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
-                                        $banned[] = trim( $domain );
-                        }
-                        update_site_option( 'banned_email_domains', $banned );
-                } else {
-                        update_site_option( 'banned_email_domains', '' );
-                }
-                update_site_option( 'default_user_role', $_POST['default_user_role'] );
-                if ( trim( $_POST['dashboard_blog_orig'] ) == '' )
-                        $_POST['dashboard_blog_orig'] = $current_site-&gt;blog_id;
-                if ( trim( $_POST['dashboard_blog'] ) == '' ) {
-                        $_POST['dashboard_blog'] = $current_site-&gt;blog_id;
-                        $dashboard_blog_id = $current_site-&gt;blog_id;
-                } elseif ( ! preg_match( '/(--|\.)/', $_POST['dashboard_blog'] ) &amp;&amp; preg_match( '|^([a-zA-Z0-9-\.])+$|', $_POST['dashboard_blog'] ) ) {
-                        $dashboard_blog = $_POST['dashboard_blog'];
-                        $blog_details = get_blog_details( $dashboard_blog );
-                        if ( false === $blog_details ) {
-                                if ( is_numeric( $dashboard_blog ) )
-                                        wp_die( __( 'A dashboard site referenced by ID must already exist' ) );
-                                if ( is_subdomain_install() ) {
-                                        $domain = $dashboard_blog . '.' . $current_site-&gt;domain;
-                                        $path = $current_site-&gt;path;
-                                } else {
-                                        $domain = $current_site-&gt;domain;
-                                        $path = trailingslashit( $current_site-&gt;path . $dashboard_blog );
-                                }
-                                $wpdb-&gt;hide_errors();
-                                $dashboard_blog_id = wpmu_create_blog( $domain, $path, __( 'My Dashboard' ), $current_user-&gt;id , array( 'public' =&gt; 0 ), $current_site-&gt;id );
-                                $wpdb-&gt;show_errors();
-                        } else {
-                                $dashboard_blog_id = $blog_details-&gt;blog_id;
-                        }
-                }
-                if ( is_wp_error( $dashboard_blog_id ) )
-                        wp_die( __( 'Problem creating dashboard site: ' ) . $dashboard_blog_id-&gt;get_error_message() );
-                if ( $_POST['dashboard_blog_orig'] != $_POST['dashboard_blog'] ) {
-                        $users = get_users_of_blog( get_site_option( 'dashboard_blog' ) );
-                        $move_users = array();
-                        foreach ( (array)$users as $user ) {
-                                $user_meta_value = unserialize( $user-&gt;meta_value );
-                                if ( is_array( $user_meta_value ) &amp;&amp; array_pop( $var_by_ref = array_keys( $user_meta_value ) ) == 'subscriber' )
-                                        $move_users[] = $user-&gt;user_id;
-                        }
-                        if ( false == empty( $move_users ) ) {
-                                foreach ( (array)$move_users as $user_id ) {
-                                        remove_user_from_blog($user_id, get_site_option( 'dashboard_blog' ) );
-                                        add_user_to_blog( $dashboard_blog_id, $user_id, get_site_option( 'default_user_role', 'subscriber' ) );
-                                        update_user_meta( $user_id, 'primary_blog', $dashboard_blog_id );
-                                }
-                        }
-                }
-                update_site_option( 'dashboard_blog', $dashboard_blog_id );
-
-                $options = array( 'registrationnotification', 'registration', 'add_new_users', 'menu_items', 'mu_media_buttons', 'upload_space_check_disabled', 'blog_upload_space', 'upload_filetypes', 'site_name', 'first_post', 'first_page', 'first_comment', 'first_comment_url', 'first_comment_author', 'welcome_email', 'welcome_user_email', 'fileupload_maxk', 'admin_notice_feed', 'global_terms_enabled' );
-                $checked_options = array( 'mu_media_buttons' =&gt; array(), 'menu_items' =&gt; array(), 'registrationnotification' =&gt; 'no', 'upload_space_check_disabled' =&gt; 1, 'add_new_users' =&gt; 0 );
-                foreach ( $checked_options as $option_name =&gt; $option_unchecked_value ) {
-                        if ( ! isset( $_POST[$option_name] ) )
-                                $_POST[$option_name] = $option_unchecked_value;
-                }
-                foreach ( $options as $option_name ) {
-                        if ( ! isset($_POST[$option_name]) )
-                                continue;
-                        $value = stripslashes_deep( $_POST[$option_name] );
-                        update_site_option( $option_name, $value );
-                }
-
-                // Update more options here
-                do_action( 'update_wpmu_options' );
-
-                wp_redirect( add_query_arg( 'updated', 'true', admin_url( 'ms-options.php' ) ) );
-                exit();
-        break;
-        case 'addblog':
-                check_admin_referer( 'add-blog', '_wpnonce_add-blog' );
-
-                if ( ! current_user_can( 'manage_sites' ) )
-                        wp_die( __( 'You do not have permission to access this page.' ) );
-
-                if ( is_array( $_POST['blog'] ) == false )
-                        wp_die(  __( 'Can&amp;#8217;t create an empty site.' ) );
-                $blog = $_POST['blog'];
-                $domain = '';
-                if ( ! preg_match( '/(--)/', $blog['domain'] ) &amp;&amp; preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) )
-                        $domain = strtolower( $blog['domain'] );
-
-                // If not a subdomain install, make sure the domain isn't a reserved word
-                if ( ! is_subdomain_install() ) {
-                        $subdirectory_reserved_names = apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed' ) );
-                        if ( in_array( $domain, $subdirectory_reserved_names ) )
-                                wp_die( sprintf( __('The following words are reserved for use by WordPress functions and cannot be used as blog names: &lt;code&gt;%s&lt;/code&gt;' ), implode( '&lt;/code&gt;, &lt;code&gt;', $subdirectory_reserved_names ) ) );
-                }
-
-                $email = sanitize_email( $blog['email'] );
-                $title = $blog['title'];
-
-                if ( empty( $domain ) )
-                        wp_die( __( 'Missing or invalid site address.' ) );
-                if ( empty( $email ) )
-                        wp_die( __( 'Missing email address.' ) );
-                if ( !is_email( $email ) )
-                        wp_die( __( 'Invalid email address.' ) );
-
-                if ( is_subdomain_install() ) {
-                        $newdomain = $domain . '.' . preg_replace( '|^www\.|', '', $current_site-&gt;domain );
-                        $path = $base;
-                } else {
-                        $newdomain = $current_site-&gt;domain;
-                        $path = $base . $domain . '/';
-                }
-
-                $password = 'N/A';
-                $user_id = email_exists($email);
-                if ( !$user_id ) { // Create a new user with a random password
-                        $password = wp_generate_password();
-                        $user_id = wpmu_create_user( $domain, $password, $email );
-                        if ( false == $user_id )
-                                wp_die( __( 'There was an error creating the user.' ) );
-                        else
-                                wp_new_user_notification( $user_id, $password );
-                }
-
-                $wpdb-&gt;hide_errors();
-                $id = wpmu_create_blog( $newdomain, $path, $title, $user_id , array( 'public' =&gt; 1 ), $current_site-&gt;id );
-                $wpdb-&gt;show_errors();
-                if ( !is_wp_error( $id ) ) {
-                        $dashboard_blog = get_dashboard_blog();
-                        if ( !is_super_admin( $user_id ) &amp;&amp; get_user_option( 'primary_blog', $user_id ) == $dashboard_blog-&gt;blog_id )
-                                update_user_option( $user_id, 'primary_blog', $id, true );
-                        $content_mail = sprintf( __( &quot;New site created by %1s\n\nAddress: http://%2s\nName: %3s&quot;), $current_user-&gt;user_login , $newdomain . $path, stripslashes( $title ) );
-                        wp_mail( get_site_option('admin_email'),  sprintf( __( '[%s] New Site Created' ), $current_site-&gt;site_name ), $content_mail, 'From: &quot;Site Admin&quot; &lt;' . get_site_option( 'admin_email' ) . '&gt;' );
-                        wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' =&gt; 1 ) );
-                        wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'add-blog' ), wp_get_referer() ) );
-                        exit();
-                } else {
-                        wp_die( $id-&gt;get_error_message() );
-                }
-        break;
-
-        case 'updateblog':
-                check_admin_referer( 'editblog' );
-                if ( ! current_user_can( 'manage_sites' ) )
-                        wp_die( __( 'You do not have permission to access this page.' ) );
-
-                if ( empty( $_POST ) )
-                        wp_die( sprintf( __( 'You probably need to go back to the &lt;a href=&quot;%s&quot;&gt;sites page&lt;/a&gt;', esc_url( admin_url( 'ms-sites.php' ) ) ) ) );
-
-                switch_to_blog( $id );
-
-                // themes
-                $allowedthemes = array();
-                if ( isset($_POST['theme']) &amp;&amp; is_array( $_POST['theme'] ) ) {
-                        foreach ( $_POST['theme'] as $theme =&gt; $val ) {
-                                if ( 'on' == $val )
-                                        $allowedthemes[$theme] = true;
-                        }
-                }
-                update_option( 'allowedthemes',  $allowedthemes );
-
-                // options
-                if ( is_array( $_POST['option'] ) ) {
-                        $c = 1;
-                        $count = count( $_POST['option'] );
-                        $skip_options = array( 'allowedthemes' ); // Don't update these options since they are handled elsewhere in the form.
-                        foreach ( (array) $_POST['option'] as $key =&gt; $val ) {
-                                if ( $key === 0 || is_array( $val ) || in_array($key, $skip_options) )
-                                        continue; // Avoids &quot;0 is a protected WP option and may not be modified&quot; error when edit blog options
-                                if ( $c == $count )
-                                        update_option( $key, stripslashes( $val ) );
-                                else
-                                        update_option( $key, stripslashes( $val ), false ); // no need to refresh blog details yet
-                                $c++;
-                        }
-                }
-
-                // home and siteurl
-                if ( isset( $_POST['update_home_url'] ) &amp;&amp; $_POST['update_home_url'] == 'update' ) {
-                        $blog_address = get_blogaddress_by_domain( $_POST['blog']['domain'], $_POST['blog']['path'] );
-                        if ( get_option( 'siteurl' ) !=  $blog_address )
-                                update_option( 'siteurl', $blog_address );
-
-                        if ( get_option( 'home' ) != $blog_address )
-                                update_option( 'home', $blog_address );
-                }
-
-                // rewrite rules can't be flushed during switch to blog
-                delete_option( 'rewrite_rules' );
-
-                // update blogs table
-                $blog_data = stripslashes_deep( $_POST['blog'] );
-                update_blog_details( $id, $blog_data );
-
-                // get blog prefix
-                $blog_prefix = $wpdb-&gt;get_blog_prefix( $id );
-
-                // user roles
-                if ( isset( $_POST['role'] ) &amp;&amp; is_array( $_POST['role'] ) == true ) {
-                        $newroles = $_POST['role'];
-
-                        reset( $newroles );
-                        foreach ( (array) $newroles as $userid =&gt; $role ) {
-                                $user = new WP_User( $userid );
-                                if ( empty( $user-&gt;ID ) )
-                                        continue;
-                                $user-&gt;for_blog( $id );
-                                $user-&gt;set_role( $role );
-                        }
-                }
-
-                // remove user
-                if ( isset( $_POST['blogusers'] ) &amp;&amp; is_array( $_POST['blogusers'] ) ) {
-                        reset( $_POST['blogusers'] );
-                        foreach ( (array) $_POST['blogusers'] as $key =&gt; $val )
-                                remove_user_from_blog( $key, $id );
-                }
-
-                // change password
-                if ( isset( $_POST['user_password'] ) &amp;&amp; is_array( $_POST['user_password'] ) ) {
-                        reset( $_POST['user_password'] );
-                        $newroles = $_POST['role'];
-                        foreach ( (array) $_POST['user_password'] as $userid =&gt; $pass ) {
-                                unset( $_POST['role'] );
-                                $_POST['role'] = $newroles[ $userid ];
-                                if ( $pass != '' ) {
-                                        $cap = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT meta_value FROM {$wpdb-&gt;usermeta} WHERE user_id = %d AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'&quot;, $userid ) );
-                                        $userdata = get_userdata($userid);
-                                        $_POST['pass1'] = $_POST['pass2'] = $pass;
-                                        $_POST['email'] = $userdata-&gt;user_email;
-                                        $_POST['rich_editing'] = $userdata-&gt;rich_editing;
-                                        edit_user( $userid );
-                                        if ( $cap == null )
-                                                $wpdb-&gt;query( $wpdb-&gt;prepare( &quot;DELETE FROM {$wpdb-&gt;usermeta} WHERE user_id = %d AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'&quot;, $userid ) );
-                                }
-                        }
-                        unset( $_POST['role'] );
-                        $_POST['role'] = $newroles;
-                }
-
-                // add user
-                if ( !empty( $_POST['newuser'] ) ) {
-                        $newuser = $_POST['newuser'];
-                        $userid = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT ID FROM &quot; . $wpdb-&gt;users . &quot; WHERE user_login = %s&quot;, $newuser ) );
-                        if ( $userid ) {
-                                $user = $wpdb-&gt;get_var( &quot;SELECT user_id FROM &quot; . $wpdb-&gt;usermeta . &quot; WHERE user_id='$userid' AND meta_key='{$blog_prefix}capabilities'&quot; );
-                                if ( $user == false )
-                                        add_user_to_blog( $id, $userid, $_POST['new_role'] );
-                        }
-                }
-                do_action( 'wpmu_update_blog_options' );
-                restore_current_blog();
-                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'editblog', 'id' =&gt; $id ), wp_get_referer() ) );
-        break;
-
-        case 'deleteblog':
-                check_admin_referer('deleteblog');
-                if ( ! current_user_can( 'manage_sites' ) )
-                        wp_die( __( 'You do not have permission to access this page.' ) );
-
-                if ( $id != '0' &amp;&amp; $id != $current_site-&gt;blog_id )
-                        wpmu_delete_blog( $id, true );
-
-                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'delete' ), wp_get_referer() ) );
-                exit();
-        break;
-
-        case 'allblogs':
-                if ( isset( $_POST['doaction']) || isset($_POST['doaction2'] ) ) {
-                        check_admin_referer( 'bulk-ms-sites', '_wpnonce_bulk-ms-sites' );
-
-                        if ( ! current_user_can( 'manage_sites' ) )
-                                wp_die( __( 'You do not have permission to access this page.' ) );
-
-                        if ( $_GET['action'] != -1 || $_POST['action2'] != -1 )
-                                $doaction = $_POST['action'] != -1 ? $_POST['action'] : $_POST['action2'];
-
-
-                        foreach ( (array) $_POST['allblogs'] as $key =&gt; $val ) {
-                                if ( $val != '0' &amp;&amp; $val != $current_site-&gt;blog_id ) {
-                                        switch ( $doaction ) {
-                                                case 'delete':
-                                                        $blogfunction = 'all_delete';
-                                                        wpmu_delete_blog( $val, true );
-                                                break;
-
-                                                case 'spam':
-                                                        $blogfunction = 'all_spam';
-                                                        update_blog_status( $val, 'spam', '1', 0 );
-                                                        set_time_limit( 60 );
-                                                break;
-
-                                                case 'notspam':
-                                                        $blogfunction = 'all_notspam';
-                                                        update_blog_status( $val, 'spam', '0', 0 );
-                                                        set_time_limit( 60 );
-                                                break;
-                                        }
-                                } else {
-                                        wp_die( __( 'You are not allowed to change the current site.' ) );
-                                }
-                        }
-
-                        wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; $blogfunction ), wp_get_referer() ) );
-                        exit();
-                } else {
-                        wp_redirect( admin_url( 'ms-sites.php' ) );
-                }
-        break;
-
-        case 'archiveblog':
-                check_admin_referer( 'archiveblog' );
-                if ( ! current_user_can( 'manage_sites' ) )
-                        wp_die( __( 'You do not have permission to access this page.' ) );
-
-                update_blog_status( $id, 'archived', '1' );
-                do_action( 'archive_blog', $id );
-                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'archive' ), wp_get_referer() ) );
-                exit();
-        break;
-
-        case 'unarchiveblog':
-                check_admin_referer( 'unarchiveblog' );
-                if ( ! current_user_can( 'manage_sites' ) )
-                        wp_die( __( 'You do not have permission to access this page.' ) );
-
-                do_action( 'unarchive_blog', $id );
-                update_blog_status( $id, 'archived', '0' );
-                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'unarchive' ), wp_get_referer() ) );
-                exit();
-        break;
-
-        case 'activateblog':
-                check_admin_referer( 'activateblog' );
-                if ( ! current_user_can( 'manage_sites' ) )
-                        wp_die( __( 'You do not have permission to access this page.' ) );
-
-                update_blog_status( $id, 'deleted', '0' );
-                do_action( 'activate_blog', $id );
-                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'activate' ), wp_get_referer() ) );
-                exit();
-        break;
-
-        case 'deactivateblog':
-                check_admin_referer( 'deactivateblog' );
-                if ( ! current_user_can( 'manage_sites' ) )
-                        wp_die( __( 'You do not have permission to access this page.' ) );
-
-                do_action( 'deactivate_blog', $id );
-                update_blog_status( $id, 'deleted', '1' );
-                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'deactivate' ), wp_get_referer() ) );
-                exit();
-        break;
-
-        case 'unspamblog':
-                check_admin_referer( 'unspamblog' );
-                if ( ! current_user_can( 'manage_sites' ) )
-                        wp_die( __( 'You do not have permission to access this page.' ) );
-
-                update_blog_status( $id, 'spam', '0' );
-                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'unspam' ), wp_get_referer() ) );
-                exit();
-        break;
-
-        case 'spamblog':
-                check_admin_referer( 'spamblog' );
-                if ( ! current_user_can( 'manage_sites' ) )
-                        wp_die( __( 'You do not have permission to access this page.' ) );
-
-                update_blog_status( $id, 'spam', '1' );
-                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'spam' ), wp_get_referer() ) );
-                exit();
-        break;
-
-        // Themes
-    case 'updatethemes':
-        if ( ! current_user_can( 'manage_network_themes' ) )
-                wp_die( __( 'You do not have permission to access this page.' ) );
-
-            if ( is_array( $_POST['theme'] ) ) {
-                        $themes = get_themes();
-                        reset( $themes );
-                        $allowed_themes = array();
-                        foreach ( (array) $themes as $key =&gt; $theme ) {
-                                if ( $_POST['theme'][ esc_html( $theme['Stylesheet'] ) ] == 'enabled' )
-                                        $allowed_themes[ esc_html( $theme['Stylesheet'] ) ] = true;
-                        }
-                        update_site_option( 'allowedthemes', $allowed_themes );
-                }
-                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'themes' ),  wp_get_referer() ) );
-                exit();
-        break;
-
-        // Common
-        case 'confirm':
-                if ( !headers_sent() ) {
-                        nocache_headers();
-                        header( 'Content-Type: text/html; charset=utf-8' );
-                }
-                if ( $current_site-&gt;blog_id == $id )
-                        wp_die( __( 'You are not allowed to change the current site.' ) );
-                ?&gt;
-                &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
-                &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &lt;?php if ( function_exists( 'language_attributes' ) ) language_attributes(); ?&gt;&gt;
-                        &lt;head&gt;
-                                &lt;title&gt;&lt;?php _e( 'WordPress &amp;rsaquo; Confirm your action' ); ?&gt;&lt;/title&gt;
-
-                                &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
-                                &lt;?php
-                                wp_admin_css( 'install', true );
-                                wp_admin_css( 'ie', true );
-                                ?&gt;
-                        &lt;/head&gt;
-                        &lt;body&gt;
-                                &lt;h1 id=&quot;logo&quot;&gt;&lt;img alt=&quot;WordPress&quot; src=&quot;&lt;?php echo esc_attr( admin_url( 'images/wordpress-logo.png' ) ); ?&gt;&quot; /&gt;&lt;/h1&gt;
-                                &lt;form action=&quot;ms-edit.php?action=&lt;?php echo esc_attr( $_GET['action2'] ) ?&gt;&quot; method=&quot;post&quot;&gt;
-                                        &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;&lt;?php echo esc_attr( $_GET['action2'] ) ?&gt;&quot; /&gt;
-                                        &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;&lt;?php echo esc_attr( $id ); ?&gt;&quot; /&gt;
-                                        &lt;input type=&quot;hidden&quot; name=&quot;_wp_http_referer&quot; value=&quot;&lt;?php echo esc_attr( wp_get_referer() ); ?&gt;&quot; /&gt;
-                                        &lt;?php wp_nonce_field( $_GET['action2'], '_wpnonce', false ); ?&gt;
-                                        &lt;p&gt;&lt;?php echo esc_html( stripslashes( $_GET['msg'] ) ); ?&gt;&lt;/p&gt;
-                                        &lt;p class=&quot;submit&quot;&gt;&lt;input class=&quot;button&quot; type=&quot;submit&quot; value=&quot;&lt;?php _e( 'Confirm' ); ?&gt;&quot; /&gt;&lt;/p&gt;
-                                &lt;/form&gt;
-                        &lt;/body&gt;
-                &lt;/html&gt;
-                &lt;?php
-        break;
-
-        // Users
-        case 'deleteuser':
-                if ( ! current_user_can( 'manage_network_users' ) )
-                        wp_die( __( 'You do not have permission to access this page.' ) );
-
-                check_admin_referer( 'deleteuser' );
-
-                if ( $id != '0' &amp;&amp; $id != '1' ) {
-                        $_POST['allusers'] = array( $id ); // confirm_delete_users() can only handle with arrays
-                        $title = __( 'Users' );
-                        $parent_file = 'ms-admin.php';
-                        require_once( 'admin-header.php' );
-                        echo '&lt;div class=&quot;wrap&quot;&gt;';
-                        confirm_delete_users( $_POST['allusers'] );
-                        echo '&lt;/div&gt;';
-            require_once( 'admin-footer.php' );
-            exit();
-                } else {
-                        wp_redirect( admin_url( 'ms-users.php' ) );
-                }
-        break;
-
-        case 'allusers':
-                if ( ! current_user_can( 'manage_network_users' ) )
-                        wp_die( __( 'You do not have permission to access this page.' ) );
-
-                if ( isset( $_POST['doaction']) || isset($_POST['doaction2'] ) ) {
-                        check_admin_referer( 'bulk-ms-users', '_wpnonce_bulk-ms-users' );
-
-                        if ( $_GET['action'] != -1 || $_POST['action2'] != -1 )
-                                $doaction = $_POST['action'] != -1 ? $_POST['action'] : $_POST['action2'];
-
-                        foreach ( (array) $_POST['allusers'] as $key =&gt; $val ) {
-                                if ( !empty( $val ) ) {
-                                        switch ( $doaction ) {
-                                                case 'delete':
-                                                        $title = __( 'Users' );
-                                                        $parent_file = 'ms-admin.php';
-                                                        require_once( 'admin-header.php' );
-                                                        echo '&lt;div class=&quot;wrap&quot;&gt;';
-                                                        confirm_delete_users( $_POST['allusers'] );
-                                                        echo '&lt;/div&gt;';
-                                            require_once( 'admin-footer.php' );
-                                            exit();
-                                               break;
-
-                                                case 'spam':
-                                                        $user = new WP_User( $val );
-                                                        if ( in_array( $user-&gt;user_login, get_super_admins() ) )
-                                                                wp_die( sprintf( __( 'Warning! User cannot be modified. The user %s is a network administrator.' ), esc_html( $user-&gt;user_login ) ) );
-
-                                                        $userfunction = 'all_spam';
-                                                        $blogs = get_blogs_of_user( $val, true );
-                                                        foreach ( (array) $blogs as $key =&gt; $details ) {
-                                                                if ( $details-&gt;userblog_id != $current_site-&gt;blog_id ) // main blog not a spam !
-                                                                        update_blog_status( $details-&gt;userblog_id, 'spam', '1' );
-                                                        }
-                                                        update_user_status( $val, 'spam', '1', 1 );
-                                                break;
-
-                                                case 'notspam':
-                                                        $userfunction = 'all_notspam';
-                                                        $blogs = get_blogs_of_user( $val, true );
-                                                        foreach ( (array) $blogs as $key =&gt; $details )
-                                                                update_blog_status( $details-&gt;userblog_id, 'spam', '0' );
-
-                                                        update_user_status( $val, 'spam', '0', 1 );
-                                                break;
-                                        }
-                                }
-                        }
-
-                        wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; $userfunction ), wp_get_referer() ) );
-                        exit();
-                } else {
-                        wp_redirect( admin_url( 'ms-users.php' ) );
-                }
-        break;
-
-        case 'dodelete':
-                check_admin_referer( 'ms-users-delete' );
-                if ( ! current_user_can( 'manage_network_users' ) )
-                        wp_die( __( 'You do not have permission to access this page.' ) );
-
-                if ( ! empty( $_POST['blog'] ) &amp;&amp; is_array( $_POST['blog'] ) ) {
-                        foreach ( $_POST['blog'] as $id =&gt; $users ) {
-                                foreach ( $users as $blogid =&gt; $user_id ) {
-                                        if ( ! empty( $_POST['delete'] ) &amp;&amp; 'reassign' == $_POST['delete'][$blogid][$id] )
-                                                remove_user_from_blog( $id, $blogid, $user_id );
-                                        else
-                                                remove_user_from_blog( $id, $blogid );
-                                }
-                        }
-                }
-                $i = 0;
-                if ( is_array( $_POST['user'] ) &amp;&amp; ! empty( $_POST['user'] ) )
-                        foreach( $_POST['user'] as $id ) {
-                                wpmu_delete_user( $id );
-                                $i++;
-                        }
-
-                if ( $i == 1 )
-                        $deletefunction = 'delete';
-                else
-                        $deletefunction = 'all_delete';
-
-                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; $deletefunction ), admin_url( 'ms-users.php' ) ) );
-        break;
-
-        case 'adduser':
-                check_admin_referer( 'add-user', '_wpnonce_add-user' );
-                if ( ! current_user_can( 'manage_network_users' ) )
-                        wp_die( __( 'You do not have permission to access this page.' ) );
-
-                if ( is_array( $_POST['user'] ) == false )
-                        wp_die( __( 'Cannot create an empty user.' ) );
-                $user = $_POST['user'];
-                if ( empty($user['username']) &amp;&amp; empty($user['email']) )
-                        wp_die( __( 'Missing username and email.' ) );
-                elseif ( empty($user['username']) )
-                        wp_die( __( 'Missing username.' ) );
-                elseif ( empty($user['email']) )
-                        wp_die( __( 'Missing email.' ) );
-
-                $password = wp_generate_password();
-                $user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );
-
-                if ( false == $user_id )
-                         wp_die( __( 'Duplicated username or email address.' ) );
-                else
-                        wp_new_user_notification( $user_id, $password );
-
-                if ( get_site_option( 'dashboard_blog' ) == false )
-                        add_user_to_blog( $current_site-&gt;blog_id, $user_id, get_site_option( 'default_user_role', 'subscriber' ) );
-                else
-                        add_user_to_blog( get_site_option( 'dashboard_blog' ), $user_id, get_site_option( 'default_user_role', 'subscriber' ) );
-
-                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'add' ), wp_get_referer() ) );
-                exit();
-        break;
-
-        default:
-                wp_redirect( admin_url( 'ms-admin.php' ) );
-        break;
-}
-?&gt;
</del></span></pre></div>
<a id="trunkwpadminmseditphp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/ms-edit.php (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-edit.php                                (rev 0)
+++ trunk/wp-admin/ms-edit.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+&lt;?php
+/**
+ * Action handler for Multisite administration panels.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( './admin.php' );
+
+wp_redirect( network_admin_url() );
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-admin/ms-edit.php
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:eol-style
</span><span class="cx">   + native
</span></span></pre></div>
<a id="trunkwpadminmsoptionsphp"></a>
<div class="delfile"><h4>Deleted: trunk/wp-admin/ms-options.php (15480 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-options.php        2010-07-29 21:58:58 UTC (rev 15480)
+++ trunk/wp-admin/ms-options.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -1,318 +0,0 @@
</span><del>-&lt;?php
-/**
- * Multisite network settings administration panel.
- *
- * @package WordPress
- * @subpackage Multisite
- * @since 3.0.0
- */
-
-require_once( './admin.php' );
-
-if ( ! is_multisite() )
-        wp_die( __( 'Multisite support is not enabled.' ) );
-
-if ( ! current_user_can( 'manage_network_options' ) )
-        wp_die( __( 'You do not have permission to access this page.' ) );
-
-$title = __( 'Network Options' );
-$parent_file = 'ms-admin.php';
-
-add_contextual_help($current_screen,
-        '&lt;p&gt;' . __('This screen sets and changes options for the network as a whole. The first site is the main site in the network and network options are pulled from that original site&amp;#8217;s options.') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('Operational settings has fields for the network&amp;#8217;s name and admin email.') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('Dashboard Site is an option to give a site to users who do not have a site on the system. Their default role is Subscriber, but that default can be changed. The Admin Notice Feed can provide a notice on all dashboards of the latest post via RSS or Atom, or provide no such notice if left blank.') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('Registration settings can disable/enable public signups. If you let others sign up for a site, install spam plugins. Spaces, not commas, should separate names banned as sites for this network.') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('New site settings are defaults applied when a new site is created in the network. These include welcome email for when a new site or user account is registered, and what&amp;#8127;s put in the first post, page, comment, comment author, and comment URL.') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('Upload settings control the size of the uploaded files and the amount of available upload space for each site. You can change the default value for specific sites when you edit a particular site. Allowed file types are also listed (space separated only).') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('Checkboxes for media upload buttons set which are shown in the visual editor. If unchecked, a generic upload button is still visible; other media types can still be uploaded if on the allowed file types list.') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('Menu setting enables/disables the plugin menus from appearing for non super admins, so that only super admins, not site admins, have access to activate plugins.') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('Super admins can no longer be added on the Options screen. You must now go to the list of existing users on Super Admin &gt; Users and click on Username or the Edit action link below that name. This goes to an Edit User page where you can check a box to grant super admin privileges.') . '&lt;/p&gt;' .
-        '&lt;p&gt;&lt;strong&gt;' . __('For more information:') . '&lt;/strong&gt;&lt;/p&gt;' .
-        '&lt;p&gt;' . __('&lt;a href=&quot;http://codex.wordpress.org/Super_Admin_Options_SubPanel&quot; target=&quot;_blank&quot;&gt;Network Options Documentation&lt;/a&gt;') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('&lt;a href=&quot;http://wordpress.org/support/&quot; target=&quot;_blank&quot;&gt;Support Forums&lt;/a&gt;') . '&lt;/p&gt;'
-);
-
-include( './admin-header.php' );
-
-if (isset($_GET['updated'])) {
-        ?&gt;
-        &lt;div id=&quot;message&quot; class=&quot;updated&quot;&gt;&lt;p&gt;&lt;?php _e( 'Options saved.' ) ?&gt;&lt;/p&gt;&lt;/div&gt;
-        &lt;?php
-}
-?&gt;
-
-&lt;div class=&quot;wrap&quot;&gt;
-        &lt;?php screen_icon(); ?&gt;
-        &lt;h2&gt;&lt;?php _e( 'Network Options' ) ?&gt;&lt;/h2&gt;
-        &lt;form method=&quot;post&quot; action=&quot;ms-edit.php?action=siteoptions&quot;&gt;
-                &lt;?php wp_nonce_field( 'siteoptions' ); ?&gt;
-                &lt;h3&gt;&lt;?php _e( 'Operational Settings' ); ?&gt;&lt;/h3&gt;
-                &lt;table class=&quot;form-table&quot;&gt;
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;site_name&quot;&gt;&lt;?php _e( 'Network Name' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
-                                &lt;td&gt;
-                                        &lt;input name=&quot;site_name&quot; type=&quot;text&quot; id=&quot;site_name&quot; class=&quot;regular-text&quot; value=&quot;&lt;?php echo esc_attr( $current_site-&gt;site_name ) ?&gt;&quot; /&gt;
-                                        &lt;br /&gt;
-                                        &lt;?php _e( 'What you would like to call this website.' ) ?&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;admin_email&quot;&gt;&lt;?php _e( 'Network Admin Email' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
-                                &lt;td&gt;
-                                        &lt;input name=&quot;admin_email&quot; type=&quot;text&quot; id=&quot;admin_email&quot; class=&quot;regular-text&quot; value=&quot;&lt;?php echo esc_attr( get_site_option('admin_email') ) ?&gt;&quot; /&gt;
-                                        &lt;br /&gt;
-                                        &lt;?php printf( __( 'Registration and support emails will come from this address. An address such as &lt;code&gt;support@%s&lt;/code&gt; is recommended.' ), $current_site-&gt;domain ); ?&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-                &lt;/table&gt;
-                &lt;h3&gt;&lt;?php _e( 'Dashboard Settings' ); ?&gt;&lt;/h3&gt;
-                &lt;table class=&quot;form-table&quot;&gt;
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;dashboard_blog&quot;&gt;&lt;?php _e( 'Dashboard Site' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
-                                &lt;td&gt;
-                                        &lt;?php
-                                        if ( $dashboard_blog = get_site_option( 'dashboard_blog' ) ) {
-                                                $details = get_blog_details( $dashboard_blog );
-                                                $blogname = untrailingslashit( sanitize_user( str_replace( '.', '', str_replace( $current_site-&gt;domain . $current_site-&gt;path, '', $details-&gt;domain . $details-&gt;path ) ) ) );
-                                        } else {
-                                                $blogname = '';
-                                        }?&gt;
-                                        &lt;input name=&quot;dashboard_blog_orig&quot; type=&quot;hidden&quot; id=&quot;dashboard_blog_orig&quot; value=&quot;&lt;?php echo esc_attr( $blogname ); ?&gt;&quot; /&gt;
-                                        &lt;input name=&quot;dashboard_blog&quot; type=&quot;text&quot; id=&quot;dashboard_blog&quot; value=&quot;&lt;?php echo esc_attr( $blogname ); ?&gt;&quot; class=&quot;regular-text&quot; /&gt;
-                                        &lt;br /&gt;
-                                        &lt;?php _e( 'Site path (&amp;#8220;dashboard&amp;#8221;, &amp;#8220;control&amp;#8221;, &amp;#8220;manager&amp;#8221;, etc.) or blog ID.&lt;br /&gt;New users are added to this site as the user role defined below if they don&amp;#8217;t have a site. Leave blank for the main site. Users with the Subscriber role on the old site will be moved to the new site if changed. The new site will be created if it does not exist.' ); ?&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;default_user_role&quot;&gt;&lt;?php _e( 'Dashboard User Default Role' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
-                                &lt;td&gt;
-                                        &lt;select name=&quot;default_user_role&quot; id=&quot;default_user_role&quot;&gt;&lt;?php
-                                        wp_dropdown_roles( get_site_option( 'default_user_role', 'subscriber' ) );
-                                        ?&gt;
-                                        &lt;/select&gt;
-                                        &lt;br /&gt;
-                                        &lt;?php _e( 'The default role for new users on the Dashboard site. &amp;#8220;Subscriber&amp;#8221; or &amp;#8220;Contributor&amp;#8221; roles are recommended.' ); ?&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;admin_notice_feed&quot;&gt;&lt;?php _e( 'Admin Notice Feed' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
-                                &lt;td&gt;&lt;input name=&quot;admin_notice_feed&quot; class=&quot;large-text&quot; type=&quot;text&quot; id=&quot;admin_notice_feed&quot; value=&quot;&lt;?php echo esc_attr( get_site_option( 'admin_notice_feed' ) ) ?&gt;&quot; size=&quot;80&quot; /&gt;&lt;br /&gt;
-                                &lt;?php _e( 'Display the latest post from this RSS or Atom feed on all site dashboards. Leave blank to disable.' ); ?&gt;&lt;br /&gt;
-
-                                &lt;?php if ( get_site_option( 'admin_notice_feed' ) != get_home_url( $current_site-&gt;id, 'feed/' ) )
-                                        echo __( 'A good one to use would be the feed from your main site: ' ) . esc_url( get_home_url( $current_site-&gt;id, 'feed/' ) ) ?&gt;&lt;/td&gt;
-                        &lt;/tr&gt;
-                &lt;/table&gt;
-                &lt;h3&gt;&lt;?php _e( 'Registration Settings' ); ?&gt;&lt;/h3&gt;
-                &lt;table class=&quot;form-table&quot;&gt;
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Allow new registrations' ) ?&gt;&lt;/th&gt;
-                                &lt;?php
-                                if ( !get_site_option( 'registration' ) )
-                                        update_site_option( 'registration', 'none' );
-                                $reg = get_site_option( 'registration' );
-                                ?&gt;
-                                &lt;td&gt;
-                                        &lt;label&gt;&lt;input name=&quot;registration&quot; type=&quot;radio&quot; id=&quot;registration1&quot; value=&quot;none&quot;&lt;?php checked( $reg, 'none') ?&gt; /&gt; &lt;?php _e( 'Registration is disabled.' ); ?&gt;&lt;/label&gt;&lt;br /&gt;
-                                        &lt;label&gt;&lt;input name=&quot;registration&quot; type=&quot;radio&quot; id=&quot;registration2&quot; value=&quot;user&quot;&lt;?php checked( $reg, 'user') ?&gt; /&gt; &lt;?php _e( 'User accounts may be registered.' ); ?&gt;&lt;/label&gt;&lt;br /&gt;
-                                        &lt;label&gt;&lt;input name=&quot;registration&quot; type=&quot;radio&quot; id=&quot;registration3&quot; value=&quot;blog&quot;&lt;?php checked( $reg, 'blog') ?&gt; /&gt; &lt;?php _e( 'Logged in users may register new sites.' ); ?&gt;&lt;/label&gt;&lt;br /&gt;
-                                        &lt;label&gt;&lt;input name=&quot;registration&quot; type=&quot;radio&quot; id=&quot;registration4&quot; value=&quot;all&quot;&lt;?php checked( $reg, 'all') ?&gt; /&gt; &lt;?php _e( 'Both sites and user accounts can be registered.' ); ?&gt;&lt;/label&gt;&lt;br /&gt;
-                                        &lt;p&gt;&lt;?php _e( 'Disable or enable registration and who or what can be registered. (Default is disabled.)' ); ?&gt;&lt;/p&gt;
-                                        &lt;?php if ( is_subdomain_install() ) {
-                                                echo '&lt;p&gt;' . __( 'If registration is disabled, please set &lt;code&gt;NOBLOGREDIRECT&lt;/code&gt; in &lt;code&gt;wp-config.php&lt;/code&gt; to a URL you will redirect visitors to if they visit a non-existent site.' ) . '&lt;/p&gt;';
-                                        } ?&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Registration notification' ) ?&gt;&lt;/th&gt;
-                                &lt;?php
-                                if ( !get_site_option( 'registrationnotification' ) )
-                                        update_site_option( 'registrationnotification', 'yes' );
-                                ?&gt;
-                                &lt;td&gt;
-                                        &lt;label&gt;&lt;input name=&quot;registrationnotification&quot; type=&quot;checkbox&quot; id=&quot;registrationnotification&quot; value=&quot;yes&quot;&lt;?php checked( get_site_option( 'registrationnotification' ), 'yes' ) ?&gt; /&gt; &lt;?php _e( 'Send the network admin an email notification every time someone registers a site or user account.' ) ?&gt;&lt;/label&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-
-                        &lt;tr valign=&quot;top&quot; id=&quot;addnewusers&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Add New Users' ) ?&gt;&lt;/th&gt;
-                                &lt;td&gt;
-                                        &lt;label&gt;&lt;input name=&quot;add_new_users&quot; type=&quot;checkbox&quot; id=&quot;add_new_users&quot; value=&quot;1&quot;&lt;?php checked( get_site_option( 'add_new_users' ) ) ?&gt; /&gt; &lt;?php _e( 'Allow site administrators to add new users to their site via the &quot;Users-&gt;Add New&quot; page.' ); ?&gt;&lt;/label&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;illegal_names&quot;&gt;&lt;?php _e( 'Banned Names' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
-                                &lt;td&gt;
-                                        &lt;input name=&quot;illegal_names&quot; type=&quot;text&quot; id=&quot;illegal_names&quot; class=&quot;large-text&quot; value=&quot;&lt;?php echo esc_attr( implode( &quot; &quot;, get_site_option( 'illegal_names' ) ) ); ?&gt;&quot; size=&quot;45&quot; /&gt;
-                                        &lt;br /&gt;
-                                        &lt;?php _e( 'Users are not allowed to register these sites. Separate names by spaces.' ) ?&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;limited_email_domains&quot;&gt;&lt;?php _e( 'Limited Email Registrations' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
-                                &lt;td&gt;
-                                        &lt;?php $limited_email_domains = get_site_option( 'limited_email_domains' );
-                                        $limited_email_domains = str_replace( ' ', &quot;\n&quot;, $limited_email_domains ); ?&gt;
-                                        &lt;textarea name=&quot;limited_email_domains&quot; id=&quot;limited_email_domains&quot; cols=&quot;45&quot; rows=&quot;5&quot;&gt;
-&lt;?php echo wp_htmledit_pre( $limited_email_domains == '' ? '' : implode( &quot;\n&quot;, (array) $limited_email_domains ) ); ?&gt;&lt;/textarea&gt;
-                                        &lt;br /&gt;
-                                        &lt;?php _e( 'If you want to limit site registrations to certain domains. One domain per line.' ) ?&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;banned_email_domains&quot;&gt;&lt;?php _e('Banned Email Domains') ?&gt;&lt;/label&gt;&lt;/th&gt;
-                                &lt;td&gt;
-                                        &lt;textarea name=&quot;banned_email_domains&quot; id=&quot;banned_email_domains&quot; cols=&quot;45&quot; rows=&quot;5&quot;&gt;
-&lt;?php echo wp_htmledit_pre( get_site_option( 'banned_email_domains' ) == '' ? '' : implode( &quot;\n&quot;, (array) get_site_option( 'banned_email_domains' ) ) ); ?&gt;&lt;/textarea&gt;
-                                        &lt;br /&gt;
-                                        &lt;?php _e( 'If you want to ban domains from site registrations. One domain per line.' ) ?&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-
-                &lt;/table&gt;
-                &lt;h3&gt;&lt;?php _e('New Site Settings'); ?&gt;&lt;/h3&gt;
-                &lt;table class=&quot;form-table&quot;&gt;
-
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;welcome_email&quot;&gt;&lt;?php _e( 'Welcome Email' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
-                                &lt;td&gt;
-                                        &lt;textarea name=&quot;welcome_email&quot; id=&quot;welcome_email&quot; rows=&quot;5&quot; cols=&quot;45&quot; class=&quot;large-text&quot;&gt;
-&lt;?php echo wp_htmledit_pre( stripslashes( get_site_option( 'welcome_email' ) ) ) ?&gt;&lt;/textarea&gt;
-                                        &lt;br /&gt;
-                                        &lt;?php _e( 'The welcome email sent to new site owners.' ) ?&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;welcome_user_email&quot;&gt;&lt;?php _e( 'Welcome User Email' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
-                                &lt;td&gt;
-                                        &lt;textarea name=&quot;welcome_user_email&quot; id=&quot;welcome_user_email&quot; rows=&quot;5&quot; cols=&quot;45&quot; class=&quot;large-text&quot;&gt;
-&lt;?php echo wp_htmledit_pre( stripslashes( get_site_option( 'welcome_user_email' ) ) ) ?&gt;&lt;/textarea&gt;
-                                        &lt;br /&gt;
-                                        &lt;?php _e( 'The welcome email sent to new users.' ) ?&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;first_post&quot;&gt;&lt;?php _e( 'First Post' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
-                                &lt;td&gt;
-                                        &lt;textarea name=&quot;first_post&quot; id=&quot;first_post&quot; rows=&quot;5&quot; cols=&quot;45&quot; class=&quot;large-text&quot;&gt;
-&lt;?php echo wp_htmledit_pre( stripslashes( get_site_option( 'first_post' ) ) ) ?&gt;&lt;/textarea&gt;
-                                        &lt;br /&gt;
-                                        &lt;?php _e( 'The first post on a new site.' ) ?&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;first_page&quot;&gt;&lt;?php _e( 'First Page' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
-                                &lt;td&gt;
-                                        &lt;textarea name=&quot;first_page&quot; id=&quot;first_page&quot; rows=&quot;5&quot; cols=&quot;45&quot; class=&quot;large-text&quot;&gt;
-&lt;?php echo wp_htmledit_pre( stripslashes( get_site_option('first_page') ) ) ?&gt;&lt;/textarea&gt;
-                                        &lt;br /&gt;
-                                        &lt;?php _e( 'The first page on a new site.' ) ?&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;first_comment&quot;&gt;&lt;?php _e( 'First Comment' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
-                                &lt;td&gt;
-                                        &lt;textarea name=&quot;first_comment&quot; id=&quot;first_comment&quot; rows=&quot;5&quot; cols=&quot;45&quot; class=&quot;large-text&quot;&gt;
-&lt;?php echo wp_htmledit_pre( stripslashes( get_site_option('first_comment') ) ) ?&gt;&lt;/textarea&gt;
-                                        &lt;br /&gt;
-                                        &lt;?php _e( 'The first comment on a new site.' ) ?&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;first_comment_author&quot;&gt;&lt;?php _e( 'First Comment Author' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
-                                &lt;td&gt;
-                                        &lt;input type=&quot;text&quot; size=&quot;40&quot; name=&quot;first_comment_author&quot; id=&quot;first_comment_author&quot; value=&quot;&lt;?php echo get_site_option('first_comment_author') ?&gt;&quot; /&gt;
-                                        &lt;br /&gt;
-                                        &lt;?php _e( 'The author of the first comment on a new site.' ) ?&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;first_comment_url&quot;&gt;&lt;?php _e( 'First Comment URL' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
-                                &lt;td&gt;
-                                        &lt;input type=&quot;text&quot; size=&quot;40&quot; name=&quot;first_comment_url&quot; id=&quot;first_comment_url&quot; value=&quot;&lt;?php echo esc_attr( get_site_option( 'first_comment_url' ) ) ?&gt;&quot; /&gt;
-                                        &lt;br /&gt;
-                                        &lt;?php _e( 'The URL for the first comment on a new site.' ) ?&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-                &lt;/table&gt;
-                &lt;h3&gt;&lt;?php _e( 'Upload Settings' ); ?&gt;&lt;/h3&gt;
-                &lt;table class=&quot;form-table&quot;&gt;
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Media upload buttons' ) ?&gt;&lt;/th&gt;
-                                &lt;?php $mu_media_buttons = get_site_option( 'mu_media_buttons', array() ); ?&gt;
-                                &lt;td&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; id=&quot;mu_media_buttons_image&quot; name=&quot;mu_media_buttons[image]&quot; value=&quot;1&quot;&lt;?php checked( ! empty( $mu_media_buttons['image'] ) ) ?&gt;/&gt; &lt;?php _e( 'Images' ); ?&gt;&lt;/label&gt;&lt;br /&gt;
-                                &lt;label&gt;&lt;input type=&quot;checkbox&quot; id=&quot;mu_media_buttons_video&quot; name=&quot;mu_media_buttons[video]&quot; value=&quot;1&quot;&lt;?php checked( ! empty( $mu_media_buttons['video'] ) ) ?&gt;/&gt; &lt;?php _e( 'Videos' ); ?&gt;&lt;/label&gt;&lt;br /&gt;
-                                &lt;label&gt;&lt;input type=&quot;checkbox&quot; id=&quot;mu_media_buttons_audio&quot; name=&quot;mu_media_buttons[audio]&quot; value=&quot;1&quot;&lt;?php checked( ! empty( $mu_media_buttons['audio'] ) ) ?&gt;/&gt; &lt;?php _e( 'Music' ); ?&gt;&lt;/label&gt;&lt;br /&gt;
-                                &lt;?php _e( 'The media upload buttons to display on the &amp;#8220;Write Post&amp;#8221; page. Make sure you update the allowed upload file types below as well.' ); ?&gt;&lt;/td&gt;
-                        &lt;/tr&gt;
-
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Site upload space' ) ?&gt;&lt;/th&gt;
-                                &lt;td&gt;
-                                &lt;label&gt;&lt;input type=&quot;checkbox&quot; id=&quot;upload_space_check_disabled&quot; name=&quot;upload_space_check_disabled&quot; value=&quot;0&quot;&lt;?php checked( get_site_option( 'upload_space_check_disabled' ), 0 ) ?&gt;/&gt; &lt;?php printf( __( 'Limit total size of files uploaded to %s MB' ), '&lt;/label&gt;&lt;label&gt;&lt;input name=&quot;blog_upload_space&quot; type=&quot;text&quot; id=&quot;blog_upload_space&quot; value=&quot;' . esc_attr( get_site_option('blog_upload_space', 10) ) . '&quot; size=&quot;3&quot; /&gt;' ); ?&gt;&lt;/label&gt;&lt;br /&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;upload_filetypes&quot;&gt;&lt;?php _e( 'Upload file types' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
-                                &lt;td&gt;&lt;input name=&quot;upload_filetypes&quot; type=&quot;text&quot; id=&quot;upload_filetypes&quot; class=&quot;large-text&quot; value=&quot;&lt;?php echo esc_attr( get_site_option('upload_filetypes', 'jpg jpeg png gif') ) ?&gt;&quot; size=&quot;45&quot; /&gt;&lt;/td&gt;
-                        &lt;/tr&gt;
-
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;fileupload_maxk&quot;&gt;&lt;?php _e( 'Max upload file size' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
-                                &lt;td&gt;&lt;?php printf( _x( '%s KB', 'File size in kilobytes' ), '&lt;input name=&quot;fileupload_maxk&quot; type=&quot;text&quot; id=&quot;fileupload_maxk&quot; value=&quot;' . esc_attr( get_site_option( 'fileupload_maxk', 300 ) ) . '&quot; size=&quot;5&quot; /&gt;' ); ?&gt;&lt;/td&gt;
-                        &lt;/tr&gt;
-                &lt;/table&gt;
-
-&lt;?php
-                $languages = get_available_languages();
-                if ( ! empty( $languages ) ) {
-                        $lang = get_site_option( 'WPLANG' );
-?&gt;
-                &lt;h3&gt;&lt;?php _e( 'Network Wide Settings' ); ?&gt;&lt;/h3&gt;
-                &lt;div class=&quot;updated inline&quot;&gt;&lt;p&gt;&lt;strong&gt;&lt;?php _e( 'Notice:' ); ?&gt;&lt;/strong&gt; &lt;?php _e( 'These settings may be overridden by site owners.' ); ?&gt;&lt;/p&gt;&lt;/div&gt;
-                &lt;table class=&quot;form-table&quot;&gt;
-                        &lt;?php
-                                ?&gt;
-                                &lt;tr valign=&quot;top&quot;&gt;
-                                        &lt;th&gt;&lt;label for=&quot;WPLANG&quot;&gt;&lt;?php _e( 'Default Language' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
-                                        &lt;td&gt;
-                                                &lt;select name=&quot;WPLANG&quot; id=&quot;WPLANG&quot;&gt;
-                                                        &lt;?php mu_dropdown_languages( $languages, get_site_option( 'WPLANG' ) ); ?&gt;
-                                                &lt;/select&gt;
-                                        &lt;/td&gt;
-                                &lt;/tr&gt;
-                &lt;/table&gt;
-&lt;?php
-                } // languages
-?&gt;
-
-                &lt;h3&gt;&lt;?php _e( 'Menu Settings' ); ?&gt;&lt;/h3&gt;
-                &lt;table id=&quot;menu&quot; class=&quot;form-table&quot;&gt;
-                        &lt;tr valign=&quot;top&quot;&gt;
-                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Enable administration menus' ); ?&gt;&lt;/th&gt;
-                                &lt;td&gt;
-                        &lt;?php
-                        $menu_perms = get_site_option( 'menu_items' );
-                        $menu_items = apply_filters( 'mu_menu_items', array( 'plugins' =&gt; __( 'Plugins' ) ) );
-                        foreach ( (array) $menu_items as $key =&gt; $val ) {
-                                echo &quot;&lt;label&gt;&lt;input type='checkbox' name='menu_items[&quot; . $key . &quot;]' value='1'&quot; .  ( isset( $menu_perms[$key] ) ? checked( $menu_perms[$key], '1', false ) : '' ) . &quot; /&gt; &quot; . esc_html( $val ) . &quot;&lt;/label&gt;&lt;br/&gt;&quot;;
-                        }
-                        ?&gt;
-                                &lt;/td&gt;
-                        &lt;/tr&gt;
-                &lt;/table&gt;
-
-                &lt;?php do_action( 'wpmu_options' ); // Add more options here ?&gt;
-
-                &lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; class=&quot;button-primary&quot; name=&quot;Submit&quot; value=&quot;&lt;?php esc_attr_e( 'Save Changes' ) ?&gt;&quot; /&gt;&lt;/p&gt;
-        &lt;/form&gt;
-&lt;/div&gt;
-
-&lt;?php include( './admin-footer.php' ); ?&gt;
</del></span></pre></div>
<a id="trunkwpadminmsoptionsphp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/ms-options.php (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-options.php                                (rev 0)
+++ trunk/wp-admin/ms-options.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+&lt;?php
+/**
+ * Multisite network settings administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( './admin.php' );
+
+wp_redirect( network_admin_url('settings.php') );
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-admin/ms-options.php
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:eol-style
</span><span class="cx">   + native
</span></span></pre></div>
<a id="trunkwpadminmssitesphp"></a>
<div class="delfile"><h4>Deleted: trunk/wp-admin/ms-sites.php (15480 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-sites.php        2010-07-29 21:58:58 UTC (rev 15480)
+++ trunk/wp-admin/ms-sites.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -1,747 +0,0 @@
</span><del>-&lt;?php
-/**
- * Multisite sites administration panel.
- *
- * @package WordPress
- * @subpackage Multisite
- * @since 3.0.0
- */
-
-require_once( './admin.php' );
-
-if ( ! is_multisite() )
-        wp_die( __( 'Multisite support is not enabled.' ) );
-
-if ( ! current_user_can( 'manage_sites' ) )
-        wp_die( __( 'You do not have permission to access this page.' ) );
-
-$title = __( 'Sites' );
-$parent_file = 'ms-admin.php';
-
-if ( isset( $_GET['action'] ) &amp;&amp; 'editblog' == $_GET['action'] ) {
-        add_contextual_help($current_screen,
-                '&lt;p&gt;' . __('This extensive list of options has five modules: Site Info, Site Options, allowing Site Themes for this given site, changing user roles and passwords for that site, adding a new user, and Miscellaneous Site Actions (upload size limits).') . '&lt;/p&gt;' .
-                '&lt;p&gt;' . __('Note that some fields in Site Options are grayed out and say Serialized Data. These are stored values in the database which you cannot change from here.') . '&lt;/p&gt;' .
-                '&lt;p&gt;&lt;strong&gt;' . __('For more information:') . '&lt;/strong&gt;&lt;/p&gt;' .
-                '&lt;p&gt;' . __('&lt;a href=&quot;http://codex.wordpress.org/Super_Admin_Sites_Edit_Site&quot; target=&quot;_blank&quot;&gt;Documentation on Editing Sites&lt;/a&gt;') . '&lt;/p&gt;' .
-                '&lt;p&gt;' . __('&lt;a href=&quot;http://wordpress.org/support/&quot; target=&quot;_blank&quot;&gt;Support Forums&lt;/a&gt;') . '&lt;/p&gt;'
-        );
-} else {
-        add_contextual_help($current_screen,
-                '&lt;p&gt;' . __('Add New takes you farther down on this same page. You can search for a site by Name, ID number, or IP address. Screen Options allows you to choose how many sites to display on one page.') . '&lt;/p&gt;' .
-                '&lt;p&gt;' . __('This is the main table of all sites on this network. Switch between list and excerpt views by using the icons above the right side of the table.') . '&lt;/p&gt;' .
-                '&lt;p&gt;' . __('Hovering over each site reveals seven options (three for the primary site):') . '&lt;/p&gt;' .
-                '&lt;ul&gt;&lt;li&gt;' . __('an Edit link to a separate Edit Site screen.') . '&lt;/li&gt;' .
-                '&lt;li&gt;' . __('Backend means the Dashboard for that site.') . '&lt;/li&gt;' .
-                '&lt;li&gt;' . __('Deactivate, Archive, and Spam which lead to confirmation screens. These actions can be reversed later.') . '&lt;/li&gt;' .
-                '&lt;li&gt;' . __('Delete which is a permanent action after the confirmations screen.') . '&lt;/li&gt;' .
-                '&lt;li&gt;' . __('Visit to go to the frontend site live.') . '&lt;/li&gt;&lt;/ul&gt;' .
-                '&lt;p&gt;' . __('The site ID is used internally, and is not shown on the front end of the site or to users/viewers.') . '&lt;/p&gt;' .
-                '&lt;p&gt;' . __('Clicking on bold settings can re-sort this table. The upper right icons switch between list and excerpt views.') . '&lt;/p&gt;' .
-                '&lt;p&gt;' . __(&quot;Clicking on Add Site, after filling out the address, title, and admin's email address, adds the site instantly to the network and this table. You may want to then click on the action link to edit options for that site.&quot;) . '&lt;/p&gt;' .
-                '&lt;p&gt;' . __('If the admin email for the new site does not exist in the database, a new user will also be created.') . '&lt;/p&gt;' .
-                '&lt;p&gt;&lt;strong&gt;' . __('For more information:') . '&lt;/strong&gt;&lt;/p&gt;' .
-                '&lt;p&gt;' . __('&lt;a href=&quot;http://codex.wordpress.org/Super_Admin_Sites_SubPanel&quot; target=&quot;_blank&quot;&gt;Documentation on Sites&lt;/a&gt;') . '&lt;/p&gt;' .
-                '&lt;p&gt;' . __('&lt;a href=&quot;http://wordpress.org/support/&quot; target=&quot;_blank&quot;&gt;Support Forums&lt;/a&gt;') . '&lt;/p&gt;'
-        );
-}
-
-wp_enqueue_script( 'admin-forms' );
-
-require_once( './admin-header.php' );
-
-$id = isset( $_GET['id'] ) ? intval( $_GET['id'] ) : 0;
-
-if ( isset( $_GET['updated'] ) &amp;&amp; $_GET['updated'] == 'true' &amp;&amp; ! empty( $_GET['action'] ) ) {
-        ?&gt;
-        &lt;div id=&quot;message&quot; class=&quot;updated&quot;&gt;&lt;p&gt;
-                &lt;?php
-                switch ( $_GET['action'] ) {
-                        case 'all_notspam':
-                                _e( 'Sites removed from spam.' );
-                        break;
-                        case 'all_spam':
-                                _e( 'Sites marked as spam.' );
-                        break;
-                        case 'all_delete':
-                                _e( 'Sites deleted.' );
-                        break;
-                        case 'delete':
-                                _e( 'Site deleted.' );
-                        break;
-                        case 'add-blog':
-                                _e( 'Site added.' );
-                        break;
-                        case 'archive':
-                                _e( 'Site archived.' );
-                        break;
-                        case 'unarchive':
-                                _e( 'Site unarchived.' );
-                        break;
-                        case 'activate':
-                                _e( 'Site activated.' );
-                        break;
-                        case 'deactivate':
-                                _e( 'Site deactivated.' );
-                        break;
-                        case 'unspam':
-                                _e( 'Site removed from spam.' );
-                        break;
-                        case 'spam':
-                                _e( 'Site marked as spam.' );
-                        break;
-                        default:
-                                _e( 'Settings saved.' );
-                        break;
-                }
-                ?&gt;
-        &lt;/p&gt;&lt;/div&gt;
-        &lt;?php
-}
-
-$action = isset( $_GET['action'] ) ? $_GET['action'] : 'list';
-
-switch ( $action ) {
-        // Edit site
-        case 'editblog':
-                $blog_prefix = $wpdb-&gt;get_blog_prefix( $id );
-                $options = $wpdb-&gt;get_results( &quot;SELECT * FROM {$blog_prefix}options WHERE option_name NOT LIKE '\_%' AND option_name NOT LIKE '%user_roles'&quot; );
-                $details = get_blog_details( $id );
-                if ( $details-&gt;site_id != $wpdb-&gt;siteid )
-                        wp_die( __( 'You do not have permission to access this page.' ) );
-
-                $editblog_roles = get_blog_option( $id, &quot;{$blog_prefix}user_roles&quot; );
-                $is_main_site = is_main_site( $id );
-                ?&gt;
-                &lt;div class=&quot;wrap&quot;&gt;
-                &lt;?php screen_icon(); ?&gt;
-                &lt;h2&gt;&lt;?php _e( 'Edit Site' ); ?&gt; - &lt;a href=&quot;&lt;?php echo esc_url( get_home_url( $id ) ); ?&gt;&quot;&gt;&lt;?php echo esc_url( get_home_url( $id ) ); ?&gt;&lt;/a&gt;&lt;/h2&gt;
-                &lt;form method=&quot;post&quot; action=&quot;ms-edit.php?action=updateblog&quot;&gt;
-                        &lt;?php wp_nonce_field( 'editblog' ); ?&gt;
-                        &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;&lt;?php echo esc_attr( $id ) ?&gt;&quot; /&gt;
-                        &lt;div class=&quot;metabox-holder&quot; style=&quot;width:49%;float:left;&quot;&gt;
-                                &lt;div id=&quot;blogedit_bloginfo&quot; class=&quot;postbox&quot;&gt;
-                                &lt;h3 class=&quot;hndle&quot;&gt;&lt;span&gt;&lt;?php _e( 'Site info (wp_blogs)' ); ?&gt;&lt;/span&gt;&lt;/h3&gt;
-                                &lt;div class=&quot;inside&quot;&gt;
-                                        &lt;table class=&quot;form-table&quot;&gt;
-                                                &lt;tr class=&quot;form-field form-required&quot;&gt;
-                                                        &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Domain' ) ?&gt;&lt;/th&gt;
-                                                        &lt;?php
-                                                        $protocol = is_ssl() ? 'https://' : 'http://';
-                                                        if ( $is_main_site ) { ?&gt;
-                                                        &lt;td&gt;&lt;code&gt;&lt;?php echo $protocol; echo esc_attr( $details-&gt;domain ) ?&gt;&lt;/code&gt;&lt;/td&gt;
-                                                        &lt;?php } else { ?&gt;
-                                                        &lt;td&gt;&lt;?php echo $protocol; ?&gt;&lt;input name=&quot;blog[domain]&quot; type=&quot;text&quot; id=&quot;domain&quot; value=&quot;&lt;?php echo esc_attr( $details-&gt;domain ) ?&gt;&quot; size=&quot;33&quot; /&gt;&lt;/td&gt;
-                                                        &lt;?php } ?&gt;
-                                                &lt;/tr&gt;
-                                                &lt;tr class=&quot;form-field form-required&quot;&gt;
-                                                        &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Path' ) ?&gt;&lt;/th&gt;
-                                                        &lt;?php if ( $is_main_site ) { ?&gt;
-                                                        &lt;td&gt;&lt;code&gt;&lt;?php echo esc_attr( $details-&gt;path ) ?&gt;&lt;/code&gt;&lt;/td&gt;
-                                                        &lt;?php } else { ?&gt;
-                                                        &lt;td&gt;&lt;input name=&quot;blog[path]&quot; type=&quot;text&quot; id=&quot;path&quot; value=&quot;&lt;?php echo esc_attr( $details-&gt;path ) ?&gt;&quot; size=&quot;40&quot; style='margin-bottom:5px;' /&gt;
-                                                        &lt;br /&gt;&lt;input type=&quot;checkbox&quot; style=&quot;width:20px;&quot; name=&quot;update_home_url&quot; value=&quot;update&quot; &lt;?php if ( get_blog_option( $id, 'siteurl' ) == untrailingslashit( get_blogaddress_by_id ($id ) ) || get_blog_option( $id, 'home' ) == untrailingslashit( get_blogaddress_by_id( $id ) ) ) echo 'checked=&quot;checked&quot;'; ?&gt; /&gt; &lt;?php _e( 'Update &lt;code&gt;siteurl&lt;/code&gt; and &lt;code&gt;home&lt;/code&gt; as well.' ); ?&gt;&lt;/td&gt;
-                                                        &lt;?php } ?&gt;
-                                                &lt;/tr&gt;
-                                                &lt;tr class=&quot;form-field&quot;&gt;
-                                                        &lt;th scope=&quot;row&quot;&gt;&lt;?php _ex( 'Registered', 'site' ) ?&gt;&lt;/th&gt;
-                                                        &lt;td&gt;&lt;input name=&quot;blog[registered]&quot; type=&quot;text&quot; id=&quot;blog_registered&quot; value=&quot;&lt;?php echo esc_attr( $details-&gt;registered ) ?&gt;&quot; size=&quot;40&quot; /&gt;&lt;/td&gt;
-                                                &lt;/tr&gt;
-                                                &lt;tr class=&quot;form-field&quot;&gt;
-                                                        &lt;th scope=&quot;row&quot;&gt;&lt;?php _e('Last Updated') ?&gt;&lt;/th&gt;
-                                                        &lt;td&gt;&lt;input name=&quot;blog[last_updated]&quot; type=&quot;text&quot; id=&quot;blog_last_updated&quot; value=&quot;&lt;?php echo esc_attr( $details-&gt;last_updated ) ?&gt;&quot; size=&quot;40&quot; /&gt;&lt;/td&gt;
-                                                &lt;/tr&gt;
-                                                &lt;?php
-                                                $radio_fields = array( 'public' =&gt; __( 'Public' ) );
-                                                if ( ! $is_main_site ) {
-                                                        $radio_fields['archived'] = __( 'Archived' );
-                                                        $radio_fields['spam']     = _x( 'Spam', 'site' );
-                                                        $radio_fields['deleted']  = __( 'Deleted' );
-                                                }
-                                                $radio_fields['mature'] = __( 'Mature' );
-                                                foreach ( $radio_fields as $field_key =&gt; $field_label ) {
-                                                ?&gt;
-                                                &lt;tr&gt;
-                                                        &lt;th scope=&quot;row&quot;&gt;&lt;?php echo $field_label; ?&gt;&lt;/th&gt;
-                                                        &lt;td&gt;
-                                                                &lt;input type=&quot;radio&quot; name=&quot;blog[&lt;?php echo $field_key; ?&gt;]&quot; id=&quot;blog_&lt;?php echo $field_key; ?&gt;_1&quot; value=&quot;1&quot;&lt;?php checked( $details-&gt;$field_key, 1 ); ?&gt; /&gt;
-                                                                &lt;label for=&quot;blog_&lt;?php echo $field_key; ?&gt;_1&quot;&gt;&lt;?php _e('Yes'); ?&gt;&lt;/label&gt;
-                                                                &lt;input type=&quot;radio&quot; name=&quot;blog[&lt;?php echo $field_key; ?&gt;]&quot; id=&quot;blog_&lt;?php echo $field_key; ?&gt;_0&quot; value=&quot;0&quot;&lt;?php checked( $details-&gt;$field_key, 0 ); ?&gt; /&gt;
-                                                                &lt;label for=&quot;blog_&lt;?php echo $field_key; ?&gt;_0&quot;&gt;&lt;?php _e('No'); ?&gt;&lt;/label&gt;
-                                                        &lt;/td&gt;
-                                                &lt;/tr&gt;
-                                                &lt;?php } ?&gt;
-                                        &lt;/table&gt;
-                                        &lt;p class=&quot;submit&quot; style=&quot;text-align:center;&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;&lt;?php esc_attr_e( 'Update Options' ) ?&gt;&quot; /&gt;&lt;/p&gt;
-                                &lt;/div&gt;
-                                &lt;/div&gt;
-
-                                &lt;div id=&quot;blogedit_blogoptions&quot; class=&quot;postbox&quot; &gt;
-                                &lt;h3 class=&quot;hndle&quot;&gt;&lt;span&gt;&lt;?php printf( __( 'Site options (%soptions)' ), $blog_prefix ); ?&gt;&lt;/span&gt;&lt;/h3&gt;
-                                &lt;div class=&quot;inside&quot;&gt;
-                                        &lt;table class=&quot;form-table&quot;&gt;
-                                                &lt;?php
-                                                $editblog_default_role = 'subscriber';
-                                                foreach ( $options as $option ) {
-                                                        if ( $option-&gt;option_name == 'default_role' )
-                                                                $editblog_default_role = $option-&gt;option_value;
-                                                        $disabled = false;
-                                                        $class = 'all-options';
-                                                        if ( is_serialized( $option-&gt;option_value ) ) {
-                                                                if ( is_serialized_string( $option-&gt;option_value ) ) {
-                                                                        $option-&gt;option_value = esc_html( maybe_unserialize( $option-&gt;option_value ), 'single' );
-                                                                } else {
-                                                                        $option-&gt;option_value = 'SERIALIZED DATA';
-                                                                        $disabled = true;
-                                                                        $class = 'all-options disabled';
-                                                                }
-                                                        }
-                                                        if ( strpos( $option-&gt;option_value, &quot;\n&quot; ) !== false ) {
-                                                        ?&gt;
-                                                                &lt;tr class=&quot;form-field&quot;&gt;
-                                                                        &lt;th scope=&quot;row&quot;&gt;&lt;?php echo ucwords( str_replace( &quot;_&quot;, &quot; &quot;, $option-&gt;option_name ) ) ?&gt;&lt;/th&gt;
-                                                                        &lt;td&gt;&lt;textarea class=&quot;&lt;?php echo $class; ?&gt;&quot; rows=&quot;5&quot; cols=&quot;40&quot; name=&quot;option[&lt;?php echo esc_attr( $option-&gt;option_name ) ?&gt;]&quot; id=&quot;&lt;?php echo esc_attr( $option-&gt;option_name ) ?&gt;&quot;&lt;?php disabled( $disabled ) ?&gt;&gt;&lt;?php echo wp_htmledit_pre( $option-&gt;option_value ) ?&gt;&lt;/textarea&gt;&lt;/td&gt;
-                                                                &lt;/tr&gt;
-                                                        &lt;?php
-                                                        } else {
-                                                        ?&gt;
-                                                                &lt;tr class=&quot;form-field&quot;&gt;
-                                                                        &lt;th scope=&quot;row&quot;&gt;&lt;?php echo esc_html( ucwords( str_replace( &quot;_&quot;, &quot; &quot;, $option-&gt;option_name ) ) ); ?&gt;&lt;/th&gt;
-                                                                        &lt;?php if ( $is_main_site &amp;&amp; in_array( $option-&gt;option_name, array( 'siteurl', 'home' ) ) ) { ?&gt;
-                                                                        &lt;td&gt;&lt;code&gt;&lt;?php echo esc_html( $option-&gt;option_value ) ?&gt;&lt;/code&gt;&lt;/td&gt;
-                                                                        &lt;?php } else { ?&gt;
-                                                                        &lt;td&gt;&lt;input class=&quot;&lt;?php echo $class; ?&gt;&quot; name=&quot;option[&lt;?php echo esc_attr( $option-&gt;option_name ) ?&gt;]&quot; type=&quot;text&quot; id=&quot;&lt;?php echo esc_attr( $option-&gt;option_name ) ?&gt;&quot; value=&quot;&lt;?php echo esc_attr( $option-&gt;option_value ) ?&gt;&quot; size=&quot;40&quot; &lt;?php disabled( $disabled ) ?&gt; /&gt;&lt;/td&gt;
-                                                                        &lt;?php } ?&gt;
-                                                                &lt;/tr&gt;
-                                                        &lt;?php
-                                                        }
-                                                } // End foreach
-                                                ?&gt;
-                                        &lt;/table&gt;
-                                        &lt;p class=&quot;submit&quot; style=&quot;text-align:center;&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;&lt;?php esc_attr_e( 'Update Options' ) ?&gt;&quot; /&gt;&lt;/p&gt;
-                                &lt;/div&gt;
-                                &lt;/div&gt;
-                        &lt;/div&gt;
-
-                        &lt;div class=&quot;metabox-holder&quot; style=&quot;width:49%;float:right;&quot;&gt;
-                                &lt;?php
-                                // Site Themes
-                                $themes = get_themes();
-                                $blog_allowed_themes = wpmu_get_blog_allowedthemes( $id );
-                                $allowed_themes = get_site_option( 'allowedthemes' );
-
-                                if ( ! $allowed_themes )
-                                        $allowed_themes = array_keys( $themes );
-
-                                $out = '';
-                                foreach ( $themes as $key =&gt; $theme ) {
-                                        $theme_key = esc_html( $theme['Stylesheet'] );
-                                        if ( ! isset( $allowed_themes[$theme_key] ) ) {
-                                                $checked = isset( $blog_allowed_themes[ $theme_key ] ) ? 'checked=&quot;checked&quot;' : '';
-                                                $out .= '&lt;tr class=&quot;form-field form-required&quot;&gt;
-                                                                &lt;th title=&quot;' . esc_attr( $theme[&quot;Description&quot;] ).'&quot; scope=&quot;row&quot;&gt;' . esc_html( $key ) . '&lt;/th&gt;
-                                                                &lt;td&gt;&lt;label&gt;&lt;input name=&quot;theme[' . esc_attr( $theme_key ) . ']&quot; type=&quot;checkbox&quot; style=&quot;width:20px;&quot; value=&quot;on&quot; '.$checked.'/&gt; ' . __( 'Active' ) . '&lt;/label&gt;&lt;/td&gt;
-                                                        &lt;/tr&gt;';
-                                        }
-                                }
-
-                                if ( $out != '' ) {
-                                ?&gt;
-                                &lt;div id=&quot;blogedit_blogthemes&quot; class=&quot;postbox&quot;&gt;
-                                &lt;h3 class=&quot;hndle&quot;&gt;&lt;span&gt;&lt;?php esc_html_e( 'Site Themes' ); ?&gt;&lt;/span&gt;&lt;/h3&gt;
-                                &lt;div class=&quot;inside&quot;&gt;
-                                        &lt;p class=&quot;description&quot;&gt;&lt;?php _e( 'Activate the themename of an existing theme and hit &quot;Update Options&quot; to allow the theme for this site.' ) ?&gt;&lt;/p&gt;
-                                        &lt;table class=&quot;form-table&quot;&gt;
-                                                &lt;?php echo $out; ?&gt;
-                                        &lt;/table&gt;
-                                        &lt;p class=&quot;submit&quot; style=&quot;text-align:center;&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;&lt;?php esc_attr_e( 'Update Options' ) ?&gt;&quot; /&gt;&lt;/p&gt;
-                                &lt;/div&gt;&lt;/div&gt;
-                                &lt;?php }
-
-                                // Site users
-                                $blogusers = get_users_of_blog( $id );
-                                if ( is_array( $blogusers ) ) {
-                                        echo '&lt;div id=&quot;blogedit_blogusers&quot; class=&quot;postbox&quot;&gt;&lt;h3 class=&quot;hndle&quot;&gt;&lt;span&gt;' . __( 'Site Users' ) . '&lt;/span&gt;&lt;/h3&gt;&lt;div class=&quot;inside&quot;&gt;';
-                                        echo '&lt;table class=&quot;form-table&quot;&gt;';
-                                        echo &quot;&lt;tr&gt;&lt;th&gt;&quot; . __( 'User' ) . &quot;&lt;/th&gt;&lt;th&gt;&quot; . __( 'Role' ) . &quot;&lt;/th&gt;&lt;th&gt;&quot; . __( 'Password' ) . &quot;&lt;/th&gt;&lt;th&gt;&quot; . __( 'Remove' ) . &quot;&lt;/th&gt;&lt;/tr&gt;&quot;;
-                                        reset( $blogusers );
-                                        foreach ( (array) $blogusers as $key =&gt; $val ) {
-                                                if ( isset( $val-&gt;meta_value ) &amp;&amp; ! $val-&gt;meta_value )
-                                                        continue;
-                                                $t = @unserialize( $val-&gt;meta_value );
-                                                if ( is_array( $t ) ) {
-                                                        reset( $t );
-                                                        $existing_role = key( $t );
-                                                }
-                                                echo '&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;user-edit.php?user_id=' . $val-&gt;user_id . '&quot;&gt;' . $val-&gt;user_login . '&lt;/a&gt;&lt;/td&gt;';
-                                                if ( $val-&gt;user_id != $current_user-&gt;data-&gt;ID ) {
-                                                        ?&gt;
-                                                        &lt;td&gt;
-                                                                &lt;select name=&quot;role[&lt;?php echo $val-&gt;user_id ?&gt;]&quot; id=&quot;new_role_1&quot;&gt;&lt;?php
-                                                                        foreach ( $editblog_roles as $role =&gt; $role_assoc ){
-                                                                                $name = translate_user_role( $role_assoc['name'] );
-                                                                                echo '&lt;option ' . selected( $role, $existing_role, false ) . ' value=&quot;' . esc_attr( $role ) . '&quot;&gt;' . esc_html( $name ) . '&lt;/option&gt;';
-                                                                        }
-                                                                        ?&gt;
-                                                                &lt;/select&gt;
-                                                        &lt;/td&gt;
-                                                        &lt;td&gt;
-                                                                &lt;input type=&quot;text&quot; name=&quot;user_password[&lt;?php echo esc_attr( $val-&gt;user_id ) ?&gt;]&quot; /&gt;
-                                                        &lt;/td&gt;
-                                                        &lt;?php
-                                                        echo '&lt;td&gt;&lt;input title=&quot;' . __( 'Click to remove user' ) . '&quot; type=&quot;checkbox&quot; name=&quot;blogusers[' . esc_attr( $val-&gt;user_id ) . ']&quot; /&gt;&lt;/td&gt;';
-                                                } else {
-                                                        echo &quot;&lt;td&gt;&lt;strong&gt;&quot; . __ ( 'N/A' ) . &quot;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;&quot; . __ ( 'N/A' ) . &quot;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;&quot; . __( 'N/A' ) . &quot;&lt;/strong&gt;&lt;/td&gt;&quot;;
-                                                }
-                                                echo '&lt;/tr&gt;';
-                                        }
-                                        echo &quot;&lt;/table&gt;&quot;;
-                                        echo '&lt;p class=&quot;submit&quot; style=&quot;text-align:center;&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;' . esc_attr__( 'Update Options' ) . '&quot; /&gt;&lt;/p&gt;';
-                                        echo &quot;&lt;/div&gt;&lt;/div&gt;&quot;;
-                                }
-                                ?&gt;
-
-                                &lt;div id=&quot;blogedit_blogadduser&quot; class=&quot;postbox&quot;&gt;
-                                &lt;h3 class=&quot;hndle&quot;&gt;&lt;span&gt;&lt;?php _e( 'Add a new user' ); ?&gt;&lt;/span&gt;&lt;/h3&gt;
-                                &lt;div class=&quot;inside&quot;&gt;
-                                        &lt;p class=&quot;description&quot;&gt;&lt;?php _e( 'Enter the username of an existing user and hit &amp;#8220;Update Options&amp;#8221; to add the user.' ) ?&gt;&lt;/p&gt;
-                                        &lt;table class=&quot;form-table&quot;&gt;
-                                                        &lt;tr&gt;
-                                                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'User&amp;nbsp;Login:' ) ?&gt;&lt;/th&gt;
-                                                                &lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;newuser&quot; id=&quot;newuser&quot; /&gt;&lt;/td&gt;
-                                                        &lt;/tr&gt;
-                                                        &lt;tr&gt;
-                                                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Role:' ) ?&gt;&lt;/th&gt;
-                                                                &lt;td&gt;
-                                                                        &lt;select name=&quot;new_role&quot; id=&quot;new_role_0&quot;&gt;
-                                                                        &lt;?php
-                                                                        reset( $editblog_roles );
-                                                                        foreach ( $editblog_roles as $role =&gt; $role_assoc ){
-                                                                                $name = translate_user_role( $role_assoc['name'] );
-                                                                                $selected = ( $role == $editblog_default_role ) ? 'selected=&quot;selected&quot;' : '';
-                                                                                echo '&lt;option ' . $selected . ' value=&quot;' . esc_attr( $role ) . '&quot;&gt;' . esc_html( $name ) . '&lt;/option&gt;';
-                                                                        }
-                                                                        ?&gt;
-                                                                        &lt;/select&gt;
-                                                                &lt;/td&gt;
-                                                        &lt;/tr&gt;
-                                                &lt;/table&gt;
-                                        &lt;p class=&quot;submit&quot; style=&quot;text-align:center;&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;&lt;?php esc_attr_e( 'Update Options' ) ?&gt;&quot; /&gt;&lt;/p&gt;
-                                &lt;/div&gt;
-                                &lt;/div&gt;
-
-                                &lt;div id=&quot;blogedit_miscoptions&quot; class=&quot;postbox&quot;&gt;
-                                &lt;h3 class=&quot;hndle&quot;&gt;&lt;span&gt;&lt;?php _e( 'Misc Site Actions' ) ?&gt;&lt;/span&gt;&lt;/h3&gt;
-                                &lt;div class=&quot;inside&quot;&gt;
-                                        &lt;table class=&quot;form-table&quot;&gt;
-                                                        &lt;?php do_action( 'wpmueditblogaction', $id ); ?&gt;
-                                        &lt;/table&gt;
-                                        &lt;p class=&quot;submit&quot; style=&quot;text-align:center;&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;&lt;?php esc_attr_e( 'Update Options' ) ?&gt;&quot; /&gt;&lt;/p&gt;
-                                &lt;/div&gt;
-                                &lt;/div&gt;
-                        &lt;/div&gt;
-
-                        &lt;div style=&quot;clear:both;&quot;&gt;&lt;/div&gt;
-                &lt;/form&gt;
-                &lt;/div&gt;
-                &lt;?php
-        break;
-
-        // List sites
-        case 'list':
-        default:
-                $pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0;
-                if ( empty($pagenum) )
-                        $pagenum = 1;
-
-                $per_page = (int) get_user_option( 'ms_sites_per_page' );
-                if ( empty( $per_page ) || $per_page &lt; 1 )
-                        $per_page = 15;
-
-                $per_page = apply_filters( 'ms_sites_per_page', $per_page );
-
-                $s = isset( $_GET['s'] ) ? stripslashes( trim( $_GET[ 's' ] ) ) : '';
-                $like_s = esc_sql( like_escape( $s ) );
-
-                $query = &quot;SELECT * FROM {$wpdb-&gt;blogs} WHERE site_id = '{$wpdb-&gt;siteid}' &quot;;
-
-                if ( isset( $_GET['searchaction'] ) ) {
-                        if ( 'name' == $_GET['searchaction'] ) {
-                                $query .= &quot; AND ( {$wpdb-&gt;blogs}.domain LIKE '%{$like_s}%' OR {$wpdb-&gt;blogs}.path LIKE '%{$like_s}%' ) &quot;;
-                        } elseif ( 'id' == $_GET['searchaction'] ) {
-                                $query .= &quot; AND {$wpdb-&gt;blogs}.blog_id = '{$like_s}' &quot;;
-                        } elseif ( 'ip' == $_GET['searchaction'] ) {
-                                $query = &quot;SELECT *
-                                        FROM {$wpdb-&gt;blogs}, {$wpdb-&gt;registration_log}
-                                        WHERE site_id = '{$wpdb-&gt;siteid}'
-                                        AND {$wpdb-&gt;blogs}.blog_id = {$wpdb-&gt;registration_log}.blog_id
-                                        AND {$wpdb-&gt;registration_log}.IP LIKE ('%{$like_s}%')&quot;;
-                        }
-                }
-
-                $order_by = isset( $_GET['sortby'] ) ? $_GET['sortby'] : 'id';
-                if ( $order_by == 'registered' ) {
-                        $query .= ' ORDER BY registered ';
-                } elseif ( $order_by == 'lastupdated' ) {
-                        $query .= ' ORDER BY last_updated ';
-                } elseif ( $order_by == 'blogname' ) {
-                        $query .= ' ORDER BY domain ';
-                } else {
-                        $order_by = 'id';
-                        $query .= &quot; ORDER BY {$wpdb-&gt;blogs}.blog_id &quot;;
-                }
-
-                $order = ( isset( $_GET['order'] ) &amp;&amp; 'DESC' == $_GET['order'] ) ? &quot;DESC&quot; : &quot;ASC&quot;;
-                $query .= $order;
-
-                $total = $wpdb-&gt;get_var( str_replace( 'SELECT *', 'SELECT COUNT(blog_id)', $query ) );
-
-                $query .= &quot; LIMIT &quot; . intval( ( $pagenum - 1 ) * $per_page ) . &quot;, &quot; . intval( $per_page );
-                $blog_list = $wpdb-&gt;get_results( $query, ARRAY_A );
-
-                $num_pages = ceil($total / $per_page);
-                $page_links = paginate_links( array(
-                        'base' =&gt; add_query_arg( 'paged', '%#%' ),
-                        'format' =&gt; '',
-                        'prev_text' =&gt; __( '&amp;laquo;' ),
-                        'next_text' =&gt; __( '&amp;raquo;' ),
-                        'total' =&gt; $num_pages,
-                        'current' =&gt; $pagenum
-                ));
-
-                if ( empty( $_GET['mode'] ) )
-                        $mode = 'list';
-                else
-                        $mode = esc_attr( $_GET['mode'] );
-                ?&gt;
-
-                &lt;div class=&quot;wrap&quot;&gt;
-                &lt;?php screen_icon(); ?&gt;
-                &lt;h2&gt;&lt;?php _e('Sites') ?&gt;
-                &lt;a href=&quot;#form-add-site&quot; class=&quot;button add-new-h2&quot;&gt;&lt;?php echo esc_html_x( 'Add New', 'sites' ); ?&gt;&lt;/a&gt;
-                &lt;?php
-                if ( isset( $_GET['s'] ) &amp;&amp; $_GET['s'] )
-                printf( '&lt;span class=&quot;subtitle&quot;&gt;' . __( 'Search results for &amp;#8220;%s&amp;#8221;' ) . '&lt;/span&gt;', esc_html( $s ) );
-                ?&gt;
-                &lt;/h2&gt;
-
-                &lt;form action=&quot;ms-sites.php&quot; method=&quot;get&quot; id=&quot;ms-search&quot;&gt;
-                &lt;p class=&quot;search-box&quot;&gt;
-                &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;blogs&quot; /&gt;
-                &lt;input type=&quot;text&quot; name=&quot;s&quot; value=&quot;&lt;?php echo esc_attr( $s ); ?&gt;&quot; /&gt;
-                &lt;input type=&quot;submit&quot; class=&quot;button&quot; value=&quot;&lt;?php esc_attr_e( 'Search Site by' ) ?&gt;&quot; /&gt;
-                &lt;select name=&quot;searchaction&quot;&gt;
-                        &lt;option value=&quot;name&quot; selected=&quot;selected&quot;&gt;&lt;?php _e( 'Name' ); ?&gt;&lt;/option&gt;
-                        &lt;option value=&quot;id&quot;&gt;&lt;?php _e( 'ID' ); ?&gt;&lt;/option&gt;
-                        &lt;option value=&quot;ip&quot;&gt;&lt;?php _e( 'IP address' ); ?&gt;&lt;/option&gt;
-                &lt;/select&gt;
-                &lt;/p&gt;
-                &lt;/form&gt;
-
-                &lt;form id=&quot;form-site-list&quot; action=&quot;ms-edit.php?action=allblogs&quot; method=&quot;post&quot;&gt;
-                &lt;input type=&quot;hidden&quot; name=&quot;mode&quot; value=&quot;&lt;?php echo esc_attr( $mode ); ?&gt;&quot; /&gt;
-                &lt;div class=&quot;tablenav&quot;&gt;
-                &lt;div class=&quot;alignleft actions&quot;&gt;
-                        &lt;select name=&quot;action&quot;&gt;
-                                &lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e( 'Bulk Actions' ); ?&gt;&lt;/option&gt;
-                                &lt;option value=&quot;delete&quot;&gt;&lt;?php _e( 'Delete' ); ?&gt;&lt;/option&gt;
-                                &lt;option value=&quot;spam&quot;&gt;&lt;?php _ex( 'Mark as Spam', 'site' ); ?&gt;&lt;/option&gt;
-                                &lt;option value=&quot;notspam&quot;&gt;&lt;?php _ex( 'Not Spam', 'site' ); ?&gt;&lt;/option&gt;
-                        &lt;/select&gt;
-                        &lt;input type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e( 'Apply' ); ?&gt;&quot; name=&quot;doaction&quot; id=&quot;doaction&quot; class=&quot;button-secondary action&quot; /&gt;
-                        &lt;?php wp_nonce_field( 'bulk-ms-sites', '_wpnonce_bulk-ms-sites' ); ?&gt;
-                &lt;/div&gt;
-
-                &lt;?php if ( $page_links ) { ?&gt;
-                &lt;div class=&quot;tablenav-pages&quot;&gt;
-                &lt;?php $page_links_text = sprintf( '&lt;span class=&quot;displaying-num&quot;&gt;' . __( 'Displaying %s&amp;#8211;%s of %s' ) . '&lt;/span&gt;%s',
-                number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
-                number_format_i18n( min( $pagenum * $per_page, $total ) ),
-                number_format_i18n( $total ),
-                $page_links
-                ); echo $page_links_text; ?&gt;
-                &lt;/div&gt;
-                &lt;?php } ?&gt;
-
-                &lt;div class=&quot;view-switch&quot;&gt;
-                        &lt;a href=&quot;&lt;?php echo esc_url( add_query_arg( 'mode', 'list', $_SERVER['REQUEST_URI'] ) ) ?&gt;&quot;&gt;&lt;img &lt;?php if ( 'list' == $mode ) echo 'class=&quot;current&quot;'; ?&gt; id=&quot;view-switch-list&quot; src=&quot;&lt;?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?&gt;&quot; width=&quot;20&quot; height=&quot;20&quot; title=&quot;&lt;?php _e( 'List View' ) ?&gt;&quot; alt=&quot;&lt;?php _e( 'List View' ) ?&gt;&quot; /&gt;&lt;/a&gt;
-                        &lt;a href=&quot;&lt;?php echo esc_url( add_query_arg( 'mode', 'excerpt', $_SERVER['REQUEST_URI'] ) ) ?&gt;&quot;&gt;&lt;img &lt;?php if ( 'excerpt' == $mode ) echo 'class=&quot;current&quot;'; ?&gt; id=&quot;view-switch-excerpt&quot; src=&quot;&lt;?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?&gt;&quot; width=&quot;20&quot; height=&quot;20&quot; title=&quot;&lt;?php _e( 'Excerpt View' ) ?&gt;&quot; alt=&quot;&lt;?php _e( 'Excerpt View' ) ?&gt;&quot; /&gt;&lt;/a&gt;
-                &lt;/div&gt;
-
-                &lt;/div&gt;
-
-                &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
-
-                &lt;?php
-                // define the columns to display, the syntax is 'internal name' =&gt; 'display name'
-                $blogname_columns = ( is_subdomain_install() ) ? __( 'Domain' ) : __( 'Path' );
-                $sites_columns = array(
-                        'id'           =&gt; __( 'ID' ),
-                        'blogname'     =&gt; $blogname_columns,
-                        'lastupdated'  =&gt; __( 'Last Updated'),
-                        'registered'   =&gt; _x( 'Registered', 'site' ),
-                        'users'        =&gt; __( 'Users' )
-                );
-
-                if ( has_filter( 'wpmublogsaction' ) )
-                        $sites_columns['plugins'] = __( 'Actions' );
-
-                $sites_columns = apply_filters( 'wpmu_blogs_columns', $sites_columns );
-                ?&gt;
-
-                &lt;table class=&quot;widefat&quot;&gt;
-                        &lt;thead&gt;
-                                &lt;tr&gt;
-                                &lt;th class=&quot;manage-column column-cb check-column&quot; id=&quot;cb&quot; scope=&quot;col&quot;&gt;
-                                        &lt;input type=&quot;checkbox&quot; /&gt;
-                                &lt;/th&gt;
-                                &lt;?php
-                                $col_url = '';
-                                foreach($sites_columns as $column_id =&gt; $column_display_name) {
-                                        $column_link = &quot;&lt;a href='&quot;;
-                                        $order2 = '';
-                                        if ( $order_by == $column_id )
-                                                $order2 = ( $order == 'DESC' ) ? 'ASC' : 'DESC';
-
-                                        $column_link .= esc_url( add_query_arg( array( 'order' =&gt; $order2, 'paged' =&gt; $pagenum, 'sortby' =&gt; $column_id ), remove_query_arg( array('action', 'updated'), $_SERVER['REQUEST_URI'] ) ) );
-                                        $column_link .= &quot;'&gt;{$column_display_name}&lt;/a&gt;&quot;;
-                                        $col_url .= '&lt;th scope=&quot;col&quot;&gt;' . ( ( $column_id == 'users' || $column_id == 'plugins' ) ? $column_display_name : $column_link ) . '&lt;/th&gt;';
-                                }
-                                echo $col_url ?&gt;
-                                &lt;/tr&gt;
-                        &lt;/thead&gt;
-                        &lt;tfoot&gt;
-                                &lt;tr&gt;
-                                &lt;th class=&quot;manage-column column-cb check-column&quot; id=&quot;cb1&quot; scope=&quot;col&quot;&gt;
-                                        &lt;input type=&quot;checkbox&quot; /&gt;
-                                &lt;/th&gt;
-                                        &lt;?php echo $col_url ?&gt;
-                                &lt;/tr&gt;
-                        &lt;/tfoot&gt;
-                        &lt;tbody id=&quot;the-site-list&quot; class=&quot;list:site&quot;&gt;
-                        &lt;?php
-                        $status_list = array( 'archived' =&gt; array( 'site-archived', __( 'Archived' ) ), 'spam' =&gt; array( 'site-spammed', _x( 'Spam', 'site' ) ), 'deleted' =&gt; array( 'site-deleted', __( 'Deleted' ) ), 'mature' =&gt; array( 'site-mature', __( 'Mature' ) ) );
-                        if ( $blog_list ) {
-                                $class = '';
-                                foreach ( $blog_list as $blog ) {
-                                        $class = ( 'alternate' == $class ) ? '' : 'alternate';
-                                        reset( $status_list );
-
-                                        $blog_states = array();
-                                        foreach ( $status_list as $status =&gt; $col ) {
-                                                if ( get_blog_status( $blog['blog_id'], $status ) == 1 ) {
-                                                        $class = $col[0];
-                                                        $blog_states[] = $col[1];
-                                                }
-                                        }
-                                        $blog_state = '';
-                                        if ( ! empty( $blog_states ) ) {
-                                                $state_count = count( $blog_states );
-                                                $i = 0;
-                                                $blog_state .= ' - ';
-                                                foreach ( $blog_states as $state ) {
-                                                        ++$i;
-                                                        ( $i == $state_count ) ? $sep = '' : $sep = ', ';
-                                                        $blog_state .= &quot;&lt;span class='post-state'&gt;$state$sep&lt;/span&gt;&quot;;
-                                                }
-                                        }
-                                        echo &quot;&lt;tr class='$class'&gt;&quot;;
-
-                                        $blogname = ( is_subdomain_install() ) ? str_replace( '.'.$current_site-&gt;domain, '', $blog['domain'] ) : $blog['path'];
-                                        foreach ( $sites_columns as $column_name=&gt;$column_display_name ) {
-                                                switch ( $column_name ) {
-                                                        case 'id': ?&gt;
-                                                                &lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;
-                                                                        &lt;input type=&quot;checkbox&quot; id=&quot;blog_&lt;?php echo $blog['blog_id'] ?&gt;&quot; name=&quot;allblogs[]&quot; value=&quot;&lt;?php echo esc_attr( $blog['blog_id'] ) ?&gt;&quot; /&gt;
-                                                                &lt;/th&gt;
-                                                                &lt;th valign=&quot;top&quot; scope=&quot;row&quot;&gt;
-                                                                        &lt;?php echo $blog['blog_id'] ?&gt;
-                                                                &lt;/th&gt;
-                                                        &lt;?php
-                                                        break;
-
-                                                        case 'blogname': ?&gt;
-                                                                &lt;td class=&quot;column-title&quot;&gt;
-                                                                        &lt;a href=&quot;&lt;?php echo esc_url( admin_url( 'ms-sites.php?action=editblog&amp;amp;id=' . $blog['blog_id'] ) ); ?&gt;&quot; class=&quot;edit&quot;&gt;&lt;?php echo $blogname . $blog_state; ?&gt;&lt;/a&gt;
-                                                                        &lt;?php
-                                                                        if ( 'list' != $mode )
-                                                                                echo '&lt;p&gt;' . sprintf( _x( '%1$s &amp;#8211; &lt;em&gt;%2$s&lt;/em&gt;', '%1$s: site name. %2$s: site tagline.' ), get_blog_option( $blog['blog_id'], 'blogname' ), get_blog_option( $blog['blog_id'], 'blogdescription ' ) ) . '&lt;/p&gt;';
-
-                                                                        // Preordered.
-                                                                        $actions = array(
-                                                                                'edit' =&gt; '', 'backend' =&gt; '',
-                                                                                'activate' =&gt; '', 'deactivate' =&gt; '',
-                                                                                'archive' =&gt; '', 'unarchive' =&gt; '',
-                                                                                'spam' =&gt; '', 'unspam' =&gt; '',
-                                                                                'delete' =&gt; '',
-                                                                                'visit' =&gt; '',
-                                                                        );
-
-                                                                        $actions['edit']        = '&lt;span class=&quot;edit&quot;&gt;&lt;a href=&quot;' . esc_url( admin_url( 'ms-sites.php?action=editblog&amp;amp;id=' . $blog['blog_id'] ) ) . '&quot;&gt;' . __( 'Edit' ) . '&lt;/a&gt;&lt;/span&gt;';
-                                                                        $actions['backend']        = &quot;&lt;span class='backend'&gt;&lt;a href='&quot; . esc_url( get_admin_url($blog['blog_id']) ) . &quot;' class='edit'&gt;&quot; . __( 'Backend' ) . '&lt;/a&gt;&lt;/span&gt;';
-                                                                        if ( $current_site-&gt;blog_id != $blog['blog_id'] ) {
-                                                                                if ( get_blog_status( $blog['blog_id'], 'deleted' ) == '1' )
-                                                                                        $actions['activate']        = '&lt;span class=&quot;activate&quot;&gt;&lt;a href=&quot;' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;amp;action2=activateblog&amp;amp;id=' . $blog['blog_id'] . '&amp;amp;msg=' . urlencode( sprintf( __( 'You are about to activate the site %s' ), $blogname ) ) ) ) . '&quot;&gt;' . __( 'Activate' ) . '&lt;/a&gt;&lt;/span&gt;';
-                                                                                else
-                                                                                        $actions['deactivate']        = '&lt;span class=&quot;activate&quot;&gt;&lt;a href=&quot;' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;amp;action2=deactivateblog&amp;amp;id=' . $blog['blog_id'] . '&amp;amp;msg=' . urlencode( sprintf( __( 'You are about to deactivate the site %s' ), $blogname ) ) ) ) . '&quot;&gt;' . __( 'Deactivate' ) . '&lt;/a&gt;&lt;/span&gt;';
-
-                                                                                if ( get_blog_status( $blog['blog_id'], 'archived' ) == '1' )
-                                                                                        $actions['unarchive']        = '&lt;span class=&quot;archive&quot;&gt;&lt;a href=&quot;' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;amp;action2=unarchiveblog&amp;amp;id=' .  $blog['blog_id'] . '&amp;amp;msg=' . urlencode( sprintf( __( 'You are about to unarchive the site %s.' ), $blogname ) ) ) ) . '&quot;&gt;' . __( 'Unarchive' ) . '&lt;/a&gt;&lt;/span&gt;';
-                                                                                else
-                                                                                        $actions['archive']        = '&lt;span class=&quot;archive&quot;&gt;&lt;a href=&quot;' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;amp;action2=archiveblog&amp;amp;id=' . $blog['blog_id'] . '&amp;amp;msg=' . urlencode( sprintf( __( 'You are about to archive the site %s.' ), $blogname ) ) ) ) . '&quot;&gt;' . _x( 'Archive', 'verb; site' ) . '&lt;/a&gt;&lt;/span&gt;';
-
-                                                                                if ( get_blog_status( $blog['blog_id'], 'spam' ) == '1' )
-                                                                                        $actions['unspam']        = '&lt;span class=&quot;spam&quot;&gt;&lt;a href=&quot;' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;amp;action2=unspamblog&amp;amp;id=' . $blog['blog_id'] . '&amp;amp;msg=' . urlencode( sprintf( __( 'You are about to unspam the site %s.' ), $blogname ) ) ) ) . '&quot;&gt;' . _x( 'Not Spam', 'site' ) . '&lt;/a&gt;&lt;/span&gt;';
-                                                                                else
-                                                                                        $actions['spam']        = '&lt;span class=&quot;spam&quot;&gt;&lt;a href=&quot;' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;amp;action2=spamblog&amp;amp;id=' . $blog['blog_id'] . '&amp;amp;msg=' . urlencode( sprintf( __( 'You are about to mark the site %s as spam.' ), $blogname ) ) ) ) . '&quot;&gt;' . _x( 'Spam', 'site' ) . '&lt;/a&gt;&lt;/span&gt;';
-
-                                                                                $actions['delete']        = '&lt;span class=&quot;delete&quot;&gt;&lt;a href=&quot;' . esc_url( admin_url( 'ms-edit.php?action=confirm&amp;amp;action2=deleteblog&amp;amp;id=' . $blog['blog_id'] . '&amp;amp;msg=' . urlencode( sprintf( __( 'You are about to delete the site %s.' ), $blogname ) ) ) ) . '&quot;&gt;' . __( 'Delete' ) . '&lt;/a&gt;&lt;/span&gt;';
-                                                                        }
-
-                                                                        $actions['visit']        = &quot;&lt;span class='view'&gt;&lt;a href='&quot; . esc_url( get_home_url( $blog['blog_id'] ) ) . &quot;' rel='permalink'&gt;&quot; . __( 'Visit' ) . '&lt;/a&gt;&lt;/span&gt;';
-                                                                        $actions = array_filter( $actions );
-                                                                        if ( count( $actions ) ) : ?&gt;
-                                                                        &lt;div class=&quot;row-actions&quot;&gt;
-                                                                                &lt;?php echo implode( ' | ', $actions ); ?&gt;
-                                                                        &lt;/div&gt;
-                                                                        &lt;?php endif; ?&gt;
-                                                                &lt;/td&gt;
-                                                        &lt;?php
-                                                        break;
-
-                                                        case 'lastupdated': ?&gt;
-                                                                &lt;td valign=&quot;top&quot;&gt;
-                                                                        &lt;?php
-                                                                        if ( 'list' == $mode )
-                                                                                $date = 'Y/m/d';
-                                                                        else
-                                                                                $date = 'Y/m/d \&lt;\b\r \/\&gt; g:i:s a';
-                                                                        echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __( 'Never' ) : mysql2date( __( $date ), $blog['last_updated'] ); ?&gt;
-                                                                &lt;/td&gt;
-                                                        &lt;?php
-                                                        break;
-                                                case 'registered': ?&gt;
-                                                                &lt;td valign=&quot;top&quot;&gt;
-                                                                &lt;?php
-                                                                if ( $blog['registered'] == '0000-00-00 00:00:00' )
-                                                                        echo '&amp;#x2014;';
-                                                                else
-                                                                        echo mysql2date( __( $date ), $blog['registered'] );
-                                                                ?&gt;
-                                                                &lt;/td&gt;
-                                                &lt;?php
-                                                break;
-                                                        case 'users': ?&gt;
-                                                                &lt;td valign=&quot;top&quot;&gt;
-                                                                        &lt;?php
-                                                                        $blogusers = get_users_of_blog( $blog['blog_id'] );
-                                                                        if ( is_array( $blogusers ) ) {
-                                                                                $blogusers_warning = '';
-                                                                                if ( count( $blogusers ) &gt; 5 ) {
-                                                                                        $blogusers = array_slice( $blogusers, 0, 5 );
-                                                                                        $blogusers_warning = __( 'Only showing first 5 users.' ) . ' &lt;a href=&quot;' . esc_url( get_admin_url( $blog['blog_id'], 'users.php' ) ) . '&quot;&gt;' . __( 'More' ) . '&lt;/a&gt;';
-                                                                                }
-                                                                                foreach ( $blogusers as $key =&gt; $val ) {
-                                                                                        echo '&lt;a href=&quot;' . esc_url( admin_url( 'user-edit.php?user_id=' . $val-&gt;user_id ) ) . '&quot;&gt;' . esc_html( $val-&gt;user_login ) . '&lt;/a&gt; ';
-                                                                                        if ( 'list' != $mode )
-                                                                                                echo '(' . $val-&gt;user_email . ')';
-                                                                                        echo '&lt;br /&gt;';
-                                                                                }
-                                                                                if ( $blogusers_warning != '' )
-                                                                                        echo '&lt;strong&gt;' . $blogusers_warning . '&lt;/strong&gt;&lt;br /&gt;';
-                                                                        }
-                                                                        ?&gt;
-                                                                &lt;/td&gt;
-                                                        &lt;?php
-                                                        break;
-
-                                                        case 'plugins': ?&gt;
-                                                                &lt;?php if ( has_filter( 'wpmublogsaction' ) ) { ?&gt;
-                                                                &lt;td valign=&quot;top&quot;&gt;
-                                                                        &lt;?php do_action( 'wpmublogsaction', $blog['blog_id'] ); ?&gt;
-                                                                &lt;/td&gt;
-                                                                &lt;?php } ?&gt;
-                                                        &lt;?php break;
-
-                                                        default: ?&gt;
-                                                                &lt;?php if ( has_filter( 'manage_blogs_custom_column' ) ) { ?&gt;
-                                                                &lt;td valign=&quot;top&quot;&gt;
-                                                                        &lt;?php do_action( 'manage_blogs_custom_column', $column_name, $blog['blog_id'] ); ?&gt;
-                                                                &lt;/td&gt;
-                                                                &lt;?php } ?&gt;
-                                                        &lt;?php break;
-                                                }
-                                        }
-                                        ?&gt;
-                                        &lt;/tr&gt;
-                                        &lt;?php
-                                }
-                        } else { ?&gt;
-                                &lt;tr&gt;
-                                        &lt;td colspan=&quot;&lt;?php echo (int) count( $sites_columns ); ?&gt;&quot;&gt;&lt;?php _e( 'No sites found.' ) ?&gt;&lt;/td&gt;
-                                &lt;/tr&gt;
-                        &lt;?php
-                        } // end if ($blogs)
-                        ?&gt;
-
-                        &lt;/tbody&gt;
-                &lt;/table&gt;
-                &lt;div class=&quot;tablenav&quot;&gt;
-                        &lt;?php
-                        if ( $page_links )
-                                echo &quot;&lt;div class='tablenav-pages'&gt;$page_links_text&lt;/div&gt;&quot;;
-                        ?&gt;
-
-                        &lt;div class=&quot;alignleft actions&quot;&gt;
-                        &lt;select name=&quot;action2&quot;&gt;
-                                &lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e( 'Bulk Actions' ); ?&gt;&lt;/option&gt;
-                                &lt;option value=&quot;delete&quot;&gt;&lt;?php _e( 'Delete' ); ?&gt;&lt;/option&gt;
-                                &lt;option value=&quot;spam&quot;&gt;&lt;?php _ex( 'Mark as Spam', 'site' ); ?&gt;&lt;/option&gt;
-                                &lt;option value=&quot;notspam&quot;&gt;&lt;?php _ex( 'Not Spam', 'site' ); ?&gt;&lt;/option&gt;
-                        &lt;/select&gt;
-                        &lt;input type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e( 'Apply' ); ?&gt;&quot; name=&quot;doaction2&quot; id=&quot;doaction2&quot; class=&quot;button-secondary action&quot; /&gt;
-                        &lt;/div&gt;
-                        &lt;br class=&quot;clear&quot; /&gt;
-                &lt;/div&gt;
-
-                &lt;/form&gt;
-                &lt;/div&gt;
-
-                &lt;div id=&quot;form-add-site&quot; class=&quot;wrap&quot;&gt;
-                        &lt;h3&gt;&lt;?php _e( 'Add Site' ) ?&gt;&lt;/h3&gt;
-                        &lt;form method=&quot;post&quot; action=&quot;ms-edit.php?action=addblog&quot;&gt;
-                                &lt;?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ) ?&gt;
-                                &lt;table class=&quot;form-table&quot;&gt;
-                                        &lt;tr class=&quot;form-field form-required&quot;&gt;
-                                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Site Address' ) ?&gt;&lt;/th&gt;
-                                                &lt;td&gt;
-                                                &lt;?php if ( is_subdomain_install() ) { ?&gt;
-                                                        &lt;input name=&quot;blog[domain]&quot; type=&quot;text&quot; class=&quot;regular-text&quot; title=&quot;&lt;?php _e( 'Domain' ) ?&gt;&quot;/&gt;.&lt;?php echo preg_replace( '|^www\.|', '', $current_site-&gt;domain );?&gt;
-                                                &lt;?php } else {
-                                                        echo $current_site-&gt;domain . $current_site-&gt;path ?&gt;&lt;input name=&quot;blog[domain]&quot; class=&quot;regular-text&quot; type=&quot;text&quot; title=&quot;&lt;?php _e( 'Domain' ) ?&gt;&quot;/&gt;
-                                                &lt;?php }
-                                                echo '&lt;p&gt;' . __( 'Only the characters a-z and 0-9 recommended.' ) . '&lt;/p&gt;';
-                                                ?&gt;
-                                                &lt;/td&gt;
-                                        &lt;/tr&gt;
-                                        &lt;tr class=&quot;form-field form-required&quot;&gt;
-                                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Site Title' ) ?&gt;&lt;/th&gt;
-                                                &lt;td&gt;&lt;input name=&quot;blog[title]&quot; type=&quot;text&quot; class=&quot;regular-text&quot; title=&quot;&lt;?php _e( 'Title' ) ?&gt;&quot;/&gt;&lt;/td&gt;
-                                        &lt;/tr&gt;
-                                        &lt;tr class=&quot;form-field form-required&quot;&gt;
-                                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Admin Email' ) ?&gt;&lt;/th&gt;
-                                                &lt;td&gt;&lt;input name=&quot;blog[email]&quot; type=&quot;text&quot; class=&quot;regular-text&quot; title=&quot;&lt;?php _e( 'Email' ) ?&gt;&quot;/&gt;&lt;/td&gt;
-                                        &lt;/tr&gt;
-                                        &lt;tr class=&quot;form-field&quot;&gt;
-                                                &lt;td colspan=&quot;2&quot;&gt;&lt;?php _e( 'A new user will be created if the above email address is not in the database.' ) ?&gt;&lt;br /&gt;&lt;?php _e( 'The username and password will be mailed to this email address.' ) ?&gt;&lt;/td&gt;
-                                        &lt;/tr&gt;
-                                &lt;/table&gt;
-                                &lt;p class=&quot;submit&quot;&gt;
-                                        &lt;input class=&quot;button&quot; type=&quot;submit&quot; name=&quot;go&quot; value=&quot;&lt;?php esc_attr_e( 'Add Site' ) ?&gt;&quot; /&gt;&lt;/p&gt;
-                        &lt;/form&gt;
-                &lt;/div&gt;
-                &lt;?php
-        break;
-} // end switch( $action )
-
-include( './admin-footer.php' ); ?&gt;
</del></span></pre></div>
<a id="trunkwpadminmssitesphp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/ms-sites.php (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-sites.php                                (rev 0)
+++ trunk/wp-admin/ms-sites.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+&lt;?php
+/**
+ * Multisite sites administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( './admin.php' );
+
+wp_redirect( network_admin_url('sites.php') );
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-admin/ms-sites.php
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:eol-style
</span><span class="cx">   + native
</span></span></pre></div>
<a id="trunkwpadminmsthemesphp"></a>
<div class="delfile"><h4>Deleted: trunk/wp-admin/ms-themes.php (15480 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-themes.php        2010-07-29 21:58:58 UTC (rev 15480)
+++ trunk/wp-admin/ms-themes.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -1,99 +0,0 @@
</span><del>-&lt;?php
-/**
- * Multisite themes administration panel.
- *
- * @package WordPress
- * @subpackage Multisite
- * @since 3.0.0
- */
-
-require_once( './admin.php' );
-
-if ( ! current_user_can( 'manage_network_themes' ) )
-        wp_die( __( 'You do not have permission to access this page.' ) );
-
-$title = __( 'Network Themes' );
-$parent_file = 'ms-admin.php';
-
-add_contextual_help($current_screen,
-        '&lt;p&gt;' . __('This screen enables and disables the inclusion of themes available to choose in the Appearance menu for each site. It does not activate or deactivate which theme a site is currently using.') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('If the network admin disables a theme that is in use, it can still remain selected on that site. If another theme is chosen, the disabled theme will not appear in the site&amp;#8217;s Appearance &gt; Themes screen.') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('Themes can be enabled on a site by site basis by the network admin on the Edit Site screen you go to via the Edit action link on the Sites screen.') . '&lt;/p&gt;' .
-        '&lt;p&gt;&lt;strong&gt;' . __('For more information:') . '&lt;/strong&gt;&lt;/p&gt;' .
-        '&lt;p&gt;' . __('&lt;a href=&quot;http://codex.wordpress.org/Super_Admin_Themes_SubPanel&quot; target=&quot;_blank&quot;&gt;Documentation on Network Themes&lt;/a&gt;') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('&lt;a href=&quot;http://wordpress.org/support/&quot; target=&quot;_blank&quot;&gt;Support Forums&lt;/a&gt;') . '&lt;/p&gt;'
-);
-
-require_once( './admin-header.php' );
-
-if ( isset( $_GET['updated'] ) ) {
-        ?&gt;
-        &lt;div id=&quot;message&quot; class=&quot;updated&quot;&gt;&lt;p&gt;&lt;?php _e( 'Site themes saved.' ) ?&gt;&lt;/p&gt;&lt;/div&gt;
-        &lt;?php
-}
-
-$themes = get_themes();
-$allowed_themes = get_site_allowed_themes();
-?&gt;
-&lt;div class=&quot;wrap&quot;&gt;
-        &lt;form action=&quot;&lt;?php echo esc_url( admin_url( 'ms-edit.php?action=updatethemes' ) ); ?&gt;&quot; method=&quot;post&quot;&gt;
-                &lt;?php screen_icon(); ?&gt;
-                &lt;h2&gt;&lt;?php _e( 'Network Themes' ) ?&gt;&lt;/h2&gt;
-                &lt;p&gt;&lt;?php _e( 'Themes must be enabled for your network before they will be available to individual sites.' ) ?&gt;&lt;/p&gt;
-                &lt;p class=&quot;submit&quot;&gt;
-                        &lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e( 'Apply Changes' ) ?&gt;&quot; /&gt;&lt;/p&gt;
-                &lt;table class=&quot;widefat&quot;&gt;
-                        &lt;thead&gt;
-                                &lt;tr&gt;
-                                        &lt;th style=&quot;width:15%;&quot;&gt;&lt;?php _e( 'Enable' ) ?&gt;&lt;/th&gt;
-                                        &lt;th style=&quot;width:25%;&quot;&gt;&lt;?php _e( 'Theme' ) ?&gt;&lt;/th&gt;
-                                        &lt;th style=&quot;width:10%;&quot;&gt;&lt;?php _e( 'Version' ) ?&gt;&lt;/th&gt;
-                                        &lt;th style=&quot;width:60%;&quot;&gt;&lt;?php _e( 'Description' ) ?&gt;&lt;/th&gt;
-                                &lt;/tr&gt;
-                        &lt;/thead&gt;
-                        &lt;tbody id=&quot;plugins&quot;&gt;
-                        &lt;?php
-                        $total_theme_count = $activated_themes_count = 0;
-                        $class = '';
-                        foreach ( (array) $themes as $key =&gt; $theme ) {
-                                $total_theme_count++;
-                                $theme_key = esc_html( $theme['Stylesheet'] );
-                                $class = ( 'alt' == $class ) ? '' : 'alt';
-                                $class1 = $enabled = $disabled = '';
-                                $enabled = $disabled = false;
-
-                                if ( isset( $allowed_themes[$theme_key] ) == true ) {
-                                        $enabled = true;
-                                        $activated_themes_count++;
-                                        $class1 = 'active';
-                                } else {
-                                        $disabled = true;
-                                }
-                                ?&gt;
-                                &lt;tr valign=&quot;top&quot; class=&quot;&lt;?php echo $class . ' ' . $class1; ?&gt;&quot;&gt;
-                                        &lt;td&gt;
-                                                &lt;label&gt;&lt;input name=&quot;theme[&lt;?php echo $theme_key ?&gt;]&quot; type=&quot;radio&quot; id=&quot;enabled_&lt;?php echo $theme_key ?&gt;&quot; value=&quot;enabled&quot; &lt;?php checked( $enabled ) ?&gt; /&gt; &lt;?php _e( 'Yes' ) ?&gt;&lt;/label&gt;
-                                                &amp;nbsp;&amp;nbsp;&amp;nbsp;
-                                                &lt;label&gt;&lt;input name=&quot;theme[&lt;?php echo $theme_key ?&gt;]&quot; type=&quot;radio&quot; id=&quot;disabled_&lt;?php echo $theme_key ?&gt;&quot; value=&quot;disabled&quot; &lt;?php checked( $disabled ) ?&gt; /&gt; &lt;?php _e( 'No' ) ?&gt;&lt;/label&gt;
-                                        &lt;/td&gt;
-                                        &lt;th scope=&quot;row&quot; style=&quot;text-align:left;&quot;&gt;&lt;?php echo $key ?&gt;&lt;/th&gt;
-                                        &lt;td&gt;&lt;?php echo $theme['Version'] ?&gt;&lt;/td&gt;
-                                        &lt;td&gt;&lt;?php echo $theme['Description'] ?&gt;&lt;/td&gt;
-                                &lt;/tr&gt;
-                        &lt;?php } ?&gt;
-                        &lt;/tbody&gt;
-                &lt;/table&gt;
-
-                &lt;p class=&quot;submit&quot;&gt;
-                        &lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e( 'Apply Changes' ) ?&gt;&quot; /&gt;&lt;/p&gt;
-        &lt;/form&gt;
-
-        &lt;h3&gt;&lt;?php _e( 'Total' )?&gt;&lt;/h3&gt;
-        &lt;p&gt;
-                &lt;?php printf( __( 'Themes Installed: %d' ), $total_theme_count); ?&gt;
-                &lt;br /&gt;
-                &lt;?php printf( __( 'Themes Enabled: %d' ), $activated_themes_count); ?&gt;
-        &lt;/p&gt;
-&lt;/div&gt;
-
-&lt;?php include( './admin-footer.php' ); ?&gt;
</del></span></pre></div>
<a id="trunkwpadminmsthemesphp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/ms-themes.php (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-themes.php                                (rev 0)
+++ trunk/wp-admin/ms-themes.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+&lt;?php
+/**
+ * Multisite themes administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( './admin.php' );
+
+wp_redirect( network_admin_url('themes.php') );
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-admin/ms-themes.php
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:eol-style
</span><span class="cx">   + native
</span></span></pre></div>
<a id="trunkwpadminmsupgradenetworkphp"></a>
<div class="delfile"><h4>Deleted: trunk/wp-admin/ms-upgrade-network.php (15480 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-upgrade-network.php        2010-07-29 21:58:58 UTC (rev 15480)
+++ trunk/wp-admin/ms-upgrade-network.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -1,85 +0,0 @@
</span><del>-&lt;?php
-/**
- * Multisite upgrade administration panel.
- *
- * @package WordPress
- * @subpackage Multisite
- * @since 3.0.0
- */
-
-require_once('admin.php');
-
-if ( !is_multisite() )
-        wp_die( __( 'Multisite support is not enabled.' ) );
-
-require_once( ABSPATH . WPINC . '/http.php' );
-
-$title = __( 'Update Network' );
-$parent_file = 'ms-admin.php';
-
-add_contextual_help($current_screen,
-        '&lt;p&gt;' . __('Only use this screen once you have updated to a new version of WordPress through Dashboard &gt; Updates. Clicking the Update Network button will step through each site in the network, five at a time, and make sure any database upgrades are applied.') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('If a version update to core has not happened, clicking this button won&amp;#8217;t affect anything.') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('If this process fails for any reason, users logging in to their sites will force the same update.') . '&lt;/p&gt;' .
-        '&lt;p&gt;&lt;strong&gt;' . __('For more information:') . '&lt;/strong&gt;&lt;/p&gt;' .
-        '&lt;p&gt;' . __('&lt;a href=&quot;http://codex.wordpress.org/Super_Admin_Update_SubPanel&quot; target=&quot;_blank&quot;&gt;Update Network Documentation&lt;/a&gt;') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('&lt;a href=&quot;http://wordpress.org/support/&quot; target=&quot;_blank&quot;&gt;Support Forums&lt;/a&gt;') . '&lt;/p&gt;'
-);
-
-require_once('admin-header.php');
-
-if ( ! current_user_can( 'manage_network' ) )
-        wp_die( __( 'You do not have permission to access this page.' ) );
-
-echo '&lt;div class=&quot;wrap&quot;&gt;';
-screen_icon();
-echo '&lt;h2&gt;' . __( 'Update Network' ) . '&lt;/h2&gt;';
-
-$action = isset($_GET['action']) ? $_GET['action'] : 'show';
-
-switch ( $action ) {
-        case &quot;upgrade&quot;:
-                $n = ( isset($_GET['n']) ) ? intval($_GET['n']) : 0;
-
-                if ( $n &lt; 5 ) {
-                        global $wp_db_version;
-                        update_site_option( 'wpmu_upgrade_site', $wp_db_version );
-                }
-
-                $blogs = $wpdb-&gt;get_results( &quot;SELECT * FROM {$wpdb-&gt;blogs} WHERE site_id = '{$wpdb-&gt;siteid}' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT {$n}, 5&quot;, ARRAY_A );
-                if ( empty( $blogs ) ) {
-                        echo '&lt;p&gt;' . __( 'All done!' ) . '&lt;/p&gt;';
-                        break;
-                }
-                echo &quot;&lt;ul&gt;&quot;;
-                foreach ( (array) $blogs as $details ) {
-                        $siteurl = get_blog_option( $details['blog_id'], 'siteurl' );
-                        echo &quot;&lt;li&gt;$siteurl&lt;/li&gt;&quot;;
-                        $response = wp_remote_get( trailingslashit( $siteurl ) . &quot;wp-admin/upgrade.php?step=upgrade_db&quot;, array( 'timeout' =&gt; 120, 'httpversion' =&gt; '1.1' ) );
-                        if ( is_wp_error( $response ) )
-                                wp_die( sprintf( __( 'Warning! Problem updating %1$s. Your server may not be able to connect to sites running on it. Error message: &lt;em&gt;%2$s&lt;/em&gt;' ), $siteurl, $response-&gt;get_error_message() ) );
-                        do_action( 'after_mu_upgrade', $response );
-                        do_action( 'wpmu_upgrade_site', $details[ 'blog_id' ] );
-                }
-                echo &quot;&lt;/ul&gt;&quot;;
-                ?&gt;&lt;p&gt;&lt;?php _e( 'If your browser doesn&amp;#8217;t start loading the next page automatically, click this link:' ); ?&gt; &lt;a class=&quot;button&quot; href=&quot;ms-upgrade-network.php?action=upgrade&amp;amp;n=&lt;?php echo ($n + 5) ?&gt;&quot;&gt;&lt;?php _e(&quot;Next Sites&quot;); ?&gt;&lt;/a&gt;&lt;/p&gt;
-                &lt;script type='text/javascript'&gt;
-                &lt;!--
-                function nextpage() {
-                        location.href = &quot;ms-upgrade-network.php?action=upgrade&amp;n=&lt;?php echo ($n + 5) ?&gt;&quot;;
-                }
-                setTimeout( &quot;nextpage()&quot;, 250 );
-                //--&gt;
-                &lt;/script&gt;&lt;?php
-        break;
-        case 'show':
-        default:
-                ?&gt;&lt;p&gt;&lt;?php _e( 'You can update all the sites on your network through this page. It works by calling the update script of each site automatically. Hit the link below to update.' ); ?&gt;&lt;/p&gt;
-                &lt;p&gt;&lt;a class=&quot;button&quot; href=&quot;ms-upgrade-network.php?action=upgrade&quot;&gt;&lt;?php _e(&quot;Update Network&quot;); ?&gt;&lt;/a&gt;&lt;/p&gt;&lt;?php
-                do_action( 'wpmu_upgrade_page' );
-        break;
-}
-?&gt;
-&lt;/div&gt;
-
-&lt;?php include('./admin-footer.php'); ?&gt;
</del></span></pre></div>
<a id="trunkwpadminmsupgradenetworkphp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/ms-upgrade-network.php (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-upgrade-network.php                                (rev 0)
+++ trunk/wp-admin/ms-upgrade-network.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+&lt;?php
+/**
+ * Multisite upgrade administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once('admin.php');
+
+wp_redirect( network_admin_url('upgrade.php') );
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-admin/ms-upgrade-network.php
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:eol-style
</span><span class="cx">   + native
</span></span></pre></div>
<a id="trunkwpadminmsusersphp"></a>
<div class="delfile"><h4>Deleted: trunk/wp-admin/ms-users.php (15480 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-users.php        2010-07-29 21:58:58 UTC (rev 15480)
+++ trunk/wp-admin/ms-users.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -1,378 +0,0 @@
</span><del>-&lt;?php
-/**
- * Multisite users administration panel.
- *
- * @package WordPress
- * @subpackage Multisite
- * @since 3.0.0
- */
-
-require_once( './admin.php' );
-
-if ( !is_multisite() )
-        wp_die( __( 'Multisite support is not enabled.' ) );
-
-if ( ! current_user_can( 'manage_network_users' ) )
-        wp_die( __( 'You do not have permission to access this page.' ) );
-
-$title = __( 'Users' );
-$parent_file = 'ms-admin.php';
-
-add_contextual_help($current_screen,
-        '&lt;p&gt;' . __('This table shows all users across the network and the sites to which they are assigned.') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('Hover over any user on the list to make the edit links appear. The Edit link on the left will take you to his or her Edit User profile page; the Edit link on the right by any site name goes to an Edit Site screen for that site.') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('You can also go to the user&amp;#8217;s profile page by clicking on the individual username.') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('You can sort the table by clicking on any of the bold headings and switch between list and excerpt views by using the icons in the upper right.') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('The bulk action will permanently delete selected users, or mark/unmark those selected as spam. Spam users will have posts removed and will be unable to sign up again with the same email addresses.') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('Add User will add that person to this table and send them an email.') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('Users who are signed up to the network without a site are added as subscribers to the main or primary dashboard site, giving them profile pages to manage their accounts. These users will only see Dashboard and My Sites in the main navigation until a site is created for them.') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('You can make an existing user an additional super admin by going to the Edit User profile page and checking the box to grant that privilege.') . '&lt;/p&gt;' .
-        '&lt;p&gt;&lt;strong&gt;' . __('For more information:') . '&lt;/strong&gt;&lt;/p&gt;' .
-        '&lt;p&gt;' . __('&lt;a href=&quot;http://codex.wordpress.org/Super_Admin_Users_SubPanel&quot; target=&quot;_blank&quot;&gt;Network Users Documentation&lt;/a&gt;') . '&lt;/p&gt;' .
-        '&lt;p&gt;' . __('&lt;a href=&quot;http://wordpress.org/support/&quot; target=&quot;_blank&quot;&gt;Support Forums&lt;/a&gt;') . '&lt;/p&gt;'
-);
-
-wp_enqueue_script( 'admin-forms' );
-
-require_once( './admin-header.php' );
-
-if ( isset( $_GET['updated'] ) &amp;&amp; $_GET['updated'] == 'true' &amp;&amp; ! empty( $_GET['action'] ) ) {
-        ?&gt;
-        &lt;div id=&quot;message&quot; class=&quot;updated&quot;&gt;&lt;p&gt;
-                &lt;?php
-                switch ( $_GET['action'] ) {
-                        case 'delete':
-                                _e( 'User deleted.' );
-                        break;
-                        case 'all_spam':
-                                _e( 'Users marked as spam.' );
-                        break;
-                        case 'all_notspam':
-                                _e( 'Users removed from spam.' );
-                        break;
-                        case 'all_delete':
-                                _e( 'Users deleted.' );
-                        break;
-                        case 'add':
-                                _e( 'User added.' );
-                        break;
-                }
-                ?&gt;
-        &lt;/p&gt;&lt;/div&gt;
-        &lt;?php
-}
-
-        $pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0;
-        if ( empty( $pagenum ) )
-                $pagenum = 1;
-
-        $per_page = (int) get_user_option( 'ms_users_per_page' );
-        if ( empty( $per_page ) || $per_page &lt; 1 )
-                $per_page = 15;
-
-        $per_page = apply_filters( 'ms_users_per_page', $per_page );
-
-        $s = isset( $_GET['s'] ) ? stripslashes( trim( $_GET[ 's' ] ) ) : '';
-        $like_s = esc_sql( like_escape( $s ) );
-
-        $query = &quot;SELECT * FROM {$wpdb-&gt;users}&quot;;
-
-        if ( !empty( $like_s ) ) {
-                $query .= &quot; WHERE user_login LIKE '%$like_s%' OR user_email LIKE '%$like_s%'&quot;;
-        }
-
-        $order_by = isset( $_GET['sortby'] ) ? $_GET['sortby'] : 'id';
-        if ( $order_by == 'email' ) {
-                $query .= ' ORDER BY user_email ';
-        } elseif ( $order_by == 'login' ) {
-                $query .= ' ORDER BY user_login ';
-        } elseif ( $order_by == 'name' ) {
-                $query .= ' ORDER BY display_name ';
-        } elseif ( $order_by == 'registered' ) {
-                $query .= ' ORDER BY user_registered ';
-        } else {
-                $order_by = 'id';
-                $query .= ' ORDER BY ID ';
-        }
-
-        $order = ( isset( $_GET['order'] ) &amp;&amp; 'DESC' == $_GET['order'] ) ? 'DESC' : 'ASC';
-        $query .= $order;
-
-        $total = $wpdb-&gt;get_var( str_replace( 'SELECT *', 'SELECT COUNT(ID)', $query ) );
-
-        $query .= &quot; LIMIT &quot; . intval( ( $pagenum - 1 ) * $per_page) . &quot;, &quot; . intval( $per_page );
-
-        $user_list = $wpdb-&gt;get_results( $query, ARRAY_A );
-
-        $num_pages = ceil( $total / $per_page );
-        $page_links = paginate_links( array(
-                'base' =&gt; add_query_arg( 'paged', '%#%' ),
-                'format' =&gt; '',
-                'prev_text' =&gt; __( '&amp;laquo;' ),
-                'next_text' =&gt; __( '&amp;raquo;' ),
-                'total' =&gt; $num_pages,
-                'current' =&gt; $pagenum
-        ));
-
-        if ( empty( $_GET['mode'] ) )
-                $mode = 'list';
-        else
-                $mode = esc_attr( $_GET['mode'] );
-
-        ?&gt;
-        &lt;div class=&quot;wrap&quot;&gt;
-        &lt;?php screen_icon(); ?&gt;
-        &lt;h2&gt;&lt;?php esc_html_e( 'Users' ); ?&gt;
-        &lt;a href=&quot;#form-add-user&quot; class=&quot;button add-new-h2&quot;&gt;&lt;?php echo esc_html_x( 'Add New' , 'users'); ?&gt;&lt;/a&gt;
-        &lt;?php
-        if ( isset( $_GET['s'] ) &amp;&amp; $_GET['s'] )
-        printf( '&lt;span class=&quot;subtitle&quot;&gt;' . __( 'Search results for &amp;#8220;%s&amp;#8221;' ) . '&lt;/span&gt;', esc_html( $s ) );
-        ?&gt;
-        &lt;/h2&gt;
-
-        &lt;form action=&quot;ms-users.php&quot; method=&quot;get&quot; class=&quot;search-form&quot;&gt;
-                &lt;p class=&quot;search-box&quot;&gt;
-                &lt;input type=&quot;text&quot; name=&quot;s&quot; value=&quot;&lt;?php echo esc_attr( $s ); ?&gt;&quot; class=&quot;search-input&quot; id=&quot;user-search-input&quot; /&gt;
-                &lt;input type=&quot;submit&quot; id=&quot;post-query-submit&quot; value=&quot;&lt;?php esc_attr_e( 'Search Users' ) ?&gt;&quot; class=&quot;button&quot; /&gt;
-                &lt;/p&gt;
-        &lt;/form&gt;
-
-        &lt;form id=&quot;form-user-list&quot; action='ms-edit.php?action=allusers' method='post'&gt;
-                &lt;input type=&quot;hidden&quot; name=&quot;mode&quot; value=&quot;&lt;?php echo esc_attr( $mode ); ?&gt;&quot; /&gt;
-                &lt;div class=&quot;tablenav&quot;&gt;
-                        &lt;div class=&quot;alignleft actions&quot;&gt;
-                                &lt;select name=&quot;action&quot;&gt;
-                                        &lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e( 'Bulk Actions' ); ?&gt;&lt;/option&gt;
-                                        &lt;option value=&quot;delete&quot;&gt;&lt;?php _e( 'Delete' ); ?&gt;&lt;/option&gt;
-                                        &lt;option value=&quot;spam&quot;&gt;&lt;?php _ex( 'Mark as Spam', 'user' ); ?&gt;&lt;/option&gt;
-                                        &lt;option value=&quot;notspam&quot;&gt;&lt;?php _ex( 'Not Spam', 'user' ); ?&gt;&lt;/option&gt;
-                                &lt;/select&gt;
-                                &lt;input type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e( 'Apply' ); ?&gt;&quot; name=&quot;doaction&quot; id=&quot;doaction&quot; class=&quot;button-secondary action&quot; /&gt;
-                                &lt;?php wp_nonce_field( 'bulk-ms-users', '_wpnonce_bulk-ms-users' ); ?&gt;
-                        &lt;/div&gt;
-
-                        &lt;?php if ( $page_links ) { ?&gt;
-                        &lt;div class=&quot;tablenav-pages&quot;&gt;
-                        &lt;?php $page_links_text = sprintf( '&lt;span class=&quot;displaying-num&quot;&gt;' . __( 'Displaying %s&amp;#8211;%s of %s' ) . '&lt;/span&gt;%s',
-                        number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
-                        number_format_i18n( min( $pagenum * $per_page, $total ) ),
-                        number_format_i18n( $total ),
-                        $page_links
-                        ); echo $page_links_text; ?&gt;
-                        &lt;/div&gt;
-                        &lt;?php } ?&gt;
-
-                        &lt;div class=&quot;view-switch&quot;&gt;
-                                &lt;a href=&quot;&lt;?php echo esc_url( add_query_arg( 'mode', 'list', $_SERVER['REQUEST_URI'] ) ) ?&gt;&quot;&gt;&lt;img &lt;?php if ( 'list' == $mode ) echo 'class=&quot;current&quot;'; ?&gt; id=&quot;view-switch-list&quot; src=&quot;&lt;?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?&gt;&quot; width=&quot;20&quot; height=&quot;20&quot; title=&quot;&lt;?php _e( 'List View' ) ?&gt;&quot; alt=&quot;&lt;?php _e( 'List View' ) ?&gt;&quot; /&gt;&lt;/a&gt;
-                                &lt;a href=&quot;&lt;?php echo esc_url( add_query_arg( 'mode', 'excerpt', $_SERVER['REQUEST_URI'] ) ) ?&gt;&quot;&gt;&lt;img &lt;?php if ( 'excerpt' == $mode ) echo 'class=&quot;current&quot;'; ?&gt; id=&quot;view-switch-excerpt&quot; src=&quot;&lt;?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?&gt;&quot; width=&quot;20&quot; height=&quot;20&quot; title=&quot;&lt;?php _e( 'Excerpt View' ) ?&gt;&quot; alt=&quot;&lt;?php _e( 'Excerpt View' ) ?&gt;&quot; /&gt;&lt;/a&gt;
-                        &lt;/div&gt;
-                &lt;/div&gt;
-                &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
-
-                &lt;?php
-                // define the columns to display, the syntax is 'internal name' =&gt; 'display name'
-                $users_columns = array(
-                        'id'           =&gt; __( 'ID' ),
-                        'login'      =&gt; __( 'Username' ),
-                        'name'       =&gt; __( 'Name' ),
-                        'email'      =&gt; __( 'E-mail' ),
-                        'registered' =&gt; _x( 'Registered', 'user' ),
-                        'blogs'      =&gt; __( 'Sites' )
-                );
-                $users_columns = apply_filters( 'wpmu_users_columns', $users_columns );
-                ?&gt;
-                &lt;table class=&quot;widefat&quot;&gt;
-                        &lt;thead&gt;
-                        &lt;tr&gt;
-                                &lt;th class=&quot;manage-column column-cb check-column&quot; scope=&quot;col&quot;&gt;
-                                        &lt;input type=&quot;checkbox&quot; /&gt;
-                                &lt;/th&gt;
-                                &lt;?php
-                                $col_url = '';
-                                foreach($users_columns as $column_id =&gt; $column_display_name) {
-                                        $column_link = &quot;&lt;a href='&quot;;
-                                        $order2 = '';
-                                        if ( $order_by == $column_id )
-                                                $order2 = ( $order == 'DESC' ) ? 'ASC' : 'DESC';
-
-                                        $column_link .= esc_url( add_query_arg( array( 'order' =&gt; $order2, 'paged' =&gt; $pagenum, 'sortby' =&gt; $column_id ), remove_query_arg( array( 'action', 'updated' ), $_SERVER['REQUEST_URI'] ) ) );
-                                        $column_link .= &quot;'&gt;{$column_display_name}&lt;/a&gt;&quot;;
-                                        $col_url .= '&lt;th scope=&quot;col&quot;&gt;' . ( $column_id == 'blogs' ? $column_display_name : $column_link ) . '&lt;/th&gt;';
-                                }
-                                echo $col_url; ?&gt;
-                        &lt;/tr&gt;
-                        &lt;/thead&gt;
-                        &lt;tfoot&gt;
-                        &lt;tr&gt;
-                                &lt;th class=&quot;manage-column column-cb check-column&quot; scope=&quot;col&quot;&gt;
-                                        &lt;input type=&quot;checkbox&quot; /&gt;
-                                &lt;/th&gt;
-                                &lt;?php echo $col_url; ?&gt;
-                        &lt;/tr&gt;
-                        &lt;/tfoot&gt;
-                        &lt;tbody id=&quot;the-user-list&quot; class=&quot;list:user&quot;&gt;
-                        &lt;?php if ( $user_list ) {
-                                $class = '';
-                                $super_admins = get_super_admins();
-                                foreach ( (array) $user_list as $user ) {
-                                        $class = ( 'alternate' == $class ) ? '' : 'alternate';
-
-                                        $status_list = array( 'spam' =&gt; 'site-spammed', 'deleted' =&gt; 'site-deleted' );
-
-                                        foreach ( $status_list as $status =&gt; $col ) {
-                                                if ( $user[$status] )
-                                                        $class = $col;
-                                        }
-
-                                        ?&gt;
-                                        &lt;tr class=&quot;&lt;?php echo $class; ?&gt;&quot;&gt;
-                                        &lt;?php
-                                        foreach( (array) $users_columns as $column_name=&gt;$column_display_name ) :
-                                                switch( $column_name ) {
-                                                        case 'id': ?&gt;
-                                                                &lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;
-                                                                        &lt;input type=&quot;checkbox&quot; id=&quot;blog_&lt;?php echo $user['ID'] ?&gt;&quot; name=&quot;allusers[]&quot; value=&quot;&lt;?php echo esc_attr( $user['ID'] ) ?&gt;&quot; /&gt;
-                                                                &lt;/th&gt;
-                                                                &lt;th valign=&quot;top&quot; scope=&quot;row&quot;&gt;
-                                                                        &lt;?php echo $user['ID'] ?&gt;
-                                                                &lt;/th&gt;
-                                                        &lt;?php
-                                                        break;
-
-                                                        case 'login':
-                                                                $avatar        = get_avatar( $user['user_email'], 32 );
-                                                                $edit_link = ( $current_user-&gt;ID == $user['ID'] ) ? 'profile.php' : 'user-edit.php?user_id=' . $user['ID'];
-                                                                ?&gt;
-                                                                &lt;td class=&quot;username column-username&quot;&gt;
-                                                                        &lt;?php echo $avatar; ?&gt;&lt;strong&gt;&lt;a href=&quot;&lt;?php echo esc_url( admin_url( $edit_link ) ); ?&gt;&quot; class=&quot;edit&quot;&gt;&lt;?php echo stripslashes( $user['user_login'] ); ?&gt;&lt;/a&gt;&lt;?php
-                                                                        if ( in_array( $user['user_login'], $super_admins ) )
-                                                                                echo ' - ' . __( 'Super admin' );
-                                                                        ?&gt;&lt;/strong&gt;
-                                                                        &lt;br/&gt;
-                                                                        &lt;div class=&quot;row-actions&quot;&gt;
-                                                                                &lt;span class=&quot;edit&quot;&gt;&lt;a href=&quot;&lt;?php echo esc_url( admin_url( $edit_link ) ); ?&gt;&quot;&gt;&lt;?php _e( 'Edit' ); ?&gt;&lt;/a&gt;&lt;/span&gt;
-                                                                                &lt;?php if ( ! in_array( $user['user_login'], $super_admins ) ) { ?&gt;
-                                                                                | &lt;span class=&quot;delete&quot;&gt;&lt;a href=&quot;&lt;?php echo $delete        = esc_url( admin_url( add_query_arg( '_wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'ms-edit.php', 'deleteuser' ) . '&amp;amp;action=deleteuser&amp;amp;id=' . $user['ID'] ) ) ); ?&gt;&quot; class=&quot;delete&quot;&gt;&lt;?php _e( 'Delete' ); ?&gt;&lt;/a&gt;&lt;/span&gt;
-                                                                                &lt;?php } ?&gt;
-                                                                        &lt;/div&gt;
-                                                                &lt;/td&gt;
-                                                        &lt;?php
-                                                        break;
-
-                                                        case 'name': ?&gt;
-                                                                &lt;td class=&quot;name column-name&quot;&gt;&lt;?php echo $user['display_name'] ?&gt;&lt;/td&gt;
-                                                        &lt;?php
-                                                        break;
-
-                                                        case 'email': ?&gt;
-                                                                &lt;td class=&quot;email column-email&quot;&gt;&lt;a href=&quot;mailto:&lt;?php echo $user['user_email'] ?&gt;&quot;&gt;&lt;?php echo $user['user_email'] ?&gt;&lt;/a&gt;&lt;/td&gt;
-                                                        &lt;?php
-                                                        break;
-
-                                                        case 'registered':
-                                                                if ( 'list' == $mode )
-                                                                        $date = 'Y/m/d';
-                                                                else
-                                                                        $date = 'Y/m/d \&lt;\b\r \/\&gt; g:i:s a';
-                                                        ?&gt;
-                                                                &lt;td&gt;&lt;?php echo mysql2date( __( $date ), $user['user_registered'] ); ?&gt;&lt;/td&gt;
-                                                        &lt;?php
-                                                        break;
-
-                                                        case 'blogs':
-                                                                $blogs = get_blogs_of_user( $user['ID'], true );
-                                                                ?&gt;
-                                                                &lt;td&gt;
-                                                                        &lt;?php
-                                                                        if ( is_array( $blogs ) ) {
-                                                                                foreach ( (array) $blogs as $key =&gt; $val ) {
-                                                                                        $path        = ( $val-&gt;path == '/' ) ? '' : $val-&gt;path;
-                                                                                        echo '&lt;a href=&quot;'. esc_url( admin_url( 'ms-sites.php?action=editblog&amp;amp;id=' . $val-&gt;userblog_id  ) ) .'&quot;&gt;' . str_replace( '.' . $current_site-&gt;domain, '', $val-&gt;domain . $path ) . '&lt;/a&gt;';
-                                                                                        echo ' &lt;small class=&quot;row-actions&quot;&gt;';
-
-                                                                                        // Edit
-                                                                                        echo '&lt;a href=&quot;'. esc_url( admin_url( 'ms-sites.php?action=editblog&amp;amp;id=' . $val-&gt;userblog_id  ) ) .'&quot;&gt;' . __( 'Edit' ) . '&lt;/a&gt; | ';
-
-                                                                                        // View
-                                                                                        echo '&lt;a ';
-                                                                                        if ( get_blog_status( $val-&gt;userblog_id, 'spam' ) == 1 )
-                                                                                                echo 'style=&quot;background-color: #faa&quot; ';
-                                                                                        echo 'href=&quot;' .  esc_url( get_home_url( $val-&gt;userblog_id ) )  . '&quot;&gt;' . __( 'View' ) . '&lt;/a&gt;';
-
-                                                                                        echo '&lt;/small&gt;&lt;br /&gt;';
-                                                                                }
-                                                                        }
-                                                                        ?&gt;
-                                                                &lt;/td&gt;
-                                                        &lt;?php
-                                                        break;
-
-                                                        default: ?&gt;
-                                                                &lt;td&gt;&lt;?php do_action( 'manage_users_custom_column', $column_name, $user['ID'] ); ?&gt;&lt;/td&gt;
-                                                        &lt;?php
-                                                        break;
-                                                }
-                                        endforeach
-                                        ?&gt;
-                                        &lt;/tr&gt;
-                                        &lt;?php
-                                }
-                        } else {
-                        ?&gt;
-                                &lt;tr&gt;
-                                        &lt;td colspan=&quot;&lt;?php echo (int) count($users_columns); ?&gt;&quot;&gt;&lt;?php _e( 'No users found.' ) ?&gt;&lt;/td&gt;
-                                &lt;/tr&gt;
-                                &lt;?php
-                        } // end if ($users)
-                        ?&gt;
-                        &lt;/tbody&gt;
-                &lt;/table&gt;
-
-                &lt;div class=&quot;tablenav&quot;&gt;
-                        &lt;?php
-                        if ( $page_links )
-                                echo &quot;&lt;div class='tablenav-pages'&gt;$page_links_text&lt;/div&gt;&quot;;
-                        ?&gt;
-
-                        &lt;div class=&quot;alignleft actions&quot;&gt;
-                                &lt;select name=&quot;action2&quot;&gt;
-                                        &lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e( 'Bulk Actions' ); ?&gt;&lt;/option&gt;
-                                        &lt;option value=&quot;delete&quot;&gt;&lt;?php _e( 'Delete' ); ?&gt;&lt;/option&gt;
-                                        &lt;option value=&quot;spam&quot;&gt;&lt;?php _ex( 'Mark as Spam', 'user' ); ?&gt;&lt;/option&gt;
-                                        &lt;option value=&quot;notspam&quot;&gt;&lt;?php _ex( 'Not Spam', 'user' ); ?&gt;&lt;/option&gt;
-                                &lt;/select&gt;
-                                &lt;input type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e( 'Apply' ); ?&gt;&quot; name=&quot;doaction2&quot; id=&quot;doaction2&quot; class=&quot;button-secondary action&quot; /&gt;
-                        &lt;/div&gt;
-                        &lt;br class=&quot;clear&quot; /&gt;
-                &lt;/div&gt;
-
-                &lt;/form&gt;
-                &lt;/div&gt;
-
-&lt;?php
-if ( apply_filters( 'show_adduser_fields', true ) ) :
-?&gt;
-&lt;div class=&quot;wrap&quot; id=&quot;form-add-user&quot;&gt;
-        &lt;h3&gt;&lt;?php _e( 'Add User' ) ?&gt;&lt;/h3&gt;
-        &lt;form action=&quot;ms-edit.php?action=adduser&quot; method=&quot;post&quot;&gt;
-        &lt;table class=&quot;form-table&quot;&gt;
-                &lt;tr class=&quot;form-field form-required&quot;&gt;
-                        &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Username' ) ?&gt;&lt;/th&gt;
-                        &lt;td&gt;&lt;input type=&quot;text&quot; class=&quot;regular-text&quot; name=&quot;user[username]&quot; /&gt;&lt;/td&gt;
-                &lt;/tr&gt;
-                &lt;tr class=&quot;form-field form-required&quot;&gt;
-                        &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Email' ) ?&gt;&lt;/th&gt;
-                        &lt;td&gt;&lt;input type=&quot;text&quot; class=&quot;regular-text&quot; name=&quot;user[email]&quot; /&gt;&lt;/td&gt;
-                &lt;/tr&gt;
-                &lt;tr class=&quot;form-field&quot;&gt;
-                        &lt;td colspan=&quot;2&quot;&gt;&lt;?php _e( 'Username and password will be mailed to the above email address.' ) ?&gt;&lt;/td&gt;
-                &lt;/tr&gt;
-        &lt;/table&gt;
-        &lt;p class=&quot;submit&quot;&gt;
-                &lt;?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?&gt;
-                &lt;input class=&quot;button&quot; type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e( 'Add user' ) ?&gt;&quot; /&gt;&lt;/p&gt;
-        &lt;/form&gt;
-&lt;/div&gt;
-&lt;?php endif; ?&gt;
-
-&lt;?php include( './admin-footer.php' ); ?&gt;
</del></span></pre></div>
<a id="trunkwpadminmsusersphp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/ms-users.php (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-users.php                                (rev 0)
+++ trunk/wp-admin/ms-users.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+&lt;?php
+/**
+ * Multisite users administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( './admin.php' );
+
+wp_redirect( network_admin_url('users.php') );
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-admin/ms-users.php
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:eol-style
</span><span class="cx">   + native
</span></span></pre></div>
<a id="trunkwpadminnetworkadminphp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/network/admin.php (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/admin.php                                (rev 0)
+++ trunk/wp-admin/network/admin.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;?php
+
+define('WP_NETWORK_ADMIN', TRUE);
+
+require_once( dirname(dirname(__FILE__)) . '/admin.php');
+
+if ( ! is_multisite() )
+        wp_die( __( 'Multisite support is not enabled.' ) );
+
+if ( ! is_main_site() )
+        wp_redirect( network_admin_url() );
+
+?&gt;
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-admin/network/admin.php
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:eol-style
</span><span class="cx">   + native
</span></span></pre></div>
<a id="trunkwpadminnetworkeditphpfromrev15473trunkwpadminmseditphp"></a>
<div class="copfile"><h4>Copied: trunk/wp-admin/network/edit.php (from rev 15473, trunk/wp-admin/ms-edit.php) (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/edit.php                                (rev 0)
+++ trunk/wp-admin/network/edit.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,637 @@
</span><ins>+&lt;?php
+/**
+ * Action handler for Multisite administration panels.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+        wp_die( __( 'Multisite support is not enabled.' ) );
+
+if ( empty( $_GET['action'] ) )
+        wp_redirect( admin_url( 'ms-admin.php' ) );
+
+do_action( 'wpmuadminedit' , '');
+
+if ( isset( $_GET['id' ]) )
+        $id = intval( $_GET['id'] );
+elseif ( isset( $_POST['id'] ) )
+        $id = intval( $_POST['id'] );
+
+switch ( $_GET['action'] ) {
+        case 'siteoptions':
+                check_admin_referer( 'siteoptions' );
+                if ( ! current_user_can( 'manage_network_options' ) )
+                        wp_die( __( 'You do not have permission to access this page.' ) );
+
+                if ( empty( $_POST ) )
+                        wp_die( sprintf( __( 'You probably need to go back to the &lt;a href=&quot;%s&quot;&gt;options page&lt;/a&gt;.', esc_url( admin_url( 'ms-options.php' ) ) ) ) );
+
+                if ( isset($_POST['WPLANG']) &amp;&amp; ( '' === $_POST['WPLANG'] || in_array( $_POST['WPLANG'], get_available_languages() ) ) )
+                        update_site_option( 'WPLANG', $_POST['WPLANG'] );
+
+                if ( is_email( $_POST['admin_email'] ) )
+                        update_site_option( 'admin_email', $_POST['admin_email'] );
+
+                $illegal_names = split( ' ', $_POST['illegal_names'] );
+                foreach ( (array) $illegal_names as $name ) {
+                        $name = trim( $name );
+                        if ( $name != '' )
+                                $names[] = trim( $name );
+                }
+                update_site_option( 'illegal_names', $names );
+
+                if ( $_POST['limited_email_domains'] != '' ) {
+                        $limited_email_domains = str_replace( ' ', &quot;\n&quot;, $_POST['limited_email_domains'] );
+                        $limited_email_domains = split( &quot;\n&quot;, stripslashes( $limited_email_domains ) );
+                        $limited_email = array();
+                        foreach ( (array) $limited_email_domains as $domain ) {
+                                        $domain = trim( $domain );
+                                if ( ! preg_match( '/(--|\.\.)/', $domain ) &amp;&amp; preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
+                                        $limited_email[] = trim( $domain );
+                        }
+                        update_site_option( 'limited_email_domains', $limited_email );
+                } else {
+                        update_site_option( 'limited_email_domains', '' );
+                }
+
+                if ( $_POST['banned_email_domains'] != '' ) {
+                        $banned_email_domains = split( &quot;\n&quot;, stripslashes( $_POST['banned_email_domains'] ) );
+                        $banned = array();
+                        foreach ( (array) $banned_email_domains as $domain ) {
+                                $domain = trim( $domain );
+                                if ( ! preg_match( '/(--|\.\.)/', $domain ) &amp;&amp; preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
+                                        $banned[] = trim( $domain );
+                        }
+                        update_site_option( 'banned_email_domains', $banned );
+                } else {
+                        update_site_option( 'banned_email_domains', '' );
+                }
+                update_site_option( 'default_user_role', $_POST['default_user_role'] );
+                if ( trim( $_POST['dashboard_blog_orig'] ) == '' )
+                        $_POST['dashboard_blog_orig'] = $current_site-&gt;blog_id;
+                if ( trim( $_POST['dashboard_blog'] ) == '' ) {
+                        $_POST['dashboard_blog'] = $current_site-&gt;blog_id;
+                        $dashboard_blog_id = $current_site-&gt;blog_id;
+                } elseif ( ! preg_match( '/(--|\.)/', $_POST['dashboard_blog'] ) &amp;&amp; preg_match( '|^([a-zA-Z0-9-\.])+$|', $_POST['dashboard_blog'] ) ) {
+                        $dashboard_blog = $_POST['dashboard_blog'];
+                        $blog_details = get_blog_details( $dashboard_blog );
+                        if ( false === $blog_details ) {
+                                if ( is_numeric( $dashboard_blog ) )
+                                        wp_die( __( 'A dashboard site referenced by ID must already exist' ) );
+                                if ( is_subdomain_install() ) {
+                                        $domain = $dashboard_blog . '.' . $current_site-&gt;domain;
+                                        $path = $current_site-&gt;path;
+                                } else {
+                                        $domain = $current_site-&gt;domain;
+                                        $path = trailingslashit( $current_site-&gt;path . $dashboard_blog );
+                                }
+                                $wpdb-&gt;hide_errors();
+                                $dashboard_blog_id = wpmu_create_blog( $domain, $path, __( 'My Dashboard' ), $current_user-&gt;id , array( 'public' =&gt; 0 ), $current_site-&gt;id );
+                                $wpdb-&gt;show_errors();
+                        } else {
+                                $dashboard_blog_id = $blog_details-&gt;blog_id;
+                        }
+                }
+                if ( is_wp_error( $dashboard_blog_id ) )
+                        wp_die( __( 'Problem creating dashboard site: ' ) . $dashboard_blog_id-&gt;get_error_message() );
+                if ( $_POST['dashboard_blog_orig'] != $_POST['dashboard_blog'] ) {
+                        $users = get_users_of_blog( get_site_option( 'dashboard_blog' ) );
+                        $move_users = array();
+                        foreach ( (array)$users as $user ) {
+                                $user_meta_value = unserialize( $user-&gt;meta_value );
+                                if ( is_array( $user_meta_value ) &amp;&amp; array_pop( $var_by_ref = array_keys( $user_meta_value ) ) == 'subscriber' )
+                                        $move_users[] = $user-&gt;user_id;
+                        }
+                        if ( false == empty( $move_users ) ) {
+                                foreach ( (array)$move_users as $user_id ) {
+                                        remove_user_from_blog($user_id, get_site_option( 'dashboard_blog' ) );
+                                        add_user_to_blog( $dashboard_blog_id, $user_id, get_site_option( 'default_user_role', 'subscriber' ) );
+                                        update_user_meta( $user_id, 'primary_blog', $dashboard_blog_id );
+                                }
+                        }
+                }
+                update_site_option( 'dashboard_blog', $dashboard_blog_id );
+
+                $options = array( 'registrationnotification', 'registration', 'add_new_users', 'menu_items', 'mu_media_buttons', 'upload_space_check_disabled', 'blog_upload_space', 'upload_filetypes', 'site_name', 'first_post', 'first_page', 'first_comment', 'first_comment_url', 'first_comment_author', 'welcome_email', 'welcome_user_email', 'fileupload_maxk', 'admin_notice_feed', 'global_terms_enabled' );
+                $checked_options = array( 'mu_media_buttons' =&gt; array(), 'menu_items' =&gt; array(), 'registrationnotification' =&gt; 'no', 'upload_space_check_disabled' =&gt; 1, 'add_new_users' =&gt; 0 );
+                foreach ( $checked_options as $option_name =&gt; $option_unchecked_value ) {
+                        if ( ! isset( $_POST[$option_name] ) )
+                                $_POST[$option_name] = $option_unchecked_value;
+                }
+                foreach ( $options as $option_name ) {
+                        if ( ! isset($_POST[$option_name]) )
+                                continue;
+                        $value = stripslashes_deep( $_POST[$option_name] );
+                        update_site_option( $option_name, $value );
+                }
+
+                // Update more options here
+                do_action( 'update_wpmu_options' );
+
+                wp_redirect( add_query_arg( 'updated', 'true', admin_url( 'ms-options.php' ) ) );
+                exit();
+        break;
+        case 'addblog':
+                check_admin_referer( 'add-blog', '_wpnonce_add-blog' );
+
+                if ( ! current_user_can( 'manage_sites' ) )
+                        wp_die( __( 'You do not have permission to access this page.' ) );
+
+                if ( is_array( $_POST['blog'] ) == false )
+                        wp_die(  __( 'Can&amp;#8217;t create an empty site.' ) );
+                $blog = $_POST['blog'];
+                $domain = '';
+                if ( ! preg_match( '/(--)/', $blog['domain'] ) &amp;&amp; preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) )
+                        $domain = strtolower( $blog['domain'] );
+
+                // If not a subdomain install, make sure the domain isn't a reserved word
+                if ( ! is_subdomain_install() ) {
+                        $subdirectory_reserved_names = apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed' ) );
+                        if ( in_array( $domain, $subdirectory_reserved_names ) )
+                                wp_die( sprintf( __('The following words are reserved for use by WordPress functions and cannot be used as blog names: &lt;code&gt;%s&lt;/code&gt;' ), implode( '&lt;/code&gt;, &lt;code&gt;', $subdirectory_reserved_names ) ) );
+                }
+
+                $email = sanitize_email( $blog['email'] );
+                $title = $blog['title'];
+
+                if ( empty( $domain ) )
+                        wp_die( __( 'Missing or invalid site address.' ) );
+                if ( empty( $email ) )
+                        wp_die( __( 'Missing email address.' ) );
+                if ( !is_email( $email ) )
+                        wp_die( __( 'Invalid email address.' ) );
+
+                if ( is_subdomain_install() ) {
+                        $newdomain = $domain . '.' . preg_replace( '|^www\.|', '', $current_site-&gt;domain );
+                        $path = $base;
+                } else {
+                        $newdomain = $current_site-&gt;domain;
+                        $path = $base . $domain . '/';
+                }
+
+                $password = 'N/A';
+                $user_id = email_exists($email);
+                if ( !$user_id ) { // Create a new user with a random password
+                        $password = wp_generate_password();
+                        $user_id = wpmu_create_user( $domain, $password, $email );
+                        if ( false == $user_id )
+                                wp_die( __( 'There was an error creating the user.' ) );
+                        else
+                                wp_new_user_notification( $user_id, $password );
+                }
+
+                $wpdb-&gt;hide_errors();
+                $id = wpmu_create_blog( $newdomain, $path, $title, $user_id , array( 'public' =&gt; 1 ), $current_site-&gt;id );
+                $wpdb-&gt;show_errors();
+                if ( !is_wp_error( $id ) ) {
+                        $dashboard_blog = get_dashboard_blog();
+                        if ( !is_super_admin( $user_id ) &amp;&amp; get_user_option( 'primary_blog', $user_id ) == $dashboard_blog-&gt;blog_id )
+                                update_user_option( $user_id, 'primary_blog', $id, true );
+                        $content_mail = sprintf( __( &quot;New site created by %1s\n\nAddress: http://%2s\nName: %3s&quot;), $current_user-&gt;user_login , $newdomain . $path, stripslashes( $title ) );
+                        wp_mail( get_site_option('admin_email'),  sprintf( __( '[%s] New Site Created' ), $current_site-&gt;site_name ), $content_mail, 'From: &quot;Site Admin&quot; &lt;' . get_site_option( 'admin_email' ) . '&gt;' );
+                        wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' =&gt; 1 ) );
+                        wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'add-blog' ), wp_get_referer() ) );
+                        exit();
+                } else {
+                        wp_die( $id-&gt;get_error_message() );
+                }
+        break;
+
+        case 'updateblog':
+                check_admin_referer( 'editblog' );
+                if ( ! current_user_can( 'manage_sites' ) )
+                        wp_die( __( 'You do not have permission to access this page.' ) );
+
+                if ( empty( $_POST ) )
+                        wp_die( sprintf( __( 'You probably need to go back to the &lt;a href=&quot;%s&quot;&gt;sites page&lt;/a&gt;', esc_url( admin_url( 'ms-sites.php' ) ) ) ) );
+
+                switch_to_blog( $id );
+
+                // themes
+                $allowedthemes = array();
+                if ( isset($_POST['theme']) &amp;&amp; is_array( $_POST['theme'] ) ) {
+                        foreach ( $_POST['theme'] as $theme =&gt; $val ) {
+                                if ( 'on' == $val )
+                                        $allowedthemes[$theme] = true;
+                        }
+                }
+                update_option( 'allowedthemes',  $allowedthemes );
+
+                // options
+                if ( is_array( $_POST['option'] ) ) {
+                        $c = 1;
+                        $count = count( $_POST['option'] );
+                        $skip_options = array( 'allowedthemes' ); // Don't update these options since they are handled elsewhere in the form.
+                        foreach ( (array) $_POST['option'] as $key =&gt; $val ) {
+                                if ( $key === 0 || is_array( $val ) || in_array($key, $skip_options) )
+                                        continue; // Avoids &quot;0 is a protected WP option and may not be modified&quot; error when edit blog options
+                                if ( $c == $count )
+                                        update_option( $key, stripslashes( $val ) );
+                                else
+                                        update_option( $key, stripslashes( $val ), false ); // no need to refresh blog details yet
+                                $c++;
+                        }
+                }
+
+                // home and siteurl
+                if ( isset( $_POST['update_home_url'] ) &amp;&amp; $_POST['update_home_url'] == 'update' ) {
+                        $blog_address = get_blogaddress_by_domain( $_POST['blog']['domain'], $_POST['blog']['path'] );
+                        if ( get_option( 'siteurl' ) !=  $blog_address )
+                                update_option( 'siteurl', $blog_address );
+
+                        if ( get_option( 'home' ) != $blog_address )
+                                update_option( 'home', $blog_address );
+                }
+
+                // rewrite rules can't be flushed during switch to blog
+                delete_option( 'rewrite_rules' );
+
+                // update blogs table
+                $blog_data = stripslashes_deep( $_POST['blog'] );
+                update_blog_details( $id, $blog_data );
+
+                // get blog prefix
+                $blog_prefix = $wpdb-&gt;get_blog_prefix( $id );
+
+                // user roles
+                if ( isset( $_POST['role'] ) &amp;&amp; is_array( $_POST['role'] ) == true ) {
+                        $newroles = $_POST['role'];
+
+                        reset( $newroles );
+                        foreach ( (array) $newroles as $userid =&gt; $role ) {
+                                $user = new WP_User( $userid );
+                                if ( empty( $user-&gt;ID ) )
+                                        continue;
+                                $user-&gt;for_blog( $id );
+                                $user-&gt;set_role( $role );
+                        }
+                }
+
+                // remove user
+                if ( isset( $_POST['blogusers'] ) &amp;&amp; is_array( $_POST['blogusers'] ) ) {
+                        reset( $_POST['blogusers'] );
+                        foreach ( (array) $_POST['blogusers'] as $key =&gt; $val )
+                                remove_user_from_blog( $key, $id );
+                }
+
+                // change password
+                if ( isset( $_POST['user_password'] ) &amp;&amp; is_array( $_POST['user_password'] ) ) {
+                        reset( $_POST['user_password'] );
+                        $newroles = $_POST['role'];
+                        foreach ( (array) $_POST['user_password'] as $userid =&gt; $pass ) {
+                                unset( $_POST['role'] );
+                                $_POST['role'] = $newroles[ $userid ];
+                                if ( $pass != '' ) {
+                                        $cap = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT meta_value FROM {$wpdb-&gt;usermeta} WHERE user_id = %d AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'&quot;, $userid ) );
+                                        $userdata = get_userdata($userid);
+                                        $_POST['pass1'] = $_POST['pass2'] = $pass;
+                                        $_POST['email'] = $userdata-&gt;user_email;
+                                        $_POST['rich_editing'] = $userdata-&gt;rich_editing;
+                                        edit_user( $userid );
+                                        if ( $cap == null )
+                                                $wpdb-&gt;query( $wpdb-&gt;prepare( &quot;DELETE FROM {$wpdb-&gt;usermeta} WHERE user_id = %d AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'&quot;, $userid ) );
+                                }
+                        }
+                        unset( $_POST['role'] );
+                        $_POST['role'] = $newroles;
+                }
+
+                // add user
+                if ( !empty( $_POST['newuser'] ) ) {
+                        $newuser = $_POST['newuser'];
+                        $userid = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT ID FROM &quot; . $wpdb-&gt;users . &quot; WHERE user_login = %s&quot;, $newuser ) );
+                        if ( $userid ) {
+                                $user = $wpdb-&gt;get_var( &quot;SELECT user_id FROM &quot; . $wpdb-&gt;usermeta . &quot; WHERE user_id='$userid' AND meta_key='{$blog_prefix}capabilities'&quot; );
+                                if ( $user == false )
+                                        add_user_to_blog( $id, $userid, $_POST['new_role'] );
+                        }
+                }
+                do_action( 'wpmu_update_blog_options' );
+                restore_current_blog();
+                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'editblog', 'id' =&gt; $id ), wp_get_referer() ) );
+        break;
+
+        case 'deleteblog':
+                check_admin_referer('deleteblog');
+                if ( ! current_user_can( 'manage_sites' ) )
+                        wp_die( __( 'You do not have permission to access this page.' ) );
+
+                if ( $id != '0' &amp;&amp; $id != $current_site-&gt;blog_id )
+                        wpmu_delete_blog( $id, true );
+
+                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'delete' ), wp_get_referer() ) );
+                exit();
+        break;
+
+        case 'allblogs':
+                if ( isset( $_POST['doaction']) || isset($_POST['doaction2'] ) ) {
+                        check_admin_referer( 'bulk-ms-sites', '_wpnonce_bulk-ms-sites' );
+
+                        if ( ! current_user_can( 'manage_sites' ) )
+                                wp_die( __( 'You do not have permission to access this page.' ) );
+
+                        if ( $_GET['action'] != -1 || $_POST['action2'] != -1 )
+                                $doaction = $_POST['action'] != -1 ? $_POST['action'] : $_POST['action2'];
+
+
+                        foreach ( (array) $_POST['allblogs'] as $key =&gt; $val ) {
+                                if ( $val != '0' &amp;&amp; $val != $current_site-&gt;blog_id ) {
+                                        switch ( $doaction ) {
+                                                case 'delete':
+                                                        $blogfunction = 'all_delete';
+                                                        wpmu_delete_blog( $val, true );
+                                                break;
+
+                                                case 'spam':
+                                                        $blogfunction = 'all_spam';
+                                                        update_blog_status( $val, 'spam', '1', 0 );
+                                                        set_time_limit( 60 );
+                                                break;
+
+                                                case 'notspam':
+                                                        $blogfunction = 'all_notspam';
+                                                        update_blog_status( $val, 'spam', '0', 0 );
+                                                        set_time_limit( 60 );
+                                                break;
+                                        }
+                                } else {
+                                        wp_die( __( 'You are not allowed to change the current site.' ) );
+                                }
+                        }
+
+                        wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; $blogfunction ), wp_get_referer() ) );
+                        exit();
+                } else {
+                        wp_redirect( admin_url( 'ms-sites.php' ) );
+                }
+        break;
+
+        case 'archiveblog':
+                check_admin_referer( 'archiveblog' );
+                if ( ! current_user_can( 'manage_sites' ) )
+                        wp_die( __( 'You do not have permission to access this page.' ) );
+
+                update_blog_status( $id, 'archived', '1' );
+                do_action( 'archive_blog', $id );
+                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'archive' ), wp_get_referer() ) );
+                exit();
+        break;
+
+        case 'unarchiveblog':
+                check_admin_referer( 'unarchiveblog' );
+                if ( ! current_user_can( 'manage_sites' ) )
+                        wp_die( __( 'You do not have permission to access this page.' ) );
+
+                do_action( 'unarchive_blog', $id );
+                update_blog_status( $id, 'archived', '0' );
+                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'unarchive' ), wp_get_referer() ) );
+                exit();
+        break;
+
+        case 'activateblog':
+                check_admin_referer( 'activateblog' );
+                if ( ! current_user_can( 'manage_sites' ) )
+                        wp_die( __( 'You do not have permission to access this page.' ) );
+
+                update_blog_status( $id, 'deleted', '0' );
+                do_action( 'activate_blog', $id );
+                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'activate' ), wp_get_referer() ) );
+                exit();
+        break;
+
+        case 'deactivateblog':
+                check_admin_referer( 'deactivateblog' );
+                if ( ! current_user_can( 'manage_sites' ) )
+                        wp_die( __( 'You do not have permission to access this page.' ) );
+
+                do_action( 'deactivate_blog', $id );
+                update_blog_status( $id, 'deleted', '1' );
+                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'deactivate' ), wp_get_referer() ) );
+                exit();
+        break;
+
+        case 'unspamblog':
+                check_admin_referer( 'unspamblog' );
+                if ( ! current_user_can( 'manage_sites' ) )
+                        wp_die( __( 'You do not have permission to access this page.' ) );
+
+                update_blog_status( $id, 'spam', '0' );
+                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'unspam' ), wp_get_referer() ) );
+                exit();
+        break;
+
+        case 'spamblog':
+                check_admin_referer( 'spamblog' );
+                if ( ! current_user_can( 'manage_sites' ) )
+                        wp_die( __( 'You do not have permission to access this page.' ) );
+
+                update_blog_status( $id, 'spam', '1' );
+                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'spam' ), wp_get_referer() ) );
+                exit();
+        break;
+
+        // Themes
+    case 'updatethemes':
+        if ( ! current_user_can( 'manage_network_themes' ) )
+                wp_die( __( 'You do not have permission to access this page.' ) );
+
+            if ( is_array( $_POST['theme'] ) ) {
+                        $themes = get_themes();
+                        reset( $themes );
+                        $allowed_themes = array();
+                        foreach ( (array) $themes as $key =&gt; $theme ) {
+                                if ( $_POST['theme'][ esc_html( $theme['Stylesheet'] ) ] == 'enabled' )
+                                        $allowed_themes[ esc_html( $theme['Stylesheet'] ) ] = true;
+                        }
+                        update_site_option( 'allowedthemes', $allowed_themes );
+                }
+                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'themes' ),  wp_get_referer() ) );
+                exit();
+        break;
+
+        // Common
+        case 'confirm':
+                if ( !headers_sent() ) {
+                        nocache_headers();
+                        header( 'Content-Type: text/html; charset=utf-8' );
+                }
+                if ( $current_site-&gt;blog_id == $id )
+                        wp_die( __( 'You are not allowed to change the current site.' ) );
+                ?&gt;
+                &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
+                &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &lt;?php if ( function_exists( 'language_attributes' ) ) language_attributes(); ?&gt;&gt;
+                        &lt;head&gt;
+                                &lt;title&gt;&lt;?php _e( 'WordPress &amp;rsaquo; Confirm your action' ); ?&gt;&lt;/title&gt;
+
+                                &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
+                                &lt;?php
+                                wp_admin_css( 'install', true );
+                                wp_admin_css( 'ie', true );
+                                ?&gt;
+                        &lt;/head&gt;
+                        &lt;body&gt;
+                                &lt;h1 id=&quot;logo&quot;&gt;&lt;img alt=&quot;WordPress&quot; src=&quot;&lt;?php echo esc_attr( admin_url( 'images/wordpress-logo.png' ) ); ?&gt;&quot; /&gt;&lt;/h1&gt;
+                                &lt;form action=&quot;ms-edit.php?action=&lt;?php echo esc_attr( $_GET['action2'] ) ?&gt;&quot; method=&quot;post&quot;&gt;
+                                        &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;&lt;?php echo esc_attr( $_GET['action2'] ) ?&gt;&quot; /&gt;
+                                        &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;&lt;?php echo esc_attr( $id ); ?&gt;&quot; /&gt;
+                                        &lt;input type=&quot;hidden&quot; name=&quot;_wp_http_referer&quot; value=&quot;&lt;?php echo esc_attr( wp_get_referer() ); ?&gt;&quot; /&gt;
+                                        &lt;?php wp_nonce_field( $_GET['action2'], '_wpnonce', false ); ?&gt;
+                                        &lt;p&gt;&lt;?php echo esc_html( stripslashes( $_GET['msg'] ) ); ?&gt;&lt;/p&gt;
+                                        &lt;p class=&quot;submit&quot;&gt;&lt;input class=&quot;button&quot; type=&quot;submit&quot; value=&quot;&lt;?php _e( 'Confirm' ); ?&gt;&quot; /&gt;&lt;/p&gt;
+                                &lt;/form&gt;
+                        &lt;/body&gt;
+                &lt;/html&gt;
+                &lt;?php
+        break;
+
+        // Users
+        case 'deleteuser':
+                if ( ! current_user_can( 'manage_network_users' ) )
+                        wp_die( __( 'You do not have permission to access this page.' ) );
+
+                check_admin_referer( 'deleteuser' );
+
+                if ( $id != '0' &amp;&amp; $id != '1' ) {
+                        $_POST['allusers'] = array( $id ); // confirm_delete_users() can only handle with arrays
+                        $title = __( 'Users' );
+                        $parent_file = 'ms-admin.php';
+                        require_once( 'admin-header.php' );
+                        echo '&lt;div class=&quot;wrap&quot;&gt;';
+                        confirm_delete_users( $_POST['allusers'] );
+                        echo '&lt;/div&gt;';
+            require_once( 'admin-footer.php' );
+            exit();
+                } else {
+                        wp_redirect( admin_url( 'ms-users.php' ) );
+                }
+        break;
+
+        case 'allusers':
+                if ( ! current_user_can( 'manage_network_users' ) )
+                        wp_die( __( 'You do not have permission to access this page.' ) );
+
+                if ( isset( $_POST['doaction']) || isset($_POST['doaction2'] ) ) {
+                        check_admin_referer( 'bulk-ms-users', '_wpnonce_bulk-ms-users' );
+
+                        if ( $_GET['action'] != -1 || $_POST['action2'] != -1 )
+                                $doaction = $_POST['action'] != -1 ? $_POST['action'] : $_POST['action2'];
+
+                        foreach ( (array) $_POST['allusers'] as $key =&gt; $val ) {
+                                if ( !empty( $val ) ) {
+                                        switch ( $doaction ) {
+                                                case 'delete':
+                                                        $title = __( 'Users' );
+                                                        $parent_file = 'ms-admin.php';
+                                                        require_once( 'admin-header.php' );
+                                                        echo '&lt;div class=&quot;wrap&quot;&gt;';
+                                                        confirm_delete_users( $_POST['allusers'] );
+                                                        echo '&lt;/div&gt;';
+                                            require_once( 'admin-footer.php' );
+                                            exit();
+                                               break;
+
+                                                case 'spam':
+                                                        $user = new WP_User( $val );
+                                                        if ( in_array( $user-&gt;user_login, get_super_admins() ) )
+                                                                wp_die( sprintf( __( 'Warning! User cannot be modified. The user %s is a network administrator.' ), esc_html( $user-&gt;user_login ) ) );
+
+                                                        $userfunction = 'all_spam';
+                                                        $blogs = get_blogs_of_user( $val, true );
+                                                        foreach ( (array) $blogs as $key =&gt; $details ) {
+                                                                if ( $details-&gt;userblog_id != $current_site-&gt;blog_id ) // main blog not a spam !
+                                                                        update_blog_status( $details-&gt;userblog_id, 'spam', '1' );
+                                                        }
+                                                        update_user_status( $val, 'spam', '1', 1 );
+                                                break;
+
+                                                case 'notspam':
+                                                        $userfunction = 'all_notspam';
+                                                        $blogs = get_blogs_of_user( $val, true );
+                                                        foreach ( (array) $blogs as $key =&gt; $details )
+                                                                update_blog_status( $details-&gt;userblog_id, 'spam', '0' );
+
+                                                        update_user_status( $val, 'spam', '0', 1 );
+                                                break;
+                                        }
+                                }
+                        }
+
+                        wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; $userfunction ), wp_get_referer() ) );
+                        exit();
+                } else {
+                        wp_redirect( admin_url( 'ms-users.php' ) );
+                }
+        break;
+
+        case 'dodelete':
+                check_admin_referer( 'ms-users-delete' );
+                if ( ! current_user_can( 'manage_network_users' ) )
+                        wp_die( __( 'You do not have permission to access this page.' ) );
+
+                if ( ! empty( $_POST['blog'] ) &amp;&amp; is_array( $_POST['blog'] ) ) {
+                        foreach ( $_POST['blog'] as $id =&gt; $users ) {
+                                foreach ( $users as $blogid =&gt; $user_id ) {
+                                        if ( ! empty( $_POST['delete'] ) &amp;&amp; 'reassign' == $_POST['delete'][$blogid][$id] )
+                                                remove_user_from_blog( $id, $blogid, $user_id );
+                                        else
+                                                remove_user_from_blog( $id, $blogid );
+                                }
+                        }
+                }
+                $i = 0;
+                if ( is_array( $_POST['user'] ) &amp;&amp; ! empty( $_POST['user'] ) )
+                        foreach( $_POST['user'] as $id ) {
+                                wpmu_delete_user( $id );
+                                $i++;
+                        }
+
+                if ( $i == 1 )
+                        $deletefunction = 'delete';
+                else
+                        $deletefunction = 'all_delete';
+
+                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; $deletefunction ), admin_url( 'ms-users.php' ) ) );
+        break;
+
+        case 'adduser':
+                check_admin_referer( 'add-user', '_wpnonce_add-user' );
+                if ( ! current_user_can( 'manage_network_users' ) )
+                        wp_die( __( 'You do not have permission to access this page.' ) );
+
+                if ( is_array( $_POST['user'] ) == false )
+                        wp_die( __( 'Cannot create an empty user.' ) );
+                $user = $_POST['user'];
+                if ( empty($user['username']) &amp;&amp; empty($user['email']) )
+                        wp_die( __( 'Missing username and email.' ) );
+                elseif ( empty($user['username']) )
+                        wp_die( __( 'Missing username.' ) );
+                elseif ( empty($user['email']) )
+                        wp_die( __( 'Missing email.' ) );
+
+                $password = wp_generate_password();
+                $user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );
+
+                if ( false == $user_id )
+                         wp_die( __( 'Duplicated username or email address.' ) );
+                else
+                        wp_new_user_notification( $user_id, $password );
+
+                if ( get_site_option( 'dashboard_blog' ) == false )
+                        add_user_to_blog( $current_site-&gt;blog_id, $user_id, get_site_option( 'default_user_role', 'subscriber' ) );
+                else
+                        add_user_to_blog( get_site_option( 'dashboard_blog' ), $user_id, get_site_option( 'default_user_role', 'subscriber' ) );
+
+                wp_redirect( add_query_arg( array( 'updated' =&gt; 'true', 'action' =&gt; 'add' ), wp_get_referer() ) );
+                exit();
+        break;
+
+        default:
+                wp_redirect( admin_url( 'ms-admin.php' ) );
+        break;
+}
+?&gt;
</ins></span></pre></div>
<a id="trunkwpadminnetworkindexphpfromrev15473trunkwpadminmsadminphp"></a>
<div class="copfile"><h4>Copied: trunk/wp-admin/network/index.php (from rev 15473, trunk/wp-admin/ms-admin.php) (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/index.php                                (rev 0)
+++ trunk/wp-admin/network/index.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+&lt;?php
+/**
+ * Multisite administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( './admin.php' );
+
+if ( !is_multisite() )
+        wp_die( __( 'Multisite support is not enabled.' ) );
+
+if ( ! current_user_can( 'manage_network' ) )
+        wp_die( __( 'You do not have permission to access this page.' ) );
+
+$title = __( 'Network Admin' );
+$parent_file = 'index.php';
+
+add_contextual_help($current_screen,
+        '&lt;p&gt;' . __('Until WordPress 3.0, running multiple sites required using WordPress MU instead of regular WordPress. In version 3.0, these applications have merged. If you are a former MU user, you should be aware of the following changes:') . '&lt;/p&gt;' .
+        '&lt;ul&gt;&lt;li&gt;' . __('Site Admin is now Super Admin (we highly encourage you to get yourself a cape!).') . '&lt;/li&gt;' .
+        '&lt;li&gt;' . __('Blogs are now called Sites; Site is now called Network.') . '&lt;/li&gt;&lt;/ul&gt;' .
+        '&lt;p&gt;' . __('This screen provides the network administrator with links to the screens for Sites and Users to either create a new site or user, or to search existing users and sites. Those screens are also accessible through the left-hand navigation in the Super Admin section.') . '&lt;/p&gt;' .
+        '&lt;p&gt;&lt;strong&gt;' . __('For more information:') . '&lt;/strong&gt;&lt;/p&gt;' .
+        '&lt;p&gt;' . __('&lt;a href=&quot;http://codex.wordpress.org/Super_Admin_Super_Admin_Menu&quot; target=&quot;_blank&quot;&gt;Documentation on Super Admin Menu&lt;/a&gt;') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('&lt;a href=&quot;http://wordpress.org/support/&quot; target=&quot;_blank&quot;&gt;Support Forums&lt;/a&gt;') . '&lt;/p&gt;'
+);
+
+require_once( '../admin-header.php' );
+
+$c_users = get_user_count();
+$c_blogs = get_blog_count();
+
+$user_text = sprintf( _n( '%s user', '%s users', $c_users ), number_format_i18n( $c_users ) );
+$blog_text = sprintf( _n( '%s site', '%s sites', $c_blogs ), number_format_i18n( $c_blogs ) );
+
+$sentence = sprintf( __( 'You have %1$s and %2$s.' ), $blog_text, $user_text );
+?&gt;
+
+&lt;div class=&quot;wrap&quot;&gt;
+        &lt;?php screen_icon(); ?&gt;
+        &lt;h2&gt;&lt;?php echo esc_html( $title ); ?&gt;&lt;/h2&gt;
+
+        &lt;ul class=&quot;subsubsub&quot;&gt;
+        &lt;li&gt;&lt;a href=&quot;sites.php#form-add-site&quot;&gt;&lt;?php _e( 'Create a New Site' ); ?&gt;&lt;/a&gt; |&lt;/li&gt;
+        &lt;li&gt;&lt;a href=&quot;users.php#form-add-user&quot;&gt;&lt;?php _e( 'Create a New User' ); ?&gt;&lt;/a&gt;&lt;/li&gt;
+        &lt;/ul&gt;
+        &lt;br class=&quot;clear&quot; /&gt;
+
+        &lt;p class=&quot;youhave&quot;&gt;&lt;?php echo $sentence; ?&gt;&lt;/p&gt;
+        &lt;?php do_action( 'wpmuadminresult', '' ); ?&gt;
+
+        &lt;form name=&quot;searchform&quot; action=&quot;users.php&quot; method=&quot;get&quot;&gt;
+                &lt;p&gt;
+                        &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;users&quot; /&gt;
+                        &lt;input type=&quot;text&quot; name=&quot;s&quot; value=&quot;&quot; size=&quot;17&quot; /&gt;
+                        &lt;input class=&quot;button&quot; type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e( 'Search Users' ); ?&gt;&quot; /&gt;
+                &lt;/p&gt;
+        &lt;/form&gt;
+
+        &lt;form name=&quot;searchform&quot; action=&quot;sites.php&quot; method=&quot;get&quot;&gt;
+                &lt;p&gt;
+                        &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;blogs&quot; /&gt;
+                        &lt;input type=&quot;hidden&quot; name=&quot;searchaction&quot; value=&quot;name&quot; /&gt;
+                        &lt;input type=&quot;text&quot; name=&quot;s&quot; value=&quot;&quot; size=&quot;17&quot; /&gt;
+                        &lt;input class=&quot;button&quot; type=&quot;submit&quot; name=&quot;blog_name&quot; value=&quot;&lt;?php esc_attr_e( 'Search Sites' ); ?&gt;&quot; /&gt;
+                &lt;/p&gt;
+        &lt;/form&gt;
+
+        &lt;?php do_action( 'mu_rightnow_end' ); ?&gt;
+        &lt;?php do_action( 'mu_activity_box_end' ); ?&gt;
+&lt;/div&gt;
+
+&lt;?php include( '../admin-footer.php' ); ?&gt;
</ins></span></pre></div>
<a id="trunkwpadminnetworkmenuphp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/network/menu.php (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/menu.php                                (rev 0)
+++ trunk/wp-admin/network/menu.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;?php
+
+/* translators: Network menu item */
+$menu[0] = array(__('Dashboard'), 'manage_network', 'index.php', '', 'menu-top menu-top-first menu-icon-site', 'menu-site', 'div');
+
+$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
+
+/* translators: Sites menu item */
+$menu[5] = array(__('Sites'), 'manage_sites', 'sites.php', '', 'menu-top menu-icon-site', 'menu-site', 'div');
+$menu[10] = array(__('Users'), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'div');
+$menu[15] = array(__('Themes'), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div');
+$menu[20] = array(__('Plugins'), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'div');
+$menu[25] = array(__('Settings'), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'div');
+$menu[30] = array(__('Update'), 'manage_network', 'upgrade.php', '', 'menu-top menu-icon-tools', 'menu-update', 'div');
+
+$menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator-last' );
+
+$compat = array();
+$submenu = array();
+
+require(ABSPATH . 'wp-admin/includes/menu.php');
+
+?&gt;
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-admin/network/menu.php
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:eol-style
</span><span class="cx">   + native
</span></span></pre></div>
<a id="trunkwpadminnetworkpluginsphp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/network/plugins.php (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/plugins.php                                (rev 0)
+++ trunk/wp-admin/network/plugins.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+&lt;?php
+
+require_once( './admin.php' );
+
+require( '../plugins.php' );
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-admin/network/plugins.php
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:eol-style
</span><span class="cx">   + native
</span></span></pre></div>
<a id="trunkwpadminnetworkprofilephp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/network/profile.php (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/profile.php                                (rev 0)
+++ trunk/wp-admin/network/profile.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+&lt;?php
+
+require_once( './admin.php' );
+
+require( '../profile.php' );
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-admin/network/profile.php
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:eol-style
</span><span class="cx">   + native
</span></span></pre></div>
<a id="trunkwpadminnetworksettingsphpfromrev15473trunkwpadminmsoptionsphp"></a>
<div class="copfile"><h4>Copied: trunk/wp-admin/network/settings.php (from rev 15473, trunk/wp-admin/ms-options.php) (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/settings.php                                (rev 0)
+++ trunk/wp-admin/network/settings.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,318 @@
</span><ins>+&lt;?php
+/**
+ * Multisite network settings administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+        wp_die( __( 'Multisite support is not enabled.' ) );
+
+if ( ! current_user_can( 'manage_network_options' ) )
+        wp_die( __( 'You do not have permission to access this page.' ) );
+
+$title = __( 'Network Options' );
+$parent_file = 'settings.php';
+
+add_contextual_help($current_screen,
+        '&lt;p&gt;' . __('This screen sets and changes options for the network as a whole. The first site is the main site in the network and network options are pulled from that original site&amp;#8217;s options.') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('Operational settings has fields for the network&amp;#8217;s name and admin email.') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('Dashboard Site is an option to give a site to users who do not have a site on the system. Their default role is Subscriber, but that default can be changed. The Admin Notice Feed can provide a notice on all dashboards of the latest post via RSS or Atom, or provide no such notice if left blank.') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('Registration settings can disable/enable public signups. If you let others sign up for a site, install spam plugins. Spaces, not commas, should separate names banned as sites for this network.') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('New site settings are defaults applied when a new site is created in the network. These include welcome email for when a new site or user account is registered, and what&amp;#8127;s put in the first post, page, comment, comment author, and comment URL.') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('Upload settings control the size of the uploaded files and the amount of available upload space for each site. You can change the default value for specific sites when you edit a particular site. Allowed file types are also listed (space separated only).') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('Checkboxes for media upload buttons set which are shown in the visual editor. If unchecked, a generic upload button is still visible; other media types can still be uploaded if on the allowed file types list.') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('Menu setting enables/disables the plugin menus from appearing for non super admins, so that only super admins, not site admins, have access to activate plugins.') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('Super admins can no longer be added on the Options screen. You must now go to the list of existing users on Super Admin &gt; Users and click on Username or the Edit action link below that name. This goes to an Edit User page where you can check a box to grant super admin privileges.') . '&lt;/p&gt;' .
+        '&lt;p&gt;&lt;strong&gt;' . __('For more information:') . '&lt;/strong&gt;&lt;/p&gt;' .
+        '&lt;p&gt;' . __('&lt;a href=&quot;http://codex.wordpress.org/Super_Admin_Options_SubPanel&quot; target=&quot;_blank&quot;&gt;Network Options Documentation&lt;/a&gt;') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('&lt;a href=&quot;http://wordpress.org/support/&quot; target=&quot;_blank&quot;&gt;Support Forums&lt;/a&gt;') . '&lt;/p&gt;'
+);
+
+include( '../admin-header.php' );
+
+if (isset($_GET['updated'])) {
+        ?&gt;
+        &lt;div id=&quot;message&quot; class=&quot;updated&quot;&gt;&lt;p&gt;&lt;?php _e( 'Options saved.' ) ?&gt;&lt;/p&gt;&lt;/div&gt;
+        &lt;?php
+}
+?&gt;
+
+&lt;div class=&quot;wrap&quot;&gt;
+        &lt;?php screen_icon(); ?&gt;
+        &lt;h2&gt;&lt;?php _e( 'Network Options' ) ?&gt;&lt;/h2&gt;
+        &lt;form method=&quot;post&quot; action=&quot;edit.php?action=siteoptions&quot;&gt;
+                &lt;?php wp_nonce_field( 'siteoptions' ); ?&gt;
+                &lt;h3&gt;&lt;?php _e( 'Operational Settings' ); ?&gt;&lt;/h3&gt;
+                &lt;table class=&quot;form-table&quot;&gt;
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;site_name&quot;&gt;&lt;?php _e( 'Network Name' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
+                                &lt;td&gt;
+                                        &lt;input name=&quot;site_name&quot; type=&quot;text&quot; id=&quot;site_name&quot; class=&quot;regular-text&quot; value=&quot;&lt;?php echo esc_attr( $current_site-&gt;site_name ) ?&gt;&quot; /&gt;
+                                        &lt;br /&gt;
+                                        &lt;?php _e( 'What you would like to call this website.' ) ?&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;admin_email&quot;&gt;&lt;?php _e( 'Network Admin Email' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
+                                &lt;td&gt;
+                                        &lt;input name=&quot;admin_email&quot; type=&quot;text&quot; id=&quot;admin_email&quot; class=&quot;regular-text&quot; value=&quot;&lt;?php echo esc_attr( get_site_option('admin_email') ) ?&gt;&quot; /&gt;
+                                        &lt;br /&gt;
+                                        &lt;?php printf( __( 'Registration and support emails will come from this address. An address such as &lt;code&gt;support@%s&lt;/code&gt; is recommended.' ), $current_site-&gt;domain ); ?&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+                &lt;/table&gt;
+                &lt;h3&gt;&lt;?php _e( 'Dashboard Settings' ); ?&gt;&lt;/h3&gt;
+                &lt;table class=&quot;form-table&quot;&gt;
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;dashboard_blog&quot;&gt;&lt;?php _e( 'Dashboard Site' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
+                                &lt;td&gt;
+                                        &lt;?php
+                                        if ( $dashboard_blog = get_site_option( 'dashboard_blog' ) ) {
+                                                $details = get_blog_details( $dashboard_blog );
+                                                $blogname = untrailingslashit( sanitize_user( str_replace( '.', '', str_replace( $current_site-&gt;domain . $current_site-&gt;path, '', $details-&gt;domain . $details-&gt;path ) ) ) );
+                                        } else {
+                                                $blogname = '';
+                                        }?&gt;
+                                        &lt;input name=&quot;dashboard_blog_orig&quot; type=&quot;hidden&quot; id=&quot;dashboard_blog_orig&quot; value=&quot;&lt;?php echo esc_attr( $blogname ); ?&gt;&quot; /&gt;
+                                        &lt;input name=&quot;dashboard_blog&quot; type=&quot;text&quot; id=&quot;dashboard_blog&quot; value=&quot;&lt;?php echo esc_attr( $blogname ); ?&gt;&quot; class=&quot;regular-text&quot; /&gt;
+                                        &lt;br /&gt;
+                                        &lt;?php _e( 'Site path (&amp;#8220;dashboard&amp;#8221;, &amp;#8220;control&amp;#8221;, &amp;#8220;manager&amp;#8221;, etc.) or blog ID.&lt;br /&gt;New users are added to this site as the user role defined below if they don&amp;#8217;t have a site. Leave blank for the main site. Users with the Subscriber role on the old site will be moved to the new site if changed. The new site will be created if it does not exist.' ); ?&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;default_user_role&quot;&gt;&lt;?php _e( 'Dashboard User Default Role' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
+                                &lt;td&gt;
+                                        &lt;select name=&quot;default_user_role&quot; id=&quot;default_user_role&quot;&gt;&lt;?php
+                                        wp_dropdown_roles( get_site_option( 'default_user_role', 'subscriber' ) );
+                                        ?&gt;
+                                        &lt;/select&gt;
+                                        &lt;br /&gt;
+                                        &lt;?php _e( 'The default role for new users on the Dashboard site. &amp;#8220;Subscriber&amp;#8221; or &amp;#8220;Contributor&amp;#8221; roles are recommended.' ); ?&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;admin_notice_feed&quot;&gt;&lt;?php _e( 'Admin Notice Feed' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
+                                &lt;td&gt;&lt;input name=&quot;admin_notice_feed&quot; class=&quot;large-text&quot; type=&quot;text&quot; id=&quot;admin_notice_feed&quot; value=&quot;&lt;?php echo esc_attr( get_site_option( 'admin_notice_feed' ) ) ?&gt;&quot; size=&quot;80&quot; /&gt;&lt;br /&gt;
+                                &lt;?php _e( 'Display the latest post from this RSS or Atom feed on all site dashboards. Leave blank to disable.' ); ?&gt;&lt;br /&gt;
+
+                                &lt;?php if ( get_site_option( 'admin_notice_feed' ) != get_home_url( $current_site-&gt;id, 'feed/' ) )
+                                        echo __( 'A good one to use would be the feed from your main site: ' ) . esc_url( get_home_url( $current_site-&gt;id, 'feed/' ) ) ?&gt;&lt;/td&gt;
+                        &lt;/tr&gt;
+                &lt;/table&gt;
+                &lt;h3&gt;&lt;?php _e( 'Registration Settings' ); ?&gt;&lt;/h3&gt;
+                &lt;table class=&quot;form-table&quot;&gt;
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Allow new registrations' ) ?&gt;&lt;/th&gt;
+                                &lt;?php
+                                if ( !get_site_option( 'registration' ) )
+                                        update_site_option( 'registration', 'none' );
+                                $reg = get_site_option( 'registration' );
+                                ?&gt;
+                                &lt;td&gt;
+                                        &lt;label&gt;&lt;input name=&quot;registration&quot; type=&quot;radio&quot; id=&quot;registration1&quot; value=&quot;none&quot;&lt;?php checked( $reg, 'none') ?&gt; /&gt; &lt;?php _e( 'Registration is disabled.' ); ?&gt;&lt;/label&gt;&lt;br /&gt;
+                                        &lt;label&gt;&lt;input name=&quot;registration&quot; type=&quot;radio&quot; id=&quot;registration2&quot; value=&quot;user&quot;&lt;?php checked( $reg, 'user') ?&gt; /&gt; &lt;?php _e( 'User accounts may be registered.' ); ?&gt;&lt;/label&gt;&lt;br /&gt;
+                                        &lt;label&gt;&lt;input name=&quot;registration&quot; type=&quot;radio&quot; id=&quot;registration3&quot; value=&quot;blog&quot;&lt;?php checked( $reg, 'blog') ?&gt; /&gt; &lt;?php _e( 'Logged in users may register new sites.' ); ?&gt;&lt;/label&gt;&lt;br /&gt;
+                                        &lt;label&gt;&lt;input name=&quot;registration&quot; type=&quot;radio&quot; id=&quot;registration4&quot; value=&quot;all&quot;&lt;?php checked( $reg, 'all') ?&gt; /&gt; &lt;?php _e( 'Both sites and user accounts can be registered.' ); ?&gt;&lt;/label&gt;&lt;br /&gt;
+                                        &lt;p&gt;&lt;?php _e( 'Disable or enable registration and who or what can be registered. (Default is disabled.)' ); ?&gt;&lt;/p&gt;
+                                        &lt;?php if ( is_subdomain_install() ) {
+                                                echo '&lt;p&gt;' . __( 'If registration is disabled, please set &lt;code&gt;NOBLOGREDIRECT&lt;/code&gt; in &lt;code&gt;wp-config.php&lt;/code&gt; to a URL you will redirect visitors to if they visit a non-existent site.' ) . '&lt;/p&gt;';
+                                        } ?&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Registration notification' ) ?&gt;&lt;/th&gt;
+                                &lt;?php
+                                if ( !get_site_option( 'registrationnotification' ) )
+                                        update_site_option( 'registrationnotification', 'yes' );
+                                ?&gt;
+                                &lt;td&gt;
+                                        &lt;label&gt;&lt;input name=&quot;registrationnotification&quot; type=&quot;checkbox&quot; id=&quot;registrationnotification&quot; value=&quot;yes&quot;&lt;?php checked( get_site_option( 'registrationnotification' ), 'yes' ) ?&gt; /&gt; &lt;?php _e( 'Send the network admin an email notification every time someone registers a site or user account.' ) ?&gt;&lt;/label&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+
+                        &lt;tr valign=&quot;top&quot; id=&quot;addnewusers&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Add New Users' ) ?&gt;&lt;/th&gt;
+                                &lt;td&gt;
+                                        &lt;label&gt;&lt;input name=&quot;add_new_users&quot; type=&quot;checkbox&quot; id=&quot;add_new_users&quot; value=&quot;1&quot;&lt;?php checked( get_site_option( 'add_new_users' ) ) ?&gt; /&gt; &lt;?php _e( 'Allow site administrators to add new users to their site via the &quot;Users-&gt;Add New&quot; page.' ); ?&gt;&lt;/label&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;illegal_names&quot;&gt;&lt;?php _e( 'Banned Names' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
+                                &lt;td&gt;
+                                        &lt;input name=&quot;illegal_names&quot; type=&quot;text&quot; id=&quot;illegal_names&quot; class=&quot;large-text&quot; value=&quot;&lt;?php echo esc_attr( implode( &quot; &quot;, get_site_option( 'illegal_names' ) ) ); ?&gt;&quot; size=&quot;45&quot; /&gt;
+                                        &lt;br /&gt;
+                                        &lt;?php _e( 'Users are not allowed to register these sites. Separate names by spaces.' ) ?&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;limited_email_domains&quot;&gt;&lt;?php _e( 'Limited Email Registrations' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
+                                &lt;td&gt;
+                                        &lt;?php $limited_email_domains = get_site_option( 'limited_email_domains' );
+                                        $limited_email_domains = str_replace( ' ', &quot;\n&quot;, $limited_email_domains ); ?&gt;
+                                        &lt;textarea name=&quot;limited_email_domains&quot; id=&quot;limited_email_domains&quot; cols=&quot;45&quot; rows=&quot;5&quot;&gt;
+&lt;?php echo wp_htmledit_pre( $limited_email_domains == '' ? '' : implode( &quot;\n&quot;, (array) $limited_email_domains ) ); ?&gt;&lt;/textarea&gt;
+                                        &lt;br /&gt;
+                                        &lt;?php _e( 'If you want to limit site registrations to certain domains. One domain per line.' ) ?&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;banned_email_domains&quot;&gt;&lt;?php _e('Banned Email Domains') ?&gt;&lt;/label&gt;&lt;/th&gt;
+                                &lt;td&gt;
+                                        &lt;textarea name=&quot;banned_email_domains&quot; id=&quot;banned_email_domains&quot; cols=&quot;45&quot; rows=&quot;5&quot;&gt;
+&lt;?php echo wp_htmledit_pre( get_site_option( 'banned_email_domains' ) == '' ? '' : implode( &quot;\n&quot;, (array) get_site_option( 'banned_email_domains' ) ) ); ?&gt;&lt;/textarea&gt;
+                                        &lt;br /&gt;
+                                        &lt;?php _e( 'If you want to ban domains from site registrations. One domain per line.' ) ?&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+
+                &lt;/table&gt;
+                &lt;h3&gt;&lt;?php _e('New Site Settings'); ?&gt;&lt;/h3&gt;
+                &lt;table class=&quot;form-table&quot;&gt;
+
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;welcome_email&quot;&gt;&lt;?php _e( 'Welcome Email' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
+                                &lt;td&gt;
+                                        &lt;textarea name=&quot;welcome_email&quot; id=&quot;welcome_email&quot; rows=&quot;5&quot; cols=&quot;45&quot; class=&quot;large-text&quot;&gt;
+&lt;?php echo wp_htmledit_pre( stripslashes( get_site_option( 'welcome_email' ) ) ) ?&gt;&lt;/textarea&gt;
+                                        &lt;br /&gt;
+                                        &lt;?php _e( 'The welcome email sent to new site owners.' ) ?&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;welcome_user_email&quot;&gt;&lt;?php _e( 'Welcome User Email' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
+                                &lt;td&gt;
+                                        &lt;textarea name=&quot;welcome_user_email&quot; id=&quot;welcome_user_email&quot; rows=&quot;5&quot; cols=&quot;45&quot; class=&quot;large-text&quot;&gt;
+&lt;?php echo wp_htmledit_pre( stripslashes( get_site_option( 'welcome_user_email' ) ) ) ?&gt;&lt;/textarea&gt;
+                                        &lt;br /&gt;
+                                        &lt;?php _e( 'The welcome email sent to new users.' ) ?&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;first_post&quot;&gt;&lt;?php _e( 'First Post' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
+                                &lt;td&gt;
+                                        &lt;textarea name=&quot;first_post&quot; id=&quot;first_post&quot; rows=&quot;5&quot; cols=&quot;45&quot; class=&quot;large-text&quot;&gt;
+&lt;?php echo wp_htmledit_pre( stripslashes( get_site_option( 'first_post' ) ) ) ?&gt;&lt;/textarea&gt;
+                                        &lt;br /&gt;
+                                        &lt;?php _e( 'The first post on a new site.' ) ?&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;first_page&quot;&gt;&lt;?php _e( 'First Page' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
+                                &lt;td&gt;
+                                        &lt;textarea name=&quot;first_page&quot; id=&quot;first_page&quot; rows=&quot;5&quot; cols=&quot;45&quot; class=&quot;large-text&quot;&gt;
+&lt;?php echo wp_htmledit_pre( stripslashes( get_site_option('first_page') ) ) ?&gt;&lt;/textarea&gt;
+                                        &lt;br /&gt;
+                                        &lt;?php _e( 'The first page on a new site.' ) ?&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;first_comment&quot;&gt;&lt;?php _e( 'First Comment' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
+                                &lt;td&gt;
+                                        &lt;textarea name=&quot;first_comment&quot; id=&quot;first_comment&quot; rows=&quot;5&quot; cols=&quot;45&quot; class=&quot;large-text&quot;&gt;
+&lt;?php echo wp_htmledit_pre( stripslashes( get_site_option('first_comment') ) ) ?&gt;&lt;/textarea&gt;
+                                        &lt;br /&gt;
+                                        &lt;?php _e( 'The first comment on a new site.' ) ?&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;first_comment_author&quot;&gt;&lt;?php _e( 'First Comment Author' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
+                                &lt;td&gt;
+                                        &lt;input type=&quot;text&quot; size=&quot;40&quot; name=&quot;first_comment_author&quot; id=&quot;first_comment_author&quot; value=&quot;&lt;?php echo get_site_option('first_comment_author') ?&gt;&quot; /&gt;
+                                        &lt;br /&gt;
+                                        &lt;?php _e( 'The author of the first comment on a new site.' ) ?&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;first_comment_url&quot;&gt;&lt;?php _e( 'First Comment URL' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
+                                &lt;td&gt;
+                                        &lt;input type=&quot;text&quot; size=&quot;40&quot; name=&quot;first_comment_url&quot; id=&quot;first_comment_url&quot; value=&quot;&lt;?php echo esc_attr( get_site_option( 'first_comment_url' ) ) ?&gt;&quot; /&gt;
+                                        &lt;br /&gt;
+                                        &lt;?php _e( 'The URL for the first comment on a new site.' ) ?&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+                &lt;/table&gt;
+                &lt;h3&gt;&lt;?php _e( 'Upload Settings' ); ?&gt;&lt;/h3&gt;
+                &lt;table class=&quot;form-table&quot;&gt;
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Media upload buttons' ) ?&gt;&lt;/th&gt;
+                                &lt;?php $mu_media_buttons = get_site_option( 'mu_media_buttons', array() ); ?&gt;
+                                &lt;td&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; id=&quot;mu_media_buttons_image&quot; name=&quot;mu_media_buttons[image]&quot; value=&quot;1&quot;&lt;?php checked( ! empty( $mu_media_buttons['image'] ) ) ?&gt;/&gt; &lt;?php _e( 'Images' ); ?&gt;&lt;/label&gt;&lt;br /&gt;
+                                &lt;label&gt;&lt;input type=&quot;checkbox&quot; id=&quot;mu_media_buttons_video&quot; name=&quot;mu_media_buttons[video]&quot; value=&quot;1&quot;&lt;?php checked( ! empty( $mu_media_buttons['video'] ) ) ?&gt;/&gt; &lt;?php _e( 'Videos' ); ?&gt;&lt;/label&gt;&lt;br /&gt;
+                                &lt;label&gt;&lt;input type=&quot;checkbox&quot; id=&quot;mu_media_buttons_audio&quot; name=&quot;mu_media_buttons[audio]&quot; value=&quot;1&quot;&lt;?php checked( ! empty( $mu_media_buttons['audio'] ) ) ?&gt;/&gt; &lt;?php _e( 'Music' ); ?&gt;&lt;/label&gt;&lt;br /&gt;
+                                &lt;?php _e( 'The media upload buttons to display on the &amp;#8220;Write Post&amp;#8221; page. Make sure you update the allowed upload file types below as well.' ); ?&gt;&lt;/td&gt;
+                        &lt;/tr&gt;
+
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Site upload space' ) ?&gt;&lt;/th&gt;
+                                &lt;td&gt;
+                                &lt;label&gt;&lt;input type=&quot;checkbox&quot; id=&quot;upload_space_check_disabled&quot; name=&quot;upload_space_check_disabled&quot; value=&quot;0&quot;&lt;?php checked( get_site_option( 'upload_space_check_disabled' ), 0 ) ?&gt;/&gt; &lt;?php printf( __( 'Limit total size of files uploaded to %s MB' ), '&lt;/label&gt;&lt;label&gt;&lt;input name=&quot;blog_upload_space&quot; type=&quot;text&quot; id=&quot;blog_upload_space&quot; value=&quot;' . esc_attr( get_site_option('blog_upload_space', 10) ) . '&quot; size=&quot;3&quot; /&gt;' ); ?&gt;&lt;/label&gt;&lt;br /&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;upload_filetypes&quot;&gt;&lt;?php _e( 'Upload file types' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
+                                &lt;td&gt;&lt;input name=&quot;upload_filetypes&quot; type=&quot;text&quot; id=&quot;upload_filetypes&quot; class=&quot;large-text&quot; value=&quot;&lt;?php echo esc_attr( get_site_option('upload_filetypes', 'jpg jpeg png gif') ) ?&gt;&quot; size=&quot;45&quot; /&gt;&lt;/td&gt;
+                        &lt;/tr&gt;
+
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;label for=&quot;fileupload_maxk&quot;&gt;&lt;?php _e( 'Max upload file size' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
+                                &lt;td&gt;&lt;?php printf( _x( '%s KB', 'File size in kilobytes' ), '&lt;input name=&quot;fileupload_maxk&quot; type=&quot;text&quot; id=&quot;fileupload_maxk&quot; value=&quot;' . esc_attr( get_site_option( 'fileupload_maxk', 300 ) ) . '&quot; size=&quot;5&quot; /&gt;' ); ?&gt;&lt;/td&gt;
+                        &lt;/tr&gt;
+                &lt;/table&gt;
+
+&lt;?php
+                $languages = get_available_languages();
+                if ( ! empty( $languages ) ) {
+                        $lang = get_site_option( 'WPLANG' );
+?&gt;
+                &lt;h3&gt;&lt;?php _e( 'Network Wide Settings' ); ?&gt;&lt;/h3&gt;
+                &lt;div class=&quot;updated inline&quot;&gt;&lt;p&gt;&lt;strong&gt;&lt;?php _e( 'Notice:' ); ?&gt;&lt;/strong&gt; &lt;?php _e( 'These settings may be overridden by site owners.' ); ?&gt;&lt;/p&gt;&lt;/div&gt;
+                &lt;table class=&quot;form-table&quot;&gt;
+                        &lt;?php
+                                ?&gt;
+                                &lt;tr valign=&quot;top&quot;&gt;
+                                        &lt;th&gt;&lt;label for=&quot;WPLANG&quot;&gt;&lt;?php _e( 'Default Language' ) ?&gt;&lt;/label&gt;&lt;/th&gt;
+                                        &lt;td&gt;
+                                                &lt;select name=&quot;WPLANG&quot; id=&quot;WPLANG&quot;&gt;
+                                                        &lt;?php mu_dropdown_languages( $languages, get_site_option( 'WPLANG' ) ); ?&gt;
+                                                &lt;/select&gt;
+                                        &lt;/td&gt;
+                                &lt;/tr&gt;
+                &lt;/table&gt;
+&lt;?php
+                } // languages
+?&gt;
+
+                &lt;h3&gt;&lt;?php _e( 'Menu Settings' ); ?&gt;&lt;/h3&gt;
+                &lt;table id=&quot;menu&quot; class=&quot;form-table&quot;&gt;
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Enable administration menus' ); ?&gt;&lt;/th&gt;
+                                &lt;td&gt;
+                        &lt;?php
+                        $menu_perms = get_site_option( 'menu_items' );
+                        $menu_items = apply_filters( 'mu_menu_items', array( 'plugins' =&gt; __( 'Plugins' ) ) );
+                        foreach ( (array) $menu_items as $key =&gt; $val ) {
+                                echo &quot;&lt;label&gt;&lt;input type='checkbox' name='menu_items[&quot; . $key . &quot;]' value='1'&quot; .  ( isset( $menu_perms[$key] ) ? checked( $menu_perms[$key], '1', false ) : '' ) . &quot; /&gt; &quot; . esc_html( $val ) . &quot;&lt;/label&gt;&lt;br/&gt;&quot;;
+                        }
+                        ?&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+                &lt;/table&gt;
+
+                &lt;?php do_action( 'wpmu_options' ); // Add more options here ?&gt;
+
+                &lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; class=&quot;button-primary&quot; name=&quot;Submit&quot; value=&quot;&lt;?php esc_attr_e( 'Save Changes' ) ?&gt;&quot; /&gt;&lt;/p&gt;
+        &lt;/form&gt;
+&lt;/div&gt;
+
+&lt;?php include( '../admin-footer.php' ); ?&gt;
</ins></span></pre></div>
<a id="trunkwpadminnetworksitesphpfromrev15473trunkwpadminmssitesphp"></a>
<div class="copfile"><h4>Copied: trunk/wp-admin/network/sites.php (from rev 15473, trunk/wp-admin/ms-sites.php) (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/sites.php                                (rev 0)
+++ trunk/wp-admin/network/sites.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,747 @@
</span><ins>+&lt;?php
+/**
+ * Multisite sites administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+        wp_die( __( 'Multisite support is not enabled.' ) );
+
+if ( ! current_user_can( 'manage_sites' ) )
+        wp_die( __( 'You do not have permission to access this page.' ) );
+
+$title = __( 'Sites' );
+$parent_file = 'sites.php';
+
+if ( isset( $_GET['action'] ) &amp;&amp; 'editblog' == $_GET['action'] ) {
+        add_contextual_help($current_screen,
+                '&lt;p&gt;' . __('This extensive list of options has five modules: Site Info, Site Options, allowing Site Themes for this given site, changing user roles and passwords for that site, adding a new user, and Miscellaneous Site Actions (upload size limits).') . '&lt;/p&gt;' .
+                '&lt;p&gt;' . __('Note that some fields in Site Options are grayed out and say Serialized Data. These are stored values in the database which you cannot change from here.') . '&lt;/p&gt;' .
+                '&lt;p&gt;&lt;strong&gt;' . __('For more information:') . '&lt;/strong&gt;&lt;/p&gt;' .
+                '&lt;p&gt;' . __('&lt;a href=&quot;http://codex.wordpress.org/Super_Admin_Sites_Edit_Site&quot; target=&quot;_blank&quot;&gt;Documentation on Editing Sites&lt;/a&gt;') . '&lt;/p&gt;' .
+                '&lt;p&gt;' . __('&lt;a href=&quot;http://wordpress.org/support/&quot; target=&quot;_blank&quot;&gt;Support Forums&lt;/a&gt;') . '&lt;/p&gt;'
+        );
+} else {
+        add_contextual_help($current_screen,
+                '&lt;p&gt;' . __('Add New takes you farther down on this same page. You can search for a site by Name, ID number, or IP address. Screen Options allows you to choose how many sites to display on one page.') . '&lt;/p&gt;' .
+                '&lt;p&gt;' . __('This is the main table of all sites on this network. Switch between list and excerpt views by using the icons above the right side of the table.') . '&lt;/p&gt;' .
+                '&lt;p&gt;' . __('Hovering over each site reveals seven options (three for the primary site):') . '&lt;/p&gt;' .
+                '&lt;ul&gt;&lt;li&gt;' . __('an Edit link to a separate Edit Site screen.') . '&lt;/li&gt;' .
+                '&lt;li&gt;' . __('Backend means the Dashboard for that site.') . '&lt;/li&gt;' .
+                '&lt;li&gt;' . __('Deactivate, Archive, and Spam which lead to confirmation screens. These actions can be reversed later.') . '&lt;/li&gt;' .
+                '&lt;li&gt;' . __('Delete which is a permanent action after the confirmations screen.') . '&lt;/li&gt;' .
+                '&lt;li&gt;' . __('Visit to go to the frontend site live.') . '&lt;/li&gt;&lt;/ul&gt;' .
+                '&lt;p&gt;' . __('The site ID is used internally, and is not shown on the front end of the site or to users/viewers.') . '&lt;/p&gt;' .
+                '&lt;p&gt;' . __('Clicking on bold settings can re-sort this table. The upper right icons switch between list and excerpt views.') . '&lt;/p&gt;' .
+                '&lt;p&gt;' . __(&quot;Clicking on Add Site, after filling out the address, title, and admin's email address, adds the site instantly to the network and this table. You may want to then click on the action link to edit options for that site.&quot;) . '&lt;/p&gt;' .
+                '&lt;p&gt;' . __('If the admin email for the new site does not exist in the database, a new user will also be created.') . '&lt;/p&gt;' .
+                '&lt;p&gt;&lt;strong&gt;' . __('For more information:') . '&lt;/strong&gt;&lt;/p&gt;' .
+                '&lt;p&gt;' . __('&lt;a href=&quot;http://codex.wordpress.org/Super_Admin_Sites_SubPanel&quot; target=&quot;_blank&quot;&gt;Documentation on Sites&lt;/a&gt;') . '&lt;/p&gt;' .
+                '&lt;p&gt;' . __('&lt;a href=&quot;http://wordpress.org/support/&quot; target=&quot;_blank&quot;&gt;Support Forums&lt;/a&gt;') . '&lt;/p&gt;'
+        );
+}
+
+wp_enqueue_script( 'admin-forms' );
+
+require_once( '../admin-header.php' );
+
+$id = isset( $_GET['id'] ) ? intval( $_GET['id'] ) : 0;
+
+if ( isset( $_GET['updated'] ) &amp;&amp; $_GET['updated'] == 'true' &amp;&amp; ! empty( $_GET['action'] ) ) {
+        ?&gt;
+        &lt;div id=&quot;message&quot; class=&quot;updated&quot;&gt;&lt;p&gt;
+                &lt;?php
+                switch ( $_GET['action'] ) {
+                        case 'all_notspam':
+                                _e( 'Sites removed from spam.' );
+                        break;
+                        case 'all_spam':
+                                _e( 'Sites marked as spam.' );
+                        break;
+                        case 'all_delete':
+                                _e( 'Sites deleted.' );
+                        break;
+                        case 'delete':
+                                _e( 'Site deleted.' );
+                        break;
+                        case 'add-blog':
+                                _e( 'Site added.' );
+                        break;
+                        case 'archive':
+                                _e( 'Site archived.' );
+                        break;
+                        case 'unarchive':
+                                _e( 'Site unarchived.' );
+                        break;
+                        case 'activate':
+                                _e( 'Site activated.' );
+                        break;
+                        case 'deactivate':
+                                _e( 'Site deactivated.' );
+                        break;
+                        case 'unspam':
+                                _e( 'Site removed from spam.' );
+                        break;
+                        case 'spam':
+                                _e( 'Site marked as spam.' );
+                        break;
+                        default:
+                                _e( 'Settings saved.' );
+                        break;
+                }
+                ?&gt;
+        &lt;/p&gt;&lt;/div&gt;
+        &lt;?php
+}
+
+$action = isset( $_GET['action'] ) ? $_GET['action'] : 'list';
+
+switch ( $action ) {
+        // Edit site
+        case 'editblog':
+                $blog_prefix = $wpdb-&gt;get_blog_prefix( $id );
+                $options = $wpdb-&gt;get_results( &quot;SELECT * FROM {$blog_prefix}options WHERE option_name NOT LIKE '\_%' AND option_name NOT LIKE '%user_roles'&quot; );
+                $details = get_blog_details( $id );
+                if ( $details-&gt;site_id != $wpdb-&gt;siteid )
+                        wp_die( __( 'You do not have permission to access this page.' ) );
+
+                $editblog_roles = get_blog_option( $id, &quot;{$blog_prefix}user_roles&quot; );
+                $is_main_site = is_main_site( $id );
+                ?&gt;
+                &lt;div class=&quot;wrap&quot;&gt;
+                &lt;?php screen_icon(); ?&gt;
+                &lt;h2&gt;&lt;?php _e( 'Edit Site' ); ?&gt; - &lt;a href=&quot;&lt;?php echo esc_url( get_home_url( $id ) ); ?&gt;&quot;&gt;&lt;?php echo esc_url( get_home_url( $id ) ); ?&gt;&lt;/a&gt;&lt;/h2&gt;
+                &lt;form method=&quot;post&quot; action=&quot;edit.php?action=updateblog&quot;&gt;
+                        &lt;?php wp_nonce_field( 'editblog' ); ?&gt;
+                        &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;&lt;?php echo esc_attr( $id ) ?&gt;&quot; /&gt;
+                        &lt;div class=&quot;metabox-holder&quot; style=&quot;width:49%;float:left;&quot;&gt;
+                                &lt;div id=&quot;blogedit_bloginfo&quot; class=&quot;postbox&quot;&gt;
+                                &lt;h3 class=&quot;hndle&quot;&gt;&lt;span&gt;&lt;?php _e( 'Site info (wp_blogs)' ); ?&gt;&lt;/span&gt;&lt;/h3&gt;
+                                &lt;div class=&quot;inside&quot;&gt;
+                                        &lt;table class=&quot;form-table&quot;&gt;
+                                                &lt;tr class=&quot;form-field form-required&quot;&gt;
+                                                        &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Domain' ) ?&gt;&lt;/th&gt;
+                                                        &lt;?php
+                                                        $protocol = is_ssl() ? 'https://' : 'http://';
+                                                        if ( $is_main_site ) { ?&gt;
+                                                        &lt;td&gt;&lt;code&gt;&lt;?php echo $protocol; echo esc_attr( $details-&gt;domain ) ?&gt;&lt;/code&gt;&lt;/td&gt;
+                                                        &lt;?php } else { ?&gt;
+                                                        &lt;td&gt;&lt;?php echo $protocol; ?&gt;&lt;input name=&quot;blog[domain]&quot; type=&quot;text&quot; id=&quot;domain&quot; value=&quot;&lt;?php echo esc_attr( $details-&gt;domain ) ?&gt;&quot; size=&quot;33&quot; /&gt;&lt;/td&gt;
+                                                        &lt;?php } ?&gt;
+                                                &lt;/tr&gt;
+                                                &lt;tr class=&quot;form-field form-required&quot;&gt;
+                                                        &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Path' ) ?&gt;&lt;/th&gt;
+                                                        &lt;?php if ( $is_main_site ) { ?&gt;
+                                                        &lt;td&gt;&lt;code&gt;&lt;?php echo esc_attr( $details-&gt;path ) ?&gt;&lt;/code&gt;&lt;/td&gt;
+                                                        &lt;?php } else { ?&gt;
+                                                        &lt;td&gt;&lt;input name=&quot;blog[path]&quot; type=&quot;text&quot; id=&quot;path&quot; value=&quot;&lt;?php echo esc_attr( $details-&gt;path ) ?&gt;&quot; size=&quot;40&quot; style='margin-bottom:5px;' /&gt;
+                                                        &lt;br /&gt;&lt;input type=&quot;checkbox&quot; style=&quot;width:20px;&quot; name=&quot;update_home_url&quot; value=&quot;update&quot; &lt;?php if ( get_blog_option( $id, 'siteurl' ) == untrailingslashit( get_blogaddress_by_id ($id ) ) || get_blog_option( $id, 'home' ) == untrailingslashit( get_blogaddress_by_id( $id ) ) ) echo 'checked=&quot;checked&quot;'; ?&gt; /&gt; &lt;?php _e( 'Update &lt;code&gt;siteurl&lt;/code&gt; and &lt;code&gt;home&lt;/code&gt; as well.' ); ?&gt;&lt;/td&gt;
+                                                        &lt;?php } ?&gt;
+                                                &lt;/tr&gt;
+                                                &lt;tr class=&quot;form-field&quot;&gt;
+                                                        &lt;th scope=&quot;row&quot;&gt;&lt;?php _ex( 'Registered', 'site' ) ?&gt;&lt;/th&gt;
+                                                        &lt;td&gt;&lt;input name=&quot;blog[registered]&quot; type=&quot;text&quot; id=&quot;blog_registered&quot; value=&quot;&lt;?php echo esc_attr( $details-&gt;registered ) ?&gt;&quot; size=&quot;40&quot; /&gt;&lt;/td&gt;
+                                                &lt;/tr&gt;
+                                                &lt;tr class=&quot;form-field&quot;&gt;
+                                                        &lt;th scope=&quot;row&quot;&gt;&lt;?php _e('Last Updated') ?&gt;&lt;/th&gt;
+                                                        &lt;td&gt;&lt;input name=&quot;blog[last_updated]&quot; type=&quot;text&quot; id=&quot;blog_last_updated&quot; value=&quot;&lt;?php echo esc_attr( $details-&gt;last_updated ) ?&gt;&quot; size=&quot;40&quot; /&gt;&lt;/td&gt;
+                                                &lt;/tr&gt;
+                                                &lt;?php
+                                                $radio_fields = array( 'public' =&gt; __( 'Public' ) );
+                                                if ( ! $is_main_site ) {
+                                                        $radio_fields['archived'] = __( 'Archived' );
+                                                        $radio_fields['spam']     = _x( 'Spam', 'site' );
+                                                        $radio_fields['deleted']  = __( 'Deleted' );
+                                                }
+                                                $radio_fields['mature'] = __( 'Mature' );
+                                                foreach ( $radio_fields as $field_key =&gt; $field_label ) {
+                                                ?&gt;
+                                                &lt;tr&gt;
+                                                        &lt;th scope=&quot;row&quot;&gt;&lt;?php echo $field_label; ?&gt;&lt;/th&gt;
+                                                        &lt;td&gt;
+                                                                &lt;input type=&quot;radio&quot; name=&quot;blog[&lt;?php echo $field_key; ?&gt;]&quot; id=&quot;blog_&lt;?php echo $field_key; ?&gt;_1&quot; value=&quot;1&quot;&lt;?php checked( $details-&gt;$field_key, 1 ); ?&gt; /&gt;
+                                                                &lt;label for=&quot;blog_&lt;?php echo $field_key; ?&gt;_1&quot;&gt;&lt;?php _e('Yes'); ?&gt;&lt;/label&gt;
+                                                                &lt;input type=&quot;radio&quot; name=&quot;blog[&lt;?php echo $field_key; ?&gt;]&quot; id=&quot;blog_&lt;?php echo $field_key; ?&gt;_0&quot; value=&quot;0&quot;&lt;?php checked( $details-&gt;$field_key, 0 ); ?&gt; /&gt;
+                                                                &lt;label for=&quot;blog_&lt;?php echo $field_key; ?&gt;_0&quot;&gt;&lt;?php _e('No'); ?&gt;&lt;/label&gt;
+                                                        &lt;/td&gt;
+                                                &lt;/tr&gt;
+                                                &lt;?php } ?&gt;
+                                        &lt;/table&gt;
+                                        &lt;p class=&quot;submit&quot; style=&quot;text-align:center;&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;&lt;?php esc_attr_e( 'Update Options' ) ?&gt;&quot; /&gt;&lt;/p&gt;
+                                &lt;/div&gt;
+                                &lt;/div&gt;
+
+                                &lt;div id=&quot;blogedit_blogoptions&quot; class=&quot;postbox&quot; &gt;
+                                &lt;h3 class=&quot;hndle&quot;&gt;&lt;span&gt;&lt;?php printf( __( 'Site options (%soptions)' ), $blog_prefix ); ?&gt;&lt;/span&gt;&lt;/h3&gt;
+                                &lt;div class=&quot;inside&quot;&gt;
+                                        &lt;table class=&quot;form-table&quot;&gt;
+                                                &lt;?php
+                                                $editblog_default_role = 'subscriber';
+                                                foreach ( $options as $option ) {
+                                                        if ( $option-&gt;option_name == 'default_role' )
+                                                                $editblog_default_role = $option-&gt;option_value;
+                                                        $disabled = false;
+                                                        $class = 'all-options';
+                                                        if ( is_serialized( $option-&gt;option_value ) ) {
+                                                                if ( is_serialized_string( $option-&gt;option_value ) ) {
+                                                                        $option-&gt;option_value = esc_html( maybe_unserialize( $option-&gt;option_value ), 'single' );
+                                                                } else {
+                                                                        $option-&gt;option_value = 'SERIALIZED DATA';
+                                                                        $disabled = true;
+                                                                        $class = 'all-options disabled';
+                                                                }
+                                                        }
+                                                        if ( strpos( $option-&gt;option_value, &quot;\n&quot; ) !== false ) {
+                                                        ?&gt;
+                                                                &lt;tr class=&quot;form-field&quot;&gt;
+                                                                        &lt;th scope=&quot;row&quot;&gt;&lt;?php echo ucwords( str_replace( &quot;_&quot;, &quot; &quot;, $option-&gt;option_name ) ) ?&gt;&lt;/th&gt;
+                                                                        &lt;td&gt;&lt;textarea class=&quot;&lt;?php echo $class; ?&gt;&quot; rows=&quot;5&quot; cols=&quot;40&quot; name=&quot;option[&lt;?php echo esc_attr( $option-&gt;option_name ) ?&gt;]&quot; id=&quot;&lt;?php echo esc_attr( $option-&gt;option_name ) ?&gt;&quot;&lt;?php disabled( $disabled ) ?&gt;&gt;&lt;?php echo wp_htmledit_pre( $option-&gt;option_value ) ?&gt;&lt;/textarea&gt;&lt;/td&gt;
+                                                                &lt;/tr&gt;
+                                                        &lt;?php
+                                                        } else {
+                                                        ?&gt;
+                                                                &lt;tr class=&quot;form-field&quot;&gt;
+                                                                        &lt;th scope=&quot;row&quot;&gt;&lt;?php echo esc_html( ucwords( str_replace( &quot;_&quot;, &quot; &quot;, $option-&gt;option_name ) ) ); ?&gt;&lt;/th&gt;
+                                                                        &lt;?php if ( $is_main_site &amp;&amp; in_array( $option-&gt;option_name, array( 'siteurl', 'home' ) ) ) { ?&gt;
+                                                                        &lt;td&gt;&lt;code&gt;&lt;?php echo esc_html( $option-&gt;option_value ) ?&gt;&lt;/code&gt;&lt;/td&gt;
+                                                                        &lt;?php } else { ?&gt;
+                                                                        &lt;td&gt;&lt;input class=&quot;&lt;?php echo $class; ?&gt;&quot; name=&quot;option[&lt;?php echo esc_attr( $option-&gt;option_name ) ?&gt;]&quot; type=&quot;text&quot; id=&quot;&lt;?php echo esc_attr( $option-&gt;option_name ) ?&gt;&quot; value=&quot;&lt;?php echo esc_attr( $option-&gt;option_value ) ?&gt;&quot; size=&quot;40&quot; &lt;?php disabled( $disabled ) ?&gt; /&gt;&lt;/td&gt;
+                                                                        &lt;?php } ?&gt;
+                                                                &lt;/tr&gt;
+                                                        &lt;?php
+                                                        }
+                                                } // End foreach
+                                                ?&gt;
+                                        &lt;/table&gt;
+                                        &lt;p class=&quot;submit&quot; style=&quot;text-align:center;&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;&lt;?php esc_attr_e( 'Update Options' ) ?&gt;&quot; /&gt;&lt;/p&gt;
+                                &lt;/div&gt;
+                                &lt;/div&gt;
+                        &lt;/div&gt;
+
+                        &lt;div class=&quot;metabox-holder&quot; style=&quot;width:49%;float:right;&quot;&gt;
+                                &lt;?php
+                                // Site Themes
+                                $themes = get_themes();
+                                $blog_allowed_themes = wpmu_get_blog_allowedthemes( $id );
+                                $allowed_themes = get_site_option( 'allowedthemes' );
+
+                                if ( ! $allowed_themes )
+                                        $allowed_themes = array_keys( $themes );
+
+                                $out = '';
+                                foreach ( $themes as $key =&gt; $theme ) {
+                                        $theme_key = esc_html( $theme['Stylesheet'] );
+                                        if ( ! isset( $allowed_themes[$theme_key] ) ) {
+                                                $checked = isset( $blog_allowed_themes[ $theme_key ] ) ? 'checked=&quot;checked&quot;' : '';
+                                                $out .= '&lt;tr class=&quot;form-field form-required&quot;&gt;
+                                                                &lt;th title=&quot;' . esc_attr( $theme[&quot;Description&quot;] ).'&quot; scope=&quot;row&quot;&gt;' . esc_html( $key ) . '&lt;/th&gt;
+                                                                &lt;td&gt;&lt;label&gt;&lt;input name=&quot;theme[' . esc_attr( $theme_key ) . ']&quot; type=&quot;checkbox&quot; style=&quot;width:20px;&quot; value=&quot;on&quot; '.$checked.'/&gt; ' . __( 'Active' ) . '&lt;/label&gt;&lt;/td&gt;
+                                                        &lt;/tr&gt;';
+                                        }
+                                }
+
+                                if ( $out != '' ) {
+                                ?&gt;
+                                &lt;div id=&quot;blogedit_blogthemes&quot; class=&quot;postbox&quot;&gt;
+                                &lt;h3 class=&quot;hndle&quot;&gt;&lt;span&gt;&lt;?php esc_html_e( 'Site Themes' ); ?&gt;&lt;/span&gt;&lt;/h3&gt;
+                                &lt;div class=&quot;inside&quot;&gt;
+                                        &lt;p class=&quot;description&quot;&gt;&lt;?php _e( 'Activate the themename of an existing theme and hit &quot;Update Options&quot; to allow the theme for this site.' ) ?&gt;&lt;/p&gt;
+                                        &lt;table class=&quot;form-table&quot;&gt;
+                                                &lt;?php echo $out; ?&gt;
+                                        &lt;/table&gt;
+                                        &lt;p class=&quot;submit&quot; style=&quot;text-align:center;&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;&lt;?php esc_attr_e( 'Update Options' ) ?&gt;&quot; /&gt;&lt;/p&gt;
+                                &lt;/div&gt;&lt;/div&gt;
+                                &lt;?php }
+
+                                // Site users
+                                $blogusers = get_users_of_blog( $id );
+                                if ( is_array( $blogusers ) ) {
+                                        echo '&lt;div id=&quot;blogedit_blogusers&quot; class=&quot;postbox&quot;&gt;&lt;h3 class=&quot;hndle&quot;&gt;&lt;span&gt;' . __( 'Site Users' ) . '&lt;/span&gt;&lt;/h3&gt;&lt;div class=&quot;inside&quot;&gt;';
+                                        echo '&lt;table class=&quot;form-table&quot;&gt;';
+                                        echo &quot;&lt;tr&gt;&lt;th&gt;&quot; . __( 'User' ) . &quot;&lt;/th&gt;&lt;th&gt;&quot; . __( 'Role' ) . &quot;&lt;/th&gt;&lt;th&gt;&quot; . __( 'Password' ) . &quot;&lt;/th&gt;&lt;th&gt;&quot; . __( 'Remove' ) . &quot;&lt;/th&gt;&lt;/tr&gt;&quot;;
+                                        reset( $blogusers );
+                                        foreach ( (array) $blogusers as $key =&gt; $val ) {
+                                                if ( isset( $val-&gt;meta_value ) &amp;&amp; ! $val-&gt;meta_value )
+                                                        continue;
+                                                $t = @unserialize( $val-&gt;meta_value );
+                                                if ( is_array( $t ) ) {
+                                                        reset( $t );
+                                                        $existing_role = key( $t );
+                                                }
+                                                echo '&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;user-edit.php?user_id=' . $val-&gt;user_id . '&quot;&gt;' . $val-&gt;user_login . '&lt;/a&gt;&lt;/td&gt;';
+                                                if ( $val-&gt;user_id != $current_user-&gt;data-&gt;ID ) {
+                                                        ?&gt;
+                                                        &lt;td&gt;
+                                                                &lt;select name=&quot;role[&lt;?php echo $val-&gt;user_id ?&gt;]&quot; id=&quot;new_role_1&quot;&gt;&lt;?php
+                                                                        foreach ( $editblog_roles as $role =&gt; $role_assoc ){
+                                                                                $name = translate_user_role( $role_assoc['name'] );
+                                                                                echo '&lt;option ' . selected( $role, $existing_role, false ) . ' value=&quot;' . esc_attr( $role ) . '&quot;&gt;' . esc_html( $name ) . '&lt;/option&gt;';
+                                                                        }
+                                                                        ?&gt;
+                                                                &lt;/select&gt;
+                                                        &lt;/td&gt;
+                                                        &lt;td&gt;
+                                                                &lt;input type=&quot;text&quot; name=&quot;user_password[&lt;?php echo esc_attr( $val-&gt;user_id ) ?&gt;]&quot; /&gt;
+                                                        &lt;/td&gt;
+                                                        &lt;?php
+                                                        echo '&lt;td&gt;&lt;input title=&quot;' . __( 'Click to remove user' ) . '&quot; type=&quot;checkbox&quot; name=&quot;blogusers[' . esc_attr( $val-&gt;user_id ) . ']&quot; /&gt;&lt;/td&gt;';
+                                                } else {
+                                                        echo &quot;&lt;td&gt;&lt;strong&gt;&quot; . __ ( 'N/A' ) . &quot;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;&quot; . __ ( 'N/A' ) . &quot;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;&quot; . __( 'N/A' ) . &quot;&lt;/strong&gt;&lt;/td&gt;&quot;;
+                                                }
+                                                echo '&lt;/tr&gt;';
+                                        }
+                                        echo &quot;&lt;/table&gt;&quot;;
+                                        echo '&lt;p class=&quot;submit&quot; style=&quot;text-align:center;&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;' . esc_attr__( 'Update Options' ) . '&quot; /&gt;&lt;/p&gt;';
+                                        echo &quot;&lt;/div&gt;&lt;/div&gt;&quot;;
+                                }
+                                ?&gt;
+
+                                &lt;div id=&quot;blogedit_blogadduser&quot; class=&quot;postbox&quot;&gt;
+                                &lt;h3 class=&quot;hndle&quot;&gt;&lt;span&gt;&lt;?php _e( 'Add a new user' ); ?&gt;&lt;/span&gt;&lt;/h3&gt;
+                                &lt;div class=&quot;inside&quot;&gt;
+                                        &lt;p class=&quot;description&quot;&gt;&lt;?php _e( 'Enter the username of an existing user and hit &amp;#8220;Update Options&amp;#8221; to add the user.' ) ?&gt;&lt;/p&gt;
+                                        &lt;table class=&quot;form-table&quot;&gt;
+                                                        &lt;tr&gt;
+                                                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'User&amp;nbsp;Login:' ) ?&gt;&lt;/th&gt;
+                                                                &lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;newuser&quot; id=&quot;newuser&quot; /&gt;&lt;/td&gt;
+                                                        &lt;/tr&gt;
+                                                        &lt;tr&gt;
+                                                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Role:' ) ?&gt;&lt;/th&gt;
+                                                                &lt;td&gt;
+                                                                        &lt;select name=&quot;new_role&quot; id=&quot;new_role_0&quot;&gt;
+                                                                        &lt;?php
+                                                                        reset( $editblog_roles );
+                                                                        foreach ( $editblog_roles as $role =&gt; $role_assoc ){
+                                                                                $name = translate_user_role( $role_assoc['name'] );
+                                                                                $selected = ( $role == $editblog_default_role ) ? 'selected=&quot;selected&quot;' : '';
+                                                                                echo '&lt;option ' . $selected . ' value=&quot;' . esc_attr( $role ) . '&quot;&gt;' . esc_html( $name ) . '&lt;/option&gt;';
+                                                                        }
+                                                                        ?&gt;
+                                                                        &lt;/select&gt;
+                                                                &lt;/td&gt;
+                                                        &lt;/tr&gt;
+                                                &lt;/table&gt;
+                                        &lt;p class=&quot;submit&quot; style=&quot;text-align:center;&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;&lt;?php esc_attr_e( 'Update Options' ) ?&gt;&quot; /&gt;&lt;/p&gt;
+                                &lt;/div&gt;
+                                &lt;/div&gt;
+
+                                &lt;div id=&quot;blogedit_miscoptions&quot; class=&quot;postbox&quot;&gt;
+                                &lt;h3 class=&quot;hndle&quot;&gt;&lt;span&gt;&lt;?php _e( 'Misc Site Actions' ) ?&gt;&lt;/span&gt;&lt;/h3&gt;
+                                &lt;div class=&quot;inside&quot;&gt;
+                                        &lt;table class=&quot;form-table&quot;&gt;
+                                                        &lt;?php do_action( 'wpmueditblogaction', $id ); ?&gt;
+                                        &lt;/table&gt;
+                                        &lt;p class=&quot;submit&quot; style=&quot;text-align:center;&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;&lt;?php esc_attr_e( 'Update Options' ) ?&gt;&quot; /&gt;&lt;/p&gt;
+                                &lt;/div&gt;
+                                &lt;/div&gt;
+                        &lt;/div&gt;
+
+                        &lt;div style=&quot;clear:both;&quot;&gt;&lt;/div&gt;
+                &lt;/form&gt;
+                &lt;/div&gt;
+                &lt;?php
+        break;
+
+        // List sites
+        case 'list':
+        default:
+                $pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0;
+                if ( empty($pagenum) )
+                        $pagenum = 1;
+
+                $per_page = (int) get_user_option( 'ms_sites_per_page' );
+                if ( empty( $per_page ) || $per_page &lt; 1 )
+                        $per_page = 15;
+
+                $per_page = apply_filters( 'ms_sites_per_page', $per_page );
+
+                $s = isset( $_GET['s'] ) ? stripslashes( trim( $_GET[ 's' ] ) ) : '';
+                $like_s = esc_sql( like_escape( $s ) );
+
+                $query = &quot;SELECT * FROM {$wpdb-&gt;blogs} WHERE site_id = '{$wpdb-&gt;siteid}' &quot;;
+
+                if ( isset( $_GET['searchaction'] ) ) {
+                        if ( 'name' == $_GET['searchaction'] ) {
+                                $query .= &quot; AND ( {$wpdb-&gt;blogs}.domain LIKE '%{$like_s}%' OR {$wpdb-&gt;blogs}.path LIKE '%{$like_s}%' ) &quot;;
+                        } elseif ( 'id' == $_GET['searchaction'] ) {
+                                $query .= &quot; AND {$wpdb-&gt;blogs}.blog_id = '{$like_s}' &quot;;
+                        } elseif ( 'ip' == $_GET['searchaction'] ) {
+                                $query = &quot;SELECT *
+                                        FROM {$wpdb-&gt;blogs}, {$wpdb-&gt;registration_log}
+                                        WHERE site_id = '{$wpdb-&gt;siteid}'
+                                        AND {$wpdb-&gt;blogs}.blog_id = {$wpdb-&gt;registration_log}.blog_id
+                                        AND {$wpdb-&gt;registration_log}.IP LIKE ('%{$like_s}%')&quot;;
+                        }
+                }
+
+                $order_by = isset( $_GET['sortby'] ) ? $_GET['sortby'] : 'id';
+                if ( $order_by == 'registered' ) {
+                        $query .= ' ORDER BY registered ';
+                } elseif ( $order_by == 'lastupdated' ) {
+                        $query .= ' ORDER BY last_updated ';
+                } elseif ( $order_by == 'blogname' ) {
+                        $query .= ' ORDER BY domain ';
+                } else {
+                        $order_by = 'id';
+                        $query .= &quot; ORDER BY {$wpdb-&gt;blogs}.blog_id &quot;;
+                }
+
+                $order = ( isset( $_GET['order'] ) &amp;&amp; 'DESC' == $_GET['order'] ) ? &quot;DESC&quot; : &quot;ASC&quot;;
+                $query .= $order;
+
+                $total = $wpdb-&gt;get_var( str_replace( 'SELECT *', 'SELECT COUNT(blog_id)', $query ) );
+
+                $query .= &quot; LIMIT &quot; . intval( ( $pagenum - 1 ) * $per_page ) . &quot;, &quot; . intval( $per_page );
+                $blog_list = $wpdb-&gt;get_results( $query, ARRAY_A );
+
+                $num_pages = ceil($total / $per_page);
+                $page_links = paginate_links( array(
+                        'base' =&gt; add_query_arg( 'paged', '%#%' ),
+                        'format' =&gt; '',
+                        'prev_text' =&gt; __( '&amp;laquo;' ),
+                        'next_text' =&gt; __( '&amp;raquo;' ),
+                        'total' =&gt; $num_pages,
+                        'current' =&gt; $pagenum
+                ));
+
+                if ( empty( $_GET['mode'] ) )
+                        $mode = 'list';
+                else
+                        $mode = esc_attr( $_GET['mode'] );
+                ?&gt;
+
+                &lt;div class=&quot;wrap&quot;&gt;
+                &lt;?php screen_icon(); ?&gt;
+                &lt;h2&gt;&lt;?php _e('Sites') ?&gt;
+                &lt;a href=&quot;#form-add-site&quot; class=&quot;button add-new-h2&quot;&gt;&lt;?php echo esc_html_x( 'Add New', 'sites' ); ?&gt;&lt;/a&gt;
+                &lt;?php
+                if ( isset( $_GET['s'] ) &amp;&amp; $_GET['s'] )
+                printf( '&lt;span class=&quot;subtitle&quot;&gt;' . __( 'Search results for &amp;#8220;%s&amp;#8221;' ) . '&lt;/span&gt;', esc_html( $s ) );
+                ?&gt;
+                &lt;/h2&gt;
+
+                &lt;form action=&quot;sites.php&quot; method=&quot;get&quot; id=&quot;ms-search&quot;&gt;
+                &lt;p class=&quot;search-box&quot;&gt;
+                &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;blogs&quot; /&gt;
+                &lt;input type=&quot;text&quot; name=&quot;s&quot; value=&quot;&lt;?php echo esc_attr( $s ); ?&gt;&quot; /&gt;
+                &lt;input type=&quot;submit&quot; class=&quot;button&quot; value=&quot;&lt;?php esc_attr_e( 'Search Site by' ) ?&gt;&quot; /&gt;
+                &lt;select name=&quot;searchaction&quot;&gt;
+                        &lt;option value=&quot;name&quot; selected=&quot;selected&quot;&gt;&lt;?php _e( 'Name' ); ?&gt;&lt;/option&gt;
+                        &lt;option value=&quot;id&quot;&gt;&lt;?php _e( 'ID' ); ?&gt;&lt;/option&gt;
+                        &lt;option value=&quot;ip&quot;&gt;&lt;?php _e( 'IP address' ); ?&gt;&lt;/option&gt;
+                &lt;/select&gt;
+                &lt;/p&gt;
+                &lt;/form&gt;
+
+                &lt;form id=&quot;form-site-list&quot; action=&quot;edit.php?action=allblogs&quot; method=&quot;post&quot;&gt;
+                &lt;input type=&quot;hidden&quot; name=&quot;mode&quot; value=&quot;&lt;?php echo esc_attr( $mode ); ?&gt;&quot; /&gt;
+                &lt;div class=&quot;tablenav&quot;&gt;
+                &lt;div class=&quot;alignleft actions&quot;&gt;
+                        &lt;select name=&quot;action&quot;&gt;
+                                &lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e( 'Bulk Actions' ); ?&gt;&lt;/option&gt;
+                                &lt;option value=&quot;delete&quot;&gt;&lt;?php _e( 'Delete' ); ?&gt;&lt;/option&gt;
+                                &lt;option value=&quot;spam&quot;&gt;&lt;?php _ex( 'Mark as Spam', 'site' ); ?&gt;&lt;/option&gt;
+                                &lt;option value=&quot;notspam&quot;&gt;&lt;?php _ex( 'Not Spam', 'site' ); ?&gt;&lt;/option&gt;
+                        &lt;/select&gt;
+                        &lt;input type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e( 'Apply' ); ?&gt;&quot; name=&quot;doaction&quot; id=&quot;doaction&quot; class=&quot;button-secondary action&quot; /&gt;
+                        &lt;?php wp_nonce_field( 'bulk-ms-sites', '_wpnonce_bulk-ms-sites' ); ?&gt;
+                &lt;/div&gt;
+
+                &lt;?php if ( $page_links ) { ?&gt;
+                &lt;div class=&quot;tablenav-pages&quot;&gt;
+                &lt;?php $page_links_text = sprintf( '&lt;span class=&quot;displaying-num&quot;&gt;' . __( 'Displaying %s&amp;#8211;%s of %s' ) . '&lt;/span&gt;%s',
+                number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
+                number_format_i18n( min( $pagenum * $per_page, $total ) ),
+                number_format_i18n( $total ),
+                $page_links
+                ); echo $page_links_text; ?&gt;
+                &lt;/div&gt;
+                &lt;?php } ?&gt;
+
+                &lt;div class=&quot;view-switch&quot;&gt;
+                        &lt;a href=&quot;&lt;?php echo esc_url( add_query_arg( 'mode', 'list', $_SERVER['REQUEST_URI'] ) ) ?&gt;&quot;&gt;&lt;img &lt;?php if ( 'list' == $mode ) echo 'class=&quot;current&quot;'; ?&gt; id=&quot;view-switch-list&quot; src=&quot;&lt;?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?&gt;&quot; width=&quot;20&quot; height=&quot;20&quot; title=&quot;&lt;?php _e( 'List View' ) ?&gt;&quot; alt=&quot;&lt;?php _e( 'List View' ) ?&gt;&quot; /&gt;&lt;/a&gt;
+                        &lt;a href=&quot;&lt;?php echo esc_url( add_query_arg( 'mode', 'excerpt', $_SERVER['REQUEST_URI'] ) ) ?&gt;&quot;&gt;&lt;img &lt;?php if ( 'excerpt' == $mode ) echo 'class=&quot;current&quot;'; ?&gt; id=&quot;view-switch-excerpt&quot; src=&quot;&lt;?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?&gt;&quot; width=&quot;20&quot; height=&quot;20&quot; title=&quot;&lt;?php _e( 'Excerpt View' ) ?&gt;&quot; alt=&quot;&lt;?php _e( 'Excerpt View' ) ?&gt;&quot; /&gt;&lt;/a&gt;
+                &lt;/div&gt;
+
+                &lt;/div&gt;
+
+                &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+
+                &lt;?php
+                // define the columns to display, the syntax is 'internal name' =&gt; 'display name'
+                $blogname_columns = ( is_subdomain_install() ) ? __( 'Domain' ) : __( 'Path' );
+                $sites_columns = array(
+                        'id'           =&gt; __( 'ID' ),
+                        'blogname'     =&gt; $blogname_columns,
+                        'lastupdated'  =&gt; __( 'Last Updated'),
+                        'registered'   =&gt; _x( 'Registered', 'site' ),
+                        'users'        =&gt; __( 'Users' )
+                );
+
+                if ( has_filter( 'wpmublogsaction' ) )
+                        $sites_columns['plugins'] = __( 'Actions' );
+
+                $sites_columns = apply_filters( 'wpmu_blogs_columns', $sites_columns );
+                ?&gt;
+
+                &lt;table class=&quot;widefat&quot;&gt;
+                        &lt;thead&gt;
+                                &lt;tr&gt;
+                                &lt;th class=&quot;manage-column column-cb check-column&quot; id=&quot;cb&quot; scope=&quot;col&quot;&gt;
+                                        &lt;input type=&quot;checkbox&quot; /&gt;
+                                &lt;/th&gt;
+                                &lt;?php
+                                $col_url = '';
+                                foreach($sites_columns as $column_id =&gt; $column_display_name) {
+                                        $column_link = &quot;&lt;a href='&quot;;
+                                        $order2 = '';
+                                        if ( $order_by == $column_id )
+                                                $order2 = ( $order == 'DESC' ) ? 'ASC' : 'DESC';
+
+                                        $column_link .= esc_url( add_query_arg( array( 'order' =&gt; $order2, 'paged' =&gt; $pagenum, 'sortby' =&gt; $column_id ), remove_query_arg( array('action', 'updated'), $_SERVER['REQUEST_URI'] ) ) );
+                                        $column_link .= &quot;'&gt;{$column_display_name}&lt;/a&gt;&quot;;
+                                        $col_url .= '&lt;th scope=&quot;col&quot;&gt;' . ( ( $column_id == 'users' || $column_id == 'plugins' ) ? $column_display_name : $column_link ) . '&lt;/th&gt;';
+                                }
+                                echo $col_url ?&gt;
+                                &lt;/tr&gt;
+                        &lt;/thead&gt;
+                        &lt;tfoot&gt;
+                                &lt;tr&gt;
+                                &lt;th class=&quot;manage-column column-cb check-column&quot; id=&quot;cb1&quot; scope=&quot;col&quot;&gt;
+                                        &lt;input type=&quot;checkbox&quot; /&gt;
+                                &lt;/th&gt;
+                                        &lt;?php echo $col_url ?&gt;
+                                &lt;/tr&gt;
+                        &lt;/tfoot&gt;
+                        &lt;tbody id=&quot;the-site-list&quot; class=&quot;list:site&quot;&gt;
+                        &lt;?php
+                        $status_list = array( 'archived' =&gt; array( 'site-archived', __( 'Archived' ) ), 'spam' =&gt; array( 'site-spammed', _x( 'Spam', 'site' ) ), 'deleted' =&gt; array( 'site-deleted', __( 'Deleted' ) ), 'mature' =&gt; array( 'site-mature', __( 'Mature' ) ) );
+                        if ( $blog_list ) {
+                                $class = '';
+                                foreach ( $blog_list as $blog ) {
+                                        $class = ( 'alternate' == $class ) ? '' : 'alternate';
+                                        reset( $status_list );
+
+                                        $blog_states = array();
+                                        foreach ( $status_list as $status =&gt; $col ) {
+                                                if ( get_blog_status( $blog['blog_id'], $status ) == 1 ) {
+                                                        $class = $col[0];
+                                                        $blog_states[] = $col[1];
+                                                }
+                                        }
+                                        $blog_state = '';
+                                        if ( ! empty( $blog_states ) ) {
+                                                $state_count = count( $blog_states );
+                                                $i = 0;
+                                                $blog_state .= ' - ';
+                                                foreach ( $blog_states as $state ) {
+                                                        ++$i;
+                                                        ( $i == $state_count ) ? $sep = '' : $sep = ', ';
+                                                        $blog_state .= &quot;&lt;span class='post-state'&gt;$state$sep&lt;/span&gt;&quot;;
+                                                }
+                                        }
+                                        echo &quot;&lt;tr class='$class'&gt;&quot;;
+
+                                        $blogname = ( is_subdomain_install() ) ? str_replace( '.'.$current_site-&gt;domain, '', $blog['domain'] ) : $blog['path'];
+                                        foreach ( $sites_columns as $column_name=&gt;$column_display_name ) {
+                                                switch ( $column_name ) {
+                                                        case 'id': ?&gt;
+                                                                &lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;
+                                                                        &lt;input type=&quot;checkbox&quot; id=&quot;blog_&lt;?php echo $blog['blog_id'] ?&gt;&quot; name=&quot;allblogs[]&quot; value=&quot;&lt;?php echo esc_attr( $blog['blog_id'] ) ?&gt;&quot; /&gt;
+                                                                &lt;/th&gt;
+                                                                &lt;th valign=&quot;top&quot; scope=&quot;row&quot;&gt;
+                                                                        &lt;?php echo $blog['blog_id'] ?&gt;
+                                                                &lt;/th&gt;
+                                                        &lt;?php
+                                                        break;
+
+                                                        case 'blogname': ?&gt;
+                                                                &lt;td class=&quot;column-title&quot;&gt;
+                                                                        &lt;a href=&quot;&lt;?php echo esc_url( network_admin_url( 'sites.php?action=editblog&amp;amp;id=' . $blog['blog_id'] ) ); ?&gt;&quot; class=&quot;edit&quot;&gt;&lt;?php echo $blogname . $blog_state; ?&gt;&lt;/a&gt;
+                                                                        &lt;?php
+                                                                        if ( 'list' != $mode )
+                                                                                echo '&lt;p&gt;' . sprintf( _x( '%1$s &amp;#8211; &lt;em&gt;%2$s&lt;/em&gt;', '%1$s: site name. %2$s: site tagline.' ), get_blog_option( $blog['blog_id'], 'blogname' ), get_blog_option( $blog['blog_id'], 'blogdescription ' ) ) . '&lt;/p&gt;';
+
+                                                                        // Preordered.
+                                                                        $actions = array(
+                                                                                'edit' =&gt; '', 'backend' =&gt; '',
+                                                                                'activate' =&gt; '', 'deactivate' =&gt; '',
+                                                                                'archive' =&gt; '', 'unarchive' =&gt; '',
+                                                                                'spam' =&gt; '', 'unspam' =&gt; '',
+                                                                                'delete' =&gt; '',
+                                                                                'visit' =&gt; '',
+                                                                        );
+
+                                                                        $actions['edit']        = '&lt;span class=&quot;edit&quot;&gt;&lt;a href=&quot;' . esc_url( network_admin_url( 'sites.php?action=editblog&amp;amp;id=' . $blog['blog_id'] ) ) . '&quot;&gt;' . __( 'Edit' ) . '&lt;/a&gt;&lt;/span&gt;';
+                                                                        $actions['backend']        = &quot;&lt;span class='backend'&gt;&lt;a href='&quot; . esc_url( get_admin_url($blog['blog_id']) ) . &quot;' class='edit'&gt;&quot; . __( 'Backend' ) . '&lt;/a&gt;&lt;/span&gt;';
+                                                                        if ( $current_site-&gt;blog_id != $blog['blog_id'] ) {
+                                                                                if ( get_blog_status( $blog['blog_id'], 'deleted' ) == '1' )
+                                                                                        $actions['activate']        = '&lt;span class=&quot;activate&quot;&gt;&lt;a href=&quot;' . esc_url( network_admin_url( 'edit.php?action=confirm&amp;amp;action2=activateblog&amp;amp;id=' . $blog['blog_id'] . '&amp;amp;msg=' . urlencode( sprintf( __( 'You are about to activate the site %s' ), $blogname ) ) ) ) . '&quot;&gt;' . __( 'Activate' ) . '&lt;/a&gt;&lt;/span&gt;';
+                                                                                else
+                                                                                        $actions['deactivate']        = '&lt;span class=&quot;activate&quot;&gt;&lt;a href=&quot;' . esc_url( network_admin_url( 'edit.php?action=confirm&amp;amp;action2=deactivateblog&amp;amp;id=' . $blog['blog_id'] . '&amp;amp;msg=' . urlencode( sprintf( __( 'You are about to deactivate the site %s' ), $blogname ) ) ) ) . '&quot;&gt;' . __( 'Deactivate' ) . '&lt;/a&gt;&lt;/span&gt;';
+
+                                                                                if ( get_blog_status( $blog['blog_id'], 'archived' ) == '1' )
+                                                                                        $actions['unarchive']        = '&lt;span class=&quot;archive&quot;&gt;&lt;a href=&quot;' . esc_url( network_admin_url( 'edit.php?action=confirm&amp;amp;action2=unarchiveblog&amp;amp;id=' .  $blog['blog_id'] . '&amp;amp;msg=' . urlencode( sprintf( __( 'You are about to unarchive the site %s.' ), $blogname ) ) ) ) . '&quot;&gt;' . __( 'Unarchive' ) . '&lt;/a&gt;&lt;/span&gt;';
+                                                                                else
+                                                                                        $actions['archive']        = '&lt;span class=&quot;archive&quot;&gt;&lt;a href=&quot;' . esc_url( network_admin_url( 'edit.php?action=confirm&amp;amp;action2=archiveblog&amp;amp;id=' . $blog['blog_id'] . '&amp;amp;msg=' . urlencode( sprintf( __( 'You are about to archive the site %s.' ), $blogname ) ) ) ) . '&quot;&gt;' . _x( 'Archive', 'verb; site' ) . '&lt;/a&gt;&lt;/span&gt;';
+
+                                                                                if ( get_blog_status( $blog['blog_id'], 'spam' ) == '1' )
+                                                                                        $actions['unspam']        = '&lt;span class=&quot;spam&quot;&gt;&lt;a href=&quot;' . esc_url( network_admin_url( 'edit.php?action=confirm&amp;amp;action2=unspamblog&amp;amp;id=' . $blog['blog_id'] . '&amp;amp;msg=' . urlencode( sprintf( __( 'You are about to unspam the site %s.' ), $blogname ) ) ) ) . '&quot;&gt;' . _x( 'Not Spam', 'site' ) . '&lt;/a&gt;&lt;/span&gt;';
+                                                                                else
+                                                                                        $actions['spam']        = '&lt;span class=&quot;spam&quot;&gt;&lt;a href=&quot;' . esc_url( network_admin_url( 'edit.php?action=confirm&amp;amp;action2=spamblog&amp;amp;id=' . $blog['blog_id'] . '&amp;amp;msg=' . urlencode( sprintf( __( 'You are about to mark the site %s as spam.' ), $blogname ) ) ) ) . '&quot;&gt;' . _x( 'Spam', 'site' ) . '&lt;/a&gt;&lt;/span&gt;';
+
+                                                                                $actions['delete']        = '&lt;span class=&quot;delete&quot;&gt;&lt;a href=&quot;' . esc_url( network_admin_url( 'edit.php?action=confirm&amp;amp;action2=deleteblog&amp;amp;id=' . $blog['blog_id'] . '&amp;amp;msg=' . urlencode( sprintf( __( 'You are about to delete the site %s.' ), $blogname ) ) ) ) . '&quot;&gt;' . __( 'Delete' ) . '&lt;/a&gt;&lt;/span&gt;';
+                                                                        }
+
+                                                                        $actions['visit']        = &quot;&lt;span class='view'&gt;&lt;a href='&quot; . esc_url( get_home_url( $blog['blog_id'] ) ) . &quot;' rel='permalink'&gt;&quot; . __( 'Visit' ) . '&lt;/a&gt;&lt;/span&gt;';
+                                                                        $actions = array_filter( $actions );
+                                                                        if ( count( $actions ) ) : ?&gt;
+                                                                        &lt;div class=&quot;row-actions&quot;&gt;
+                                                                                &lt;?php echo implode( ' | ', $actions ); ?&gt;
+                                                                        &lt;/div&gt;
+                                                                        &lt;?php endif; ?&gt;
+                                                                &lt;/td&gt;
+                                                        &lt;?php
+                                                        break;
+
+                                                        case 'lastupdated': ?&gt;
+                                                                &lt;td valign=&quot;top&quot;&gt;
+                                                                        &lt;?php
+                                                                        if ( 'list' == $mode )
+                                                                                $date = 'Y/m/d';
+                                                                        else
+                                                                                $date = 'Y/m/d \&lt;\b\r \/\&gt; g:i:s a';
+                                                                        echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __( 'Never' ) : mysql2date( __( $date ), $blog['last_updated'] ); ?&gt;
+                                                                &lt;/td&gt;
+                                                        &lt;?php
+                                                        break;
+                                                case 'registered': ?&gt;
+                                                                &lt;td valign=&quot;top&quot;&gt;
+                                                                &lt;?php
+                                                                if ( $blog['registered'] == '0000-00-00 00:00:00' )
+                                                                        echo '&amp;#x2014;';
+                                                                else
+                                                                        echo mysql2date( __( $date ), $blog['registered'] );
+                                                                ?&gt;
+                                                                &lt;/td&gt;
+                                                &lt;?php
+                                                break;
+                                                        case 'users': ?&gt;
+                                                                &lt;td valign=&quot;top&quot;&gt;
+                                                                        &lt;?php
+                                                                        $blogusers = get_users_of_blog( $blog['blog_id'] );
+                                                                        if ( is_array( $blogusers ) ) {
+                                                                                $blogusers_warning = '';
+                                                                                if ( count( $blogusers ) &gt; 5 ) {
+                                                                                        $blogusers = array_slice( $blogusers, 0, 5 );
+                                                                                        $blogusers_warning = __( 'Only showing first 5 users.' ) . ' &lt;a href=&quot;' . esc_url( get_admin_url( $blog['blog_id'], 'users.php' ) ) . '&quot;&gt;' . __( 'More' ) . '&lt;/a&gt;';
+                                                                                }
+                                                                                foreach ( $blogusers as $key =&gt; $val ) {
+                                                                                        echo '&lt;a href=&quot;' . esc_url( admin_url( 'user-edit.php?user_id=' . $val-&gt;user_id ) ) . '&quot;&gt;' . esc_html( $val-&gt;user_login ) . '&lt;/a&gt; ';
+                                                                                        if ( 'list' != $mode )
+                                                                                                echo '(' . $val-&gt;user_email . ')';
+                                                                                        echo '&lt;br /&gt;';
+                                                                                }
+                                                                                if ( $blogusers_warning != '' )
+                                                                                        echo '&lt;strong&gt;' . $blogusers_warning . '&lt;/strong&gt;&lt;br /&gt;';
+                                                                        }
+                                                                        ?&gt;
+                                                                &lt;/td&gt;
+                                                        &lt;?php
+                                                        break;
+
+                                                        case 'plugins': ?&gt;
+                                                                &lt;?php if ( has_filter( 'wpmublogsaction' ) ) { ?&gt;
+                                                                &lt;td valign=&quot;top&quot;&gt;
+                                                                        &lt;?php do_action( 'wpmublogsaction', $blog['blog_id'] ); ?&gt;
+                                                                &lt;/td&gt;
+                                                                &lt;?php } ?&gt;
+                                                        &lt;?php break;
+
+                                                        default: ?&gt;
+                                                                &lt;?php if ( has_filter( 'manage_blogs_custom_column' ) ) { ?&gt;
+                                                                &lt;td valign=&quot;top&quot;&gt;
+                                                                        &lt;?php do_action( 'manage_blogs_custom_column', $column_name, $blog['blog_id'] ); ?&gt;
+                                                                &lt;/td&gt;
+                                                                &lt;?php } ?&gt;
+                                                        &lt;?php break;
+                                                }
+                                        }
+                                        ?&gt;
+                                        &lt;/tr&gt;
+                                        &lt;?php
+                                }
+                        } else { ?&gt;
+                                &lt;tr&gt;
+                                        &lt;td colspan=&quot;&lt;?php echo (int) count( $sites_columns ); ?&gt;&quot;&gt;&lt;?php _e( 'No sites found.' ) ?&gt;&lt;/td&gt;
+                                &lt;/tr&gt;
+                        &lt;?php
+                        } // end if ($blogs)
+                        ?&gt;
+
+                        &lt;/tbody&gt;
+                &lt;/table&gt;
+                &lt;div class=&quot;tablenav&quot;&gt;
+                        &lt;?php
+                        if ( $page_links )
+                                echo &quot;&lt;div class='tablenav-pages'&gt;$page_links_text&lt;/div&gt;&quot;;
+                        ?&gt;
+
+                        &lt;div class=&quot;alignleft actions&quot;&gt;
+                        &lt;select name=&quot;action2&quot;&gt;
+                                &lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e( 'Bulk Actions' ); ?&gt;&lt;/option&gt;
+                                &lt;option value=&quot;delete&quot;&gt;&lt;?php _e( 'Delete' ); ?&gt;&lt;/option&gt;
+                                &lt;option value=&quot;spam&quot;&gt;&lt;?php _ex( 'Mark as Spam', 'site' ); ?&gt;&lt;/option&gt;
+                                &lt;option value=&quot;notspam&quot;&gt;&lt;?php _ex( 'Not Spam', 'site' ); ?&gt;&lt;/option&gt;
+                        &lt;/select&gt;
+                        &lt;input type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e( 'Apply' ); ?&gt;&quot; name=&quot;doaction2&quot; id=&quot;doaction2&quot; class=&quot;button-secondary action&quot; /&gt;
+                        &lt;/div&gt;
+                        &lt;br class=&quot;clear&quot; /&gt;
+                &lt;/div&gt;
+
+                &lt;/form&gt;
+                &lt;/div&gt;
+
+                &lt;div id=&quot;form-add-site&quot; class=&quot;wrap&quot;&gt;
+                        &lt;h3&gt;&lt;?php _e( 'Add Site' ) ?&gt;&lt;/h3&gt;
+                        &lt;form method=&quot;post&quot; action=&quot;edit.php?action=addblog&quot;&gt;
+                                &lt;?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ) ?&gt;
+                                &lt;table class=&quot;form-table&quot;&gt;
+                                        &lt;tr class=&quot;form-field form-required&quot;&gt;
+                                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Site Address' ) ?&gt;&lt;/th&gt;
+                                                &lt;td&gt;
+                                                &lt;?php if ( is_subdomain_install() ) { ?&gt;
+                                                        &lt;input name=&quot;blog[domain]&quot; type=&quot;text&quot; class=&quot;regular-text&quot; title=&quot;&lt;?php _e( 'Domain' ) ?&gt;&quot;/&gt;.&lt;?php echo preg_replace( '|^www\.|', '', $current_site-&gt;domain );?&gt;
+                                                &lt;?php } else {
+                                                        echo $current_site-&gt;domain . $current_site-&gt;path ?&gt;&lt;input name=&quot;blog[domain]&quot; class=&quot;regular-text&quot; type=&quot;text&quot; title=&quot;&lt;?php _e( 'Domain' ) ?&gt;&quot;/&gt;
+                                                &lt;?php }
+                                                echo '&lt;p&gt;' . __( 'Only the characters a-z and 0-9 recommended.' ) . '&lt;/p&gt;';
+                                                ?&gt;
+                                                &lt;/td&gt;
+                                        &lt;/tr&gt;
+                                        &lt;tr class=&quot;form-field form-required&quot;&gt;
+                                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Site Title' ) ?&gt;&lt;/th&gt;
+                                                &lt;td&gt;&lt;input name=&quot;blog[title]&quot; type=&quot;text&quot; class=&quot;regular-text&quot; title=&quot;&lt;?php _e( 'Title' ) ?&gt;&quot;/&gt;&lt;/td&gt;
+                                        &lt;/tr&gt;
+                                        &lt;tr class=&quot;form-field form-required&quot;&gt;
+                                                &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Admin Email' ) ?&gt;&lt;/th&gt;
+                                                &lt;td&gt;&lt;input name=&quot;blog[email]&quot; type=&quot;text&quot; class=&quot;regular-text&quot; title=&quot;&lt;?php _e( 'Email' ) ?&gt;&quot;/&gt;&lt;/td&gt;
+                                        &lt;/tr&gt;
+                                        &lt;tr class=&quot;form-field&quot;&gt;
+                                                &lt;td colspan=&quot;2&quot;&gt;&lt;?php _e( 'A new user will be created if the above email address is not in the database.' ) ?&gt;&lt;br /&gt;&lt;?php _e( 'The username and password will be mailed to this email address.' ) ?&gt;&lt;/td&gt;
+                                        &lt;/tr&gt;
+                                &lt;/table&gt;
+                                &lt;p class=&quot;submit&quot;&gt;
+                                        &lt;input class=&quot;button&quot; type=&quot;submit&quot; name=&quot;go&quot; value=&quot;&lt;?php esc_attr_e( 'Add Site' ) ?&gt;&quot; /&gt;&lt;/p&gt;
+                        &lt;/form&gt;
+                &lt;/div&gt;
+                &lt;?php
+        break;
+} // end switch( $action )
+
+include( '../admin-footer.php' ); ?&gt;
</ins></span></pre></div>
<a id="trunkwpadminnetworkthemesphpfromrev15473trunkwpadminmsthemesphp"></a>
<div class="copfile"><h4>Copied: trunk/wp-admin/network/themes.php (from rev 15473, trunk/wp-admin/ms-themes.php) (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/themes.php                                (rev 0)
+++ trunk/wp-admin/network/themes.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,99 @@
</span><ins>+&lt;?php
+/**
+ * Multisite themes administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( './admin.php' );
+
+if ( ! current_user_can( 'manage_network_themes' ) )
+        wp_die( __( 'You do not have permission to access this page.' ) );
+
+$title = __( 'Network Themes' );
+$parent_file = 'themes.php';
+
+add_contextual_help($current_screen,
+        '&lt;p&gt;' . __('This screen enables and disables the inclusion of themes available to choose in the Appearance menu for each site. It does not activate or deactivate which theme a site is currently using.') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('If the network admin disables a theme that is in use, it can still remain selected on that site. If another theme is chosen, the disabled theme will not appear in the site&amp;#8217;s Appearance &gt; Themes screen.') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('Themes can be enabled on a site by site basis by the network admin on the Edit Site screen you go to via the Edit action link on the Sites screen.') . '&lt;/p&gt;' .
+        '&lt;p&gt;&lt;strong&gt;' . __('For more information:') . '&lt;/strong&gt;&lt;/p&gt;' .
+        '&lt;p&gt;' . __('&lt;a href=&quot;http://codex.wordpress.org/Super_Admin_Themes_SubPanel&quot; target=&quot;_blank&quot;&gt;Documentation on Network Themes&lt;/a&gt;') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('&lt;a href=&quot;http://wordpress.org/support/&quot; target=&quot;_blank&quot;&gt;Support Forums&lt;/a&gt;') . '&lt;/p&gt;'
+);
+
+require_once( '../admin-header.php' );
+
+if ( isset( $_GET['updated'] ) ) {
+        ?&gt;
+        &lt;div id=&quot;message&quot; class=&quot;updated&quot;&gt;&lt;p&gt;&lt;?php _e( 'Site themes saved.' ) ?&gt;&lt;/p&gt;&lt;/div&gt;
+        &lt;?php
+}
+
+$themes = get_themes();
+$allowed_themes = get_site_allowed_themes();
+?&gt;
+&lt;div class=&quot;wrap&quot;&gt;
+        &lt;form action=&quot;&lt;?php echo esc_url( network_admin_url( 'edit.php?action=updatethemes' ) ); ?&gt;&quot; method=&quot;post&quot;&gt;
+                &lt;?php screen_icon(); ?&gt;
+                &lt;h2&gt;&lt;?php _e( 'Network Themes' ) ?&gt;&lt;/h2&gt;
+                &lt;p&gt;&lt;?php _e( 'Themes must be enabled for your network before they will be available to individual sites.' ) ?&gt;&lt;/p&gt;
+                &lt;p class=&quot;submit&quot;&gt;
+                        &lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e( 'Apply Changes' ) ?&gt;&quot; /&gt;&lt;/p&gt;
+                &lt;table class=&quot;widefat&quot;&gt;
+                        &lt;thead&gt;
+                                &lt;tr&gt;
+                                        &lt;th style=&quot;width:15%;&quot;&gt;&lt;?php _e( 'Enable' ) ?&gt;&lt;/th&gt;
+                                        &lt;th style=&quot;width:25%;&quot;&gt;&lt;?php _e( 'Theme' ) ?&gt;&lt;/th&gt;
+                                        &lt;th style=&quot;width:10%;&quot;&gt;&lt;?php _e( 'Version' ) ?&gt;&lt;/th&gt;
+                                        &lt;th style=&quot;width:60%;&quot;&gt;&lt;?php _e( 'Description' ) ?&gt;&lt;/th&gt;
+                                &lt;/tr&gt;
+                        &lt;/thead&gt;
+                        &lt;tbody id=&quot;plugins&quot;&gt;
+                        &lt;?php
+                        $total_theme_count = $activated_themes_count = 0;
+                        $class = '';
+                        foreach ( (array) $themes as $key =&gt; $theme ) {
+                                $total_theme_count++;
+                                $theme_key = esc_html( $theme['Stylesheet'] );
+                                $class = ( 'alt' == $class ) ? '' : 'alt';
+                                $class1 = $enabled = $disabled = '';
+                                $enabled = $disabled = false;
+
+                                if ( isset( $allowed_themes[$theme_key] ) == true ) {
+                                        $enabled = true;
+                                        $activated_themes_count++;
+                                        $class1 = 'active';
+                                } else {
+                                        $disabled = true;
+                                }
+                                ?&gt;
+                                &lt;tr valign=&quot;top&quot; class=&quot;&lt;?php echo $class . ' ' . $class1; ?&gt;&quot;&gt;
+                                        &lt;td&gt;
+                                                &lt;label&gt;&lt;input name=&quot;theme[&lt;?php echo $theme_key ?&gt;]&quot; type=&quot;radio&quot; id=&quot;enabled_&lt;?php echo $theme_key ?&gt;&quot; value=&quot;enabled&quot; &lt;?php checked( $enabled ) ?&gt; /&gt; &lt;?php _e( 'Yes' ) ?&gt;&lt;/label&gt;
+                                                &amp;nbsp;&amp;nbsp;&amp;nbsp;
+                                                &lt;label&gt;&lt;input name=&quot;theme[&lt;?php echo $theme_key ?&gt;]&quot; type=&quot;radio&quot; id=&quot;disabled_&lt;?php echo $theme_key ?&gt;&quot; value=&quot;disabled&quot; &lt;?php checked( $disabled ) ?&gt; /&gt; &lt;?php _e( 'No' ) ?&gt;&lt;/label&gt;
+                                        &lt;/td&gt;
+                                        &lt;th scope=&quot;row&quot; style=&quot;text-align:left;&quot;&gt;&lt;?php echo $key ?&gt;&lt;/th&gt;
+                                        &lt;td&gt;&lt;?php echo $theme['Version'] ?&gt;&lt;/td&gt;
+                                        &lt;td&gt;&lt;?php echo $theme['Description'] ?&gt;&lt;/td&gt;
+                                &lt;/tr&gt;
+                        &lt;?php } ?&gt;
+                        &lt;/tbody&gt;
+                &lt;/table&gt;
+
+                &lt;p class=&quot;submit&quot;&gt;
+                        &lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e( 'Apply Changes' ) ?&gt;&quot; /&gt;&lt;/p&gt;
+        &lt;/form&gt;
+
+        &lt;h3&gt;&lt;?php _e( 'Total' )?&gt;&lt;/h3&gt;
+        &lt;p&gt;
+                &lt;?php printf( __( 'Themes Installed: %d' ), $total_theme_count); ?&gt;
+                &lt;br /&gt;
+                &lt;?php printf( __( 'Themes Enabled: %d' ), $activated_themes_count); ?&gt;
+        &lt;/p&gt;
+&lt;/div&gt;
+
+&lt;?php include( '../admin-footer.php' ); ?&gt;
</ins></span></pre></div>
<a id="trunkwpadminnetworkupgradephpfromrev15473trunkwpadminmsupgradenetworkphp"></a>
<div class="copfile"><h4>Copied: trunk/wp-admin/network/upgrade.php (from rev 15473, trunk/wp-admin/ms-upgrade-network.php) (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/upgrade.php                                (rev 0)
+++ trunk/wp-admin/network/upgrade.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+&lt;?php
+/**
+ * Multisite upgrade administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once('./admin.php');
+
+if ( !is_multisite() )
+        wp_die( __( 'Multisite support is not enabled.' ) );
+
+require_once( ABSPATH . WPINC . '/http.php' );
+
+$title = __( 'Update Network' );
+$parent_file = 'upgrade.php';
+
+add_contextual_help($current_screen,
+        '&lt;p&gt;' . __('Only use this screen once you have updated to a new version of WordPress through Dashboard &gt; Updates. Clicking the Update Network button will step through each site in the network, five at a time, and make sure any database upgrades are applied.') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('If a version update to core has not happened, clicking this button won&amp;#8217;t affect anything.') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('If this process fails for any reason, users logging in to their sites will force the same update.') . '&lt;/p&gt;' .
+        '&lt;p&gt;&lt;strong&gt;' . __('For more information:') . '&lt;/strong&gt;&lt;/p&gt;' .
+        '&lt;p&gt;' . __('&lt;a href=&quot;http://codex.wordpress.org/Super_Admin_Update_SubPanel&quot; target=&quot;_blank&quot;&gt;Update Network Documentation&lt;/a&gt;') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('&lt;a href=&quot;http://wordpress.org/support/&quot; target=&quot;_blank&quot;&gt;Support Forums&lt;/a&gt;') . '&lt;/p&gt;'
+);
+
+require_once('../admin-header.php');
+
+if ( ! current_user_can( 'manage_network' ) )
+        wp_die( __( 'You do not have permission to access this page.' ) );
+
+echo '&lt;div class=&quot;wrap&quot;&gt;';
+screen_icon();
+echo '&lt;h2&gt;' . __( 'Update Network' ) . '&lt;/h2&gt;';
+
+$action = isset($_GET['action']) ? $_GET['action'] : 'show';
+
+switch ( $action ) {
+        case &quot;upgrade&quot;:
+                $n = ( isset($_GET['n']) ) ? intval($_GET['n']) : 0;
+
+                if ( $n &lt; 5 ) {
+                        global $wp_db_version;
+                        update_site_option( 'wpmu_upgrade_site', $wp_db_version );
+                }
+
+                $blogs = $wpdb-&gt;get_results( &quot;SELECT * FROM {$wpdb-&gt;blogs} WHERE site_id = '{$wpdb-&gt;siteid}' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT {$n}, 5&quot;, ARRAY_A );
+                if ( empty( $blogs ) ) {
+                        echo '&lt;p&gt;' . __( 'All done!' ) . '&lt;/p&gt;';
+                        break;
+                }
+                echo &quot;&lt;ul&gt;&quot;;
+                foreach ( (array) $blogs as $details ) {
+                        $siteurl = get_blog_option( $details['blog_id'], 'siteurl' );
+                        echo &quot;&lt;li&gt;$siteurl&lt;/li&gt;&quot;;
+                        $response = wp_remote_get( trailingslashit( $siteurl ) . &quot;wp-admin/upgrade.php?step=upgrade_db&quot;, array( 'timeout' =&gt; 120, 'httpversion' =&gt; '1.1' ) );
+                        if ( is_wp_error( $response ) )
+                                wp_die( sprintf( __( 'Warning! Problem updating %1$s. Your server may not be able to connect to sites running on it. Error message: &lt;em&gt;%2$s&lt;/em&gt;' ), $siteurl, $response-&gt;get_error_message() ) );
+                        do_action( 'after_mu_upgrade', $response );
+                        do_action( 'wpmu_upgrade_site', $details[ 'blog_id' ] );
+                }
+                echo &quot;&lt;/ul&gt;&quot;;
+                ?&gt;&lt;p&gt;&lt;?php _e( 'If your browser doesn&amp;#8217;t start loading the next page automatically, click this link:' ); ?&gt; &lt;a class=&quot;button&quot; href=&quot;ms-upgrade-network.php?action=upgrade&amp;amp;n=&lt;?php echo ($n + 5) ?&gt;&quot;&gt;&lt;?php _e(&quot;Next Sites&quot;); ?&gt;&lt;/a&gt;&lt;/p&gt;
+                &lt;script type='text/javascript'&gt;
+                &lt;!--
+                function nextpage() {
+                        location.href = &quot;upgrade.php?action=upgrade&amp;n=&lt;?php echo ($n + 5) ?&gt;&quot;;
+                }
+                setTimeout( &quot;nextpage()&quot;, 250 );
+                //--&gt;
+                &lt;/script&gt;&lt;?php
+        break;
+        case 'show':
+        default:
+                ?&gt;&lt;p&gt;&lt;?php _e( 'You can update all the sites on your network through this page. It works by calling the update script of each site automatically. Hit the link below to update.' ); ?&gt;&lt;/p&gt;
+                &lt;p&gt;&lt;a class=&quot;button&quot; href=&quot;upgrade.php?action=upgrade&quot;&gt;&lt;?php _e(&quot;Update Network&quot;); ?&gt;&lt;/a&gt;&lt;/p&gt;&lt;?php
+                do_action( 'wpmu_upgrade_page' );
+        break;
+}
+?&gt;
+&lt;/div&gt;
+
+&lt;?php include('../admin-footer.php'); ?&gt;
</ins></span></pre></div>
<a id="trunkwpadminnetworkusereditphp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/network/user-edit.php (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/user-edit.php                                (rev 0)
+++ trunk/wp-admin/network/user-edit.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+&lt;?php
+
+require_once( './admin.php' );
+
+require( '../user-edit.php' );
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-admin/network/user-edit.php
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:eol-style
</span><span class="cx">   + native
</span></span></pre></div>
<a id="trunkwpadminnetworkusersphpfromrev15473trunkwpadminmsusersphp"></a>
<div class="copfile"><h4>Copied: trunk/wp-admin/network/users.php (from rev 15473, trunk/wp-admin/ms-users.php) (0 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/users.php                                (rev 0)
+++ trunk/wp-admin/network/users.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -0,0 +1,378 @@
</span><ins>+&lt;?php
+/**
+ * Multisite users administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+require_once( './admin.php' );
+
+if ( !is_multisite() )
+        wp_die( __( 'Multisite support is not enabled.' ) );
+
+if ( ! current_user_can( 'manage_network_users' ) )
+        wp_die( __( 'You do not have permission to access this page.' ) );
+
+$title = __( 'Users' );
+$parent_file = 'users.php';
+
+add_contextual_help($current_screen,
+        '&lt;p&gt;' . __('This table shows all users across the network and the sites to which they are assigned.') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('Hover over any user on the list to make the edit links appear. The Edit link on the left will take you to his or her Edit User profile page; the Edit link on the right by any site name goes to an Edit Site screen for that site.') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('You can also go to the user&amp;#8217;s profile page by clicking on the individual username.') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('You can sort the table by clicking on any of the bold headings and switch between list and excerpt views by using the icons in the upper right.') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('The bulk action will permanently delete selected users, or mark/unmark those selected as spam. Spam users will have posts removed and will be unable to sign up again with the same email addresses.') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('Add User will add that person to this table and send them an email.') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('Users who are signed up to the network without a site are added as subscribers to the main or primary dashboard site, giving them profile pages to manage their accounts. These users will only see Dashboard and My Sites in the main navigation until a site is created for them.') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('You can make an existing user an additional super admin by going to the Edit User profile page and checking the box to grant that privilege.') . '&lt;/p&gt;' .
+        '&lt;p&gt;&lt;strong&gt;' . __('For more information:') . '&lt;/strong&gt;&lt;/p&gt;' .
+        '&lt;p&gt;' . __('&lt;a href=&quot;http://codex.wordpress.org/Super_Admin_Users_SubPanel&quot; target=&quot;_blank&quot;&gt;Network Users Documentation&lt;/a&gt;') . '&lt;/p&gt;' .
+        '&lt;p&gt;' . __('&lt;a href=&quot;http://wordpress.org/support/&quot; target=&quot;_blank&quot;&gt;Support Forums&lt;/a&gt;') . '&lt;/p&gt;'
+);
+
+wp_enqueue_script( 'admin-forms' );
+
+require_once( '../admin-header.php' );
+
+if ( isset( $_GET['updated'] ) &amp;&amp; $_GET['updated'] == 'true' &amp;&amp; ! empty( $_GET['action'] ) ) {
+        ?&gt;
+        &lt;div id=&quot;message&quot; class=&quot;updated&quot;&gt;&lt;p&gt;
+                &lt;?php
+                switch ( $_GET['action'] ) {
+                        case 'delete':
+                                _e( 'User deleted.' );
+                        break;
+                        case 'all_spam':
+                                _e( 'Users marked as spam.' );
+                        break;
+                        case 'all_notspam':
+                                _e( 'Users removed from spam.' );
+                        break;
+                        case 'all_delete':
+                                _e( 'Users deleted.' );
+                        break;
+                        case 'add':
+                                _e( 'User added.' );
+                        break;
+                }
+                ?&gt;
+        &lt;/p&gt;&lt;/div&gt;
+        &lt;?php
+}
+
+        $pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0;
+        if ( empty( $pagenum ) )
+                $pagenum = 1;
+
+        $per_page = (int) get_user_option( 'ms_users_per_page' );
+        if ( empty( $per_page ) || $per_page &lt; 1 )
+                $per_page = 15;
+
+        $per_page = apply_filters( 'ms_users_per_page', $per_page );
+
+        $s = isset( $_GET['s'] ) ? stripslashes( trim( $_GET[ 's' ] ) ) : '';
+        $like_s = esc_sql( like_escape( $s ) );
+
+        $query = &quot;SELECT * FROM {$wpdb-&gt;users}&quot;;
+
+        if ( !empty( $like_s ) ) {
+                $query .= &quot; WHERE user_login LIKE '%$like_s%' OR user_email LIKE '%$like_s%'&quot;;
+        }
+
+        $order_by = isset( $_GET['sortby'] ) ? $_GET['sortby'] : 'id';
+        if ( $order_by == 'email' ) {
+                $query .= ' ORDER BY user_email ';
+        } elseif ( $order_by == 'login' ) {
+                $query .= ' ORDER BY user_login ';
+        } elseif ( $order_by == 'name' ) {
+                $query .= ' ORDER BY display_name ';
+        } elseif ( $order_by == 'registered' ) {
+                $query .= ' ORDER BY user_registered ';
+        } else {
+                $order_by = 'id';
+                $query .= ' ORDER BY ID ';
+        }
+
+        $order = ( isset( $_GET['order'] ) &amp;&amp; 'DESC' == $_GET['order'] ) ? 'DESC' : 'ASC';
+        $query .= $order;
+
+        $total = $wpdb-&gt;get_var( str_replace( 'SELECT *', 'SELECT COUNT(ID)', $query ) );
+
+        $query .= &quot; LIMIT &quot; . intval( ( $pagenum - 1 ) * $per_page) . &quot;, &quot; . intval( $per_page );
+
+        $user_list = $wpdb-&gt;get_results( $query, ARRAY_A );
+
+        $num_pages = ceil( $total / $per_page );
+        $page_links = paginate_links( array(
+                'base' =&gt; add_query_arg( 'paged', '%#%' ),
+                'format' =&gt; '',
+                'prev_text' =&gt; __( '&amp;laquo;' ),
+                'next_text' =&gt; __( '&amp;raquo;' ),
+                'total' =&gt; $num_pages,
+                'current' =&gt; $pagenum
+        ));
+
+        if ( empty( $_GET['mode'] ) )
+                $mode = 'list';
+        else
+                $mode = esc_attr( $_GET['mode'] );
+
+        ?&gt;
+        &lt;div class=&quot;wrap&quot;&gt;
+        &lt;?php screen_icon(); ?&gt;
+        &lt;h2&gt;&lt;?php esc_html_e( 'Users' ); ?&gt;
+        &lt;a href=&quot;#form-add-user&quot; class=&quot;button add-new-h2&quot;&gt;&lt;?php echo esc_html_x( 'Add New' , 'users'); ?&gt;&lt;/a&gt;
+        &lt;?php
+        if ( isset( $_GET['s'] ) &amp;&amp; $_GET['s'] )
+        printf( '&lt;span class=&quot;subtitle&quot;&gt;' . __( 'Search results for &amp;#8220;%s&amp;#8221;' ) . '&lt;/span&gt;', esc_html( $s ) );
+        ?&gt;
+        &lt;/h2&gt;
+
+        &lt;form action=&quot;users.php&quot; method=&quot;get&quot; class=&quot;search-form&quot;&gt;
+                &lt;p class=&quot;search-box&quot;&gt;
+                &lt;input type=&quot;text&quot; name=&quot;s&quot; value=&quot;&lt;?php echo esc_attr( $s ); ?&gt;&quot; class=&quot;search-input&quot; id=&quot;user-search-input&quot; /&gt;
+                &lt;input type=&quot;submit&quot; id=&quot;post-query-submit&quot; value=&quot;&lt;?php esc_attr_e( 'Search Users' ) ?&gt;&quot; class=&quot;button&quot; /&gt;
+                &lt;/p&gt;
+        &lt;/form&gt;
+
+        &lt;form id=&quot;form-user-list&quot; action='edit.php?action=allusers' method='post'&gt;
+                &lt;input type=&quot;hidden&quot; name=&quot;mode&quot; value=&quot;&lt;?php echo esc_attr( $mode ); ?&gt;&quot; /&gt;
+                &lt;div class=&quot;tablenav&quot;&gt;
+                        &lt;div class=&quot;alignleft actions&quot;&gt;
+                                &lt;select name=&quot;action&quot;&gt;
+                                        &lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e( 'Bulk Actions' ); ?&gt;&lt;/option&gt;
+                                        &lt;option value=&quot;delete&quot;&gt;&lt;?php _e( 'Delete' ); ?&gt;&lt;/option&gt;
+                                        &lt;option value=&quot;spam&quot;&gt;&lt;?php _ex( 'Mark as Spam', 'user' ); ?&gt;&lt;/option&gt;
+                                        &lt;option value=&quot;notspam&quot;&gt;&lt;?php _ex( 'Not Spam', 'user' ); ?&gt;&lt;/option&gt;
+                                &lt;/select&gt;
+                                &lt;input type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e( 'Apply' ); ?&gt;&quot; name=&quot;doaction&quot; id=&quot;doaction&quot; class=&quot;button-secondary action&quot; /&gt;
+                                &lt;?php wp_nonce_field( 'bulk-ms-users', '_wpnonce_bulk-ms-users' ); ?&gt;
+                        &lt;/div&gt;
+
+                        &lt;?php if ( $page_links ) { ?&gt;
+                        &lt;div class=&quot;tablenav-pages&quot;&gt;
+                        &lt;?php $page_links_text = sprintf( '&lt;span class=&quot;displaying-num&quot;&gt;' . __( 'Displaying %s&amp;#8211;%s of %s' ) . '&lt;/span&gt;%s',
+                        number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
+                        number_format_i18n( min( $pagenum * $per_page, $total ) ),
+                        number_format_i18n( $total ),
+                        $page_links
+                        ); echo $page_links_text; ?&gt;
+                        &lt;/div&gt;
+                        &lt;?php } ?&gt;
+
+                        &lt;div class=&quot;view-switch&quot;&gt;
+                                &lt;a href=&quot;&lt;?php echo esc_url( add_query_arg( 'mode', 'list', $_SERVER['REQUEST_URI'] ) ) ?&gt;&quot;&gt;&lt;img &lt;?php if ( 'list' == $mode ) echo 'class=&quot;current&quot;'; ?&gt; id=&quot;view-switch-list&quot; src=&quot;&lt;?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?&gt;&quot; width=&quot;20&quot; height=&quot;20&quot; title=&quot;&lt;?php _e( 'List View' ) ?&gt;&quot; alt=&quot;&lt;?php _e( 'List View' ) ?&gt;&quot; /&gt;&lt;/a&gt;
+                                &lt;a href=&quot;&lt;?php echo esc_url( add_query_arg( 'mode', 'excerpt', $_SERVER['REQUEST_URI'] ) ) ?&gt;&quot;&gt;&lt;img &lt;?php if ( 'excerpt' == $mode ) echo 'class=&quot;current&quot;'; ?&gt; id=&quot;view-switch-excerpt&quot; src=&quot;&lt;?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?&gt;&quot; width=&quot;20&quot; height=&quot;20&quot; title=&quot;&lt;?php _e( 'Excerpt View' ) ?&gt;&quot; alt=&quot;&lt;?php _e( 'Excerpt View' ) ?&gt;&quot; /&gt;&lt;/a&gt;
+                        &lt;/div&gt;
+                &lt;/div&gt;
+                &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+
+                &lt;?php
+                // define the columns to display, the syntax is 'internal name' =&gt; 'display name'
+                $users_columns = array(
+                        'id'           =&gt; __( 'ID' ),
+                        'login'      =&gt; __( 'Username' ),
+                        'name'       =&gt; __( 'Name' ),
+                        'email'      =&gt; __( 'E-mail' ),
+                        'registered' =&gt; _x( 'Registered', 'user' ),
+                        'blogs'      =&gt; __( 'Sites' )
+                );
+                $users_columns = apply_filters( 'wpmu_users_columns', $users_columns );
+                ?&gt;
+                &lt;table class=&quot;widefat&quot;&gt;
+                        &lt;thead&gt;
+                        &lt;tr&gt;
+                                &lt;th class=&quot;manage-column column-cb check-column&quot; scope=&quot;col&quot;&gt;
+                                        &lt;input type=&quot;checkbox&quot; /&gt;
+                                &lt;/th&gt;
+                                &lt;?php
+                                $col_url = '';
+                                foreach($users_columns as $column_id =&gt; $column_display_name) {
+                                        $column_link = &quot;&lt;a href='&quot;;
+                                        $order2 = '';
+                                        if ( $order_by == $column_id )
+                                                $order2 = ( $order == 'DESC' ) ? 'ASC' : 'DESC';
+
+                                        $column_link .= esc_url( add_query_arg( array( 'order' =&gt; $order2, 'paged' =&gt; $pagenum, 'sortby' =&gt; $column_id ), remove_query_arg( array( 'action', 'updated' ), $_SERVER['REQUEST_URI'] ) ) );
+                                        $column_link .= &quot;'&gt;{$column_display_name}&lt;/a&gt;&quot;;
+                                        $col_url .= '&lt;th scope=&quot;col&quot;&gt;' . ( $column_id == 'blogs' ? $column_display_name : $column_link ) . '&lt;/th&gt;';
+                                }
+                                echo $col_url; ?&gt;
+                        &lt;/tr&gt;
+                        &lt;/thead&gt;
+                        &lt;tfoot&gt;
+                        &lt;tr&gt;
+                                &lt;th class=&quot;manage-column column-cb check-column&quot; scope=&quot;col&quot;&gt;
+                                        &lt;input type=&quot;checkbox&quot; /&gt;
+                                &lt;/th&gt;
+                                &lt;?php echo $col_url; ?&gt;
+                        &lt;/tr&gt;
+                        &lt;/tfoot&gt;
+                        &lt;tbody id=&quot;the-user-list&quot; class=&quot;list:user&quot;&gt;
+                        &lt;?php if ( $user_list ) {
+                                $class = '';
+                                $super_admins = get_super_admins();
+                                foreach ( (array) $user_list as $user ) {
+                                        $class = ( 'alternate' == $class ) ? '' : 'alternate';
+
+                                        $status_list = array( 'spam' =&gt; 'site-spammed', 'deleted' =&gt; 'site-deleted' );
+
+                                        foreach ( $status_list as $status =&gt; $col ) {
+                                                if ( $user[$status] )
+                                                        $class = $col;
+                                        }
+
+                                        ?&gt;
+                                        &lt;tr class=&quot;&lt;?php echo $class; ?&gt;&quot;&gt;
+                                        &lt;?php
+                                        foreach( (array) $users_columns as $column_name=&gt;$column_display_name ) :
+                                                switch( $column_name ) {
+                                                        case 'id': ?&gt;
+                                                                &lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;
+                                                                        &lt;input type=&quot;checkbox&quot; id=&quot;blog_&lt;?php echo $user['ID'] ?&gt;&quot; name=&quot;allusers[]&quot; value=&quot;&lt;?php echo esc_attr( $user['ID'] ) ?&gt;&quot; /&gt;
+                                                                &lt;/th&gt;
+                                                                &lt;th valign=&quot;top&quot; scope=&quot;row&quot;&gt;
+                                                                        &lt;?php echo $user['ID'] ?&gt;
+                                                                &lt;/th&gt;
+                                                        &lt;?php
+                                                        break;
+
+                                                        case 'login':
+                                                                $avatar        = get_avatar( $user['user_email'], 32 );
+                                                                $edit_link = ( $current_user-&gt;ID == $user['ID'] ) ? 'profile.php' : 'user-edit.php?user_id=' . $user['ID'];
+                                                                ?&gt;
+                                                                &lt;td class=&quot;username column-username&quot;&gt;
+                                                                        &lt;?php echo $avatar; ?&gt;&lt;strong&gt;&lt;a href=&quot;&lt;?php echo esc_url( network_admin_url( $edit_link ) ); ?&gt;&quot; class=&quot;edit&quot;&gt;&lt;?php echo stripslashes( $user['user_login'] ); ?&gt;&lt;/a&gt;&lt;?php
+                                                                        if ( in_array( $user['user_login'], $super_admins ) )
+                                                                                echo ' - ' . __( 'Super admin' );
+                                                                        ?&gt;&lt;/strong&gt;
+                                                                        &lt;br/&gt;
+                                                                        &lt;div class=&quot;row-actions&quot;&gt;
+                                                                                &lt;span class=&quot;edit&quot;&gt;&lt;a href=&quot;&lt;?php echo esc_url( network_admin_url( $edit_link ) ); ?&gt;&quot;&gt;&lt;?php _e( 'Edit' ); ?&gt;&lt;/a&gt;&lt;/span&gt;
+                                                                                &lt;?php if ( ! in_array( $user['user_login'], $super_admins ) ) { ?&gt;
+                                                                                | &lt;span class=&quot;delete&quot;&gt;&lt;a href=&quot;&lt;?php echo $delete        = esc_url( admin_url( add_query_arg( '_wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'edit.php', 'deleteuser' ) . '&amp;amp;action=deleteuser&amp;amp;id=' . $user['ID'] ) ) ); ?&gt;&quot; class=&quot;delete&quot;&gt;&lt;?php _e( 'Delete' ); ?&gt;&lt;/a&gt;&lt;/span&gt;
+                                                                                &lt;?php } ?&gt;
+                                                                        &lt;/div&gt;
+                                                                &lt;/td&gt;
+                                                        &lt;?php
+                                                        break;
+
+                                                        case 'name': ?&gt;
+                                                                &lt;td class=&quot;name column-name&quot;&gt;&lt;?php echo $user['display_name'] ?&gt;&lt;/td&gt;
+                                                        &lt;?php
+                                                        break;
+
+                                                        case 'email': ?&gt;
+                                                                &lt;td class=&quot;email column-email&quot;&gt;&lt;a href=&quot;mailto:&lt;?php echo $user['user_email'] ?&gt;&quot;&gt;&lt;?php echo $user['user_email'] ?&gt;&lt;/a&gt;&lt;/td&gt;
+                                                        &lt;?php
+                                                        break;
+
+                                                        case 'registered':
+                                                                if ( 'list' == $mode )
+                                                                        $date = 'Y/m/d';
+                                                                else
+                                                                        $date = 'Y/m/d \&lt;\b\r \/\&gt; g:i:s a';
+                                                        ?&gt;
+                                                                &lt;td&gt;&lt;?php echo mysql2date( __( $date ), $user['user_registered'] ); ?&gt;&lt;/td&gt;
+                                                        &lt;?php
+                                                        break;
+
+                                                        case 'blogs':
+                                                                $blogs = get_blogs_of_user( $user['ID'], true );
+                                                                ?&gt;
+                                                                &lt;td&gt;
+                                                                        &lt;?php
+                                                                        if ( is_array( $blogs ) ) {
+                                                                                foreach ( (array) $blogs as $key =&gt; $val ) {
+                                                                                        $path        = ( $val-&gt;path == '/' ) ? '' : $val-&gt;path;
+                                                                                        echo '&lt;a href=&quot;'. esc_url( network_admin_url( 'sites.php?action=editblog&amp;amp;id=' . $val-&gt;userblog_id  ) ) .'&quot;&gt;' . str_replace( '.' . $current_site-&gt;domain, '', $val-&gt;domain . $path ) . '&lt;/a&gt;';
+                                                                                        echo ' &lt;small class=&quot;row-actions&quot;&gt;';
+
+                                                                                        // Edit
+                                                                                        echo '&lt;a href=&quot;'. esc_url( network_admin_url( 'sites.php?action=editblog&amp;amp;id=' . $val-&gt;userblog_id  ) ) .'&quot;&gt;' . __( 'Edit' ) . '&lt;/a&gt; | ';
+
+                                                                                        // View
+                                                                                        echo '&lt;a ';
+                                                                                        if ( get_blog_status( $val-&gt;userblog_id, 'spam' ) == 1 )
+                                                                                                echo 'style=&quot;background-color: #faa&quot; ';
+                                                                                        echo 'href=&quot;' .  esc_url( get_home_url( $val-&gt;userblog_id ) )  . '&quot;&gt;' . __( 'View' ) . '&lt;/a&gt;';
+
+                                                                                        echo '&lt;/small&gt;&lt;br /&gt;';
+                                                                                }
+                                                                        }
+                                                                        ?&gt;
+                                                                &lt;/td&gt;
+                                                        &lt;?php
+                                                        break;
+
+                                                        default: ?&gt;
+                                                                &lt;td&gt;&lt;?php do_action( 'manage_users_custom_column', $column_name, $user['ID'] ); ?&gt;&lt;/td&gt;
+                                                        &lt;?php
+                                                        break;
+                                                }
+                                        endforeach
+                                        ?&gt;
+                                        &lt;/tr&gt;
+                                        &lt;?php
+                                }
+                        } else {
+                        ?&gt;
+                                &lt;tr&gt;
+                                        &lt;td colspan=&quot;&lt;?php echo (int) count($users_columns); ?&gt;&quot;&gt;&lt;?php _e( 'No users found.' ) ?&gt;&lt;/td&gt;
+                                &lt;/tr&gt;
+                                &lt;?php
+                        } // end if ($users)
+                        ?&gt;
+                        &lt;/tbody&gt;
+                &lt;/table&gt;
+
+                &lt;div class=&quot;tablenav&quot;&gt;
+                        &lt;?php
+                        if ( $page_links )
+                                echo &quot;&lt;div class='tablenav-pages'&gt;$page_links_text&lt;/div&gt;&quot;;
+                        ?&gt;
+
+                        &lt;div class=&quot;alignleft actions&quot;&gt;
+                                &lt;select name=&quot;action2&quot;&gt;
+                                        &lt;option value=&quot;-1&quot; selected=&quot;selected&quot;&gt;&lt;?php _e( 'Bulk Actions' ); ?&gt;&lt;/option&gt;
+                                        &lt;option value=&quot;delete&quot;&gt;&lt;?php _e( 'Delete' ); ?&gt;&lt;/option&gt;
+                                        &lt;option value=&quot;spam&quot;&gt;&lt;?php _ex( 'Mark as Spam', 'user' ); ?&gt;&lt;/option&gt;
+                                        &lt;option value=&quot;notspam&quot;&gt;&lt;?php _ex( 'Not Spam', 'user' ); ?&gt;&lt;/option&gt;
+                                &lt;/select&gt;
+                                &lt;input type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e( 'Apply' ); ?&gt;&quot; name=&quot;doaction2&quot; id=&quot;doaction2&quot; class=&quot;button-secondary action&quot; /&gt;
+                        &lt;/div&gt;
+                        &lt;br class=&quot;clear&quot; /&gt;
+                &lt;/div&gt;
+
+                &lt;/form&gt;
+                &lt;/div&gt;
+
+&lt;?php
+if ( apply_filters( 'show_adduser_fields', true ) ) :
+?&gt;
+&lt;div class=&quot;wrap&quot; id=&quot;form-add-user&quot;&gt;
+        &lt;h3&gt;&lt;?php _e( 'Add User' ) ?&gt;&lt;/h3&gt;
+        &lt;form action=&quot;edit.php?action=adduser&quot; method=&quot;post&quot;&gt;
+        &lt;table class=&quot;form-table&quot;&gt;
+                &lt;tr class=&quot;form-field form-required&quot;&gt;
+                        &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Username' ) ?&gt;&lt;/th&gt;
+                        &lt;td&gt;&lt;input type=&quot;text&quot; class=&quot;regular-text&quot; name=&quot;user[username]&quot; /&gt;&lt;/td&gt;
+                &lt;/tr&gt;
+                &lt;tr class=&quot;form-field form-required&quot;&gt;
+                        &lt;th scope=&quot;row&quot;&gt;&lt;?php _e( 'Email' ) ?&gt;&lt;/th&gt;
+                        &lt;td&gt;&lt;input type=&quot;text&quot; class=&quot;regular-text&quot; name=&quot;user[email]&quot; /&gt;&lt;/td&gt;
+                &lt;/tr&gt;
+                &lt;tr class=&quot;form-field&quot;&gt;
+                        &lt;td colspan=&quot;2&quot;&gt;&lt;?php _e( 'Username and password will be mailed to the above email address.' ) ?&gt;&lt;/td&gt;
+                &lt;/tr&gt;
+        &lt;/table&gt;
+        &lt;p class=&quot;submit&quot;&gt;
+                &lt;?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?&gt;
+                &lt;input class=&quot;button&quot; type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e( 'Add user' ) ?&gt;&quot; /&gt;&lt;/p&gt;
+        &lt;/form&gt;
+&lt;/div&gt;
+&lt;?php endif; ?&gt;
+
+&lt;?php include( '../admin-footer.php' ); ?&gt;
</ins></span></pre></div>
<a id="trunkwpadminpluginsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/plugins.php (15480 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/plugins.php        2010-07-29 21:58:58 UTC (rev 15480)
+++ trunk/wp-admin/plugins.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -122,7 +122,7 @@
</span><span class="cx">                         $title = __( 'Upgrade Plugins' );
</span><span class="cx">                         $parent_file = 'plugins.php';
</span><span class="cx"> 
</span><del>-                        require_once( './admin-header.php' );
</del><ins>+                        require_once( ABSPATH . 'wp-admin/admin-header.php' );
</ins><span class="cx"> 
</span><span class="cx">                         echo '&lt;div class=&quot;wrap&quot;&gt;';
</span><span class="cx">                         screen_icon();
</span><span class="lines">@@ -219,7 +219,7 @@
</span><span class="cx"> 
</span><span class="cx">                         if ( ! isset($_REQUEST['verify-delete']) ) {
</span><span class="cx">                                 wp_enqueue_script('jquery');
</span><del>-                                require_once('./admin-header.php');
</del><ins>+                                require_once(ABSPATH . 'wp-admin/admin-header.php');
</ins><span class="cx">                                 ?&gt;
</span><span class="cx">                         &lt;div class=&quot;wrap&quot;&gt;
</span><span class="cx">                                 &lt;?php
</span><span class="lines">@@ -327,7 +327,7 @@
</span><span class="cx"> 
</span><span class="cx"> $title = __('Plugins');
</span><span class="cx"> 
</span><del>-require_once('./admin-header.php');
</del><ins>+require_once(ABSPATH . 'wp-admin/admin-header.php');
</ins><span class="cx"> 
</span><span class="cx"> $invalid = validate_active_plugins();
</span><span class="cx"> if ( !empty($invalid) )
</span><span class="lines">@@ -345,7 +345,7 @@
</span><span class="cx">         &lt;div id=&quot;message&quot; class=&quot;updated&quot;&gt;&lt;p&gt;&lt;?php echo $errmsg; ?&gt;&lt;/p&gt;
</span><span class="cx">         &lt;?php
</span><span class="cx">                 if ( !isset($_GET['charsout']) &amp;&amp; wp_verify_nonce($_GET['_error_nonce'], 'plugin-activation-error_' . $plugin) ) { ?&gt;
</span><del>-        &lt;iframe style=&quot;border:0&quot; width=&quot;100%&quot; height=&quot;70px&quot; src=&quot;&lt;?php echo admin_url('plugins.php?action=error_scrape&amp;amp;plugin=' . esc_attr($plugin) . '&amp;amp;_wpnonce=' . esc_attr($_GET['_error_nonce'])); ?&gt;&quot;&gt;&lt;/iframe&gt;
</del><ins>+        &lt;iframe style=&quot;border:0&quot; width=&quot;100%&quot; height=&quot;70px&quot; src=&quot;&lt;?php echo 'plugins.php?action=error_scrape&amp;amp;plugin=' . esc_attr($plugin) . '&amp;amp;_wpnonce=' . esc_attr($_GET['_error_nonce']); ?&gt;&quot;&gt;&lt;/iframe&gt;
</ins><span class="cx">         &lt;?php
</span><span class="cx">                 }
</span><span class="cx">         ?&gt;
</span><span class="lines">@@ -384,9 +384,8 @@
</span><span class="cx"> $recent_plugins = array();
</span><span class="cx"> $recently_activated = get_option('recently_activated', array());
</span><span class="cx"> $upgrade_plugins = array();
</span><del>-$network_plugins = array();
</del><span class="cx"> $mustuse_plugins = $dropins_plugins = array();
</span><del>-if ( ! is_multisite() || current_user_can('manage_network_plugins') ) {
</del><ins>+if ( ! is_multisite() || ( is_network_admin() &amp;&amp; current_user_can('manage_network_plugins') ) ) {
</ins><span class="cx">         if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) )
</span><span class="cx">                 $mustuse_plugins = get_mu_plugins();
</span><span class="cx">         if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) )
</span><span class="lines">@@ -413,16 +412,21 @@
</span><span class="cx"> unset( $plugin_array_name );
</span><span class="cx"> 
</span><span class="cx"> foreach ( (array) $all_plugins as $plugin_file =&gt; $plugin_data) {
</span><ins>+        if ( is_network_admin() )
+                $is_active = is_plugin_active_for_network($plugin_file);
+        else
+                $is_active = is_plugin_active($plugin_file);
</ins><span class="cx">         // Filter into individual sections
</span><del>-        if ( is_multisite() &amp;&amp; is_network_only_plugin( $plugin_file ) &amp;&amp; !current_user_can( 'manage_network_plugins' ) ) {
</del><ins>+        if ( is_plugin_active_for_network($plugin_file) &amp;&amp; !is_network_admin() ) {
</ins><span class="cx">                 unset( $all_plugins[ $plugin_file ] );
</span><span class="cx">                 continue;
</span><del>-        } elseif ( is_plugin_active_for_network($plugin_file) ) {
-                $network_plugins[ $plugin_file ] = $plugin_data;
-        } elseif ( is_plugin_active($plugin_file) ) {
</del><ins>+        } elseif ( is_multisite() &amp;&amp; is_network_only_plugin( $plugin_file ) &amp;&amp; !current_user_can( 'manage_network_plugins' ) ) {
+                unset( $all_plugins[ $plugin_file ] );
+                continue;
+        } elseif ( $is_active ) {
</ins><span class="cx">                 $active_plugins[ $plugin_file ] = $plugin_data;
</span><span class="cx">         } else {
</span><del>-                if ( isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?
</del><ins>+                if ( !is_network_admin() &amp;&amp; isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?
</ins><span class="cx">                         $recent_plugins[ $plugin_file ] = $plugin_data;
</span><span class="cx">                 $inactive_plugins[ $plugin_file ] = $plugin_data;
</span><span class="cx">         }
</span><span class="lines">@@ -439,7 +443,6 @@
</span><span class="cx"> $total_active_plugins = count($active_plugins);
</span><span class="cx"> $total_recent_plugins = count($recent_plugins);
</span><span class="cx"> $total_upgrade_plugins = count($upgrade_plugins);
</span><del>-$total_network_plugins = count($network_plugins);
</del><span class="cx"> $total_mustuse_plugins = count($mustuse_plugins);
</span><span class="cx"> $total_dropins_plugins = count($dropins_plugins);
</span><span class="cx"> 
</span><span class="lines">@@ -543,8 +546,12 @@
</span><span class="cx">                 );
</span><span class="cx"> 
</span><span class="cx">                 if ( 'mustuse' == $context ) {
</span><ins>+                        if ( is_multisite() &amp;&amp; !is_network_admin() )
+                                continue;
</ins><span class="cx">                         $is_active = true;
</span><span class="cx">                 } elseif ( 'dropins' == $context ) {
</span><ins>+                        if ( is_multisite() &amp;&amp; !is_network_admin() )
+                                continue;
</ins><span class="cx">                         $dropins = _get_dropins();
</span><span class="cx">                         $plugin_name = $plugin_file;
</span><span class="cx">                         if ( $plugin_file != $plugin_data['Name'] )
</span><span class="lines">@@ -563,30 +570,38 @@
</span><span class="cx">                                 $description .= '&lt;p&gt;' . $plugin_data['Description'] . '&lt;/p&gt;';
</span><span class="cx">                 } else {
</span><span class="cx">                         $is_active_for_network = is_plugin_active_for_network($plugin_file);
</span><del>-                        $is_active = $is_active_for_network || is_plugin_active( $plugin_file );
-                        if ( $is_active_for_network &amp;&amp; !is_super_admin() )
</del><ins>+                        if ( is_network_admin() )
+                                $is_active = $is_active_for_network;
+                        else
+                                $is_active = is_plugin_active( $plugin_file );
+
+                        if ( $is_active_for_network &amp;&amp; !is_super_admin() &amp;&amp; !is_network_admin() )
</ins><span class="cx">                                 continue;
</span><span class="cx"> 
</span><del>-                        if ( $is_active ) {
</del><ins>+                        if ( is_network_admin() ) {
</ins><span class="cx">                                 if ( $is_active_for_network ) {
</span><del>-                                        if ( is_super_admin() )
</del><ins>+                                        if ( current_user_can( 'manage_network_plugins' ) )
</ins><span class="cx">                                                 $actions['network_deactivate'] = '&lt;a href=&quot;' . wp_nonce_url('plugins.php?action=deactivate&amp;amp;networkwide=1&amp;amp;plugin=' . $plugin_file . '&amp;amp;plugin_status=' . $context . '&amp;amp;paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '&quot; title=&quot;' . __('Deactivate this plugin') . '&quot;&gt;' . __('Network Deactivate') . '&lt;/a&gt;';
</span><span class="cx">                                 } else {
</span><del>-                                        $actions['deactivate'] = '&lt;a href=&quot;' . wp_nonce_url('plugins.php?action=deactivate&amp;amp;plugin=' . $plugin_file . '&amp;amp;plugin_status=' . $context . '&amp;amp;paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '&quot; title=&quot;' . __('Deactivate this plugin') . '&quot;&gt;' . __('Deactivate') . '&lt;/a&gt;';
</del><ins>+                                        if ( current_user_can( 'manage_network_plugins' ) )
+                                                $actions['network_activate'] = '&lt;a href=&quot;' . wp_nonce_url('plugins.php?action=activate&amp;amp;networkwide=1&amp;amp;plugin=' . $plugin_file . '&amp;amp;plugin_status=' . $context . '&amp;amp;paged=' . $page, 'activate-plugin_' . $plugin_file) . '&quot; title=&quot;' . __('Activate this plugin for all sites in this network') . '&quot; class=&quot;edit&quot;&gt;' . __('Network Activate') . '&lt;/a&gt;';
+                                        if ( current_user_can('delete_plugins') )
+                                                $actions['delete'] = '&lt;a href=&quot;' . wp_nonce_url('plugins.php?action=delete-selected&amp;amp;checked[]=' . $plugin_file . '&amp;amp;plugin_status=' . $context . '&amp;amp;paged=' . $page, 'bulk-manage-plugins') . '&quot; title=&quot;' . __('Delete this plugin') . '&quot; class=&quot;delete&quot;&gt;' . __('Delete') . '&lt;/a&gt;';
</ins><span class="cx">                                 }
</span><span class="cx">                         } else {
</span><del>-                                if ( is_multisite() &amp;&amp; is_network_only_plugin( $plugin_file ) )
-                                        $actions['network_only'] = '&lt;span title=&quot;' . __('This plugin can only be activated for all sites in a network') . '&quot;&gt;' . __('Network Only') . '&lt;/span&gt;';
-                                else
</del><ins>+                                if ( $is_active ) {
+                                        $actions['deactivate'] = '&lt;a href=&quot;' . wp_nonce_url('plugins.php?action=deactivate&amp;amp;plugin=' . $plugin_file . '&amp;amp;plugin_status=' . $context . '&amp;amp;paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '&quot; title=&quot;' . __('Deactivate this plugin') . '&quot;&gt;' . __('Deactivate') . '&lt;/a&gt;';
+                                } else {
+                                        if ( is_network_only_plugin( $plugin_file ) &amp;&amp; !is_network_admin() )
+                                                continue;
+
</ins><span class="cx">                                         $actions['activate'] = '&lt;a href=&quot;' . wp_nonce_url('plugins.php?action=activate&amp;amp;plugin=' . $plugin_file . '&amp;amp;plugin_status=' . $context . '&amp;amp;paged=' . $page, 'activate-plugin_' . $plugin_file) . '&quot; title=&quot;' . __('Activate this plugin') . '&quot; class=&quot;edit&quot;&gt;' . __('Activate') . '&lt;/a&gt;';
</span><span class="cx"> 
</span><del>-                                if ( is_multisite() &amp;&amp; current_user_can( 'manage_network_plugins' ) )
-                                        $actions['network_activate'] = '&lt;a href=&quot;' . wp_nonce_url('plugins.php?action=activate&amp;amp;networkwide=1&amp;amp;plugin=' . $plugin_file . '&amp;amp;plugin_status=' . $context . '&amp;amp;paged=' . $page, 'activate-plugin_' . $plugin_file) . '&quot; title=&quot;' . __('Activate this plugin for all sites in this network') . '&quot; class=&quot;edit&quot;&gt;' . __('Network Activate') . '&lt;/a&gt;';
</del><ins>+                                        if ( current_user_can('delete_plugins') )
+                                                $actions['delete'] = '&lt;a href=&quot;' . wp_nonce_url('plugins.php?action=delete-selected&amp;amp;checked[]=' . $plugin_file . '&amp;amp;plugin_status=' . $context . '&amp;amp;paged=' . $page, 'bulk-manage-plugins') . '&quot; title=&quot;' . __('Delete this plugin') . '&quot; class=&quot;delete&quot;&gt;' . __('Delete') . '&lt;/a&gt;';
+                                } // end if $is_active
+                         } // end if is_network_admin()
</ins><span class="cx"> 
</span><del>-                                if ( current_user_can('delete_plugins') )
-                                        $actions['delete'] = '&lt;a href=&quot;' . wp_nonce_url('plugins.php?action=delete-selected&amp;amp;checked[]=' . $plugin_file . '&amp;amp;plugin_status=' . $context . '&amp;amp;paged=' . $page, 'bulk-manage-plugins') . '&quot; title=&quot;' . __('Delete this plugin') . '&quot; class=&quot;delete&quot;&gt;' . __('Delete') . '&lt;/a&gt;';
-                        } // end if $is_active
-
</del><span class="cx">                         if ( current_user_can('edit_plugins') &amp;&amp; is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
</span><span class="cx">                                 $actions['edit'] = '&lt;a href=&quot;plugin-editor.php?file=' . $plugin_file . '&quot; title=&quot;' . __('Open this file in the Plugin Editor') . '&quot; class=&quot;edit&quot;&gt;' . __('Edit') . '&lt;/a&gt;';
</span><span class="cx">                 } // end if $context
</span><span class="lines">@@ -689,7 +704,7 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;?php do_action( 'pre_current_active_plugins', $all_plugins ) ?&gt;
</span><span class="cx"> 
</span><del>-&lt;form method=&quot;post&quot; action=&quot;&lt;?php echo admin_url('plugins.php') ?&gt;&quot;&gt;
</del><ins>+&lt;form method=&quot;post&quot; action=&quot;plugins.php&quot;&gt;
</ins><span class="cx"> &lt;?php wp_nonce_field('bulk-manage-plugins') ?&gt;
</span><span class="cx"> &lt;input type=&quot;hidden&quot; name=&quot;plugin_status&quot; value=&quot;&lt;?php echo esc_attr($status) ?&gt;&quot; /&gt;
</span><span class="cx"> &lt;input type=&quot;hidden&quot; name=&quot;paged&quot; value=&quot;&lt;?php echo esc_attr($page) ?&gt;&quot; /&gt;
</span><span class="lines">@@ -783,5 +798,5 @@
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;?php
</span><del>-include('./admin-footer.php');
</del><ins>+include(ABSPATH . 'wp-admin/admin-footer.php');
</ins><span class="cx"> ?&gt;
</span></span></pre></div>
<a id="trunkwpadminusereditphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/user-edit.php (15480 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/user-edit.php        2010-07-29 21:58:58 UTC (rev 15480)
+++ trunk/wp-admin/user-edit.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -84,12 +84,12 @@
</span><span class="cx">                         $wpdb-&gt;query( $wpdb-&gt;prepare( &quot;UPDATE {$wpdb-&gt;signups} SET user_email = %s WHERE user_login = %s&quot;, $user-&gt;user_email, $current_user-&gt;user_login ) );
</span><span class="cx">                 wp_update_user( get_object_vars( $user ) );
</span><span class="cx">                 delete_option( $current_user-&gt;ID . '_new_email' );
</span><del>-                wp_redirect( add_query_arg( array('updated' =&gt; 'true'), admin_url( 'profile.php' ) ) );
</del><ins>+                wp_redirect( add_query_arg( array('updated' =&gt; 'true'), self_admin_url( 'profile.php' ) ) );
</ins><span class="cx">                 die();
</span><span class="cx">         }
</span><span class="cx"> } elseif ( is_multisite() &amp;&amp; IS_PROFILE_PAGE &amp;&amp; !empty( $_GET['dismiss'] ) &amp;&amp; $current_user-&gt;ID . '_new_email' == $_GET['dismiss'] ) {
</span><span class="cx">         delete_option( $current_user-&gt;ID . '_new_email' );
</span><del>-        wp_redirect( add_query_arg( array('updated' =&gt; 'true'), admin_url( 'profile.php' ) ) );
</del><ins>+        wp_redirect( add_query_arg( array('updated' =&gt; 'true'), self_admin_url( 'profile.php' ) ) );
</ins><span class="cx">         die();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -138,7 +138,7 @@
</span><span class="cx">         if ( $delete_role ) // stops users being added to current blog when they are edited
</span><span class="cx">                 delete_user_meta( $user_id, $blog_prefix . 'capabilities' );
</span><span class="cx"> 
</span><del>-        if ( is_multisite() &amp;&amp; !IS_PROFILE_PAGE &amp;&amp; current_user_can( 'manage_network_options' ) &amp;&amp; !isset($super_admins) &amp;&amp; empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) )
</del><ins>+        if ( is_multisite() &amp;&amp; is_network_admin() &amp; !IS_PROFILE_PAGE &amp;&amp; current_user_can( 'manage_network_options' ) &amp;&amp; !isset($super_admins) &amp;&amp; empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) )
</ins><span class="cx">                 empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id );
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx"> if ( !current_user_can('edit_user', $user_id) )
</span><span class="cx">         wp_die(__('You do not have permission to edit this user.'));
</span><span class="cx"> 
</span><del>-include ('admin-header.php');
</del><ins>+include (ABSPATH . 'wp-admin/admin-header.php');
</ins><span class="cx"> ?&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;?php if ( !IS_PROFILE_PAGE &amp;&amp; is_super_admin( $profileuser-&gt;ID ) &amp;&amp; current_user_can( 'manage_network_options' ) ) { ?&gt;
</span><span class="lines">@@ -177,7 +177,7 @@
</span><span class="cx"> &lt;?php screen_icon(); ?&gt;
</span><span class="cx"> &lt;h2&gt;&lt;?php echo esc_html( $title ); ?&gt;&lt;/h2&gt;
</span><span class="cx"> 
</span><del>-&lt;form id=&quot;your-profile&quot; action=&quot;&lt;?php echo esc_url( admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?&gt;&quot; method=&quot;post&quot;&lt;?php do_action('user_edit_form_tag'); ?&gt;&gt;
</del><ins>+&lt;form id=&quot;your-profile&quot; action=&quot;&lt;?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?&gt;&quot; method=&quot;post&quot;&lt;?php do_action('user_edit_form_tag'); ?&gt;&gt;
</ins><span class="cx"> &lt;?php wp_nonce_field('update-user_' . $user_id) ?&gt;
</span><span class="cx"> &lt;?php if ( $wp_http_referer ) : ?&gt;
</span><span class="cx">         &lt;input type=&quot;hidden&quot; name=&quot;wp_http_referer&quot; value=&quot;&lt;?php echo esc_url($wp_http_referer); ?&gt;&quot; /&gt;
</span><span class="lines">@@ -245,7 +245,7 @@
</span><span class="cx">         echo '&lt;option value=&quot;&quot; selected=&quot;selected&quot;&gt;' . __('&amp;mdash; No role for this site &amp;mdash;') . '&lt;/option&gt;';
</span><span class="cx"> ?&gt;
</span><span class="cx"> &lt;/select&gt;
</span><del>-&lt;?php if ( is_multisite() &amp;&amp; current_user_can( 'manage_network_options' ) &amp;&amp; !isset($super_admins) ) { ?&gt;
</del><ins>+&lt;?php if ( is_multisite() &amp;&amp; is_network_admin() &amp;&amp; current_user_can( 'manage_network_options' ) &amp;&amp; !isset($super_admins) ) { ?&gt;
</ins><span class="cx"> &lt;p&gt;&lt;label&gt;&lt;input type=&quot;checkbox&quot; id=&quot;super_admin&quot; name=&quot;super_admin&quot;&lt;?php checked( is_super_admin( $profileuser-&gt;ID ) ); ?&gt; /&gt; &lt;?php _e( 'Grant this user super admin privileges for the Network.'); ?&gt;&lt;/label&gt;&lt;/p&gt;
</span><span class="cx"> &lt;?php } ?&gt;
</span><span class="cx"> &lt;/td&gt;&lt;/tr&gt;
</span><span class="lines">@@ -307,7 +307,7 @@
</span><span class="cx">         $new_email = get_option( $current_user-&gt;ID . '_new_email' );
</span><span class="cx">         if ( $new_email &amp;&amp; $new_email != $current_user-&gt;user_email ) : ?&gt;
</span><span class="cx">         &lt;div class=&quot;updated inline&quot;&gt;
</span><del>-        &lt;p&gt;&lt;?php printf( __('There is a pending change of your e-mail to &lt;code&gt;%1$s&lt;/code&gt;. &lt;a href=&quot;%2$s&quot;&gt;Cancel&lt;/a&gt;'), $new_email['newemail'], esc_url( admin_url( 'profile.php?dismiss=' . $current_user-&gt;ID . '_new_email' ) ) ); ?&gt;&lt;/p&gt;
</del><ins>+        &lt;p&gt;&lt;?php printf( __('There is a pending change of your e-mail to &lt;code&gt;%1$s&lt;/code&gt;. &lt;a href=&quot;%2$s&quot;&gt;Cancel&lt;/a&gt;'), $new_email['newemail'], esc_url( self_admin_url( 'profile.php?dismiss=' . $current_user-&gt;ID . '_new_email' ) ) ); ?&gt;&lt;/p&gt;
</ins><span class="cx">         &lt;/div&gt;
</span><span class="cx">         &lt;?php endif; ?&gt;
</span><span class="cx">         &lt;/td&gt;
</span><span class="lines">@@ -398,5 +398,5 @@
</span><span class="cx">         }
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;?php
</span><del>-include('./admin-footer.php');
</del><ins>+include( ABSPATH . 'wp-admin/admin-footer.php');
</ins><span class="cx"> ?&gt;
</span></span></pre></div>
<a id="trunkwpincludeslinktemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/link-template.php (15480 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/link-template.php        2010-07-29 21:58:58 UTC (rev 15480)
+++ trunk/wp-includes/link-template.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -2132,7 +2132,7 @@
</span><span class="cx">  * @return string Admin url link with optional path appended
</span><span class="cx"> */
</span><span class="cx"> function network_admin_url( $path = '', $scheme = 'admin' ) {
</span><del>-        $url = network_site_url('wp-admin/', $scheme);
</del><ins>+        $url = network_site_url('wp-admin/network/', $scheme);
</ins><span class="cx"> 
</span><span class="cx">         if ( !empty($path) &amp;&amp; is_string($path) &amp;&amp; strpos($path, '..') === false )
</span><span class="cx">                 $url .= ltrim($path, '/');
</span><span class="lines">@@ -2141,6 +2141,23 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * Retrieve the url to the admin area for either the current blog or the network depending on context.
+ *
+ * @package WordPress
+ * @since 3.1.0
+ *
+ * @param string $path Optional path relative to the admin url
+ * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.
+ * @return string Admin url link with optional path appended
+*/
+function self_admin_url($path = '', $scheme = 'admin') {
+        if ( is_network_admin() )
+                return network_admin_url($path, $scheme);
+        else
+                return admin_url($path, $scheme);
+}
+
+/**
</ins><span class="cx">  * Output rel=canonical for singular queries
</span><span class="cx">  *
</span><span class="cx">  * @package WordPress
</span></span></pre></div>
<a id="trunkwpincludesloadphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/load.php (15480 => 15481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/load.php        2010-07-29 21:58:58 UTC (rev 15480)
+++ trunk/wp-includes/load.php        2010-07-30 20:34:54 UTC (rev 15481)
</span><span class="lines">@@ -569,6 +569,22 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * Whether the current request is in WordPress network admin Panel
+ *
+ * Does not inform on whether the user is a network admin! Use capability checks to
+ * tell if the user should be accessing a section or not.
+ *
+ * @since 3.1.0
+ *
+ * @return bool True if inside WordPress network administration pages.
+ */
+function is_network_admin() {
+        if ( defined( 'WP_NETWORK_ADMIN' ) )
+                return WP_NETWORK_ADMIN;
+        return false;
+}
+
+/**
</ins><span class="cx">  * Whether Multisite support is enabled
</span><span class="cx">  *
</span><span class="cx">  * @since 3.0.0
</span></span></pre>
</div>
</div>

</body>
</html>