BaikalAdmin\Core\Auth::isAuthenticated PHP Метод

isAuthenticated() статический публичный Метод

static public isAuthenticated ( )
    static function isAuthenticated()
    {
        if (isset($_SESSION["baikaladminauth"]) && $_SESSION["baikaladminauth"] === md5(BAIKAL_ADMIN_PASSWORDHASH)) {
            return true;
        }
        return false;
    }

Usage Example

Пример #1
0
 public function render()
 {
     $sActionUrl = \Flake\Util\Tools::getCurrentUrl();
     $sSubmittedFlagName = "auth";
     $sMessage = "";
     if (self::isSubmitted() && !\BaikalAdmin\Core\Auth::isAuthenticated()) {
         $sMessage = \Formal\Core\Message::error("The login/password you provided is invalid. Please retry.", "Authentication error");
     } elseif (self::justLoggedOut()) {
         $sMessage = \Formal\Core\Message::notice("You have been disconnected from your session.", "Session ended", FALSE);
     }
     $sLogin = htmlspecialchars(\Flake\Util\Tools::POST("login"));
     $sPassword = htmlspecialchars(\Flake\Util\Tools::POST("password"));
     if (trim($sLogin) === "") {
         $sLogin = "******";
     }
     $oView = new \BaikalAdmin\View\Login();
     $oView->setData("message", $sMessage);
     $oView->setData("actionurl", $sActionUrl);
     $oView->setData("submittedflagname", $sSubmittedFlagName);
     $oView->setData("login", $sLogin);
     $oView->setData("password", $sPassword);
     return $oView->render();
 }
All Usage Examples Of BaikalAdmin\Core\Auth::isAuthenticated