. */ define('IS_LOGIN', true); require_once dirname(__FILE__) . '/head.php'; if(!empty($_POST['login']) && !empty($_POST['password'])) { if($nk->login($_POST['login'], $_POST['password'])) { if (!empty($_SESSION['login_referer'])) header('Location: '.$_SESSION['login_referer']); else header('Location: '.ADMIN_URL); exit; } form_error('INVALID_LOGIN'); } if(isset($_GET['logout'])) { $nk->logout(); tpl_assign('logout', true); if (isset($_GET['inFrame'])) { echo ''; } elseif (isset($_GET['fromPublic']) && !empty($_SERVER['HTTP_REFERER'])) { header('Location: '.$_SERVER['HTTP_REFERER']); exit; } } if($nk->isLogged()) { header('Location: ./'); exit; } if (!empty($_SERVER['HTTP_REFERER']) && isset($_GET['fromPublic'])) $_SESSION['login_referer'] = $_SERVER['HTTP_REFERER']; else $_SESSION['login_referer'] = ''; tpl_error('INVALID_LOGIN', "Nom d'utilisateur ou mot de passe invalide."); inc('login'); ?>