6000)) { // last request was more than 30 minutes ago session_unset(); // unset $_SESSION variable for the run-time session_destroy(); // destroy session data in storage } $_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp $add = 'Login Area'; foreach (array_keys($_REQUEST) as $var) { ${$var} = $_REQUEST[$var]; } if ($act == "exit") { session_unset(); session_destroy(); session_start(); } if ($_SESSION['cmdlevel']) $cmdlevel = $_SESSION['cmdlevel']; if ($_SESSION['hostid']) $agent_id = $_SESSION['hostid']; if ($_SESSION['add']) $add = $_SESSION['add']; if ($_SESSION['id']) $id = $_SESSION['id']; if ($_SESSION['login']) $login = $_SESSION['login']; if ($_SESSION['name']) $name = $_SESSION['name']; foreach (array_keys($_SESSION) as $var) { ${$var} = $_SESSION[$var]; } include 'functions.php'; include 'auth.php'; $logged_me_in_successfully234 = 0; $incl = ''; if (!$_SESSION['pass'] && !$_SESSION['login']) { $table = 'accounts'; $result=mysqli_query($link, "SELECT id, login, name, cmdlevel FROM $table WHERE login='".$login."' AND password='".md5($pass)."'"); $res1 = mysqli_fetch_array($result); $cmdlevel = $res1['cmdlevel']; $name = $res1['name']; $id = $res1['id']; if ($cmdlevel == '10') { $add = "Head Administrator"; } else if ($cmdlevel == '1') { $add = "Company Administrator"; } else if ($cmdlevel == '2') { $add = "Company Operator"; } if (mysqli_num_rows($result)) { $_SESSION['pass']=$pass; $_SESSION['login']=$login; $_SESSION['name']=$name; $_SESSION['add']=$add; $_SESSION['cmdlevel']=$cmdlevel; $_SESSION['id']=$id; $logged_me_in_successfully234 = 1; } } else $logged_me_in_successfully234 = 1; $query = mysqli_query($link, "update accounts set last_seen_web =NOW() where id=".$id); $getincl = GetInclude($act, intval($cmdlevel)); $incl = $getincl[0]; $accnum = $getincl[1]; ?>