Skip to content
Snippets Groups Projects
main.inc.php 1.37 KiB
Newer Older
  • Learn to ignore specific revisions
  • Jared Hancock's avatar
    Jared Hancock committed
    <?php
    /*********************************************************************
    
    Jared Hancock's avatar
    Jared Hancock committed
    main.inc.php
    
    Jared Hancock's avatar
    Jared Hancock committed
    Master include file which must be included at the start of every file.
    The brain of the whole sytem. Don't monkey with it.
    
    Jared Hancock's avatar
    Jared Hancock committed
    Peter Rotich <peter@osticket.com>
    Copyright (c)  2006-2013 osTicket
    http://www.osticket.com
    
    Jared Hancock's avatar
    Jared Hancock committed
    Released under the GNU General Public License WITHOUT ANY WARRANTY.
    See LICENSE.TXT for details.
    
    Jared Hancock's avatar
    Jared Hancock committed
    vim: expandtab sw=4 ts=4 sts=4:
    
    **********************************************************************/
    
    
    Jared Hancock's avatar
    Jared Hancock committed
    #Disable direct access.
    
    if(isset($_SERVER['SCRIPT_NAME'])
            && !strcasecmp(basename($_SERVER['SCRIPT_NAME']),basename(__FILE__)))
        die('kwaheri rafiki!');
    
    Jared Hancock's avatar
    Jared Hancock committed
    require('bootstrap.php');
    Bootstrap::loadConfig();
    Bootstrap::defineTables(TABLE_PREFIX);
    
    Bootstrap::i18n_prep();
    
    Bootstrap::loadCode();
    
    Jared Hancock's avatar
    Jared Hancock committed
    Bootstrap::connect();
    
    Jared Hancock's avatar
    Jared Hancock committed
    if(!($ost=osTicket::start()) || !($cfg = $ost->getConfig()))
    Bootstrap::croak('Unable to load config info from DB. Get tech support.');
    
    Jared Hancock's avatar
    Jared Hancock committed
    //Init
    $session = $ost->getSession();
    
    Jared Hancock's avatar
    Jared Hancock committed
    //System defaults we might want to make global//
    #pagenation default - user can override it!
    define('DEFAULT_PAGE_LIMIT', $cfg->getPageSize()?$cfg->getPageSize():25);
    
    Jared Hancock's avatar
    Jared Hancock committed
    #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);
    }
    
    Jared Hancock's avatar
    Jared Hancock committed
    ?>