|
1 | 1 | <?php |
2 | 2 | /** |
3 | | - * @copyright Copyright (c) 2016, ownCloud, Inc. |
| 3 | + * @copyright Copyright (c) 2018, Joas Schilling <[email protected]> |
4 | 4 | * |
5 | 5 | * @author Joas Schilling <[email protected]> |
6 | | - * @author Lukas Reschke <[email protected]> |
7 | | - * @author Morris Jobke <[email protected]> |
8 | | - * @author Thomas Müller <[email protected]> |
9 | 6 | * |
10 | | - * @license AGPL-3.0 |
| 7 | + * @license GNU AGPL version 3 or any later version |
11 | 8 | * |
12 | | - * This code is free software: you can redistribute it and/or modify |
13 | | - * it under the terms of the GNU Affero General Public License, version 3, |
14 | | - * as published by the Free Software Foundation. |
| 9 | + * This program is free software: you can redistribute it and/or modify |
| 10 | + * it under the terms of the GNU Affero General Public License as |
| 11 | + * published by the Free Software Foundation, either version 3 of the |
| 12 | + * License, or (at your option) any later version. |
15 | 13 | * |
16 | 14 | * This program is distributed in the hope that it will be useful, |
17 | 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
18 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
19 | 17 | * GNU Affero General Public License for more details. |
20 | 18 | * |
21 | | - * You should have received a copy of the GNU Affero General Public License, version 3, |
22 | | - * along with this program. If not, see <http://www.gnu.org/licenses/> |
| 19 | + * You should have received a copy of the GNU Affero General Public License |
| 20 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
23 | 21 | * |
24 | 22 | */ |
25 | 23 |
|
26 | | -if(\OC::$server->getConfig()->getSystemValue('updatechecker', true) === true) { |
27 | | - $updater = new \OC\Updater\VersionCheck( |
28 | | - \OC::$server->getHTTPClientService(), |
29 | | - \OC::$server->getConfig() |
30 | | - ); |
31 | | - $updateChecker = new \OCA\UpdateNotification\UpdateChecker( |
32 | | - $updater |
33 | | - ); |
34 | | - |
35 | | - $userObject = \OC::$server->getUserSession()->getUser(); |
36 | | - if($userObject !== null) { |
37 | | - if(\OC::$server->getGroupManager()->isAdmin($userObject->getUID()) && |
38 | | - !\OC::$server->getAppManager()->isEnabledForUser('notifications')) { |
39 | | - if($updateChecker->getUpdateState() !== []) { |
40 | | - \OCP\Util::addScript('updatenotification', 'notification'); |
41 | | - OC_Hook::connect('\OCP\Config', 'js', $updateChecker, 'getJavaScript'); |
42 | | - } |
43 | | - } |
44 | | - } |
45 | | - |
46 | | - $manager = \OC::$server->getNotificationManager(); |
47 | | - $manager->registerNotifier(function() { |
48 | | - return \OC::$server->query(\OCA\UpdateNotification\Notification\Notifier::class); |
49 | | - }, function() { |
50 | | - $l = \OC::$server->getL10N('updatenotification'); |
51 | | - return [ |
52 | | - 'id' => 'updatenotification', |
53 | | - 'name' => $l->t('Update notifications'), |
54 | | - ]; |
55 | | - }); |
56 | | -} |
| 24 | +$app = new \OCA\UpdateNotification\AppInfo\Application(); |
| 25 | +$app->register(); |
0 commit comments