'item', //singular name of the listed records 'plural' => 'items', //plural name of the listed records 'ajax' => false //does this table support ajax? ) ); } function column_default($item, $column_name){ return $item[$column_name]; } function column_user_id($item){ $tab = strip_tags($_REQUEST['tab']); $force_logout_url = sprintf('admin.php?page=%s&tab=%s&action=%s&logged_in_id=%s&ip_address=%s', AIOWPSEC_USER_LOGIN_MENU_SLUG, $tab, 'force_user_logout', $item['user_id'], $item['ip_address']); //Add nonce to URL $force_logout_nonce = wp_nonce_url($force_logout_url, "force_user_logout", "aiowps_nonce"); //Build row actions $actions = array( 'logout' => 'Force Logout', ); //Return the user_login contents return sprintf('%1$s %2$s', /*$1%s*/ $item['user_id'], /*$2%s*/ $this->row_actions($actions) ); } function get_columns(){ $columns = array( 'user_id' => 'User ID', 'username' => 'Login Name', 'ip_address' => 'IP Address', ); return $columns; } function get_sortable_columns() { $sortable_columns = array( 'user_id' => array('user_id',false), 'username' => array('username',false), 'ip_address' => array('ip_address',false), ); return $sortable_columns; } function get_bulk_actions() { return array(); } function process_bulk_action() { } /* * This function will force a selected user to be logged out. * The function accepts either an array of IDs or a single ID (TODO - bulk actions not implemented yet!) */ function force_user_logout($user_id, $ip_addr) { global $wpdb, $aio_wp_security; if (is_array($user_id)) { if (isset($_REQUEST['_wp_http_referer'])) { //TODO - implement bulk action in future release! } } elseif ($user_id != NULL) { $nonce=isset($_GET['aiowps_nonce'])?$_GET['aiowps_nonce']:''; if (!isset($nonce) ||!wp_verify_nonce($nonce, 'force_user_logout')) { $aio_wp_security->debug_logger->log_debug("Nonce check failed for force user logout operation!",4); die(__('Nonce check failed for force user logout operation!','all-in-one-wp-security-and-firewall')); } //Force single user logout $user_id = absint($user_id); $manager = WP_Session_Tokens::get_instance( $user_id ); $manager->destroy_all(); // $aio_wp_security->user_login_obj->update_user_online_transient($user_id, $ip_addr); // if($result != NULL) // { $success_msg = '
'; $success_msg .= __('The selected user was logged out successfully!','all-in-one-wp-security-and-firewall'); $success_msg .= '