diff options
author | Marc Alexander <admin@m-a-styles.de> | 2014-08-08 16:43:31 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2014-08-08 16:43:31 +0200 |
commit | 80788980aa7dd4b3a849a43a94569a8b415d96db (patch) | |
tree | 1ab3fee487aa69b0fda908785a72971b7c1297ed | |
parent | 44a0f43062ea63ebb5cc5cdfa500934987b85cde (diff) | |
download | forums-80788980aa7dd4b3a849a43a94569a8b415d96db.tar forums-80788980aa7dd4b3a849a43a94569a8b415d96db.tar.gz forums-80788980aa7dd4b3a849a43a94569a8b415d96db.tar.bz2 forums-80788980aa7dd4b3a849a43a94569a8b415d96db.tar.xz forums-80788980aa7dd4b3a849a43a94569a8b415d96db.zip |
[ticket/12742] Add method for getting authenticated recipients
PHPBB3-12742
-rw-r--r-- | phpBB/phpbb/notification/type/base.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/phpBB/phpbb/notification/type/base.php b/phpBB/phpbb/notification/type/base.php index a11ad76db9..8243a2e6a2 100644 --- a/phpBB/phpbb/notification/type/base.php +++ b/phpBB/phpbb/notification/type/base.php @@ -533,4 +533,27 @@ abstract class base implements \phpbb\notification\type\type_interface WHERE ' . $where; $this->db->sql_query($sql); } + + /** + * Get a list of users that are authenticated to receive notifications + * + * @param array $users Array of users that have subscribed to a notification + * @param int $forum_id Forum ID of the forum + * @param array $options Array of notification options + * @return array Array of users that are authenticated recipients + */ + protected function get_authenticated_recipients($users, $forum_id, $options) + { + $users = array_unique($users); + sort($users); + + $auth_read = $this->auth->acl_get_list($users, 'f_read', $forum_id); + + if (empty($auth_read)) + { + return array(); + } + + return $this->check_user_notification_options($auth_read[$forum_id]['f_read'], $options); + } } |