diff options
Diffstat (limited to 'apps/updatenotification/lib/Notification/BackgroundJob.php')
-rw-r--r-- | apps/updatenotification/lib/Notification/BackgroundJob.php | 11 |
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; } |