summaryrefslogtreecommitdiffstats
path: root/wp-admin/wpmu-edit.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-07-17 15:37:10 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-07-17 15:37:10 +0000
commiteefcfdd4dd76eb2eadd852e7fa7268f225bfc943 (patch)
tree6a8b5aaa987f0552250fcc8a07c55040e38cdda5 /wp-admin/wpmu-edit.php
parent967ed843087b9a1058fba902eefa4e407035afb2 (diff)
downloadwordpress-mu-eefcfdd4dd76eb2eadd852e7fa7268f225bfc943.tar.gz
wordpress-mu-eefcfdd4dd76eb2eadd852e7fa7268f225bfc943.tar.xz
wordpress-mu-eefcfdd4dd76eb2eadd852e7fa7268f225bfc943.zip
nonce the site admin options page.
Add site_admins to the main blog git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@679 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/wpmu-edit.php')
-rw-r--r--wp-admin/wpmu-edit.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/wp-admin/wpmu-edit.php b/wp-admin/wpmu-edit.php
index 42a4408..174456e 100644
--- a/wp-admin/wpmu-edit.php
+++ b/wp-admin/wpmu-edit.php
@@ -12,6 +12,7 @@ switch( $_GET[ 'action' ] ) {
if( is_site_admin() == false ) {
die( __('<p>You do not have permission to access this page.</p>') );
}
+ check_admin_referer('siteoptions');
update_site_option( "WPLANG", $_POST[ 'WPLANG' ] );
update_site_option( "illegal_names", split( ' ', $_POST[ 'illegal_names' ] ) );
@@ -28,8 +29,18 @@ switch( $_GET[ 'action' ] ) {
update_site_option( "welcome_email", $_POST[ 'welcome_email' ] );
update_site_option( "fileupload_maxk", $_POST[ 'fileupload_maxk' ] );
$site_admins = explode( ' ', $_POST['site_admins'] );
- if ( is_array( $site_admins ) )
+ if ( is_array( $site_admins ) ) {
+ $mainblog_id = $wpdb->get_var( "SELECT blog_id FROM {$wpdb->blogs} WHERE domain='{$current_site->domain}' AND path='{$current_site->path}'" );
+ if( $mainblog_id ) {
+ reset( $site_admins );
+ foreach( $site_admins as $site_admin ) {
+ $uid = $wpdb->get_var( "SELECT ID FROM {$wpdb->users} WHERE user_login='{$site_admin}'" );
+ if( $uid )
+ add_user_to_blog( $mainblog_id, $uid, 'Administrator' );
+ }
+ }
update_site_option( 'site_admins' , $site_admins );
+ }
wpmu_admin_do_redirect( "wpmu-options.php" );
exit;
break;