diff options
Diffstat (limited to 'h-source/Application/Models/UsersModel.php')
-rwxr-xr-x | h-source/Application/Models/UsersModel.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/h-source/Application/Models/UsersModel.php b/h-source/Application/Models/UsersModel.php index c425079..7a221cd 100755 --- a/h-source/Application/Models/UsersModel.php +++ b/h-source/Application/Models/UsersModel.php @@ -86,6 +86,22 @@ class UsersModel extends Model_Map } } + //get the user id from the username + public function getUserId($username) + { + $clean['username'] = ctype_alnum($username) ? sanitizeAll($username) : ''; + + $users = $this->select('id_user')->where(array('username'=>$clean['username'],'has_confirmed'=>0,'deleted'=>'no'))->send(); + if (count($users) > 0) + { + return $users[0]['regusers']['id_user']; + } + else + { + return 0; + } + } + public function insert() { //create the token |