Guest User

Untitled

a guest
Oct 20th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. public function index()
  2. {
  3. $this->template->title = "L33t Str33t::Card";
  4. $this->template->content = new View('pages/login');
  5.  
  6. $this->template->content->username = '';
  7. $this->template->content->password = '';
  8.  
  9. if(Auth::instance()->logged_in('logged_in'))
  10. {
  11. url::redirect('home');
  12. }
  13. elseif (Auth::instance()->logged_in())
  14. {
  15. url::redirect('accessdenied');
  16. }
  17.  
  18.  
  19. //$form=$_POST;
  20. $post = $this->input->post();
  21.  
  22. if($post)
  23. {
  24. $username = $this->input->post('username');
  25. $password = $this->input->post('password');
  26.  
  27.  
  28. $user = ORM::factory('user', $post->username);
  29. Auth::instance()->login($user->username, $password);
  30. //url::redirect('/user/login');
  31. url::redirect('profile');
  32. }
  33. }
Add Comment
Please, Sign In to add comment