@@ -4,13 +4,13 @@ discard block |
||
4 | 4 | script('federatedfilesharing', 'settings-admin'); |
5 | 5 | ?> |
6 | 6 | |
7 | -<?php if($_['internalOnly'] === false): ?> |
|
7 | +<?php if ($_['internalOnly'] === false): ?> |
|
8 | 8 | |
9 | 9 | <div id="fileSharingSettings" class="section"> |
10 | 10 | <h2> |
11 | - <?php p($l->t('Federated Cloud Sharing'));?> |
|
11 | + <?php p($l->t('Federated Cloud Sharing')); ?> |
|
12 | 12 | <a target="_blank" rel="noreferrer noopener" class="icon-info svg" |
13 | - title="<?php p($l->t('Open documentation'));?>" |
|
13 | + title="<?php p($l->t('Open documentation')); ?>" |
|
14 | 14 | href="<?php p(link_to_docs('admin-sharing-federated')); ?>"></a> |
15 | 15 | </h2> |
16 | 16 | |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | <input type="checkbox" name="outgoing_server2server_share_enabled" id="outgoingServer2serverShareEnabled" class="checkbox" |
21 | 21 | value="1" <?php if ($_['outgoingServer2serverShareEnabled']) print_unescaped('checked="checked"'); ?> /> |
22 | 22 | <label for="outgoingServer2serverShareEnabled"> |
23 | - <?php p($l->t('Allow users on this server to send shares to other servers'));?> |
|
23 | + <?php p($l->t('Allow users on this server to send shares to other servers')); ?> |
|
24 | 24 | </label> |
25 | 25 | </p> |
26 | 26 | |
@@ -28,21 +28,21 @@ discard block |
||
28 | 28 | <input type="checkbox" name="incoming_server2server_share_enabled" id="incomingServer2serverShareEnabled" class="checkbox" |
29 | 29 | value="1" <?php if ($_['incomingServer2serverShareEnabled']) print_unescaped('checked="checked"'); ?> /> |
30 | 30 | <label for="incomingServer2serverShareEnabled"> |
31 | - <?php p($l->t('Allow users on this server to receive shares from other servers'));?> |
|
31 | + <?php p($l->t('Allow users on this server to receive shares from other servers')); ?> |
|
32 | 32 | </label><br/> |
33 | 33 | </p> |
34 | 34 | <p> |
35 | 35 | <input type="checkbox" name="lookupServerEnabled" id="lookupServerEnabled" class="checkbox" |
36 | 36 | value="1" <?php if ($_['lookupServerEnabled']) print_unescaped('checked="checked"'); ?> /> |
37 | 37 | <label for="lookupServerEnabled"> |
38 | - <?php p($l->t('Search global and public address book for users'));?> |
|
38 | + <?php p($l->t('Search global and public address book for users')); ?> |
|
39 | 39 | </label><br/> |
40 | 40 | </p> |
41 | 41 | <p> |
42 | 42 | <input type="checkbox" name="lookupServerUploadEnabled" id="lookupServerUploadEnabled" class="checkbox" |
43 | 43 | value="1" <?php if ($_['lookupServerUploadEnabled']) print_unescaped('checked="checked"'); ?> /> |
44 | 44 | <label for="lookupServerUploadEnabled"> |
45 | - <?php p($l->t('Allow users to publish their data to a global and public address book'));?> |
|
45 | + <?php p($l->t('Allow users to publish their data to a global and public address book')); ?> |
|
46 | 46 | </label><br/> |
47 | 47 | </p> |
48 | 48 |
@@ -31,102 +31,102 @@ |
||
31 | 31 | use OCP\Settings\ISettings; |
32 | 32 | |
33 | 33 | trait CommonSettingsTrait { |
34 | - /** @var ISettingsManager */ |
|
35 | - private $settingsManager; |
|
36 | - |
|
37 | - /** @var INavigationManager */ |
|
38 | - private $navigationManager; |
|
39 | - |
|
40 | - /** |
|
41 | - * @param string $currentSection |
|
42 | - * @return array |
|
43 | - */ |
|
44 | - private function getNavigationParameters($currentType, $currentSection) { |
|
45 | - $templateParameters = [ |
|
46 | - 'personal' => $this->formatPersonalSections($currentType, $currentSection), |
|
47 | - 'admin' => [] |
|
48 | - ]; |
|
49 | - |
|
50 | - if(\OC_User::isAdminUser(\OC_User::getUser())) { |
|
51 | - $templateParameters['admin'] = $this->formatAdminSections($currentType, $currentSection); |
|
52 | - } |
|
53 | - |
|
54 | - return [ |
|
55 | - 'forms' => $templateParameters |
|
56 | - ]; |
|
57 | - } |
|
58 | - |
|
59 | - protected function formatSections($sections, $currentSection, $type, $currentType) { |
|
60 | - $templateParameters = []; |
|
61 | - /** @var \OCP\Settings\ISection[] $prioritizedSections */ |
|
62 | - foreach($sections as $prioritizedSections) { |
|
63 | - foreach ($prioritizedSections as $section) { |
|
64 | - if($type === 'admin') { |
|
65 | - $settings = $this->settingsManager->getAdminSettings($section->getID()); |
|
66 | - } else if($type === 'personal') { |
|
67 | - $settings = $this->settingsManager->getPersonalSettings($section->getID()); |
|
68 | - } |
|
69 | - if (empty($settings) && !($section->getID() === 'additional' && count(\OC_App::getForms('admin')) > 0)) { |
|
70 | - continue; |
|
71 | - } |
|
72 | - |
|
73 | - $icon = ''; |
|
74 | - if ($section instanceof IIconSection) { |
|
75 | - $icon = $section->getIcon(); |
|
76 | - } |
|
77 | - |
|
78 | - $active = $section->getID() === $currentSection |
|
79 | - && $type === $currentType; |
|
80 | - |
|
81 | - $templateParameters[] = [ |
|
82 | - 'anchor' => $section->getID(), |
|
83 | - 'section-name' => $section->getName(), |
|
84 | - 'active' => $active, |
|
85 | - 'icon' => $icon, |
|
86 | - ]; |
|
87 | - } |
|
88 | - } |
|
89 | - return $templateParameters; |
|
90 | - } |
|
91 | - |
|
92 | - protected function formatPersonalSections($currentType, $currentSections) { |
|
93 | - $sections = $this->settingsManager->getPersonalSections(); |
|
94 | - $templateParameters = $this->formatSections($sections, $currentSections, 'personal', $currentType); |
|
95 | - |
|
96 | - return $templateParameters; |
|
97 | - } |
|
98 | - |
|
99 | - protected function formatAdminSections($currentType, $currentSections) { |
|
100 | - $sections = $this->settingsManager->getAdminSections(); |
|
101 | - $templateParameters = $this->formatSections($sections, $currentSections, 'admin', $currentType); |
|
102 | - |
|
103 | - return $templateParameters; |
|
104 | - } |
|
105 | - |
|
106 | - /** |
|
107 | - * @param ISettings[] $settings |
|
108 | - * @return array |
|
109 | - */ |
|
110 | - private function formatSettings($settings) { |
|
111 | - $html = ''; |
|
112 | - foreach ($settings as $prioritizedSettings) { |
|
113 | - foreach ($prioritizedSettings as $setting) { |
|
114 | - /** @var \OCP\Settings\ISettings $setting */ |
|
115 | - $form = $setting->getForm(); |
|
116 | - $html .= $form->renderAs('')->render(); |
|
117 | - } |
|
118 | - } |
|
119 | - return ['content' => $html]; |
|
120 | - } |
|
121 | - |
|
122 | - private function getIndexResponse($type, $section) { |
|
123 | - $this->navigationManager->setActiveEntry('settings'); |
|
124 | - $templateParams = []; |
|
125 | - $templateParams = array_merge($templateParams, $this->getNavigationParameters($type, $section)); |
|
126 | - $templateParams = array_merge($templateParams, $this->getSettings($section)); |
|
127 | - |
|
128 | - return new TemplateResponse('settings', 'settings/frame', $templateParams); |
|
129 | - } |
|
130 | - |
|
131 | - abstract protected function getSettings($section); |
|
34 | + /** @var ISettingsManager */ |
|
35 | + private $settingsManager; |
|
36 | + |
|
37 | + /** @var INavigationManager */ |
|
38 | + private $navigationManager; |
|
39 | + |
|
40 | + /** |
|
41 | + * @param string $currentSection |
|
42 | + * @return array |
|
43 | + */ |
|
44 | + private function getNavigationParameters($currentType, $currentSection) { |
|
45 | + $templateParameters = [ |
|
46 | + 'personal' => $this->formatPersonalSections($currentType, $currentSection), |
|
47 | + 'admin' => [] |
|
48 | + ]; |
|
49 | + |
|
50 | + if(\OC_User::isAdminUser(\OC_User::getUser())) { |
|
51 | + $templateParameters['admin'] = $this->formatAdminSections($currentType, $currentSection); |
|
52 | + } |
|
53 | + |
|
54 | + return [ |
|
55 | + 'forms' => $templateParameters |
|
56 | + ]; |
|
57 | + } |
|
58 | + |
|
59 | + protected function formatSections($sections, $currentSection, $type, $currentType) { |
|
60 | + $templateParameters = []; |
|
61 | + /** @var \OCP\Settings\ISection[] $prioritizedSections */ |
|
62 | + foreach($sections as $prioritizedSections) { |
|
63 | + foreach ($prioritizedSections as $section) { |
|
64 | + if($type === 'admin') { |
|
65 | + $settings = $this->settingsManager->getAdminSettings($section->getID()); |
|
66 | + } else if($type === 'personal') { |
|
67 | + $settings = $this->settingsManager->getPersonalSettings($section->getID()); |
|
68 | + } |
|
69 | + if (empty($settings) && !($section->getID() === 'additional' && count(\OC_App::getForms('admin')) > 0)) { |
|
70 | + continue; |
|
71 | + } |
|
72 | + |
|
73 | + $icon = ''; |
|
74 | + if ($section instanceof IIconSection) { |
|
75 | + $icon = $section->getIcon(); |
|
76 | + } |
|
77 | + |
|
78 | + $active = $section->getID() === $currentSection |
|
79 | + && $type === $currentType; |
|
80 | + |
|
81 | + $templateParameters[] = [ |
|
82 | + 'anchor' => $section->getID(), |
|
83 | + 'section-name' => $section->getName(), |
|
84 | + 'active' => $active, |
|
85 | + 'icon' => $icon, |
|
86 | + ]; |
|
87 | + } |
|
88 | + } |
|
89 | + return $templateParameters; |
|
90 | + } |
|
91 | + |
|
92 | + protected function formatPersonalSections($currentType, $currentSections) { |
|
93 | + $sections = $this->settingsManager->getPersonalSections(); |
|
94 | + $templateParameters = $this->formatSections($sections, $currentSections, 'personal', $currentType); |
|
95 | + |
|
96 | + return $templateParameters; |
|
97 | + } |
|
98 | + |
|
99 | + protected function formatAdminSections($currentType, $currentSections) { |
|
100 | + $sections = $this->settingsManager->getAdminSections(); |
|
101 | + $templateParameters = $this->formatSections($sections, $currentSections, 'admin', $currentType); |
|
102 | + |
|
103 | + return $templateParameters; |
|
104 | + } |
|
105 | + |
|
106 | + /** |
|
107 | + * @param ISettings[] $settings |
|
108 | + * @return array |
|
109 | + */ |
|
110 | + private function formatSettings($settings) { |
|
111 | + $html = ''; |
|
112 | + foreach ($settings as $prioritizedSettings) { |
|
113 | + foreach ($prioritizedSettings as $setting) { |
|
114 | + /** @var \OCP\Settings\ISettings $setting */ |
|
115 | + $form = $setting->getForm(); |
|
116 | + $html .= $form->renderAs('')->render(); |
|
117 | + } |
|
118 | + } |
|
119 | + return ['content' => $html]; |
|
120 | + } |
|
121 | + |
|
122 | + private function getIndexResponse($type, $section) { |
|
123 | + $this->navigationManager->setActiveEntry('settings'); |
|
124 | + $templateParams = []; |
|
125 | + $templateParams = array_merge($templateParams, $this->getNavigationParameters($type, $section)); |
|
126 | + $templateParams = array_merge($templateParams, $this->getSettings($section)); |
|
127 | + |
|
128 | + return new TemplateResponse('settings', 'settings/frame', $templateParams); |
|
129 | + } |
|
130 | + |
|
131 | + abstract protected function getSettings($section); |
|
132 | 132 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | use OCP\Settings\IIconSection; |
31 | 31 | use OCP\Settings\ISettings; |
32 | 32 | |
33 | -trait CommonSettingsTrait { |
|
33 | +trait CommonSettingsTrait { |
|
34 | 34 | /** @var ISettingsManager */ |
35 | 35 | private $settingsManager; |
36 | 36 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | 'admin' => [] |
48 | 48 | ]; |
49 | 49 | |
50 | - if(\OC_User::isAdminUser(\OC_User::getUser())) { |
|
50 | + if (\OC_User::isAdminUser(\OC_User::getUser())) { |
|
51 | 51 | $templateParameters['admin'] = $this->formatAdminSections($currentType, $currentSection); |
52 | 52 | } |
53 | 53 | |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | protected function formatSections($sections, $currentSection, $type, $currentType) { |
60 | 60 | $templateParameters = []; |
61 | 61 | /** @var \OCP\Settings\ISection[] $prioritizedSections */ |
62 | - foreach($sections as $prioritizedSections) { |
|
62 | + foreach ($sections as $prioritizedSections) { |
|
63 | 63 | foreach ($prioritizedSections as $section) { |
64 | - if($type === 'admin') { |
|
64 | + if ($type === 'admin') { |
|
65 | 65 | $settings = $this->settingsManager->getAdminSettings($section->getID()); |
66 | - } else if($type === 'personal') { |
|
66 | + } else if ($type === 'personal') { |
|
67 | 67 | $settings = $this->settingsManager->getPersonalSettings($section->getID()); |
68 | 68 | } |
69 | 69 | if (empty($settings) && !($section->getID() === 'additional' && count(\OC_App::getForms('admin')) > 0)) { |
@@ -27,10 +27,6 @@ |
||
27 | 27 | namespace OC\Settings\Admin; |
28 | 28 | |
29 | 29 | use Doctrine\DBAL\Connection; |
30 | -use Doctrine\DBAL\DBALException; |
|
31 | -use Doctrine\DBAL\Platforms\SqlitePlatform; |
|
32 | -use OC\Lock\DBLockingProvider; |
|
33 | -use OC\Lock\NoopLockingProvider; |
|
34 | 30 | use OCP\AppFramework\Http\TemplateResponse; |
35 | 31 | use OCP\IConfig; |
36 | 32 | use OCP\IDBConnection; |
@@ -40,67 +40,67 @@ |
||
40 | 40 | use OCP\Settings\ISettings; |
41 | 41 | |
42 | 42 | class Server implements ISettings { |
43 | - /** @var IDBConnection|Connection */ |
|
44 | - private $db; |
|
45 | - /** @var IRequest */ |
|
46 | - private $request; |
|
47 | - /** @var IConfig */ |
|
48 | - private $config; |
|
49 | - /** @var ILockingProvider */ |
|
50 | - private $lockingProvider; |
|
51 | - /** @var IL10N */ |
|
52 | - private $l; |
|
43 | + /** @var IDBConnection|Connection */ |
|
44 | + private $db; |
|
45 | + /** @var IRequest */ |
|
46 | + private $request; |
|
47 | + /** @var IConfig */ |
|
48 | + private $config; |
|
49 | + /** @var ILockingProvider */ |
|
50 | + private $lockingProvider; |
|
51 | + /** @var IL10N */ |
|
52 | + private $l; |
|
53 | 53 | |
54 | - /** |
|
55 | - * @param IDBConnection $db |
|
56 | - * @param IRequest $request |
|
57 | - * @param IConfig $config |
|
58 | - * @param ILockingProvider $lockingProvider |
|
59 | - * @param IL10N $l |
|
60 | - */ |
|
61 | - public function __construct(IDBConnection $db, |
|
62 | - IRequest $request, |
|
63 | - IConfig $config, |
|
64 | - ILockingProvider $lockingProvider, |
|
65 | - IL10N $l) { |
|
66 | - $this->db = $db; |
|
67 | - $this->request = $request; |
|
68 | - $this->config = $config; |
|
69 | - $this->lockingProvider = $lockingProvider; |
|
70 | - $this->l = $l; |
|
71 | - } |
|
54 | + /** |
|
55 | + * @param IDBConnection $db |
|
56 | + * @param IRequest $request |
|
57 | + * @param IConfig $config |
|
58 | + * @param ILockingProvider $lockingProvider |
|
59 | + * @param IL10N $l |
|
60 | + */ |
|
61 | + public function __construct(IDBConnection $db, |
|
62 | + IRequest $request, |
|
63 | + IConfig $config, |
|
64 | + ILockingProvider $lockingProvider, |
|
65 | + IL10N $l) { |
|
66 | + $this->db = $db; |
|
67 | + $this->request = $request; |
|
68 | + $this->config = $config; |
|
69 | + $this->lockingProvider = $lockingProvider; |
|
70 | + $this->l = $l; |
|
71 | + } |
|
72 | 72 | |
73 | - /** |
|
74 | - * @return TemplateResponse |
|
75 | - */ |
|
76 | - public function getForm() { |
|
77 | - $parameters = [ |
|
78 | - // Background jobs |
|
79 | - 'backgroundjobs_mode' => $this->config->getAppValue('core', 'backgroundjobs_mode', 'ajax'), |
|
80 | - 'lastcron' => $this->config->getAppValue('core', 'lastcron', false), |
|
81 | - 'cronErrors' => $this->config->getAppValue('core', 'cronErrors'), |
|
82 | - 'cli_based_cron_possible' => function_exists('posix_getpwuid'), |
|
83 | - 'cli_based_cron_user' => function_exists('posix_getpwuid') ? posix_getpwuid(fileowner(\OC::$configDir . 'config.php'))['name'] : '', |
|
84 | - ]; |
|
73 | + /** |
|
74 | + * @return TemplateResponse |
|
75 | + */ |
|
76 | + public function getForm() { |
|
77 | + $parameters = [ |
|
78 | + // Background jobs |
|
79 | + 'backgroundjobs_mode' => $this->config->getAppValue('core', 'backgroundjobs_mode', 'ajax'), |
|
80 | + 'lastcron' => $this->config->getAppValue('core', 'lastcron', false), |
|
81 | + 'cronErrors' => $this->config->getAppValue('core', 'cronErrors'), |
|
82 | + 'cli_based_cron_possible' => function_exists('posix_getpwuid'), |
|
83 | + 'cli_based_cron_user' => function_exists('posix_getpwuid') ? posix_getpwuid(fileowner(\OC::$configDir . 'config.php'))['name'] : '', |
|
84 | + ]; |
|
85 | 85 | |
86 | - return new TemplateResponse('settings', 'settings/admin/server', $parameters, ''); |
|
87 | - } |
|
86 | + return new TemplateResponse('settings', 'settings/admin/server', $parameters, ''); |
|
87 | + } |
|
88 | 88 | |
89 | - /** |
|
90 | - * @return string the section ID, e.g. 'sharing' |
|
91 | - */ |
|
92 | - public function getSection() { |
|
93 | - return 'server'; |
|
94 | - } |
|
89 | + /** |
|
90 | + * @return string the section ID, e.g. 'sharing' |
|
91 | + */ |
|
92 | + public function getSection() { |
|
93 | + return 'server'; |
|
94 | + } |
|
95 | 95 | |
96 | - /** |
|
97 | - * @return int whether the form should be rather on the top or bottom of |
|
98 | - * the admin section. The forms are arranged in ascending order of the |
|
99 | - * priority values. It is required to return a value between 0 and 100. |
|
100 | - * |
|
101 | - * E.g.: 70 |
|
102 | - */ |
|
103 | - public function getPriority() { |
|
104 | - return 0; |
|
105 | - } |
|
96 | + /** |
|
97 | + * @return int whether the form should be rather on the top or bottom of |
|
98 | + * the admin section. The forms are arranged in ascending order of the |
|
99 | + * priority values. It is required to return a value between 0 and 100. |
|
100 | + * |
|
101 | + * E.g.: 70 |
|
102 | + */ |
|
103 | + public function getPriority() { |
|
104 | + return 0; |
|
105 | + } |
|
106 | 106 | } |
@@ -80,7 +80,7 @@ |
||
80 | 80 | 'lastcron' => $this->config->getAppValue('core', 'lastcron', false), |
81 | 81 | 'cronErrors' => $this->config->getAppValue('core', 'cronErrors'), |
82 | 82 | 'cli_based_cron_possible' => function_exists('posix_getpwuid'), |
83 | - 'cli_based_cron_user' => function_exists('posix_getpwuid') ? posix_getpwuid(fileowner(\OC::$configDir . 'config.php'))['name'] : '', |
|
83 | + 'cli_based_cron_user' => function_exists('posix_getpwuid') ? posix_getpwuid(fileowner(\OC::$configDir.'config.php'))['name'] : '', |
|
84 | 84 | ]; |
85 | 85 | |
86 | 86 | return new TemplateResponse('settings', 'settings/admin/server', $parameters, ''); |
@@ -37,118 +37,118 @@ |
||
37 | 37 | use OCP\Settings\ISettings; |
38 | 38 | |
39 | 39 | class Overview implements ISettings { |
40 | - /** @var IDBConnection|Connection */ |
|
41 | - private $db; |
|
42 | - /** @var IRequest */ |
|
43 | - private $request; |
|
44 | - /** @var IConfig */ |
|
45 | - private $config; |
|
46 | - /** @var ILockingProvider */ |
|
47 | - private $lockingProvider; |
|
48 | - /** @var IL10N */ |
|
49 | - private $l; |
|
40 | + /** @var IDBConnection|Connection */ |
|
41 | + private $db; |
|
42 | + /** @var IRequest */ |
|
43 | + private $request; |
|
44 | + /** @var IConfig */ |
|
45 | + private $config; |
|
46 | + /** @var ILockingProvider */ |
|
47 | + private $lockingProvider; |
|
48 | + /** @var IL10N */ |
|
49 | + private $l; |
|
50 | 50 | |
51 | - /** |
|
52 | - * @param IDBConnection $db |
|
53 | - * @param IRequest $request |
|
54 | - * @param IConfig $config |
|
55 | - * @param ILockingProvider $lockingProvider |
|
56 | - * @param IL10N $l |
|
57 | - */ |
|
58 | - public function __construct(IDBConnection $db, |
|
59 | - IRequest $request, |
|
60 | - IConfig $config, |
|
61 | - ILockingProvider $lockingProvider, |
|
62 | - IL10N $l) { |
|
63 | - $this->db = $db; |
|
64 | - $this->request = $request; |
|
65 | - $this->config = $config; |
|
66 | - $this->lockingProvider = $lockingProvider; |
|
67 | - $this->l = $l; |
|
68 | - } |
|
51 | + /** |
|
52 | + * @param IDBConnection $db |
|
53 | + * @param IRequest $request |
|
54 | + * @param IConfig $config |
|
55 | + * @param ILockingProvider $lockingProvider |
|
56 | + * @param IL10N $l |
|
57 | + */ |
|
58 | + public function __construct(IDBConnection $db, |
|
59 | + IRequest $request, |
|
60 | + IConfig $config, |
|
61 | + ILockingProvider $lockingProvider, |
|
62 | + IL10N $l) { |
|
63 | + $this->db = $db; |
|
64 | + $this->request = $request; |
|
65 | + $this->config = $config; |
|
66 | + $this->lockingProvider = $lockingProvider; |
|
67 | + $this->l = $l; |
|
68 | + } |
|
69 | 69 | |
70 | - /** |
|
71 | - * @return TemplateResponse |
|
72 | - */ |
|
73 | - public function getForm() { |
|
74 | - try { |
|
75 | - if ($this->db->getDatabasePlatform() instanceof SqlitePlatform) { |
|
76 | - $invalidTransactionIsolationLevel = false; |
|
77 | - } else { |
|
78 | - $invalidTransactionIsolationLevel = $this->db->getTransactionIsolation() !== Connection::TRANSACTION_READ_COMMITTED; |
|
79 | - } |
|
80 | - } catch (DBALException $e) { |
|
81 | - // ignore |
|
82 | - $invalidTransactionIsolationLevel = false; |
|
83 | - } |
|
70 | + /** |
|
71 | + * @return TemplateResponse |
|
72 | + */ |
|
73 | + public function getForm() { |
|
74 | + try { |
|
75 | + if ($this->db->getDatabasePlatform() instanceof SqlitePlatform) { |
|
76 | + $invalidTransactionIsolationLevel = false; |
|
77 | + } else { |
|
78 | + $invalidTransactionIsolationLevel = $this->db->getTransactionIsolation() !== Connection::TRANSACTION_READ_COMMITTED; |
|
79 | + } |
|
80 | + } catch (DBALException $e) { |
|
81 | + // ignore |
|
82 | + $invalidTransactionIsolationLevel = false; |
|
83 | + } |
|
84 | 84 | |
85 | - $envPath = getenv('PATH'); |
|
85 | + $envPath = getenv('PATH'); |
|
86 | 86 | |
87 | - // warn if outdated version of a memcache module is used |
|
88 | - $caches = [ |
|
89 | - 'apcu' => ['name' => $this->l->t('APCu'), 'version' => '4.0.6'], |
|
90 | - 'redis' => ['name' => $this->l->t('Redis'), 'version' => '2.2.5'], |
|
91 | - ]; |
|
92 | - $outdatedCaches = []; |
|
93 | - foreach ($caches as $php_module => $data) { |
|
94 | - $isOutdated = extension_loaded($php_module) && version_compare(phpversion($php_module), $data['version'], '<'); |
|
95 | - if ($isOutdated) { |
|
96 | - $outdatedCaches[$php_module] = $data; |
|
97 | - } |
|
98 | - } |
|
87 | + // warn if outdated version of a memcache module is used |
|
88 | + $caches = [ |
|
89 | + 'apcu' => ['name' => $this->l->t('APCu'), 'version' => '4.0.6'], |
|
90 | + 'redis' => ['name' => $this->l->t('Redis'), 'version' => '2.2.5'], |
|
91 | + ]; |
|
92 | + $outdatedCaches = []; |
|
93 | + foreach ($caches as $php_module => $data) { |
|
94 | + $isOutdated = extension_loaded($php_module) && version_compare(phpversion($php_module), $data['version'], '<'); |
|
95 | + if ($isOutdated) { |
|
96 | + $outdatedCaches[$php_module] = $data; |
|
97 | + } |
|
98 | + } |
|
99 | 99 | |
100 | - if ($this->lockingProvider instanceof NoopLockingProvider) { |
|
101 | - $fileLockingType = 'none'; |
|
102 | - } else if ($this->lockingProvider instanceof DBLockingProvider) { |
|
103 | - $fileLockingType = 'db'; |
|
104 | - } else { |
|
105 | - $fileLockingType = 'cache'; |
|
106 | - } |
|
100 | + if ($this->lockingProvider instanceof NoopLockingProvider) { |
|
101 | + $fileLockingType = 'none'; |
|
102 | + } else if ($this->lockingProvider instanceof DBLockingProvider) { |
|
103 | + $fileLockingType = 'db'; |
|
104 | + } else { |
|
105 | + $fileLockingType = 'cache'; |
|
106 | + } |
|
107 | 107 | |
108 | - $suggestedOverwriteCliUrl = ''; |
|
109 | - if ($this->config->getSystemValue('overwrite.cli.url', '') === '') { |
|
110 | - $suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT; |
|
111 | - if (!$this->config->getSystemValue('config_is_read_only', false)) { |
|
112 | - // Set the overwrite URL when it was not set yet. |
|
113 | - $this->config->setSystemValue('overwrite.cli.url', $suggestedOverwriteCliUrl); |
|
114 | - $suggestedOverwriteCliUrl = ''; |
|
115 | - } |
|
116 | - } |
|
108 | + $suggestedOverwriteCliUrl = ''; |
|
109 | + if ($this->config->getSystemValue('overwrite.cli.url', '') === '') { |
|
110 | + $suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT; |
|
111 | + if (!$this->config->getSystemValue('config_is_read_only', false)) { |
|
112 | + // Set the overwrite URL when it was not set yet. |
|
113 | + $this->config->setSystemValue('overwrite.cli.url', $suggestedOverwriteCliUrl); |
|
114 | + $suggestedOverwriteCliUrl = ''; |
|
115 | + } |
|
116 | + } |
|
117 | 117 | |
118 | - $parameters = [ |
|
119 | - // Diagnosis |
|
120 | - 'readOnlyConfigEnabled' => \OC_Helper::isReadOnlyConfigEnabled(), |
|
121 | - 'isLocaleWorking' => \OC_Util::isSetLocaleWorking(), |
|
122 | - 'isAnnotationsWorking' => \OC_Util::isAnnotationsWorking(), |
|
123 | - 'checkForWorkingWellKnownSetup' => $this->config->getSystemValue('check_for_working_wellknown_setup', true), |
|
124 | - 'has_fileinfo' => \OC_Util::fileInfoLoaded(), |
|
125 | - 'invalidTransactionIsolationLevel' => $invalidTransactionIsolationLevel, |
|
126 | - 'getenvServerNotWorking' => empty($envPath), |
|
127 | - 'OutdatedCacheWarning' => $outdatedCaches, |
|
128 | - 'fileLockingType' => $fileLockingType, |
|
129 | - 'suggestedOverwriteCliUrl' => $suggestedOverwriteCliUrl, |
|
130 | - 'lastcron' => $this->config->getAppValue('core', 'lastcron', false), |
|
131 | - 'cronErrors' => $this->config->getAppValue('core', 'cronErrors'), |
|
132 | - ]; |
|
118 | + $parameters = [ |
|
119 | + // Diagnosis |
|
120 | + 'readOnlyConfigEnabled' => \OC_Helper::isReadOnlyConfigEnabled(), |
|
121 | + 'isLocaleWorking' => \OC_Util::isSetLocaleWorking(), |
|
122 | + 'isAnnotationsWorking' => \OC_Util::isAnnotationsWorking(), |
|
123 | + 'checkForWorkingWellKnownSetup' => $this->config->getSystemValue('check_for_working_wellknown_setup', true), |
|
124 | + 'has_fileinfo' => \OC_Util::fileInfoLoaded(), |
|
125 | + 'invalidTransactionIsolationLevel' => $invalidTransactionIsolationLevel, |
|
126 | + 'getenvServerNotWorking' => empty($envPath), |
|
127 | + 'OutdatedCacheWarning' => $outdatedCaches, |
|
128 | + 'fileLockingType' => $fileLockingType, |
|
129 | + 'suggestedOverwriteCliUrl' => $suggestedOverwriteCliUrl, |
|
130 | + 'lastcron' => $this->config->getAppValue('core', 'lastcron', false), |
|
131 | + 'cronErrors' => $this->config->getAppValue('core', 'cronErrors'), |
|
132 | + ]; |
|
133 | 133 | |
134 | - return new TemplateResponse('settings', 'settings/admin/overview', $parameters, ''); |
|
135 | - } |
|
134 | + return new TemplateResponse('settings', 'settings/admin/overview', $parameters, ''); |
|
135 | + } |
|
136 | 136 | |
137 | - /** |
|
138 | - * @return string the section ID, e.g. 'sharing' |
|
139 | - */ |
|
140 | - public function getSection() { |
|
141 | - return 'overview'; |
|
142 | - } |
|
137 | + /** |
|
138 | + * @return string the section ID, e.g. 'sharing' |
|
139 | + */ |
|
140 | + public function getSection() { |
|
141 | + return 'overview'; |
|
142 | + } |
|
143 | 143 | |
144 | - /** |
|
145 | - * @return int whether the form should be rather on the top or bottom of |
|
146 | - * the admin section. The forms are arranged in ascending order of the |
|
147 | - * priority values. It is required to return a value between 0 and 100. |
|
148 | - * |
|
149 | - * E.g.: 70 |
|
150 | - */ |
|
151 | - public function getPriority() { |
|
152 | - return 10; |
|
153 | - } |
|
144 | + /** |
|
145 | + * @return int whether the form should be rather on the top or bottom of |
|
146 | + * the admin section. The forms are arranged in ascending order of the |
|
147 | + * priority values. It is required to return a value between 0 and 100. |
|
148 | + * |
|
149 | + * E.g.: 70 |
|
150 | + */ |
|
151 | + public function getPriority() { |
|
152 | + return 10; |
|
153 | + } |
|
154 | 154 | } |
@@ -107,7 +107,7 @@ |
||
107 | 107 | |
108 | 108 | $suggestedOverwriteCliUrl = ''; |
109 | 109 | if ($this->config->getSystemValue('overwrite.cli.url', '') === '') { |
110 | - $suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT; |
|
110 | + $suggestedOverwriteCliUrl = $this->request->getServerProtocol().'://'.$this->request->getInsecureServerHost().\OC::$WEBROOT; |
|
111 | 111 | if (!$this->config->getSystemValue('config_is_read_only', false)) { |
112 | 112 | // Set the overwrite URL when it was not set yet. |
113 | 113 | $this->config->setSystemValue('overwrite.cli.url', $suggestedOverwriteCliUrl); |