<?php
/**
 * @package linea21.core
 * @subpackage admin
 * @author linea21 <info@linea21.com>
 * @version $id SVN
 * @access public
 * @license http://opensource.org/licenses/gpl-3.0.html
 */

ob_start();
session_start();
include_once("../config/define.php");
include_once("../config/server.php");
include_once("../lib/no_cache.php");
include_once('../languages/' . LANGUAGE . '/lang_common.'. CHARSET .'.php');
include_once("../class/system/class." . SQL . ".php");
include_once('../lib/lang.php'); 

$sql_entity = SQL;
$sql_object = new $sql_entity;
$sql_object->DBInitialise();
$sql_object->DBConnexion();

include_once(SQL . ".inc.php");
// ////////////////////////////////////
// TENTATIVE D'AUTHENTIFICATION
// ////////////////////////////////////
if (isset($_POST['valid'])) {
    include_once("../lib/functions_auth.php");

    $auth_res = AuthenthificationProcess($_POST['login'], $_POST['password'], 'ADMIN');
    if ($auth_res === true) {
        header("Location: index.php");
    } 
} 

?>

<?php include_once(THEME_ADMIN_PATH."login.php"); ?>
