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__');
 }
Beispiel #3
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);
}