<?php
/**
 * 
 * @file login.php
 * @copyright (c) 2005 - 2007 eifr.com
 * @license http://www.gnu.org/copyleft/gpl.html gnu/gpl
 * eifr is free software
 */

require_once('../../includes/inc_login.php');
require_once(EIFR_ROOT . 'libraries/template.php');
// ---start---
$errormsg = '';
if (!isset($act)) {
    $act = '';
} else if ($act == 'login') {
    $username = kPost('username');
    $password = md5($password);
    if (Common::checkLogin($username, $password, 3)) {
        header("Location:index.php");
    } else {
        $errormsg = $lang['checkLogin'];
        if (!Common::checkLoginErrornum()) {
            $errormsg = $lang['user_login_maxnum'];
        } 
    } 
} 

$clTemplate = new Template('../' . DIR_TEMPLATE_NAME . '/' . SYS_DEFAULT_STYLE . '/main/');
$clTemplate -> assign_vars(array('sys_charset' => SYS_CHARSET,
        'adminStylePath' => SYS_ADMIN_STYLE_PATH,
        'frontStylePath' => SYS_FRONT_STYLE_PATH,
        'sys_weburl' => SYS_WEBURL,
        'soft_name' => SOFT_NAME,
        'soft_version' => SOFT_VERSION,
        'soft_copyright' => SOFT_COPYRIGHT,
        'soft_weburl' => SOFT_WEBURL,
        'errormsg' => $errormsg,
        'manage_title' => $lang['manageTitle']
        ));

$clTemplate -> set_filenames(array('body' => 'login.tpl.html'));
$clTemplate -> pparse("body");

?>

