<?
session_cache_limiter('public');

error_reporting (E_ALL & ~E_NOTICE);
$sys['root'] =  str_replace("\\","/",getcwd());

require_once($sys['root']."/system/class/lib.strings.php");
$str = new strings;
require_once($sys['root']."/system/functions/misc.inc");
require_once($sys['root']."/system/class/lib.csv.php");
require_once($sys['root']."/system/class/lib.settings.php");
$settings = new settings();


define('ADODB_DIR',gluePath($sys['root'],"/system/class/adodb"));
require_once($sys['root']."/system/class/adodb/adodb.inc.php");
require_once($sys['root']."/system/class/adodb/adodb-errorhandler.inc.php");
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$ADODB_CACHE_DIR = $sys['root']."/system/data/temp/adodbcache";
$db = NewADOConnection($settings->config['dbtype']);
if (!@$db->Connect($settings->config['server'], $settings->config['dbuser'], $settings->config['dbpass'], $settings->config['dbname'])) {
	exit("Database connection failed!");
}

require_once($sys['root']."/system/class/lib.config.php");
$config = new config();
session_start();

require_once($sys['root']."/system/includes/inputchk.inc");
require_once($sys['root']."/system/class/lib.thumb.php");
require_once($sys['root']."/system/class/lib.fileman.php");
require_once($sys['root']."/system/class/lib.debug.php");
require_once($sys['root']."/system/class/lib.quota.php");
require_once($sys['root']."/system/class/lib.sharing.php");
require_once($sys['root']."/system/class/lib.list.php");
require_once($sys['root']."/system/class/lib.trash.php");
require_once($sys['root']."/system/class/lib.zip.php");
require_once($sys['root']."/system/class/lib.comments.php");
require_once($sys['root']."/system/class/lib.img.php");
//require_once($sys['root']."/system/includes/viewstyle.inc");
require_once($sys['root']."/system/class/lib.template.php");
require_once($sys['root']."/system/class/lib.jstemplate.php");
$tpl = new template();
require_once($sys['root']."/system/class/lib.calendar.php");
require_once($sys['root']."/system/class/lib.log.php");
require_once($sys['root']."/system/class/email/htmlmimemail.inc");
require_once($sys['root']."/system/includes/checkimages.inc");
require_once($sys['root']."/system/class/lib.flags.php");
require_once($sys['root']."/system/class/auth/lib.auth.sql.php");


$fm = new fileman;

//require_once($sys['root']."/system/class/lib.obgzip.php");

$auth = new Auth;
if ($auth->logged()){
$flags 	=	new flags;
$img 	=	new Images;
$thumb	= 	new Thumbs;
$fm->loadFileTypesInfo();
$share 	= 	new share;

require_once($sys['root']."/system/includes/permissions.inc");
require_once($sys['root']."/system/includes/thumbmaker.inc");
}
exit();
?>