Advertisement
Guest User

Untitled

a guest
Mar 17th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.26 KB | None | 0 0
  1. <?php if (!defined('BlogUi')) exit;
  2.  
  3.  
  4.     # Si l'admin est déjà enregistré
  5.     if (Utilities::isAdmin())
  6.         $this->reloadPage(null, 'administration/home.html');
  7.  
  8.  
  9.     # Vérification des données de l'utilisateur et du captcha
  10.     if (isset($_POST['submit'], $_POST['user_name'], $_POST['user_pass'])) :
  11.  
  12.  
  13.         unset($_SESSION['returnDataReloadPage']);
  14.  
  15.         if (!LOCAL)
  16.             if (isset($_POST['g-recaptcha-response']))
  17.                 $responseCatpcha = Utilities::verifyCaptcha();
  18.             else
  19.                 $responseCatpcha = false;
  20.         else
  21.             $responseCatpcha = false;
  22.  
  23.         if ($this->acceptCookies AND (LOCAL OR $responseCatpcha === true)) :
  24.  
  25.             include BUI_ROOT . 'data/config.identifiant.php';
  26.  
  27.             if (sha1($_POST['user_name']) == BUI_IDENTIFY_ADMIN_NAME AND sha1($_POST['user_pass']) == BUI_IDENTIFY_ADMIN_PASS) :
  28.  
  29.                 $_SESSION['ADMIN_OPENING'] = true;
  30.                 $this->reloadPage(null, 'administration/home.html');
  31.  
  32.             else :
  33.                 $this->reloadPage(['error' => ['Identifiants incorrects']]);
  34.             endif;
  35.         else :
  36.             if (!$responseCatpcha OR !$this->acceptCookies)
  37.                 $responseCatpcha = ['Cookies désactivés'];
  38.  
  39.             $this->reloadPage(['error' => $responseCatpcha]);
  40.         endif;
  41.     endif;
  42.  
  43.  
  44.     # Réinsère les données du formulaire en cas d'échec de celui-ci
  45.     Utilities::getPost($this);
  46.  
  47.  
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement