aboutsummaryrefslogtreecommitdiffstats
path: root/apps/updatenotification/lib/Notification
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2016-05-09 09:43:06 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2016-05-24 11:26:52 +0200
commitc34788918d83ff3f10c44d2c8cb7dfde09b326a5 (patch)
treed23c75730244913a7a372495c8dde1d6c2acc819 /apps/updatenotification/lib/Notification
parentd2553a4f6e14181d7788e42d1c70285ebb40f736 (diff)
downloadnextcloud-server-c34788918d83ff3f10c44d2c8cb7dfde09b326a5.tar.gz
nextcloud-server-c34788918d83ff3f10c44d2c8cb7dfde09b326a5.zip
Make the group selectable
Diffstat (limited to 'apps/updatenotification/lib/Notification')
-rw-r--r--apps/updatenotification/lib/Notification/BackgroundJob.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/updatenotification/lib/Notification/BackgroundJob.php b/apps/updatenotification/lib/Notification/BackgroundJob.php
index 7661f073e7b..f2cf7e1cd85 100644
--- a/apps/updatenotification/lib/Notification/BackgroundJob.php
+++ b/apps/updatenotification/lib/Notification/BackgroundJob.php
@@ -28,6 +28,7 @@ use OC\Updater\VersionCheck;
use OCP\App\IAppManager;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
+use OCP\IGroup;
use OCP\IGroupManager;
use OCP\IUser;
use OCP\Notification\IManager;
@@ -149,8 +150,14 @@ class BackgroundJob extends TimedJob {
return $this->users;
}
- $groupToNotify = $this->groupManager->get('admin');
- $this->users = $groupToNotify->getUsers();
+ $notifyGroups = json_decode($this->config->getAppValue('updatenotification', 'notify_groups', '["admin"]'));
+ foreach ($notifyGroups as $group) {
+ $groupToNotify = $this->groupManager->get($group);
+ if ($groupToNotify instanceof IGroup) {
+ $this->users = array_merge($this->users, $groupToNotify->getUsers());
+ }
+ }
+
return $this->users;
}