/** * Attaches actions/filters explicitly to users.php * * Callback for "load-users.php" hook * * @since 6.0 * @access public */ function load_users_page() { add_filter('user_row_actions', array(&$this, 'user_row_actions'), 10, 2); add_action('admin_notices', array(&$this, 'admin_notices')); add_action('delete_user', array(&$this, 'deny_user')); // Is there an action? if (isset($_GET['action'])) { // Is it a sanctioned action? if (in_array($_GET['action'], array('approve', 'resendactivation'))) { // Is there a user ID? $user = isset($_GET['user']) ? $_GET['user'] : ''; // No user ID? if (!$user || !current_user_can('edit_user', $user)) { wp_die(__('You can’t edit that user.', 'theme-my-login')); } // Where did we come from? $redirect_to = isset($_REQUEST['wp_http_referer']) ? remove_query_arg(array('wp_http_referer', 'updated', 'delete_count'), stripslashes($_REQUEST['wp_http_referer'])) : 'users.php'; // Are we approving? if ('approve' == $_GET['action']) { check_admin_referer('approve-user'); if (!Theme_My_Login_User_Moderation_Admin::approve_user($user)) { wp_die(__('You can’t edit that user.', 'theme-my-login')); } $redirect_to = add_query_arg('update', 'approve', $redirect_to); } elseif ('resendactivation' == $_GET['action']) { check_admin_referer('resend-activation'); if (!Theme_My_Login_User_Moderation::new_user_activation_notification($user)) { wp_die(__('The e-mail could not be sent.', 'theme-my-login') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...', 'theme-my-login')); } $redirect_to = add_query_arg('update', 'sendactivation', $redirect_to); } wp_redirect($redirect_to); exit; } } }