//TODO: restrict to viewing bellow class, username in h2 if (isset($_GET['userid']) && check_perms('users_view_ips') && check_perms('users_logout')) { if (!is_number($_GET['userid'])) { error(404); } $UserID = $_GET['userid']; } else { $UserID = $LoggedUser['ID']; } if (isset($_POST['all'])) { authorize(); $DB->query("DELETE FROM users_sessions WHERE UserID='$UserID' AND SessionID != '$SessionID'"); $Cache->delete_value('users_sessions_'.$UserID); } if (isset($_POST['session'])) { authorize(); $DB->query("DELETE FROM users_sessions WHERE UserID='$UserID' AND SessionID='".db_string($_POST['session'])."'"); $Cache->delete_value('users_sessions_'.$UserID); } $UserSessions = $Cache->get_value('users_sessions_'.$UserID); if (!is_array($UserSessions)) { $DB->query(" SELECT SessionID, Browser, OperatingSystem, IP, LastUpdate FROM users_sessions WHERE UserID='$UserID' ORDER BY LastUpdate DESC"); $UserSessions = $DB->to_array('SessionID',MYSQLI_ASSOC); $Cache->cache_value('users_sessions_'.$UserID, $UserSessions, 0); } list($UserID, $Username) = array_values(Users::user_info($UserID)); View::show_header($Username.' > Sessions'); ?>
Note: Clearing cookies can result in ghost sessions which are automatically removed after 30 days.
IP | Browser | Platform | Last Activity | |
=$IP?> | =$Browser?> | =$OperatingSystem?> | =time_diff($LastUpdate)?> |