public function mainAction() { if (authModel::is_Authorized()) { // go to main page in admin header("Location: " . $this->makeURI(array("controller" => "archive"))); } else { // go to authorize form header("Location: " . $this->makeURI(array("controller" => "auth"))); } exit; }
function __construct() { // clear messages and errors classModel::$errors = classModel::$messages = array(); // set logout link authModel::$logoutLink = $this->makeURI(array("controller" => "auth", "action" => "logout")); // check logining if (!authModel::is_Authorized()) { header("Location: " . $this->makeURI(array("controller" => "auth"))); } else { authModel::$userData = classModel::getSession("userData"); } // create top menu self::createTopMenu(); }