Esempio n. 1
0
#Page generated
if (SERVER_STATUS == 'test') {
    @error_reporting(E_ALL);
    $starttime = explode(' ', microtime());
    $starttime = $starttime[1] + $starttime[0];
}
require_once INCLUDES . 'model.php';
require_once INCLUDES . 'class_main.php';
$main = new main();
# Create the class
if (isset($main) && !empty($main)) {
    global $main;
}
//Improve security to avoid double agents with the same session, avoiding session hijacking
if ($main->checkUserAgent() == false) {
    $main->logout();
}
/* Autoload base classes and hook classes */
spl_autoload_register('__autoload');
define('SMARTY_DIR', INCLUDES . 'smarty/');
require_once INCLUDES . 'smarty/Smarty.class.php';
function __autoload($class_name)
{
    //Loading BNPanel classes
    if (strpos($class_name, 'hook') === false) {
        $class_name = strtolower($class_name);
        $class_file = INCLUDES . 'class_' . $class_name . '.php';
    } else {
        //Loading BNPanel Hook classes i.e dolibarr
        list($hook, $module, $class) = explode('_', $class_name);
        //This is a hook class