Guest User

Untitled

a guest
Dec 11th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. //see if the user still needs to login
  2. if( ! $this->authentica->is_logged_in())
  3. {
  4. //load the user model
  5. $this->load->model('user_model');
  6. //complete a login
  7. $username = $this->input->post('username');
  8. $password = $this->input->post('password');
  9.  
  10. $user = $this->user_model->get_username_password($username, $password);
  11. if( ! $user)
  12. {
  13. echo "Wrong username and password combination";
  14. return true;
  15. }
  16.  
  17. //tell the authentication library to login
  18. $this->authentica->login($user->id);
  19. //continue on
  20. }
  21. //redirect to the post login controller/function
  22. redirect('post/login');
Add Comment
Please, Sign In to add comment