summaryrefslogtreecommitdiff
path: root/classes/Notice.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-11-16 19:03:59 +0100
committerEvan Prodromou <evan@status.net>2009-11-16 19:03:59 +0100
commitd2145a5b7f3a95dcfa90edb4bcd5e5b3bf66c116 (patch)
treeef31dc1aeb9e111fb0ca3e0b44c347e4203561ac /classes/Notice.php
parent02cc7af1b6a6f8c460550ad0f884bf5e7a18d176 (diff)
Move rights check to profile and add right for new notices
Added a right for new notices, realized that the hasRight() method should be on the profile, and moved it. Makes this a less atomic commit but that's the way it goes sometimes.
Diffstat (limited to 'classes/Notice.php')
-rw-r--r--classes/Notice.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 291e6202b..fde40240f 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -195,10 +195,8 @@ class Notice extends Memcached_DataObject
' take a breather and post again in a few minutes.'));
}
- $banned = common_config('profile', 'banned');
-
- if ( in_array($profile_id, $banned) || in_array($profile->nickname, $banned)) {
- common_log(LOG_WARNING, "Attempted post from banned user: $profile->nickname (user id = $profile_id).");
+ if (!$profile->hasRight(Right::NEWNOTICE)) {
+ common_log(LOG_WARNING, "Attempted post from user disallowed to post: " . $profile->nickname);
throw new ClientException(_('You are banned from posting notices on this site.'));
}