<?php
// Initialize session
session_start();
// DEV
$_SESSION['user_infos'] = serialize(array('user_id' => 1, 'login' => 'mogui', 'hash' => '5d9f71b71b207b9e665820c0dce67bdb'));
error_reporting(E_ALL);
ini_set('display_errors', 'On');
// DEV

// Open configuration
// Open autoload api
require_once(PATH_API.'api.php');
try
{
	// Initialize Error system
	require_once(PATH_API.'myexception.api.php');

	// Initialize mysql class
	$_SESSION['database'] = new mysql();
	$_SESSION['database']->connect(MYSQL_USER, MYSQL_PASSWORD, MYSQL_SERVER, MYSQL_DATABASE);
	
	// Inclusion of libs
	require_once(PATH_LIB.'smarty/Smarty.class.php');

	// Initialize user class
	$_SESSION['user'] = new user();

	// Initialize information user
	$_SESSION['user']->userInitialize();
	
	// Initialize security class
	$_SESSION['security'] = new security();
	
	// Initialize the hosting class
	$_SESSION['hosting'] = new hosting();

	// Initialize the informatin hosting
	$_SESSION['hosting']->userInitializeHosting();

	// Initialize template class
	$_SESSION['template'] = new template();
		
	// Rights display
	$_SESSION['template']->userSetRightsDisplay();
	
} catch (myException $error)
{
	$error->displayErrorMessage();
}
?>
