Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var $table='jos_users';
- /*
- Work on joomla 1.5
- */
- public function detail($id,$field='username'){
- $sql=sprintf('select * from %s where %s="%s"',
- $this->table, $field, $id);
- return $this->resOne($sql ); //array (name,username,pass ...
- }
- public function checkUser($username,$password){
- $data=$this->detail($username);
- $pass=$data['password'];
- $ar=explode(":",$pass);
- $pass2=md5($password.$ar[1]).":".$ar[1] ;
- $sql=sprintf("select count(id) c from %s where username='%s' and password='%s' and block=0",
- $this->table, $username,$pass2);
- $data=$this->resOne($sql,1);//array(c=>
- return $data['c']==1?true:false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement