Пример #1
0
function set_admin_pass($password)
{
    Authenticate::setAdminCookie($password);
}
Пример #2
0
 public static function setAdminLogin()
 {
     global $locale, $defender;
     if (isset($_GET['logout'])) {
         self::expireAdminCookie();
         redirect(BASEDIR . "index.php");
     }
     if (isset($_POST['admin_password'])) {
         $admin_password = form_sanitizer($_POST['admin_password'], '', 'admin_password');
         if ($defender->safe()) {
             if (\PHPFusion\Authenticate::validateAuthAdmin($admin_password)) {
                 if (Authenticate::setAdminCookie($admin_password)) {
                     redirect(FUSION_REQUEST);
                 } else {
                     addNotice("danger", $locale['cookie_error'], $locale['cookie_error_description']);
                 }
             } else {
                 addNotice("danger", $locale['password_invalid'], $locale['password_invalid_description']);
             }
         }
     }
     if (defined('ADMIN_PANEL') && !isset($_COOKIE[COOKIE_PREFIX . "admin"])) {
         addNotice("danger", $locale['cookie_title'], $locale['cookie_description']);
     }
 }