4500b54c25ff5144504dbdf6ba8aacc1520d83b9
[GitHub/WoltLab/WCF.git] /
1 <?php
2 namespace wcf\system\user\notification\object\type;
3 use wcf\data\comment\Comment;
4 use wcf\system\WCF;
5
6 /**
7 * Implements IMultiRecipientCommentUserNotificationObjectType::getRecipientIDs()
8 * for page comment user notification object types.
9 *
10 * @author Joshua Ruesweg
11 * @copyright 2001-2018 WoltLab GmbH
12 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
13 * @package WoltLabSuite\Core\System\User\Notification\Object\Type
14 * @since 3.2
15 */
16 trait TMultiRecipientPageCommentUserNotificationObjectType {
17 /**
18 * @inheritDoc
19 */
20 public function getRecipientIDs(Comment $comment) {
21 // find all userIDs with the permission to manage pages
22 $sql = "SELECT userID
23 FROM wcf".WCF_N."_user_to_group
24 INNER JOIN wcf".WCF_N."_user_group_option_value
25 ON wcf".WCF_N."_user_to_group.groupID = wcf".WCF_N."_user_group_option_value.groupID
26 AND wcf".WCF_N."_user_group_option_value.optionValue = ?
27 INNER JOIN wcf".WCF_N."_user_group_option
28 ON wcf".WCF_N."_user_group_option_value.optionID = wcf".WCF_N."_user_group_option.optionID
29 AND wcf".WCF_N."_user_group_option.optionName = ?";
30 $statement = WCF::getDB()->prepareStatement($sql);
31 $statement->execute([
32 1,
33 'admin.content.cms.canManagePage'
34 ]);
35 return $statement->fetchAll(\PDO::FETCH_COLUMN);
36 }
37 }