Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. public function log_in()
  2. {
  3. $emailadres = $this->input->post('email');
  4. $wachtwoord = ($this->input->post('password'));
  5.  
  6. $result = $this->user_model->login($emailadres, $wachtwoord);
  7.  
  8. if ($result[0]->role_id == 1) {
  9. $this->user_model->add_login();
  10. $this->log();
  11. redirect('admin/welcome_admin', 'refresh');
  12. }
  13. if ($result[0]->role_id == 2) {
  14. $this->user_model->add_login();
  15. $this->log();
  16. redirect('manager/welcome_manager', 'refresh');
  17. }
  18. if ($result[0]->role_id == 3) {
  19. $this->user_model->add_login();
  20. $this->log();
  21. redirect('edumed/welcome_edumed', 'refresh');
  22. }
  23. if ($result[0]->role_id == 4) {
  24. $this->user_model->add_login();
  25. $this->log();
  26. redirect('salesman/welcome_salesman', 'refresh');
  27. } else {
  28. $this->user_model->add_login_attempt();
  29. $this->log();
  30. echo "Login mislukt, probeer opnieuw";
  31. $this->login();
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement