Esempio n. 1
0
<?php

session_start();
include "class_lib.php";
include "template.php";
$template = new template('html');
//=========
if (!$_POST['login'] && !$_SESSION['islogin']) {
    $template->set_filenames(array('login' => 'login.html'));
    $template->pparse('login');
} else {
    if ($_POST['login']) {
        include "classes/login.php";
        $login = new login();
        $test = $login->logger($_POST['log'], $_POST['pass']);
        if (!$test) {
            $template->set_filenames(array('login' => 'login.html'));
            $template->assign_block_vars('switch_login_fails', array());
            $template->pparse('login');
            $template->set_filenames(array('footer' => 'footer.html'));
            $template->pparse('footer');
            exit;
        }
        if ($test) {
            $_SESSION['islogin'] = $login->islogin;
            $_SESSION['access'] = $login->access;
            $_SESSION['emp'] = $login->EMP;
            $_SESSION['zone'] = $login->zone;
            $session = new session_info();
            $page = new layout();
            $page->call_info($_GET['pageload'], $session->access);