diff options
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/notification/type/post_in_queue.php | 18 | ||||
-rw-r--r-- | phpBB/includes/notification/type/topic_in_queue.php | 25 |
2 files changed, 35 insertions, 8 deletions
diff --git a/phpBB/includes/notification/type/post_in_queue.php b/phpBB/includes/notification/type/post_in_queue.php index 1c29bee3cd..9c719205e6 100644 --- a/phpBB/includes/notification/type/post_in_queue.php +++ b/phpBB/includes/notification/type/post_in_queue.php @@ -64,9 +64,9 @@ class phpbb_notification_type_post_in_queue extends phpbb_notification_type_post */ public function is_available() { - $m_approve = $this->auth->acl_getf($this->permission, true); + $has_permission = $this->auth->acl_getf($this->permission, true); - return (!empty($m_approve)); + return (!empty($has_permission)); } /** @@ -90,9 +90,19 @@ class phpbb_notification_type_post_in_queue extends phpbb_notification_type_post return array(); } - $auth_approve[$post['forum_id']] = array_unique(array_merge($auth_approve[$post['forum_id']], $auth_approve[0])); + $has_permission = array(); - return $this->check_user_notification_options($auth_approve[$post['forum_id']][$this->permission], array_merge($options, array( + if (isset($auth_approve[$post['forum_id']][$this->permission])) + { + $has_permission = $auth_approve[$post['forum_id']][$this->permission]; + } + + if (isset($auth_approve[0][$this->permission])) + { + $has_permission = array_unique(array_merge($has_permission, $auth_approve[0][$this->permission])); + } + + return $this->check_user_notification_options($has_permission, array_merge($options, array( 'item_type' => self::$notification_option['id'], ))); } diff --git a/phpBB/includes/notification/type/topic_in_queue.php b/phpBB/includes/notification/type/topic_in_queue.php index dc0b9f9869..c501434c43 100644 --- a/phpBB/includes/notification/type/topic_in_queue.php +++ b/phpBB/includes/notification/type/topic_in_queue.php @@ -53,13 +53,20 @@ class phpbb_notification_type_topic_in_queue extends phpbb_notification_type_top ); /** + * Permission to check for (in find_users_for_notification) + * + * @var string Permission name + */ + protected $permission = 'm_approve'; + + /** * Is available */ public function is_available() { - $m_approve = $this->auth->acl_getf('m_approve', true); + $has_permission = $this->auth->acl_getf($this->permission, true); - return (!empty($m_approve)); + return (!empty($has_permission)); } /** @@ -83,9 +90,19 @@ class phpbb_notification_type_topic_in_queue extends phpbb_notification_type_top return array(); } - $auth_approve[$topic['forum_id']] = array_unique(array_merge($auth_approve[$topic['forum_id']], $auth_approve[0])); + $has_permission = array(); + + if (isset($auth_approve[$topic['forum_id']][$this->permission])) + { + $has_permission = $auth_approve[$topic['forum_id']][$this->permission]; + } + + if (isset($auth_approve[0][$this->permission])) + { + $has_permission = array_unique(array_merge($has_permission, $auth_approve[0][$this->permission])); + } - return $this->check_user_notification_options($auth_approve[$topic['forum_id']]['m_approve'], array_merge($options, array( + return $this->check_user_notification_options($has_permission, array_merge($options, array( 'item_type' => self::$notification_option['id'], ))); } |