die('alert(\'Invalid update script defined custom CID. Please try to refresh site manually.\');'); } } else { define('CID', false); } //i know that i won't access $_SESSION['client'] require_once 'include/session.php'; // if it's direct request to this file return content-type: text/javascript // otherwise it's include and do not send header. if (isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) { header("Content-type: text/javascript"); } $client_id = isset($_SESSION['num_of_clients']) ? $_SESSION['num_of_clients'] : 0; $client_id_next = $client_id + 1; if ($client_id_next == 5) { $client_id_next = 0; } $_SESSION['num_of_clients'] = $client_id_next; session_commit(); DBSession::destroy_client(session_id(), $client_id); ?> Epesi.init(<?php print $client_id; ?> ,'<?php print rtrim(str_replace('\\', '/', dirname($_SERVER['PHP_SELF'])), '/') . '/process.php'; ?> ','<?php print http_build_query($_GET); ?> ');
define('JS_OUTPUT', 1); define('EPESI_PROCESS', 1); require_once 'include.php'; if (epesi_requires_update()) { die('window.location = "index.php";'); } if (!isset($_SESSION['num_of_clients'])) { Epesi::alert('Session expired, restarting Epesi'); Epesi::redirect(); Epesi::send_output(); define('SESSION_EXPIRED', 1); //session_commit(); //DBSession::destroy(session_id()); } elseif ((!isset($_POST['history']) || !is_numeric($_POST['history']) || $_POST['history'] > 0) && !isset($_SESSION['client']['__history_id__'])) { Epesi::alert('Too many Epesi tabs open - session expired, restarting Epesi'); Epesi::redirect(); Epesi::send_output(); define('SESSION_EXPIRED', 1); //session_commit(); DBSession::destroy_client(session_id(), CID); } else { Epesi::process($_POST['url'], isset($_POST['history']) ? $_POST['history'] : false); } $content = ob_get_contents(); ob_end_clean(); require_once 'libs/minify/HTTP/Encoder.php'; $he = new HTTP_Encoder(array('content' => $content)); if (MINIFY_ENCODE) { $he->encode(); } $he->sendAll();