@@ -33,31 +33,31 @@ |
||
33 | 33 | * @package OCA\UpdateNotification |
34 | 34 | */ |
35 | 35 | class ResetTokenBackgroundJob extends TimedJob { |
36 | - /** @var IConfig */ |
|
37 | - private $config; |
|
38 | - /** @var ITimeFactory */ |
|
39 | - private $timeFactory; |
|
36 | + /** @var IConfig */ |
|
37 | + private $config; |
|
38 | + /** @var ITimeFactory */ |
|
39 | + private $timeFactory; |
|
40 | 40 | |
41 | - /** |
|
42 | - * @param IConfig $config |
|
43 | - * @param ITimeFactory $timeFactory |
|
44 | - */ |
|
45 | - public function __construct(IConfig $config, |
|
46 | - ITimeFactory $timeFactory) { |
|
47 | - // Run all 10 minutes |
|
48 | - $this->setInterval(60 * 10); |
|
49 | - $this->config = $config; |
|
50 | - $this->timeFactory = $timeFactory; |
|
51 | - } |
|
41 | + /** |
|
42 | + * @param IConfig $config |
|
43 | + * @param ITimeFactory $timeFactory |
|
44 | + */ |
|
45 | + public function __construct(IConfig $config, |
|
46 | + ITimeFactory $timeFactory) { |
|
47 | + // Run all 10 minutes |
|
48 | + $this->setInterval(60 * 10); |
|
49 | + $this->config = $config; |
|
50 | + $this->timeFactory = $timeFactory; |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * @param $argument |
|
55 | - */ |
|
56 | - protected function run($argument) { |
|
57 | - // Delete old tokens after 2 days |
|
58 | - if($this->timeFactory->getTime() - $this->config->getAppValue('core', 'updater.secret.created', $this->timeFactory->getTime()) >= 172800) { |
|
59 | - $this->config->deleteSystemValue('updater.secret'); |
|
60 | - } |
|
61 | - } |
|
53 | + /** |
|
54 | + * @param $argument |
|
55 | + */ |
|
56 | + protected function run($argument) { |
|
57 | + // Delete old tokens after 2 days |
|
58 | + if($this->timeFactory->getTime() - $this->config->getAppValue('core', 'updater.secret.created', $this->timeFactory->getTime()) >= 172800) { |
|
59 | + $this->config->deleteSystemValue('updater.secret'); |
|
60 | + } |
|
61 | + } |
|
62 | 62 | |
63 | 63 | } |
@@ -27,48 +27,48 @@ |
||
27 | 27 | use OC\Updater\VersionCheck; |
28 | 28 | |
29 | 29 | class UpdateChecker { |
30 | - /** @var VersionCheck */ |
|
31 | - private $updater; |
|
30 | + /** @var VersionCheck */ |
|
31 | + private $updater; |
|
32 | 32 | |
33 | - /** |
|
34 | - * @param VersionCheck $updater |
|
35 | - */ |
|
36 | - public function __construct(VersionCheck $updater) { |
|
37 | - $this->updater = $updater; |
|
38 | - } |
|
33 | + /** |
|
34 | + * @param VersionCheck $updater |
|
35 | + */ |
|
36 | + public function __construct(VersionCheck $updater) { |
|
37 | + $this->updater = $updater; |
|
38 | + } |
|
39 | 39 | |
40 | - /** |
|
41 | - * @return array |
|
42 | - */ |
|
43 | - public function getUpdateState() { |
|
44 | - $data = $this->updater->check(); |
|
45 | - $result = []; |
|
40 | + /** |
|
41 | + * @return array |
|
42 | + */ |
|
43 | + public function getUpdateState() { |
|
44 | + $data = $this->updater->check(); |
|
45 | + $result = []; |
|
46 | 46 | |
47 | - if(isset($data['version']) && $data['version'] !== '' && $data['version'] !== []) { |
|
48 | - $result['updateAvailable'] = true; |
|
49 | - $result['updateVersion'] = $data['versionstring']; |
|
50 | - $result['updaterEnabled'] = $data['autoupdater'] === '1'; |
|
51 | - if(substr($data['web'], 0, 8) === 'https://') { |
|
52 | - $result['updateLink'] = $data['web']; |
|
53 | - } |
|
54 | - if(substr($data['url'], 0, 8) === 'https://') { |
|
55 | - $result['downloadLink'] = $data['url']; |
|
56 | - } |
|
47 | + if(isset($data['version']) && $data['version'] !== '' && $data['version'] !== []) { |
|
48 | + $result['updateAvailable'] = true; |
|
49 | + $result['updateVersion'] = $data['versionstring']; |
|
50 | + $result['updaterEnabled'] = $data['autoupdater'] === '1'; |
|
51 | + if(substr($data['web'], 0, 8) === 'https://') { |
|
52 | + $result['updateLink'] = $data['web']; |
|
53 | + } |
|
54 | + if(substr($data['url'], 0, 8) === 'https://') { |
|
55 | + $result['downloadLink'] = $data['url']; |
|
56 | + } |
|
57 | 57 | |
58 | - return $result; |
|
59 | - } |
|
58 | + return $result; |
|
59 | + } |
|
60 | 60 | |
61 | - return []; |
|
62 | - } |
|
61 | + return []; |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * @param array $data |
|
66 | - */ |
|
67 | - public function populateJavaScriptVariables(array $data) { |
|
68 | - $data['array']['oc_updateState'] = json_encode([ |
|
69 | - 'updateAvailable' => true, |
|
70 | - 'updateVersion' => $this->getUpdateState()['updateVersion'], |
|
71 | - 'updateLink' => isset($this->getUpdateState()['updateLink']) ? $this->getUpdateState()['updateLink'] : '', |
|
72 | - ]); |
|
73 | - } |
|
64 | + /** |
|
65 | + * @param array $data |
|
66 | + */ |
|
67 | + public function populateJavaScriptVariables(array $data) { |
|
68 | + $data['array']['oc_updateState'] = json_encode([ |
|
69 | + 'updateAvailable' => true, |
|
70 | + 'updateVersion' => $this->getUpdateState()['updateVersion'], |
|
71 | + 'updateLink' => isset($this->getUpdateState()['updateLink']) ? $this->getUpdateState()['updateLink'] : '', |
|
72 | + ]); |
|
73 | + } |
|
74 | 74 | } |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | $data = $this->updater->check(); |
45 | 45 | $result = []; |
46 | 46 | |
47 | - if(isset($data['version']) && $data['version'] !== '' && $data['version'] !== []) { |
|
47 | + if (isset($data['version']) && $data['version'] !== '' && $data['version'] !== []) { |
|
48 | 48 | $result['updateAvailable'] = true; |
49 | 49 | $result['updateVersion'] = $data['versionstring']; |
50 | 50 | $result['updaterEnabled'] = $data['autoupdater'] === '1'; |
51 | - if(substr($data['web'], 0, 8) === 'https://') { |
|
51 | + if (substr($data['web'], 0, 8) === 'https://') { |
|
52 | 52 | $result['updateLink'] = $data['web']; |
53 | 53 | } |
54 | - if(substr($data['url'], 0, 8) === 'https://') { |
|
54 | + if (substr($data['url'], 0, 8) === 'https://') { |
|
55 | 55 | $result['downloadLink'] = $data['url']; |
56 | 56 | } |
57 | 57 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @param array $data |
66 | 66 | */ |
67 | 67 | public function populateJavaScriptVariables(array $data) { |
68 | - $data['array']['oc_updateState'] = json_encode([ |
|
68 | + $data['array']['oc_updateState'] = json_encode([ |
|
69 | 69 | 'updateAvailable' => true, |
70 | 70 | 'updateVersion' => $this->getUpdateState()['updateVersion'], |
71 | 71 | 'updateLink' => isset($this->getUpdateState()['updateLink']) ? $this->getUpdateState()['updateLink'] : '', |
@@ -31,53 +31,53 @@ |
||
31 | 31 | use OCP\Util; |
32 | 32 | |
33 | 33 | class Application extends App { |
34 | - public function __construct() { |
|
35 | - parent::__construct('updatenotification', []); |
|
36 | - } |
|
34 | + public function __construct() { |
|
35 | + parent::__construct('updatenotification', []); |
|
36 | + } |
|
37 | 37 | |
38 | - public function register() { |
|
39 | - $server = $this->getContainer()->getServer(); |
|
38 | + public function register() { |
|
39 | + $server = $this->getContainer()->getServer(); |
|
40 | 40 | |
41 | - if ($server->getConfig()->getSystemValue('updatechecker', true) !== true) { |
|
42 | - // Updater check is disabled |
|
43 | - return; |
|
44 | - } |
|
41 | + if ($server->getConfig()->getSystemValue('updatechecker', true) !== true) { |
|
42 | + // Updater check is disabled |
|
43 | + return; |
|
44 | + } |
|
45 | 45 | |
46 | - $user = $server->getUserSession()->getUser(); |
|
47 | - if (!$user instanceof IUser) { |
|
48 | - // Nothing to do for guests |
|
49 | - return; |
|
50 | - } |
|
46 | + $user = $server->getUserSession()->getUser(); |
|
47 | + if (!$user instanceof IUser) { |
|
48 | + // Nothing to do for guests |
|
49 | + return; |
|
50 | + } |
|
51 | 51 | |
52 | - if ($server->getAppManager()->isEnabledForUser('notifications')) { |
|
53 | - // Notifications app is available, so we register. |
|
54 | - // Since notifications also work for non-admins we don't check this here. |
|
55 | - $this->registerNotifier(); |
|
56 | - } else if ($server->getGroupManager()->isAdmin($user->getUID())) { |
|
57 | - try { |
|
58 | - $updateChecker = $this->getContainer()->query(UpdateChecker::class); |
|
59 | - } catch (QueryException $e) { |
|
60 | - $server->getLogger()->logException($e); |
|
61 | - return; |
|
62 | - } |
|
52 | + if ($server->getAppManager()->isEnabledForUser('notifications')) { |
|
53 | + // Notifications app is available, so we register. |
|
54 | + // Since notifications also work for non-admins we don't check this here. |
|
55 | + $this->registerNotifier(); |
|
56 | + } else if ($server->getGroupManager()->isAdmin($user->getUID())) { |
|
57 | + try { |
|
58 | + $updateChecker = $this->getContainer()->query(UpdateChecker::class); |
|
59 | + } catch (QueryException $e) { |
|
60 | + $server->getLogger()->logException($e); |
|
61 | + return; |
|
62 | + } |
|
63 | 63 | |
64 | - if ($updateChecker->getUpdateState() !== []) { |
|
65 | - Util::addScript('updatenotification', 'notification'); |
|
66 | - \OC_Hook::connect('\OCP\Config', 'js', $updateChecker, 'populateJavaScriptVariables'); |
|
67 | - } |
|
68 | - } |
|
69 | - } |
|
64 | + if ($updateChecker->getUpdateState() !== []) { |
|
65 | + Util::addScript('updatenotification', 'notification'); |
|
66 | + \OC_Hook::connect('\OCP\Config', 'js', $updateChecker, 'populateJavaScriptVariables'); |
|
67 | + } |
|
68 | + } |
|
69 | + } |
|
70 | 70 | |
71 | - public function registerNotifier() { |
|
72 | - $notificationsManager = $this->getContainer()->getServer()->getNotificationManager(); |
|
73 | - $notificationsManager->registerNotifier(function() { |
|
74 | - return $this->getContainer()->query(Notifier::class); |
|
75 | - }, function() { |
|
76 | - $l = $this->getContainer()->getServer()->getL10N('updatenotification'); |
|
77 | - return [ |
|
78 | - 'id' => 'updatenotification', |
|
79 | - 'name' => $l->t('Update notifications'), |
|
80 | - ]; |
|
81 | - }); |
|
82 | - } |
|
71 | + public function registerNotifier() { |
|
72 | + $notificationsManager = $this->getContainer()->getServer()->getNotificationManager(); |
|
73 | + $notificationsManager->registerNotifier(function() { |
|
74 | + return $this->getContainer()->query(Notifier::class); |
|
75 | + }, function() { |
|
76 | + $l = $this->getContainer()->getServer()->getL10N('updatenotification'); |
|
77 | + return [ |
|
78 | + 'id' => 'updatenotification', |
|
79 | + 'name' => $l->t('Update notifications'), |
|
80 | + ]; |
|
81 | + }); |
|
82 | + } |
|
83 | 83 | } |
@@ -37,63 +37,63 @@ |
||
37 | 37 | use OCP\Util; |
38 | 38 | |
39 | 39 | class AdminController extends Controller { |
40 | - /** @var IJobList */ |
|
41 | - private $jobList; |
|
42 | - /** @var ISecureRandom */ |
|
43 | - private $secureRandom; |
|
44 | - /** @var IConfig */ |
|
45 | - private $config; |
|
46 | - /** @var ITimeFactory */ |
|
47 | - private $timeFactory; |
|
48 | - /** @var IL10N */ |
|
49 | - private $l10n; |
|
40 | + /** @var IJobList */ |
|
41 | + private $jobList; |
|
42 | + /** @var ISecureRandom */ |
|
43 | + private $secureRandom; |
|
44 | + /** @var IConfig */ |
|
45 | + private $config; |
|
46 | + /** @var ITimeFactory */ |
|
47 | + private $timeFactory; |
|
48 | + /** @var IL10N */ |
|
49 | + private $l10n; |
|
50 | 50 | |
51 | - /** |
|
52 | - * @param string $appName |
|
53 | - * @param IRequest $request |
|
54 | - * @param IJobList $jobList |
|
55 | - * @param ISecureRandom $secureRandom |
|
56 | - * @param IConfig $config |
|
57 | - * @param ITimeFactory $timeFactory |
|
58 | - * @param IL10N $l10n |
|
59 | - */ |
|
60 | - public function __construct($appName, |
|
61 | - IRequest $request, |
|
62 | - IJobList $jobList, |
|
63 | - ISecureRandom $secureRandom, |
|
64 | - IConfig $config, |
|
65 | - ITimeFactory $timeFactory, |
|
66 | - IL10N $l10n) { |
|
67 | - parent::__construct($appName, $request); |
|
68 | - $this->jobList = $jobList; |
|
69 | - $this->secureRandom = $secureRandom; |
|
70 | - $this->config = $config; |
|
71 | - $this->timeFactory = $timeFactory; |
|
72 | - $this->l10n = $l10n; |
|
73 | - } |
|
51 | + /** |
|
52 | + * @param string $appName |
|
53 | + * @param IRequest $request |
|
54 | + * @param IJobList $jobList |
|
55 | + * @param ISecureRandom $secureRandom |
|
56 | + * @param IConfig $config |
|
57 | + * @param ITimeFactory $timeFactory |
|
58 | + * @param IL10N $l10n |
|
59 | + */ |
|
60 | + public function __construct($appName, |
|
61 | + IRequest $request, |
|
62 | + IJobList $jobList, |
|
63 | + ISecureRandom $secureRandom, |
|
64 | + IConfig $config, |
|
65 | + ITimeFactory $timeFactory, |
|
66 | + IL10N $l10n) { |
|
67 | + parent::__construct($appName, $request); |
|
68 | + $this->jobList = $jobList; |
|
69 | + $this->secureRandom = $secureRandom; |
|
70 | + $this->config = $config; |
|
71 | + $this->timeFactory = $timeFactory; |
|
72 | + $this->l10n = $l10n; |
|
73 | + } |
|
74 | 74 | |
75 | - /** |
|
76 | - * @param string $channel |
|
77 | - * @return DataResponse |
|
78 | - */ |
|
79 | - public function setChannel($channel) { |
|
80 | - Util::setChannel($channel); |
|
81 | - $this->config->setAppValue('core', 'lastupdatedat', 0); |
|
82 | - return new DataResponse(['status' => 'success', 'data' => ['message' => $this->l10n->t('Channel updated')]]); |
|
83 | - } |
|
75 | + /** |
|
76 | + * @param string $channel |
|
77 | + * @return DataResponse |
|
78 | + */ |
|
79 | + public function setChannel($channel) { |
|
80 | + Util::setChannel($channel); |
|
81 | + $this->config->setAppValue('core', 'lastupdatedat', 0); |
|
82 | + return new DataResponse(['status' => 'success', 'data' => ['message' => $this->l10n->t('Channel updated')]]); |
|
83 | + } |
|
84 | 84 | |
85 | - /** |
|
86 | - * @return DataResponse |
|
87 | - */ |
|
88 | - public function createCredentials() { |
|
89 | - // Create a new job and store the creation date |
|
90 | - $this->jobList->add(ResetTokenBackgroundJob::class); |
|
91 | - $this->config->setAppValue('core', 'updater.secret.created', $this->timeFactory->getTime()); |
|
85 | + /** |
|
86 | + * @return DataResponse |
|
87 | + */ |
|
88 | + public function createCredentials() { |
|
89 | + // Create a new job and store the creation date |
|
90 | + $this->jobList->add(ResetTokenBackgroundJob::class); |
|
91 | + $this->config->setAppValue('core', 'updater.secret.created', $this->timeFactory->getTime()); |
|
92 | 92 | |
93 | - // Create a new token |
|
94 | - $newToken = $this->secureRandom->generate(64); |
|
95 | - $this->config->setSystemValue('updater.secret', password_hash($newToken, PASSWORD_DEFAULT)); |
|
93 | + // Create a new token |
|
94 | + $newToken = $this->secureRandom->generate(64); |
|
95 | + $this->config->setSystemValue('updater.secret', password_hash($newToken, PASSWORD_DEFAULT)); |
|
96 | 96 | |
97 | - return new DataResponse($newToken); |
|
98 | - } |
|
97 | + return new DataResponse($newToken); |
|
98 | + } |
|
99 | 99 | } |
@@ -33,84 +33,84 @@ |
||
33 | 33 | use OCP\Util; |
34 | 34 | |
35 | 35 | class Admin implements ISettings { |
36 | - /** @var IConfig */ |
|
37 | - private $config; |
|
38 | - /** @var UpdateChecker */ |
|
39 | - private $updateChecker; |
|
40 | - /** @var IDateTimeFormatter */ |
|
41 | - private $dateTimeFormatter; |
|
36 | + /** @var IConfig */ |
|
37 | + private $config; |
|
38 | + /** @var UpdateChecker */ |
|
39 | + private $updateChecker; |
|
40 | + /** @var IDateTimeFormatter */ |
|
41 | + private $dateTimeFormatter; |
|
42 | 42 | |
43 | - /** |
|
44 | - * @param IConfig $config |
|
45 | - * @param UpdateChecker $updateChecker |
|
46 | - * @param IDateTimeFormatter $dateTimeFormatter |
|
47 | - */ |
|
48 | - public function __construct(IConfig $config, |
|
49 | - UpdateChecker $updateChecker, |
|
50 | - IDateTimeFormatter $dateTimeFormatter) { |
|
51 | - $this->config = $config; |
|
52 | - $this->updateChecker = $updateChecker; |
|
53 | - $this->dateTimeFormatter = $dateTimeFormatter; |
|
54 | - } |
|
43 | + /** |
|
44 | + * @param IConfig $config |
|
45 | + * @param UpdateChecker $updateChecker |
|
46 | + * @param IDateTimeFormatter $dateTimeFormatter |
|
47 | + */ |
|
48 | + public function __construct(IConfig $config, |
|
49 | + UpdateChecker $updateChecker, |
|
50 | + IDateTimeFormatter $dateTimeFormatter) { |
|
51 | + $this->config = $config; |
|
52 | + $this->updateChecker = $updateChecker; |
|
53 | + $this->dateTimeFormatter = $dateTimeFormatter; |
|
54 | + } |
|
55 | 55 | |
56 | - /** |
|
57 | - * @return TemplateResponse |
|
58 | - */ |
|
59 | - public function getForm() { |
|
60 | - $lastUpdateCheckTimestamp = $this->config->getAppValue('core', 'lastupdatedat'); |
|
61 | - $lastUpdateCheck = $this->dateTimeFormatter->formatDateTime($lastUpdateCheckTimestamp); |
|
56 | + /** |
|
57 | + * @return TemplateResponse |
|
58 | + */ |
|
59 | + public function getForm() { |
|
60 | + $lastUpdateCheckTimestamp = $this->config->getAppValue('core', 'lastupdatedat'); |
|
61 | + $lastUpdateCheck = $this->dateTimeFormatter->formatDateTime($lastUpdateCheckTimestamp); |
|
62 | 62 | |
63 | - $channels = [ |
|
64 | - 'daily', |
|
65 | - 'beta', |
|
66 | - 'stable', |
|
67 | - 'production', |
|
68 | - ]; |
|
69 | - $currentChannel = Util::getChannel(); |
|
63 | + $channels = [ |
|
64 | + 'daily', |
|
65 | + 'beta', |
|
66 | + 'stable', |
|
67 | + 'production', |
|
68 | + ]; |
|
69 | + $currentChannel = Util::getChannel(); |
|
70 | 70 | |
71 | - // Remove the currently used channel from the channels list |
|
72 | - if(($key = array_search($currentChannel, $channels, true)) !== false) { |
|
73 | - unset($channels[$key]); |
|
74 | - } |
|
75 | - $updateState = $this->updateChecker->getUpdateState(); |
|
71 | + // Remove the currently used channel from the channels list |
|
72 | + if(($key = array_search($currentChannel, $channels, true)) !== false) { |
|
73 | + unset($channels[$key]); |
|
74 | + } |
|
75 | + $updateState = $this->updateChecker->getUpdateState(); |
|
76 | 76 | |
77 | - $notifyGroups = json_decode($this->config->getAppValue('updatenotification', 'notify_groups', '["admin"]'), true); |
|
77 | + $notifyGroups = json_decode($this->config->getAppValue('updatenotification', 'notify_groups', '["admin"]'), true); |
|
78 | 78 | |
79 | - $defaultUpdateServerURL = 'https://updates.nextcloud.com/server/'; |
|
80 | - $updateServerURL = $this->config->getSystemValue('updater.server.url', $defaultUpdateServerURL); |
|
79 | + $defaultUpdateServerURL = 'https://updates.nextcloud.com/server/'; |
|
80 | + $updateServerURL = $this->config->getSystemValue('updater.server.url', $defaultUpdateServerURL); |
|
81 | 81 | |
82 | - $params = [ |
|
83 | - 'isNewVersionAvailable' => !empty($updateState['updateAvailable']), |
|
84 | - 'isUpdateChecked' => $lastUpdateCheckTimestamp > 0, |
|
85 | - 'lastChecked' => $lastUpdateCheck, |
|
86 | - 'currentChannel' => $currentChannel, |
|
87 | - 'channels' => $channels, |
|
88 | - 'newVersionString' => empty($updateState['updateVersion']) ? '' : $updateState['updateVersion'], |
|
89 | - 'downloadLink' => empty($updateState['downloadLink']) ? '' : $updateState['downloadLink'], |
|
90 | - 'updaterEnabled' => empty($updateState['updaterEnabled']) ? false : $updateState['updaterEnabled'], |
|
91 | - 'isDefaultUpdateServerURL' => $updateServerURL === $defaultUpdateServerURL, |
|
92 | - 'updateServerURL' => $updateServerURL, |
|
93 | - 'notify_groups' => implode('|', $notifyGroups), |
|
94 | - ]; |
|
82 | + $params = [ |
|
83 | + 'isNewVersionAvailable' => !empty($updateState['updateAvailable']), |
|
84 | + 'isUpdateChecked' => $lastUpdateCheckTimestamp > 0, |
|
85 | + 'lastChecked' => $lastUpdateCheck, |
|
86 | + 'currentChannel' => $currentChannel, |
|
87 | + 'channels' => $channels, |
|
88 | + 'newVersionString' => empty($updateState['updateVersion']) ? '' : $updateState['updateVersion'], |
|
89 | + 'downloadLink' => empty($updateState['downloadLink']) ? '' : $updateState['downloadLink'], |
|
90 | + 'updaterEnabled' => empty($updateState['updaterEnabled']) ? false : $updateState['updaterEnabled'], |
|
91 | + 'isDefaultUpdateServerURL' => $updateServerURL === $defaultUpdateServerURL, |
|
92 | + 'updateServerURL' => $updateServerURL, |
|
93 | + 'notify_groups' => implode('|', $notifyGroups), |
|
94 | + ]; |
|
95 | 95 | |
96 | - return new TemplateResponse('updatenotification', 'admin', $params, ''); |
|
97 | - } |
|
96 | + return new TemplateResponse('updatenotification', 'admin', $params, ''); |
|
97 | + } |
|
98 | 98 | |
99 | - /** |
|
100 | - * @return string the section ID, e.g. 'sharing' |
|
101 | - */ |
|
102 | - public function getSection() { |
|
103 | - return 'server'; |
|
104 | - } |
|
99 | + /** |
|
100 | + * @return string the section ID, e.g. 'sharing' |
|
101 | + */ |
|
102 | + public function getSection() { |
|
103 | + return 'server'; |
|
104 | + } |
|
105 | 105 | |
106 | - /** |
|
107 | - * @return int whether the form should be rather on the top or bottom of |
|
108 | - * the admin section. The forms are arranged in ascending order of the |
|
109 | - * priority values. It is required to return a value between 0 and 100. |
|
110 | - * |
|
111 | - * E.g.: 70 |
|
112 | - */ |
|
113 | - public function getPriority() { |
|
114 | - return 1; |
|
115 | - } |
|
106 | + /** |
|
107 | + * @return int whether the form should be rather on the top or bottom of |
|
108 | + * the admin section. The forms are arranged in ascending order of the |
|
109 | + * priority values. It is required to return a value between 0 and 100. |
|
110 | + * |
|
111 | + * E.g.: 70 |
|
112 | + */ |
|
113 | + public function getPriority() { |
|
114 | + return 1; |
|
115 | + } |
|
116 | 116 | } |
@@ -69,7 +69,7 @@ |
||
69 | 69 | $currentChannel = Util::getChannel(); |
70 | 70 | |
71 | 71 | // Remove the currently used channel from the channels list |
72 | - if(($key = array_search($currentChannel, $channels, true)) !== false) { |
|
72 | + if (($key = array_search($currentChannel, $channels, true)) !== false) { |
|
73 | 73 | unset($channels[$key]); |
74 | 74 | } |
75 | 75 | $updateState = $this->updateChecker->getUpdateState(); |
@@ -6,11 +6,11 @@ |
||
6 | 6 | $baseDir = $vendorDir; |
7 | 7 | |
8 | 8 | return array( |
9 | - 'OCA\\UpdateNotification\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', |
|
10 | - 'OCA\\UpdateNotification\\Controller\\AdminController' => $baseDir . '/../lib/Controller/AdminController.php', |
|
11 | - 'OCA\\UpdateNotification\\Notification\\BackgroundJob' => $baseDir . '/../lib/Notification/BackgroundJob.php', |
|
12 | - 'OCA\\UpdateNotification\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php', |
|
13 | - 'OCA\\UpdateNotification\\ResetTokenBackgroundJob' => $baseDir . '/../lib/ResetTokenBackgroundJob.php', |
|
14 | - 'OCA\\UpdateNotification\\Settings\\Admin' => $baseDir . '/../lib/Settings/Admin.php', |
|
15 | - 'OCA\\UpdateNotification\\UpdateChecker' => $baseDir . '/../lib/UpdateChecker.php', |
|
9 | + 'OCA\\UpdateNotification\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php', |
|
10 | + 'OCA\\UpdateNotification\\Controller\\AdminController' => $baseDir.'/../lib/Controller/AdminController.php', |
|
11 | + 'OCA\\UpdateNotification\\Notification\\BackgroundJob' => $baseDir.'/../lib/Notification/BackgroundJob.php', |
|
12 | + 'OCA\\UpdateNotification\\Notification\\Notifier' => $baseDir.'/../lib/Notification/Notifier.php', |
|
13 | + 'OCA\\UpdateNotification\\ResetTokenBackgroundJob' => $baseDir.'/../lib/ResetTokenBackgroundJob.php', |
|
14 | + 'OCA\\UpdateNotification\\Settings\\Admin' => $baseDir.'/../lib/Settings/Admin.php', |
|
15 | + 'OCA\\UpdateNotification\\UpdateChecker' => $baseDir.'/../lib/UpdateChecker.php', |
|
16 | 16 | ); |
@@ -6,33 +6,33 @@ |
||
6 | 6 | |
7 | 7 | class ComposerStaticInitUpdateNotification |
8 | 8 | { |
9 | - public static $prefixLengthsPsr4 = array ( |
|
9 | + public static $prefixLengthsPsr4 = array( |
|
10 | 10 | 'O' => |
11 | - array ( |
|
11 | + array( |
|
12 | 12 | 'OCA\\UpdateNotification\\' => 23, |
13 | 13 | ), |
14 | 14 | ); |
15 | 15 | |
16 | - public static $prefixDirsPsr4 = array ( |
|
16 | + public static $prefixDirsPsr4 = array( |
|
17 | 17 | 'OCA\\UpdateNotification\\' => |
18 | - array ( |
|
19 | - 0 => __DIR__ . '/..' . '/../lib', |
|
18 | + array( |
|
19 | + 0 => __DIR__.'/..'.'/../lib', |
|
20 | 20 | ), |
21 | 21 | ); |
22 | 22 | |
23 | - public static $classMap = array ( |
|
24 | - 'OCA\\UpdateNotification\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php', |
|
25 | - 'OCA\\UpdateNotification\\Controller\\AdminController' => __DIR__ . '/..' . '/../lib/Controller/AdminController.php', |
|
26 | - 'OCA\\UpdateNotification\\Notification\\BackgroundJob' => __DIR__ . '/..' . '/../lib/Notification/BackgroundJob.php', |
|
27 | - 'OCA\\UpdateNotification\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php', |
|
28 | - 'OCA\\UpdateNotification\\ResetTokenBackgroundJob' => __DIR__ . '/..' . '/../lib/ResetTokenBackgroundJob.php', |
|
29 | - 'OCA\\UpdateNotification\\Settings\\Admin' => __DIR__ . '/..' . '/../lib/Settings/Admin.php', |
|
30 | - 'OCA\\UpdateNotification\\UpdateChecker' => __DIR__ . '/..' . '/../lib/UpdateChecker.php', |
|
23 | + public static $classMap = array( |
|
24 | + 'OCA\\UpdateNotification\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php', |
|
25 | + 'OCA\\UpdateNotification\\Controller\\AdminController' => __DIR__.'/..'.'/../lib/Controller/AdminController.php', |
|
26 | + 'OCA\\UpdateNotification\\Notification\\BackgroundJob' => __DIR__.'/..'.'/../lib/Notification/BackgroundJob.php', |
|
27 | + 'OCA\\UpdateNotification\\Notification\\Notifier' => __DIR__.'/..'.'/../lib/Notification/Notifier.php', |
|
28 | + 'OCA\\UpdateNotification\\ResetTokenBackgroundJob' => __DIR__.'/..'.'/../lib/ResetTokenBackgroundJob.php', |
|
29 | + 'OCA\\UpdateNotification\\Settings\\Admin' => __DIR__.'/..'.'/../lib/Settings/Admin.php', |
|
30 | + 'OCA\\UpdateNotification\\UpdateChecker' => __DIR__.'/..'.'/../lib/UpdateChecker.php', |
|
31 | 31 | ); |
32 | 32 | |
33 | 33 | public static function getInitializer(ClassLoader $loader) |
34 | 34 | { |
35 | - return \Closure::bind(function () use ($loader) { |
|
35 | + return \Closure::bind(function() use ($loader) { |
|
36 | 36 | $loader->prefixLengthsPsr4 = ComposerStaticInitUpdateNotification::$prefixLengthsPsr4; |
37 | 37 | $loader->prefixDirsPsr4 = ComposerStaticInitUpdateNotification::$prefixDirsPsr4; |
38 | 38 | $loader->classMap = ComposerStaticInitUpdateNotification::$classMap; |