aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Models
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2010-10-30 16:17:50 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2010-10-30 16:17:50 +0000
commit19272c7c88f5df7fbba47f120efe440b5a472315 (patch)
treef083c49d68644ca2aea0175c886e94de4e6eb18c /h-source/Application/Models
parent4641de870cfa9c5d4c41a94328a8fb1f4adfdc78 (diff)
improved users history - part 1
Diffstat (limited to 'h-source/Application/Models')
-rwxr-xr-xh-source/Application/Models/UsersModel.php16
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