Changes from trunk/wp-admin/ms-edit.php at r15244 to branches/3.0/wp-admin/ms-edit.php at r15470
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/wp-admin/ms-edit.php
r15244 r15470 105 105 foreach ( (array)$users as $user ) { 106 106 $user_meta_value = unserialize( $user->meta_value ); 107 if ( is_array( $user_meta_value ) && array_pop( array_keys( $user_meta_value ) ) == 'subscriber' )107 if ( is_array( $user_meta_value ) && array_pop( $var_by_ref = array_keys( $user_meta_value ) ) == 'subscriber' ) 108 108 $move_users[] = $user->user_id; 109 109 } … … 119 119 120 120 $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' ); 121 $checked_options = array( 'mu_media_buttons' => array(), 'menu_items' => array(), 'registrationnotification' => 'no', 'upload_space_check_disabled' => 1 );121 $checked_options = array( 'mu_media_buttons' => array(), 'menu_items' => array(), 'registrationnotification' => 'no', 'upload_space_check_disabled' => 1, 'add_new_users' => 0 ); 122 122 foreach ( $checked_options as $option_name => $option_unchecked_value ) { 123 123 if ( ! isset( $_POST[$option_name] ) ) … … 227 227 $c = 1; 228 228 $count = count( $_POST['option'] ); 229 $skip_options = array( 'allowedthemes' ); // Don't update these options since they are handled elsewhere in the form. 229 230 foreach ( (array) $_POST['option'] as $key => $val ) { 230 if ( $key === 0 || is_array( $val ) )231 if ( $key === 0 || is_array( $val ) || in_array($key, $skip_options) ) 231 232 continue; // Avoids "0 is a protected WP option and may not be modified" error when edit blog options 232 233 if ( $c == $count ) … … 265 266 foreach ( (array) $newroles as $userid => $role ) { 266 267 $user = new WP_User( $userid ); 267 if ( ! $user)268 if ( empty( $user->ID ) ) 268 269 continue; 269 270 $user->for_blog( $id ); … … 287 288 $_POST['role'] = $newroles[ $userid ]; 288 289 if ( $pass != '' ) { 289 $cap = $wpdb->get_var( "SELECT meta_value FROM {$wpdb->usermeta} WHERE user_id = '{$userid}' AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'");290 $cap = $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM {$wpdb->usermeta} WHERE user_id = %d AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'", $userid ) ); 290 291 $userdata = get_userdata($userid); 291 292 $_POST['pass1'] = $_POST['pass2'] = $pass; … … 294 295 edit_user( $userid ); 295 296 if ( $cap == null ) 296 $wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE user_id = '{$userid}' AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'");297 $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->usermeta} WHERE user_id = %d AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'", $userid ) ); 297 298 } 298 299 }
Note: See TracChangeset
for help on using the changeset viewer.