Advertisement
Guest User

Untitled

a guest
Jul 7th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. public function before()
  2. {
  3.     parent::before();
  4.    
  5.     if ( ! Session:;instance()->get('logged_in', FALSE))
  6.     {
  7.         $this->request->redirect('admin/login');
  8.     }
  9. }
  10.  
  11. public function action_login()
  12. {
  13.     if ($_POST)
  14.     {
  15.         $username = arr::get($_POST, 'username');
  16.         $password = arr::get($_POST, 'password');
  17.        
  18.         if ($username == $this->_username AND $password == $this->_password)
  19.         {
  20.             Session::instance()->set('logged_in', TRUE);
  21.         }
  22.     }
  23.    
  24.     $this->template->content = View::factory('admin/login');
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement