= 2) { $current_page = substr($current_page, $substr_pos); } } // Get the current host from the request data $current_host = $_GET['URL']; $str_start = 0; for ($i = 0; $i < 3; $i++) { $substr_pos = strpos($current_host, '/'); if ($substr_pos === false) { break; } if ($i < 2) { $current_host = substr($current_host, $substr_pos + 1); $str_start += $substr_pos + 1; } elseif ($i >= 2) { $current_host = substr($_GET['URL'], 0, $substr_pos + $str_start); } } // Update the current URL statistics within the requests tables if ($current_page == '') { $current_page = '/'; } $select_session_id = "SELECT page_path FROM " . $table_prefix . "requests WHERE session_id = '$current_session'"; $row = $SQL->selectquery($select_session_id); if (is_array($row)) { $current_page = urldecode($current_page); $prev_path = explode('; ', $row['page_path']); $current_path = $row['page_path']; end($prev_path); $index = key($prev_path); if ($current_page != $prev_path[$index]) { $update_current_url_stat = "UPDATE " . $table_prefix . "requests SET current_page = '$referer', current_page_title = '$title', page_path = '$current_path; $current_page' WHERE session_id = '$current_session'"; $SQL->insertquery($update_current_url_stat); } } if ($disable_login_details == 'true') { header('Location: frames.php?URL=' . $_GET['URL'] . '&SERVER=' . $_GET['SERVER'] . '&SESSION=' . $_GET['SESSION']); exit(); } // Checks if any users in user table are online $query_select_users_online = "SELECT login_id FROM " . $table_prefix . "sessions AS s, " . $table_prefix . "users AS u WHERE s.login_id = u.last_login_id AND s.username = u.username AND (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(s.last_refresh)) < $connection_timeout AND active = '-2'"; if ($department != '' && $departments == 'true') { $query_select_users_online .= " AND u.department LIKE '%$department%'"; } $rows_users_online = $SQL->selectall($query_select_users_online); if(!is_array($rows_users_online)) { header('Location: index_offline.php?SERVER=' . $_GET['SERVER']); } } header('Content-type: text/html; charset=' . CHARSET); ?>