function osTicket() { require_once INCLUDE_DIR . 'class.config.php'; //Config helper $this->session = osTicketSession::start(SESSION_TTL); // start DB based session $this->config = new OsticketConfig(); $this->csrf = new CSRF('__CSRFToken__'); }
function osTicket($cfgId) { $this->config = Config::lookup($cfgId); //DB based session storage was added starting with v1.7 if ($this->config && !$this->getConfig()->getDBVersion()) { $this->session = osTicketSession::start(SESSION_TTL); } else { session_start(); } $this->csrf = new CSRF('__CSRFToken__'); }
Copyright (c) 2006-2013 osTicket http://www.osticket.com Released under the GNU General Public License WITHOUT ANY WARRANTY. See LICENSE.TXT for details. vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ require('staff.inc.php'); //Check token: Make sure the user actually clicked on the link to logout. if(!$_GET['auth'] || !$ost->validateLinkToken($_GET['auth'])) @header('Location: index.php'); $thisstaff->logOut(); //Clear any ticket locks the staff has. TicketLock::removeStaffLocks($thisstaff->getId()); //Destroy session on logout. // TODO: Stop doing this starting with 1.9 - separate session data per // app/panel. session_unset(); session_destroy(); osTicketSession::destroyCookie(); @header('Location: login.php'); require('login.php'); ?>
function refreshSession($force = false) { global $cfg; $time = $this->session->getLastUpdate($this->token); // Deadband session token updates to once / 30-seconds if (!$force && time() - $time < 30) { return; } $this->token = $this->getSessionToken(); osTicketSession::renewCookie($time, $cfg->getStaffSessionTimeout()); }
function migrateSessionFile2DB($taskId) { # How about 'dis for a hack? osTicketSession::write(session_id(), session_encode()); return 0; }
#Connect to the DB && get configuration from database $ferror = null; if (!db_connect(DBHOST, DBUSER, DBPASS) || !db_select_database(DBNAME)) { $ferror = 'Unable to connect to the database'; } elseif (!($cfg = Sys::getConfig())) { $ferror = 'Unable to load config info from DB. Get tech support.'; } elseif (!ini_get('short_open_tag')) { $ferror = 'Short open tag disabled! - osTicket requires it turned ON.'; } if ($ferror) { //Fatal error Sys::alertAdmin('osTicket Fatal Error', $ferror); //try alerting admin. die("<b>Fatal Error:</b> Contact system administrator."); //Generic error. exit; } //Init $cfg->init(); //Start session handler! $session = osTicketSession::start(SESSION_TTL); // start_session //Set default timezone...staff will overwrite it. $_SESSION['TZ_OFFSET'] = $cfg->getTZoffset(); $_SESSION['daylight'] = $cfg->observeDaylightSaving(); #Cleanup magic quotes crap. if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) { $_POST = Format::strip_slashes($_POST); $_GET = Format::strip_slashes($_GET); $_REQUEST = Format::strip_slashes($_REQUEST); }
function run() { # How about 'dis for a hack? osTicketSession::write(session_id(), session_encode()); }