aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/users.php
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-01-08 15:28:56 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-01-08 15:28:56 +0000
commit6955e992dbbc5a6e4a1844fa30475aacf6262701 (patch)
treeb38171042a354bba440ac730fe79733ee0100296 /engine/lib/users.php
parent50606888ddaa348bdabcd1e735eed55e26ff9c75 (diff)
downloadelgg-6955e992dbbc5a6e4a1844fa30475aacf6262701.tar.gz
elgg-6955e992dbbc5a6e4a1844fa30475aacf6262701.tar.bz2
Refs #668, #640: Cleaner interface provided for banning.
git-svn-id: https://code.elgg.org/elgg/trunk@2546 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/users.php')
-rw-r--r--engine/lib/users.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php
index c3ad2abfd..9b8594a93 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -155,6 +155,27 @@
return parent::delete();
+ }
+
+ /**
+ * Ban this user.
+ *
+ * @param string $reason Optional reason
+ */
+ public function ban($reason = "")
+ {
+ if (disable_user_entities($this->guid))
+ return $this->disable($reason);
+
+ return false;
+ }
+
+ /**
+ * Unban this user.
+ */
+ public function unban()
+ {
+ return enable_entity($this->guid);
}
/**