Beispiel #1
0
<?php

/**
 * Users administration panel.
 *
 * @package WordPress
 * @subpackage Administration
 */
/** WordPress Administration Bootstrap */
require_once './admin.php';
/** WordPress Registration API */
require_once ABSPATH . WPINC . '/registration.php';
require_once './includes/default-list-tables.php';
$wp_list_table = new WP_Users_Table();
$wp_list_table->check_permissions();
$title = __('Users');
$parent_file = 'users.php';
// contextual help - choose Help on the top right of admin panel to preview this.
add_contextual_help($current_screen, '<p>' . __('This screen lists all the existing users for your site. Each user has one of five defined roles as set by the site admin: Site Administrator, Editor, Author, Contributor, or Subscriber. Users with roles other than Administrator will see fewer options when they are logged in, based on their role.') . '</p>' . '<p>' . __('You can customize the display of information on this screen as you can on other screens, by using the Screen Options tab and the on-screen filters.') . '</p>' . '<p>' . __('To add a new user for your site, click the Add New button at the top of the screen or Add New in the Users menu section.') . '</p>' . '<p><strong>' . __('For more information:') . '</strong></p>' . '<p>' . __('<a href="http://codex.wordpress.org/Users_Authors_and_Users_SubPanel" target="_blank">Documentation on Authors and Users</a>') . '</p>' . '<p>' . __('<a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank">Roles and Capabilities Descriptions</a>') . '</p>' . '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>');
$update = $doaction = '';
if (isset($_REQUEST['action'])) {
    $doaction = $_REQUEST['action'] ? $_REQUEST['action'] : $_REQUEST['action2'];
}
if (empty($doaction)) {
    if (isset($_GET['changeit']) && !empty($_GET['new_role'])) {
        $doaction = 'promote';
    }
}
if (empty($_REQUEST)) {
    $referer = '<input type="hidden" name="wp_http_referer" value="' . esc_attr(stripslashes($_SERVER['REQUEST_URI'])) . '" />';
} elseif (isset($_REQUEST['wp_http_referer'])) {
Beispiel #2
0
     break;
 case 'add-user':
     check_ajax_referer($action);
     if (!current_user_can('create_users')) {
         die('-1');
     }
     require_once ABSPATH . WPINC . '/registration.php';
     if (!($user_id = add_user())) {
         die('0');
     } elseif (is_wp_error($user_id)) {
         $x = new WP_Ajax_Response(array('what' => 'user', 'id' => $user_id));
         $x->send();
     }
     $user_object = new WP_User($user_id);
     require_once './includes/default-list-tables.php';
     $wp_list_table = new WP_Users_Table();
     $x = new WP_Ajax_Response(array('what' => 'user', 'id' => $user_id, 'data' => $wp_list_table->single_row($user_object, '', $user_object->roles[0]), 'supplemental' => array('show-link' => sprintf(__('User <a href="#%s">%s</a> added'), "user-{$user_id}", $user_object->user_login), 'role' => $user_object->roles[0])));
     $x->send();
     break;
 case 'autosave':
     // The name of this action is hardcoded in edit_post()
     define('DOING_AUTOSAVE', true);
     $nonce_age = check_ajax_referer('autosave', 'autosavenonce');
     $_POST['post_category'] = explode(",", $_POST['catslist']);
     if ($_POST['post_type'] == 'page' || empty($_POST['post_category'])) {
         unset($_POST['post_category']);
     }
     $do_autosave = (bool) $_POST['autosave'];
     $do_lock = true;
     $data = '';
     /* translators: draft saved date format, see http://php.net/date */