aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Models/UsersModel.php
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2010-11-01 20:42:44 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2010-11-01 20:42:44 +0000
commit049e37619a1ea7de4eed2695139645d6d6b9f397 (patch)
treeaac510dfdcc9e771cd3448cc0f45e7a6fdfc0665 /h-source/Application/Models/UsersModel.php
parentb006de42300a5671544e6fd3ea20ae7ce96da933 (diff)
moderators can now block/unblock users - part 1
Diffstat (limited to 'h-source/Application/Models/UsersModel.php')
-rwxr-xr-xh-source/Application/Models/UsersModel.php16
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