<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
session_start();
include_once ($_SERVER['DOCUMENT_ROOT'] . '/_config/functions.php');
spl_autoload_register('my_autoload');

$login                              = new login();

$_SESSION[ALLOW]                    = $_COOKIE["identifier"];
$userData                           = $login->getUserData($_COOKIE["identifier"]);
$_SESSION['username']               = $userData['username'];
$_SESSION['complete_name']          = $userData['first_name'] . ' ' . $userData['last_name'];
$_SESSION['role']                   = $userData['role'];
$_SESSION['calendar_panel_class']   = $userData['calendar_panel_class'];
$_SESSION['ext_login']              = $userData['ext_login'];
security::saveAuthorizedLogins($_COOKIE["identifier"], $userData['first_name'] . ' ' . $userData['last_name'], $_SERVER['REMOTE_ADDR'], 1);

echo '<meta http-equiv="refresh" content="0; URL=' . HOME_DIR_HTML . '/main.php">';

