Guest User

Untitled

a guest
Mar 13th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. function _check_admin_login($username, $pword)
  2. {
  3.  
  4. $target_username="firas";
  5. $target_pass="password";
  6.  
  7. if(($username==$target_username) && ($pword==$target_pass)){
  8. return TRUE;
  9. }else{
  10. return FALSE;
  11. }
  12.  
  13.  
  14. }
  15.  
  16. function username_check($str){
  17.  
  18.  
  19. $this->load->module('store_accounts');
  20. $this->load->module('site_security');
  21. $error_msg = "Vous avez saisi un nom d'utilisateur ou un mot de passe incorrecte";
  22.  
  23. $pword = $this->input->post('pword', TRUE);
  24.  
  25. $result = $this->site_security->_check_admin_login($str, $pword);
  26. if($result==FALSE){
  27.  
  28. $this->form_validation->set_message('username_check', $error_msg);
  29. return FALSE;
  30. }else{
  31. return TRUE;
  32. }
  33.  
  34.  
  35.  
  36. }
  37.  
  38. function _check_admin_login($username, $pword)
  39. {
  40. $this->load->module('store_accounts');
  41. $this->store_accounts->fetch_data_from_db();
  42. $is_adminn = $data['is_adminn'];
  43.  
  44.  
  45. if($is_adminn==1){
  46. return TRUE;
  47. }else{
  48. return FALSE;
  49. }
  50.  
  51.  
  52. }
Add Comment
Please, Sign In to add comment