@@ -119,6 +119,7 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | /** |
| 121 | 121 | * Checks if the Nextcloud server can connect to a specific URL using both HTTPS and HTTP |
| 122 | + * @param string $sitename |
|
| 122 | 123 | * @return bool |
| 123 | 124 | */ |
| 124 | 125 | private function isSiteReachable($sitename) { |
@@ -316,7 +317,7 @@ discard block |
||
| 316 | 317 | |
| 317 | 318 | /** |
| 318 | 319 | * @NoCSRFRequired |
| 319 | - * @return DataResponse |
|
| 320 | + * @return DataDisplayResponse |
|
| 320 | 321 | */ |
| 321 | 322 | public function getFailedIntegrityCheckFiles() { |
| 322 | 323 | if(!$this->checker->isCodeCheckEnforced()) { |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | 'www.edri.org', |
| 110 | 110 | ]; |
| 111 | 111 | |
| 112 | - foreach($siteArray as $site) { |
|
| 112 | + foreach ($siteArray as $site) { |
|
| 113 | 113 | if ($this->isSiteReachable($site)) { |
| 114 | 114 | return true; |
| 115 | 115 | } |
@@ -122,8 +122,8 @@ discard block |
||
| 122 | 122 | * @return bool |
| 123 | 123 | */ |
| 124 | 124 | private function isSiteReachable($sitename) { |
| 125 | - $httpSiteName = 'http://' . $sitename . '/'; |
|
| 126 | - $httpsSiteName = 'https://' . $sitename . '/'; |
|
| 125 | + $httpSiteName = 'http://'.$sitename.'/'; |
|
| 126 | + $httpsSiteName = 'https://'.$sitename.'/'; |
|
| 127 | 127 | |
| 128 | 128 | try { |
| 129 | 129 | $client = $this->clientService->newClient(); |
@@ -150,9 +150,9 @@ discard block |
||
| 150 | 150 | * @return bool |
| 151 | 151 | */ |
| 152 | 152 | private function isUrandomAvailable() { |
| 153 | - if(@file_exists('/dev/urandom')) { |
|
| 153 | + if (@file_exists('/dev/urandom')) { |
|
| 154 | 154 | $file = fopen('/dev/urandom', 'rb'); |
| 155 | - if($file) { |
|
| 155 | + if ($file) { |
|
| 156 | 156 | fclose($file); |
| 157 | 157 | return true; |
| 158 | 158 | } |
@@ -183,40 +183,40 @@ discard block |
||
| 183 | 183 | // Don't run check when: |
| 184 | 184 | // 1. Server has `has_internet_connection` set to false |
| 185 | 185 | // 2. AppStore AND S2S is disabled |
| 186 | - if(!$this->config->getSystemValue('has_internet_connection', true)) { |
|
| 186 | + if (!$this->config->getSystemValue('has_internet_connection', true)) { |
|
| 187 | 187 | return ''; |
| 188 | 188 | } |
| 189 | - if(!$this->config->getSystemValue('appstoreenabled', true) |
|
| 189 | + if (!$this->config->getSystemValue('appstoreenabled', true) |
|
| 190 | 190 | && $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'no' |
| 191 | 191 | && $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'no') { |
| 192 | 192 | return ''; |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | $versionString = $this->getCurlVersion(); |
| 196 | - if(isset($versionString['ssl_version'])) { |
|
| 196 | + if (isset($versionString['ssl_version'])) { |
|
| 197 | 197 | $versionString = $versionString['ssl_version']; |
| 198 | 198 | } else { |
| 199 | 199 | return ''; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | - $features = (string)$this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing'); |
|
| 203 | - if(!$this->config->getSystemValue('appstoreenabled', true)) { |
|
| 204 | - $features = (string)$this->l10n->t('Federated Cloud Sharing'); |
|
| 202 | + $features = (string) $this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing'); |
|
| 203 | + if (!$this->config->getSystemValue('appstoreenabled', true)) { |
|
| 204 | + $features = (string) $this->l10n->t('Federated Cloud Sharing'); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | // Check if at least OpenSSL after 1.01d or 1.0.2b |
| 208 | - if(strpos($versionString, 'OpenSSL/') === 0) { |
|
| 208 | + if (strpos($versionString, 'OpenSSL/') === 0) { |
|
| 209 | 209 | $majorVersion = substr($versionString, 8, 5); |
| 210 | 210 | $patchRelease = substr($versionString, 13, 6); |
| 211 | 211 | |
| 212 | - if(($majorVersion === '1.0.1' && ord($patchRelease) < ord('d')) || |
|
| 212 | + if (($majorVersion === '1.0.1' && ord($patchRelease) < ord('d')) || |
|
| 213 | 213 | ($majorVersion === '1.0.2' && ord($patchRelease) < ord('b'))) { |
| 214 | 214 | return (string) $this->l10n->t('cURL is using an outdated %s version (%s). Please update your operating system or features such as %s will not work reliably.', ['OpenSSL', $versionString, $features]); |
| 215 | 215 | } |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | // Check if NSS and perform heuristic check |
| 219 | - if(strpos($versionString, 'NSS/') === 0) { |
|
| 219 | + if (strpos($versionString, 'NSS/') === 0) { |
|
| 220 | 220 | try { |
| 221 | 221 | $firstClient = $this->clientService->newClient(); |
| 222 | 222 | $firstClient->get('https://nextcloud.com/'); |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | $secondClient = $this->clientService->newClient(); |
| 225 | 225 | $secondClient->get('https://nextcloud.com/'); |
| 226 | 226 | } catch (ClientException $e) { |
| 227 | - if($e->getResponse()->getStatusCode() === 400) { |
|
| 227 | + if ($e->getResponse()->getStatusCode() === 400) { |
|
| 228 | 228 | return (string) $this->l10n->t('cURL is using an outdated %s version (%s). Please update your operating system or features such as %s will not work reliably.', ['NSS', $versionString, $features]); |
| 229 | 229 | } |
| 230 | 230 | } |
@@ -319,13 +319,13 @@ discard block |
||
| 319 | 319 | * @return DataResponse |
| 320 | 320 | */ |
| 321 | 321 | public function getFailedIntegrityCheckFiles() { |
| 322 | - if(!$this->checker->isCodeCheckEnforced()) { |
|
| 322 | + if (!$this->checker->isCodeCheckEnforced()) { |
|
| 323 | 323 | return new DataDisplayResponse('Integrity checker has been disabled. Integrity cannot be verified.'); |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | $completeResults = $this->checker->getResults(); |
| 327 | 327 | |
| 328 | - if(!empty($completeResults)) { |
|
| 328 | + if (!empty($completeResults)) { |
|
| 329 | 329 | $formattedTextResponse = 'Technical information |
| 330 | 330 | ===================== |
| 331 | 331 | The following list covers which files have failed the integrity check. Please read |
@@ -335,12 +335,12 @@ discard block |
||
| 335 | 335 | Results |
| 336 | 336 | ======= |
| 337 | 337 | '; |
| 338 | - foreach($completeResults as $context => $contextResult) { |
|
| 338 | + foreach ($completeResults as $context => $contextResult) { |
|
| 339 | 339 | $formattedTextResponse .= "- $context\n"; |
| 340 | 340 | |
| 341 | - foreach($contextResult as $category => $result) { |
|
| 341 | + foreach ($contextResult as $category => $result) { |
|
| 342 | 342 | $formattedTextResponse .= "\t- $category\n"; |
| 343 | - if($category !== 'EXCEPTION') { |
|
| 343 | + if ($category !== 'EXCEPTION') { |
|
| 344 | 344 | foreach ($result as $key => $results) { |
| 345 | 345 | $formattedTextResponse .= "\t\t- $key\n"; |
| 346 | 346 | } |
@@ -383,27 +383,27 @@ discard block |
||
| 383 | 383 | |
| 384 | 384 | $isOpcacheProperlySetUp = true; |
| 385 | 385 | |
| 386 | - if(!$iniWrapper->getBool('opcache.enable')) { |
|
| 386 | + if (!$iniWrapper->getBool('opcache.enable')) { |
|
| 387 | 387 | $isOpcacheProperlySetUp = false; |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | - if(!$iniWrapper->getBool('opcache.save_comments')) { |
|
| 390 | + if (!$iniWrapper->getBool('opcache.save_comments')) { |
|
| 391 | 391 | $isOpcacheProperlySetUp = false; |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | - if(!$iniWrapper->getBool('opcache.enable_cli')) { |
|
| 394 | + if (!$iniWrapper->getBool('opcache.enable_cli')) { |
|
| 395 | 395 | $isOpcacheProperlySetUp = false; |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | - if($iniWrapper->getNumeric('opcache.max_accelerated_files') < 10000) { |
|
| 398 | + if ($iniWrapper->getNumeric('opcache.max_accelerated_files') < 10000) { |
|
| 399 | 399 | $isOpcacheProperlySetUp = false; |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | - if($iniWrapper->getNumeric('opcache.memory_consumption') < 128) { |
|
| 402 | + if ($iniWrapper->getNumeric('opcache.memory_consumption') < 128) { |
|
| 403 | 403 | $isOpcacheProperlySetUp = false; |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | - if($iniWrapper->getNumeric('opcache.interned_strings_buffer') < 8) { |
|
| 406 | + if ($iniWrapper->getNumeric('opcache.interned_strings_buffer') < 8) { |
|
| 407 | 407 | $isOpcacheProperlySetUp = false; |
| 408 | 408 | } |
| 409 | 409 | |