Changeset 12826
- Timestamp:
- 01/25/2010 10:01:43 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ms.php
r12825 r12826 1 1 <?php 2 3 /** 4 * Determine if uploaded file exceeds space quota. 5 * 6 * @since 3.0 7 * 8 * @param array $file $_FILES array for a given file. 9 * @return array $_FILES array with 'error' key set if file exceeds quota. 'error' is empty otherwise. 10 */ 2 11 function check_upload_size( $file ) { 3 if ( get_site_option( 'upload_space_check_disabled' ) ) {12 if ( get_site_option( 'upload_space_check_disabled' ) ) 4 13 return $file; 5 } 14 6 15 if ( $file['error'] != '0' ) // there's already an error 7 16 return $file; … … 28 37 add_filter( 'wp_handle_upload_prefilter', 'check_upload_size' ); 29 38 39 /** 40 * Delete a blog 41 * 42 * @since 3.0 43 * 44 * @param int $blog_id Blog ID 45 * @param bool $drop True if blog's table should be dropped. Default is false. 46 * @return void 47 */ 30 48 function wpmu_delete_blog($blog_id, $drop = false) { 31 49 global $wpdb; … … 41 59 42 60 // Remove users from this blog. 43 if ( !empty($users) ) foreach ($users as $user) { 44 remove_user_from_blog($user->user_id, $blog_id); 61 if ( !empty($users) ) { 62 foreach ($users as $user) { 63 remove_user_from_blog($user->user_id, $blog_id); 64 } 45 65 } 46 66 … … 62 82 $index = 0; 63 83 64 while ( $index < count($stack)) {84 while ( $index < count($stack) ) { 65 85 # Get indexed directory from stack 66 86 $dir = $stack[$index]; 67 87 68 88 $dh = @ opendir($dir); 69 if ( $dh) {70 while ( ($file = @ readdir($dh)) !== false) {89 if ( $dh ) { 90 while ( ($file = @ readdir($dh)) !== false ) { 71 91 if ($file == '.' or $file == '..') 72 92 continue; … … 82 102 83 103 $stack = array_reverse($stack); // Last added dirs are deepest 84 foreach( (array) $stack as $dir ) {104 foreach( (array) $stack as $dir ) { 85 105 if ( $dir != $top_dir) 86 106 @rmdir($dir); … … 90 110 $blogs = get_site_option( "blog_list" ); 91 111 if ( is_array( $blogs ) ) { 92 foreach ( $blogs as $n => $blog ) {93 if ( $blog[ 'blog_id' ] == $blog_id ) {112 foreach ( $blogs as $n => $blog ) { 113 if ( $blog[ 'blog_id' ] == $blog_id ) 94 114 unset( $blogs[ $n ] ); 95 }96 115 } 97 116 update_site_option( 'blog_list', $blogs ); … … 153 172 if ( $val != '' && $val != '0' ) { 154 173 $user = new WP_User( $val ); 155 if ( in_array( $user->user_login, get_site_option( 'site_admins', array( 'admin' ) ) ) ) {174 if ( in_array( $user->user_login, get_site_option( 'site_admins', array( 'admin' ) ) ) ) 156 175 wp_die( sprintf( __( 'Warning! User cannot be deleted. The user %s is a site admnistrator.' ), $user->user_login ) ); 157 }158 176 echo "<input type='hidden' name='user[]' value='{$val}'/>\n"; 159 177 $blogs = get_blogs_of_user( $val, true ); … … 165 183 echo "<select name='blog[$val][{$key}]'>"; 166 184 $out = ''; 167 foreach ( $blog_users as $user ) {185 foreach ( $blog_users as $user ) { 168 186 if ( $user->user_id != $val ) 169 187 $out .= "<option value='{$user->user_id}'>{$user->user_login}</option>"; … … 265 283 $user->ID = $current_user->ID; 266 284 $user->user_email = wp_specialchars( trim( $new_email[ 'newemail' ] ) ); 267 if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $current_user->user_login ) ) ) {285 if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $current_user->user_login ) ) ) 268 286 $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $user->user_email, $current_user->user_login ) ); 269 }270 287 wp_update_user( get_object_vars( $user ) ); 271 288 delete_option( $current_user->ID . '_new_email' ); -
trunk/wp-includes/ms-functions.php
r12807 r12826 1609 1609 $user_id = 0; 1610 1610 if ( is_email( $string ) ) { 1611 $user = get_user_by _email($string);1611 $user = get_user_by('email', $string); 1612 1612 if ( $user ) 1613 1613 $user_id = $user->ID; … … 1615 1615 $user_id = $string; 1616 1616 } else { 1617 $user = get_user databylogin($string);1617 $user = get_user_by('login', $string); 1618 1618 if ( $user ) 1619 1619 $user_id = $user->ID;
Note: See TracChangeset
for help on using the changeset viewer.