Changeset 12778
- Timestamp:
- 01/20/2010 09:58:13 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/menu.php
r12757 r12778 131 131 $_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php. 132 132 $submenu['users.php'][5] = array(__('Authors & Users'), 'edit_users', 'users.php'); 133 if ( !is_multisite() ) 134 $submenu['users.php'][10] = array(_x('Add New', 'user'), 'create_users', 'user-new.php'); 135 elseif ( is_super_admin() || get_site_option( 'add_new_users' ) ) 136 $submenu['users.php'][10] = array(__('Add New') . ' <strong>*</strong>', 'create_users', 'ms-options.php#addnewusers'); 133 $submenu['users.php'][10] = array(_x('Add New', 'user'), 'create_users', 'user-new.php'); 137 134 138 135 $submenu['users.php'][15] = array(__('Your Profile'), 'read', 'profile.php'); -
trunk/wp-admin/user-new.php
r12764 r12778 63 63 $username = $user_details->user_login; 64 64 $user_id = $user_details->ID; 65 if ( ( $username != null && is_site_admin( $username ) == false) && ( array_key_exists($blog_id, get_blogs_of_user($user_id)) ) ) {65 if ( ( $username != null && !is_super_admin( $user_id ) ) && ( array_key_exists($blog_id, get_blogs_of_user($user_id)) ) ) { 66 66 $redirect = add_query_arg( array('update' => 'addexisting'), 'user-new.php' ); 67 67 } else { 68 if ( isset( $_POST[ 'noconfirmation' ] ) && is_s ite_admin() ) {68 if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin() ) { 69 69 add_existing_user_to_blog( array( 'user_id' => $user_id, 'role' => $_REQUEST[ 'role' ] ) ); 70 70 $redirect = add_query_arg( array('update' => 'addnoconfirmation'), 'user-new.php' ); … … 185 185 ?> 186 186 <table class="form-table"> 187 <?php if ( !is_multisite() ) { ?>188 187 <tr class="form-field form-required"> 189 188 <th scope="row"><label for="user_login"><?php _e('Username'); ?> <span class="description"><?php _e('(required)'); ?></span></label> … … 191 190 <td><input name="user_login" type="text" id="user_login" value="<?php echo esc_attr($new_user_login); ?>" aria-required="true" /></td> 192 191 </tr> 193 <tr class="form-field">194 <th scope="row"><label for="first_name"><?php _e('First Name') ?> </label></th>195 <td><input name="first_name" type="text" id="first_name" value="<?php echo esc_attr($new_user_firstname); ?>" /></td>196 </tr>197 <tr class="form-field">198 <th scope="row"><label for="last_name"><?php _e('Last Name') ?> </label></th>199 <td><input name="last_name" type="text" id="last_name" value="<?php echo esc_attr($new_user_lastname); ?>" /></td>200 </tr>201 192 <tr class="form-field form-required"> 202 193 <th scope="row"><label for="email"><?php _e('E-mail'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th> 203 194 <td><input name="email" type="text" id="email" value="<?php echo esc_attr($new_user_email); ?>" /></td> 204 195 </tr> 196 <?php if ( !is_multisite() ) { ?> 197 <tr class="form-field"> 198 <th scope="row"><label for="first_name"><?php _e('First Name') ?> </label></th> 199 <td><input name="first_name" type="text" id="first_name" value="<?php echo esc_attr($new_user_firstname); ?>" /></td> 200 </tr> 201 <tr class="form-field"> 202 <th scope="row"><label for="last_name"><?php _e('Last Name') ?> </label></th> 203 <td><input name="last_name" type="text" id="last_name" value="<?php echo esc_attr($new_user_lastname); ?>" /></td> 204 </tr> 205 205 <tr class="form-field"> 206 206 <th scope="row"><label for="url"><?php _e('Website') ?></label></th> 207 207 <td><input name="url" type="text" id="url" class="code" value="<?php echo esc_attr($new_user_uri); ?>" /></td> 208 208 </tr> 209 210 209 <?php if ( apply_filters('show_password_fields', true) ) : ?> 211 210 <tr class="form-field form-required"> … … 224 223 </tr> 225 224 <?php endif; ?> 226 <?php } else { // multisite ?> 227 <tr class="form-field form-required"> 228 <th scope="row"><label for="user_login"><?php _e('Username (required)') ?></label><input name="action" type="hidden" id="action" value="adduser" /></th> 229 <td ><input name="user_login" type="text" id="user_login" value="<?php echo $new_user_login; ?>" aria-required="true" /></td> 230 </tr> 231 <tr class="form-field form-required"> 232 <th scope="row"><label for="email"><?php _e('E-mail (required)') ?></label></th> 233 <td><input name="email" type="text" id="email" value="<?php echo $new_user_email; ?>" /></td> 234 </tr> 235 <?php } ?> 225 <?php } // !is_multisite ?> 236 226 <tr class="form-field"> 237 227 <th scope="row"><label for="role"><?php _e('Role'); ?></label></th> … … 245 235 </td> 246 236 </tr> 247 248 237 <?php if ( is_multisite() && is_super_admin() ) { ?> 249 <tr class="form-field">238 <tr> 250 239 <th scope="row"><label for="noconfirmation"><?php _e('Skip Confirmation Email') ?></label></th> 251 <td>< input name="noconfirmation" type="checkbox" id="noconfirmation" value="1" /> <label for="noconfirmation"><?php _e( 'Site administrators can add a user without sending the confirmation email.' ); ?></label></td>240 <td><label for="noconfirmation"><input type="checkbox" name="noconfirmation" id="noconfirmation" value="1" /> <?php _e( 'Site administrators can add a user without sending the confirmation email.' ); ?></label></td> 252 241 </tr> 253 242 <?php } ?> -
trunk/wp-includes/capabilities.php
r12770 r12778 981 981 $caps[] = $cap; 982 982 break; 983 case 'create_users': 984 if ( is_multisite() && !get_site_option( 'add_new_users' ) ) 985 $caps[] = 'do_not_allow'; 986 else 987 $caps[] = $cap; 988 break; 983 989 default: 984 990 // If no meta caps match, return the original cap. -
trunk/wp-includes/ms-functions.php
r12776 r12778 1223 1223 function wpmu_create_user( $user_name, $password, $email) { 1224 1224 $user_name = preg_replace( "/\s+/", '', sanitize_user( $user_name, true ) ); 1225 if ( username_exists($user_name) ) 1225 1226 $user_id = wp_create_user( $user_name, $password, $email ); 1227 if ( is_wp_error($user_id) ) 1226 1228 return false; 1227 1229 1228 // Check if the email address has been used already.1229 if ( email_exists($email) )1230 return false;1231 1232 $user_id = wp_create_user( $user_name, $password, $email );1233 1230 $user = new WP_User($user_id); 1234 1231 -
trunk/wp-includes/registration.php
r12733 r12778 123 123 $user_login = trim($user_login); 124 124 125 if ( empty($user_login) ) {125 if ( empty($user_login) ) 126 126 return new WP_Error('empty_user_login', __('Cannot create a user with an empty login name.') ); 127 } 127 128 if ( !$update && username_exists( $user_login ) ) 129 return new WP_Error('existing_user_login', __('This username is already registered.') ); 128 130 129 131 if ( empty($user_nicename) ) … … 138 140 $user_email = ''; 139 141 $user_email = apply_filters('pre_user_email', $user_email); 142 143 if ( !$update && email_exists($user_email) ) 144 return new WP_Error('existing_user_email', __('This email address is already registered.') ); 140 145 141 146 if ( empty($display_name) )
Note: See TracChangeset
for help on using the changeset viewer.