aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Models/UsersModel.php
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Application/Models/UsersModel.php')
-rwxr-xr-xh-source/Application/Models/UsersModel.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/h-source/Application/Models/UsersModel.php b/h-source/Application/Models/UsersModel.php
index 0d84bb4..ea19a7b 100755
--- a/h-source/Application/Models/UsersModel.php
+++ b/h-source/Application/Models/UsersModel.php
@@ -112,6 +112,24 @@ class UsersModel extends Model_Map
return $this->getLinkToUser($this->getUser($clean['id_user']));
}
+ //check if the user exists
+ public function userExists($user)
+ {
+ $clean['user'] = ctype_alnum($user) ? sanitizeAll($user) : '';
+
+ if (strcmp($clean['user'],'') !== 0)
+ {
+ $res = $this->where(array("username"=>$clean['user'],"has_confirmed"=>"0","deleted"=>"no"))->send();
+// $res = $this->db->select('regusers','has_confirmed','username="'.$clean['user'].'" and has_confirmed=0 and deleted="no"');
+
+ if (count($res) > 0)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
//get the user id from the username
public function getUserId($username = '')
{