Browse Source

Merge pull request #28 from code2prog/master

Added new function: user_exsist_by_id()
develop
Emre Akay 11 years ago
parent
commit
8f5131ab12
  1. 10
      README.md
  2. 19
      application/libraries/Aauth.php

10
README.md

@ -165,6 +165,16 @@ sorry John you will be banned :(
$this->aauth->ban_user(3);
```
You can check if the user exists in the database based on the user's id
```php
if($this->aauth->user_exsist_by_id(3)){
//user exsist
}else{
//user not exsist
}
```
Quick Start is done but thats not the end
Take a look [detailed Documentation from wiki](https://github.com/emreakay/CodeIgniter-Aauth/wiki/_pages)

19
application/libraries/Aauth.php

@ -803,6 +803,25 @@ class Aauth {
return FALSE;
}
/**
* user_exsist_by_id
* Check if user exist by user id
* @param $user_id
*
* @return bool
*/
public function user_exsist_by_id( $user_id ) {
$query = $this->CI->db->where('id', $user_id);
$query = $this->CI->db->get($this->config_vars['users']);
if ($query->num_rows() > 0)
return TRUE;
else
return FALSE;
}
/**
* Get user id
* Get user id from email address, if par. not given, return current user's id

Loading…
Cancel
Save