summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris Cornutt <chris.cornutt@hp.com>2014-12-17 10:13:54 -0600
committerChris Cornutt <chris.cornutt@hp.com>2014-12-17 10:13:54 -0600
commit9b24ddd79deb077d07cba6a971d39d8cdad1005c (patch)
tree3a4ae6051b36e478c90d0d0287d925c75da90b97 /src
parentd31ce4f794c5dc6bd7ad9e05e7e797c6fd5c5f7b (diff)
downloadgatekeeper-9b24ddd79deb077d07cba6a971d39d8cdad1005c.zip
gatekeeper-9b24ddd79deb077d07cba6a971d39d8cdad1005c.tar.gz
gatekeeper-9b24ddd79deb077d07cba6a971d39d8cdad1005c.tar.bz2
adding the "isBanned" method
Diffstat (limited to 'src')
-rw-r--r--src/Psecio/Gatekeeper/UserModel.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Psecio/Gatekeeper/UserModel.php b/src/Psecio/Gatekeeper/UserModel.php
index ba068a7..6c91617 100644
--- a/src/Psecio/Gatekeeper/UserModel.php
+++ b/src/Psecio/Gatekeeper/UserModel.php
@@ -286,4 +286,17 @@ class UserModel extends \Psecio\Gatekeeper\Model\Mysql
}
return $res === 0;
}
+
+ /**
+ * Check to see if a user is banned
+ *
+ * @return boolean User is/is not banned
+ */
+ public function isBanned()
+ {
+ $throttle = new ThrottleModel($this->getDb());
+ $throttle->find(array('user_id' => $this->id));
+
+ return ($throttle->status === ThrottleModel::STATUS_BLOCKED) ? true : false;
+ }
} \ No newline at end of file