Advertisement
Guest User

Untitled

a guest
Oct 12th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. namespace App\Controllers;
  4.  
  5. class Login extends \App\Controller
  6. {
  7.     protected function action()
  8.     {
  9.         $authorization = new \App\Models\Authorization();
  10.         $view = new \App\View();
  11.  
  12.         if (!isset($_POST['login']) && !isset($_POST['password']) || !$authorization->checkPassword($_POST['login'], $_POST['password'])) {
  13.  
  14.             $view->display($_SERVER['DOCUMENT_ROOT'] . '/App/Templates/Authorization.php');
  15.             return;
  16.  
  17.         }   $authorization->checkPassword($_POST['login'], $_POST['password']);
  18.  
  19.             $authorization->setCurrentUser($_POST['login']);
  20.  
  21.             header('Location:/Admin/index.php');
  22.     }
  23.  
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement