diff options
Diffstat (limited to 'h-source/Application/Models')
-rwxr-xr-x | h-source/Application/Models/UsersModel.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/h-source/Application/Models/UsersModel.php b/h-source/Application/Models/UsersModel.php index 27fc02a..a7c3845 100755 --- a/h-source/Application/Models/UsersModel.php +++ b/h-source/Application/Models/UsersModel.php @@ -89,7 +89,7 @@ class UsersModel extends Model_Map } //get the user id from the username - public function getUserId($username) + public function getUserId($username = '') { $clean['username'] = ctype_alnum($username) ? sanitizeAll($username) : ''; @@ -104,6 +104,20 @@ class UsersModel extends Model_Map } } + public function isBlocked($idUser) + { + $clean['id_user'] = (int)$idUser; + + $res = $this->select('blocked')->where(array('id_user'=>$clean['id_user'],'has_confirmed'=>0,'deleted'=>'no'))->toList('blocked')->send(); + + if (count($res) > 0) + { + return strcmp($res[0],'yes') === 0 ? true : false; + } + + return true; + } + public function insert() { //create the token |