diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2011-12-25 00:57:23 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2011-12-25 00:57:23 +0000 |
commit | fe4d464805d9c6d3471dbfab6e20cc960fdfd329 (patch) | |
tree | 9f19b3a692e291e1cab49f78e5f6fef55881ef74 /h-source/Application/Models/UsersModel.php | |
parent | b7910c20f6eb7dff80f5db4c8659222bd6e57c95 (diff) |
improved user history and improved mobile version
Diffstat (limited to 'h-source/Application/Models/UsersModel.php')
-rwxr-xr-x | h-source/Application/Models/UsersModel.php | 18 |
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 = '') { |