<?php
//#################################################################################################
// Login page
//#################################################################################################
// chillyCMS - Content Management System
// Copyright (C) 2008
// Stefanie Wiegand <hide@address.com> & Johannes Cox <hide@address.com>
//
// This program is licensed under the GPL 3.0 license. For more information see LICENSE.txt.
//#################################################################################################
define('DOIT',true);
require_once("../core/backendpage.class.php");
$page = new Backendpage();
require_once(PATH."/core/session.class.php");
require_once(PATH."/admin/login.include.php");
if (isset($_POST["action"])) {
$action = only_text($_POST["action"]);
} elseif (isset($_GET["action"])) {
$action = only_text($_GET["action"]);
} else {
$action = "";
}
if (isset($_POST["reason"])) {
$reason = only_text($_POST["reason"]);
} elseif (isset($_GET["reason"])) {
$reason = only_text($_GET["reason"]);
} else {
$reason = "";
}
if (isset($_POST["user"])) { $user = escape_html($_POST["user"]); }
if ($action=="logout") { destroy_existing_session(); }
if ($reason=="backend") { $msg = array($l_log["msg_nobackend_err"],"bad"); }
elseif ($reason=="inactive") { $msg = array($l_log["msg_inactive_err"],"bad"); }
elseif ($reason=="timeout") { $msg = array($l_log["msg_timeout1_err"].round($settings["session_ltime"]/60,0).$l_log["msg_timeout2_err"],"bad"); }
elseif ($reason=="logout") { $msg = array($l_log["lbl_logout"],"good"); }
else { $msg = ""; }
$page->set_type("login");
$page->print_head();
$page->add(loginform($reason));
$page->print_body($msg);
?>