Advertisement
Guest User

Untitled

a guest
Jun 10th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1.      public function login($u,$p){
  2.           // sql injection safe guard
  3.           $u = str_replace('\\"','"',$u);
  4.           $u = str_replace('\\\\','\\',$u);
  5.           $p = str_replace('\\"','"',$p);
  6.           $p = str_replace('\\\\','\\',$p);
  7.          
  8.           //$this->DB()->debug=true;
  9.          
  10.           $this->Load("username='".$u."' and password='".md5($p)."'");
  11.           if(!empty($this->username)){
  12.                $_SESSION['user'] = array(
  13.                          "iduser"=>$this->iduser,
  14.                          "username"=>$this->username,
  15.                          "role"=>$this->role
  16.                     );
  17.                return true;
  18.           }else{
  19.  
  20.                $this->error = $this->language['errors']['Login_Failure'];
  21.                return false;
  22.           }
  23.      }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement