<?php // Access level restriction Authentication::accessLevelController(8, ">"); // Deal with usr_ban form if (isset($_GET['action'])) { if ($_GET['action'] == 'ban' && isset($_POST['user'])) { Authentication::suspendUser($_POST['user']); $successAlert = 1; } // Deal with unban form if ($_GET['action'] == 'unban' && isset($_POST['unbanID'])) { Authentication::reinstateUser($_POST['unbanID']); $successAlert = 1; } if ($_GET['action'] == 'deactivate' && isset($_POST['uid'])) { Authentication::deactivateUser($_POST['uid']); $successAlert = 1; } } $sqlSuspend = "SELECT * FROM `users` WHERE `suspended` = '0'"; $resultSuspend = openRailwayCore::dbQuery($sqlSuspend); $sqlReinstate = "SELECT * FROM `users` WHERE `suspended` = '1'"; $resultReinstate = openRailwayCore::dbQuery($sqlReinstate); $main = new Template(); $main->set_custom_template("includes/", 'default'); $main->assign_var('ROOT', ROOT); while ($accountSuspend = mysql_fetch_assoc($resultSuspend)) { $main->assign_block_vars('user_loop', array('UID' => $accountSuspend['user_id'], 'NAME' => $accountSuspend['username'], 'SID' => $accountSuspend['staff_id'])); } while ($accountReinstate = mysql_fetch_assoc($resultReinstate)) {
<?php Authentication::accessLevelController(8, '>'); // Deal with logout form if (isset($_GET['action']) && $_GET['action'] == "force" && isset($_POST['uid'])) { Authentication::logUserOut($_POST['uid'], openRailwayCore::createInteractionIdentifier(), 1); } $sql = "SELECT * FROM `sessions`"; $result = openRailwayCore::dbQuery($sql); $main = new Template(); $main->set_custom_template("includes/", 'default'); $main->assign_var('ROOT', ROOT); while ($sessions = mysql_fetch_assoc($result)) { $ipGeoLoc = array(); $ipGeoLoc = Authentication::checkIPLocation($sessions['user_ip']); if ($ipGeoLoc['town'] == '') { $geoLoc = null; } else { $geoLoc = $ipGeoLoc['town'] . ", " . $ipGeoLoc['state'] . ", " . $ipGeoLoc['country']; } $main->assign_block_vars('usr_sess', array('SESSID' => $sessions['session_id'], 'LOGIN' => date("d-M-Y H:i:s", $sessions['log_in_time']), 'LASTACTIVE' => date("d-M-Y H:i:s", $sessions['last_active_time']), 'UID' => $sessions['user_id'], 'SID' => $sessions['staff_id'], 'IP' => $sessions['user_ip'], 'GEOLOC' => $geoLoc, 'UA' => $sessions['user_agent'], 'SAL' => $sessions['session_access_level'])); } $main->set_filenames(array('main' => "usr_sess.html")); $main->display('main');