WordPress.org

Make WordPress Core

Changeset 9614


Ignore:
Timestamp:
11/11/2008 07:47:22 PM (10 years ago)
Author:
ryan
Message:

Add new user page

Location:
trunk/wp-admin
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-page-form.php

    r9564 r9614  
    317317<?php
    318318}
    319 add_meta_box('pagecommentstatusdiv', __('Comments &amp; Pings'), 'page_comments_status_meta_box', 'page', 'normal', 'core');
     319add_meta_box('pagecommentstatusdiv', __('Discussion'), 'page_comments_status_meta_box', 'page', 'normal', 'core');
    320320
    321321/**
  • trunk/wp-admin/menu.php

    r9580 r9614  
    7979    $_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php.
    8080    $submenu['users.php'][5] = array(__('Authors &amp; Users'), 'edit_users', 'users.php');
    81     $submenu['users.php'][10] = array(__('Your Profile'), 'read', 'profile.php');
     81    $submenu['users.php'][10] = array(__('Add New'), 'create_users', 'user-new.php');
     82    $submenu['users.php'][15] = array(__('Your Profile'), 'read', 'profile.php');
    8283} else {
    8384    $_wp_real_parent_file['users.php'] = 'profile.php';
  • trunk/wp-admin/users.php

    r9563 r9614  
    177177break;
    178178
    179 case 'adduser':
    180     check_admin_referer('add-user');
    181 
    182     if ( ! current_user_can('create_users') )
    183         wp_die(__('You can&#8217;t create users.'));
    184 
    185     $user_id = add_user();
    186     $update = 'add';
    187     if ( is_wp_error( $user_id ) )
    188         $add_user_errors = $user_id;
    189     else {
    190         $new_user_login = apply_filters('pre_user_login', sanitize_user(stripslashes($_REQUEST['user_login']), true));
    191         $redirect = add_query_arg( array('usersearch' => urlencode($new_user_login), 'update' => $update), $redirect );
    192         wp_redirect( $redirect . '#user-' . $user_id );
    193         die();
    194     }
    195 
    196179default:
    197180
     
    408391
    409392<br class="clear" />
    410 <?php if ( current_user_can('create_users') ) { ?>
    411 
    412 <div class="wrap">
    413 <h2 id="add-new-user"><?php _e('Add New User') ?></h2>
    414 
    415 <?php if ( isset($add_user_errors) && is_wp_error( $add_user_errors ) ) : ?>
    416     <div class="error">
    417         <?php
    418             foreach ( $add_user_errors->get_error_messages() as $message )
    419                 echo "<p>$message</p>";
    420         ?>
    421     </div>
    422 <?php endif; ?>
    423 <div id="ajax-response"></div>
    424 
    425 <?php
    426     if ( get_option('users_can_register') )
    427         echo '<p>' . sprintf(__('Users can <a href="%1$s">register themselves</a> or you can manually create users here.'), site_url('wp-register.php')) . '</p>';
    428     else
    429         echo '<p>' . sprintf(__('Users cannot currently <a href="%1$s">register themselves</a>, but you can manually create users here.'), admin_url('options-general.php#users_can_register')) . '</p>';
    430 ?>
    431 <form action="#add-new-user" method="post" name="adduser" id="adduser" class="add:users: validate">
    432 <?php wp_nonce_field('add-user') ?>
    433 <table class="form-table">
    434     <tr class="form-field form-required">
    435         <th scope="row"><label for="user_login"><?php _e('Username (required)') ?></label><input name="action" type="hidden" id="action" value="adduser" /></th>
    436         <td ><input name="user_login" type="text" id="user_login" value="<?php echo $new_user_login; ?>" aria-required="true" /></td>
    437     </tr>
    438     <tr class="form-field">
    439         <th scope="row"><label for="first_name"><?php _e('First Name') ?> </label></th>
    440         <td><input name="first_name" type="text" id="first_name" value="<?php echo $new_user_firstname; ?>" /></td>
    441     </tr>
    442     <tr class="form-field">
    443         <th scope="row"><label for="last_name"><?php _e('Last Name') ?> </label></th>
    444         <td><input name="last_name" type="text" id="last_name" value="<?php echo $new_user_lastname; ?>" /></td>
    445     </tr>
    446     <tr class="form-field form-required">
    447         <th scope="row"><label for="email"><?php _e('E-mail (required)') ?></label></th>
    448         <td><input name="email" type="text" id="email" value="<?php echo $new_user_email; ?>" /></td>
    449     </tr>
    450     <tr class="form-field">
    451         <th scope="row"><label for="url"><?php _e('Website') ?></label></th>
    452         <td><input name="url" type="text" id="url" value="<?php echo $new_user_uri; ?>" /></td>
    453     </tr>
    454 
    455 <?php if ( apply_filters('show_password_fields', true) ) : ?>
    456     <tr class="form-field form-required">
    457         <th scope="row"><label for="pass1"><?php _e('Password (twice)') ?> </label></th>
    458         <td><input name="pass1" type="password" id="pass1" autocomplete="off" />
    459         <br />
    460         <input name="pass2" type="password" id="pass2" autocomplete="off"/></td>
    461     </tr>
    462 <?php endif; ?>
    463 
    464     <tr class="form-field">
    465         <th scope="row"><label for="role"><?php _e('Role'); ?></label></th>
    466         <td><select name="role" id="role">
    467             <?php
    468             if ( !$new_user_role )
    469                 $new_user_role = $current_role ? $current_role : get_option('default_role');
    470             wp_dropdown_roles($new_user_role);
    471             ?>
    472             </select>
    473         </td>
    474     </tr>
    475 </table>
    476 <p class="submit">
    477     <?php echo $referer; ?>
    478     <input name="adduser" type="submit" id="addusersub" class="button" value="<?php _e('Add User') ?>" />
    479 </p>
    480 </form>
    481 
    482 </div>
    483 
    484 <?php
    485 }
     393<?php
    486394break;
    487395
Note: See TracChangeset for help on using the changeset viewer.