]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not show a internet connectivity warning if internet access is disabled 16146/head
authorChristoph Wurst <christoph@winzerhof-wurst.at>
Tue, 25 Jun 2019 11:37:31 +0000 (13:37 +0200)
committerBackportbot <backportbot-noreply@rullzer.com>
Fri, 28 Jun 2019 08:55:11 +0000 (08:55 +0000)
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
core/js/setupchecks.js
core/js/tests/specs/setupchecksSpec.js
settings/Controller/CheckSetupController.php
tests/Settings/Controller/CheckSetupControllerTest.php

index 2e4901a10c5d9815d3a948aa6cee37d4a6316a8c..a8d8a3d92c8be54482dbf9b4a83126b76d2e91a0 100644 (file)
                                                        type: OC.SetupChecks.MESSAGE_TYPE_ERROR
                                                });
                                        }
-                                       if (!data.serverHasInternetConnection) {
+                                       if (data.serverHasInternetConnectionProblems) {
                                                messages.push({
                                                        msg: t('core', 'This server has no working Internet connection: Multiple endpoints could not be reached. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. Establish a connection from this server to the Internet to enjoy all features.'),
                                                        type: OC.SetupChecks.MESSAGE_TYPE_WARNING
index b5248add98441645afc9d90fd319024694bb4eb4..a2a92874fa6c6f5986c7d0c057983b903dac5591 100644 (file)
@@ -230,7 +230,7 @@ describe('OC.SetupChecks tests', function() {
                                        hasValidTransactionIsolationLevel: true,
                                        suggestedOverwriteCliURL: '',
                                        isRandomnessSecure: true,
-                                       serverHasInternetConnection: false,
+                                       serverHasInternetConnectionProblems: true,
                                        memcacheDocs: 'https://docs.nextcloud.com/server/go.php?to=admin-performance',
                                        forwardedForHeadersWorking: true,
                                        isCorrectMemcachedPHPModuleInstalled: true,
@@ -282,7 +282,7 @@ describe('OC.SetupChecks tests', function() {
                                        hasValidTransactionIsolationLevel: true,
                                        suggestedOverwriteCliURL: '',
                                        isRandomnessSecure: true,
-                                       serverHasInternetConnection: false,
+                                       serverHasInternetConnectionProblems: true,
                                        memcacheDocs: 'https://docs.nextcloud.com/server/go.php?to=admin-performance',
                                        forwardedForHeadersWorking: true,
                                        isCorrectMemcachedPHPModuleInstalled: true,
@@ -335,7 +335,7 @@ describe('OC.SetupChecks tests', function() {
                                        hasValidTransactionIsolationLevel: true,
                                        suggestedOverwriteCliURL: '',
                                        isRandomnessSecure: true,
-                                       serverHasInternetConnection: false,
+                                       serverHasInternetConnectionProblems: true,
                                        isMemcacheConfigured: true,
                                        forwardedForHeadersWorking: true,
                                        isCorrectMemcachedPHPModuleInstalled: true,
@@ -386,7 +386,7 @@ describe('OC.SetupChecks tests', function() {
                                        suggestedOverwriteCliURL: '',
                                        isRandomnessSecure: false,
                                        securityDocs: 'https://docs.owncloud.org/myDocs.html',
-                                       serverHasInternetConnection: true,
+                                       serverHasInternetConnectionProblems: false,
                                        isMemcacheConfigured: true,
                                        forwardedForHeadersWorking: true,
                                        isCorrectMemcachedPHPModuleInstalled: true,
@@ -435,7 +435,7 @@ describe('OC.SetupChecks tests', function() {
                                        suggestedOverwriteCliURL: '',
                                        isRandomnessSecure: true,
                                        securityDocs: 'https://docs.owncloud.org/myDocs.html',
-                                       serverHasInternetConnection: true,
+                                       serverHasInternetConnectionProblems: false,
                                        isMemcacheConfigured: true,
                                        forwardedForHeadersWorking: true,
                                        isCorrectMemcachedPHPModuleInstalled: false,
@@ -484,7 +484,7 @@ describe('OC.SetupChecks tests', function() {
                                        suggestedOverwriteCliURL: '',
                                        isRandomnessSecure: true,
                                        securityDocs: 'https://docs.owncloud.org/myDocs.html',
-                                       serverHasInternetConnection: true,
+                                       serverHasInternetConnectionProblems: false,
                                        isMemcacheConfigured: true,
                                        forwardedForHeadersWorking: true,
                                        isCorrectMemcachedPHPModuleInstalled: true,
@@ -534,7 +534,7 @@ describe('OC.SetupChecks tests', function() {
                                        hasValidTransactionIsolationLevel: true,
                                        suggestedOverwriteCliURL: '',
                                        isRandomnessSecure: true,
-                                       serverHasInternetConnection: true,
+                                       serverHasInternetConnectionProblems: false,
                                        isMemcacheConfigured: true,
                                        forwardedForHeadersWorking: false,
                                        reverseProxyDocs: 'https://docs.owncloud.org/foo/bar.html',
@@ -583,7 +583,7 @@ describe('OC.SetupChecks tests', function() {
                                        hasValidTransactionIsolationLevel: true,
                                        suggestedOverwriteCliURL: '',
                                        isRandomnessSecure: true,
-                                       serverHasInternetConnection: true,
+                                       serverHasInternetConnectionProblems: false,
                                        isMemcacheConfigured: true,
                                        forwardedForHeadersWorking: true,
                                        reverseProxyDocs: 'https://docs.owncloud.org/foo/bar.html',
@@ -632,7 +632,7 @@ describe('OC.SetupChecks tests', function() {
                                        hasValidTransactionIsolationLevel: true,
                                        suggestedOverwriteCliURL: '',
                                        isRandomnessSecure: true,
-                                       serverHasInternetConnection: true,
+                                       serverHasInternetConnectionProblems: false,
                                        isMemcacheConfigured: true,
                                        forwardedForHeadersWorking: true,
                                        reverseProxyDocs: 'https://docs.owncloud.org/foo/bar.html',
@@ -673,7 +673,7 @@ describe('OC.SetupChecks tests', function() {
                                {
                                        'Content-Type': 'application/json'
                                },
-                               JSON.stringify({data: {serverHasInternetConnection: false}})
+                               JSON.stringify({data: {serverHasInternetConnectionProblems: true}})
                        );
 
                        async.done(function( data, s, x ){
@@ -702,7 +702,7 @@ describe('OC.SetupChecks tests', function() {
                                        suggestedOverwriteCliURL: '',
                                        isRandomnessSecure: true,
                                        securityDocs: 'https://docs.owncloud.org/myDocs.html',
-                                       serverHasInternetConnection: true,
+                                       serverHasInternetConnectionProblems: false,
                                        isMemcacheConfigured: true,
                                        forwardedForHeadersWorking: true,
                                        phpSupported: {eol: true, version: '5.4.0'},
@@ -752,7 +752,7 @@ describe('OC.SetupChecks tests', function() {
                                        suggestedOverwriteCliURL: '',
                                        isRandomnessSecure: true,
                                        securityDocs: 'https://docs.owncloud.org/myDocs.html',
-                                       serverHasInternetConnection: true,
+                                       serverHasInternetConnectionProblems: false,
                                        isMemcacheConfigured: true,
                                        forwardedForHeadersWorking: true,
                                        isCorrectMemcachedPHPModuleInstalled: true,
@@ -802,7 +802,7 @@ describe('OC.SetupChecks tests', function() {
                                        suggestedOverwriteCliURL: '',
                                        isRandomnessSecure: true,
                                        securityDocs: 'https://docs.owncloud.org/myDocs.html',
-                                       serverHasInternetConnection: true,
+                                       serverHasInternetConnectionProblems: false,
                                        isMemcacheConfigured: true,
                                        forwardedForHeadersWorking: true,
                                        isCorrectMemcachedPHPModuleInstalled: true,
@@ -852,7 +852,7 @@ describe('OC.SetupChecks tests', function() {
                                        suggestedOverwriteCliURL: '',
                                        isRandomnessSecure: true,
                                        securityDocs: 'https://docs.owncloud.org/myDocs.html',
-                                       serverHasInternetConnection: true,
+                                       serverHasInternetConnectionProblems: false,
                                        isMemcacheConfigured: true,
                                        forwardedForHeadersWorking: true,
                                        isCorrectMemcachedPHPModuleInstalled: true,
@@ -902,7 +902,7 @@ describe('OC.SetupChecks tests', function() {
                                        suggestedOverwriteCliURL: '',
                                        isRandomnessSecure: true,
                                        securityDocs: 'https://docs.owncloud.org/myDocs.html',
-                                       serverHasInternetConnection: true,
+                                       serverHasInternetConnectionProblems: false,
                                        isMemcacheConfigured: true,
                                        forwardedForHeadersWorking: true,
                                        isCorrectMemcachedPHPModuleInstalled: true,
@@ -951,7 +951,7 @@ describe('OC.SetupChecks tests', function() {
                                        suggestedOverwriteCliURL: '',
                                        isRandomnessSecure: true,
                                        securityDocs: 'https://docs.owncloud.org/myDocs.html',
-                                       serverHasInternetConnection: true,
+                                       serverHasInternetConnectionProblems: false,
                                        isMemcacheConfigured: true,
                                        forwardedForHeadersWorking: true,
                                        isCorrectMemcachedPHPModuleInstalled: true,
@@ -1418,7 +1418,7 @@ describe('OC.SetupChecks tests', function() {
                        {
                                'Content-Type': 'application/json'
                        },
-                       JSON.stringify({data: {serverHasInternetConnection: false}})
+                       JSON.stringify({data: {serverHasInternetConnectionProblems: true}})
                );
                async.done(function( data, s, x ){
                        expect(data).toEqual([{
index f760eefacb60c46904092f5af9e1825d23c47c47..a8102b2e1362553378da450cb68c5b8604bcb132 100644 (file)
@@ -123,7 +123,7 @@ class CheckSetupController extends Controller {
         * Checks if the server can connect to the internet using HTTPS and HTTP
         * @return bool
         */
-       private function isInternetConnectionWorking() {
+       private function hasInternetConnectivityProblems(): bool {
                if ($this->config->getSystemValue('has_internet_connection', true) === false) {
                        return false;
                }
@@ -134,10 +134,10 @@ class CheckSetupController extends Controller {
 
                foreach($siteArray as $site) {
                        if ($this->isSiteReachable($site)) {
-                               return true;
+                               return false;
                        }
                }
-               return false;
+               return true;
        }
 
        /**
@@ -670,7 +670,7 @@ Raw output
                                'suggestedOverwriteCliURL' => $this->getSuggestedOverwriteCliURL(),
                                'cronInfo' => $this->getLastCronInfo(),
                                'cronErrors' => $this->getCronErrors(),
-                               'serverHasInternetConnection' => $this->isInternetConnectionWorking(),
+                               'serverHasInternetConnectionProblems' => $this->hasInternetConnectivityProblems(),
                                'isMemcacheConfigured' => $this->isMemcacheConfigured(),
                                'memcacheDocs' => $this->urlGenerator->linkToDocs('admin-performance'),
                                'isRandomnessSecure' => $this->isRandomnessSecure(),
index 173c0a1f85fd4de0ece69db6396298d65d76fd7e..4b9d990df159c2c66b53caca83fa68313d627b5d 100644 (file)
@@ -180,7 +180,7 @@ class CheckSetupControllerTest extends TestCase {
                $this->assertFalse(
                        self::invokePrivate(
                                $this->checkSetupController,
-                               'isInternetConnectionWorking'
+                               'hasInternetConnectivityProblems'
                        )
                );
        }
@@ -206,10 +206,10 @@ class CheckSetupControllerTest extends TestCase {
                        ->will($this->returnValue($client));
 
 
-               $this->assertTrue(
+               $this->assertFalse(
                        self::invokePrivate(
                                $this->checkSetupController,
-                               'isInternetConnectionWorking'
+                               'hasInternetConnectivityProblems'
                        )
                );
        }
@@ -235,10 +235,10 @@ class CheckSetupControllerTest extends TestCase {
                        ->method('newClient')
                        ->will($this->returnValue($client));
 
-               $this->assertFalse(
+               $this->assertTrue(
                        self::invokePrivate(
                                $this->checkSetupController,
-                               'isInternetConnectionWorking'
+                               'hasInternetConnectivityProblems'
                        )
                );
        }
@@ -540,7 +540,7 @@ class CheckSetupControllerTest extends TestCase {
                                        'backgroundJobsUrl' => 'https://example.org',
                                ],
                                'cronErrors' => [],
-                               'serverHasInternetConnection' => false,
+                               'serverHasInternetConnectionProblems' => true,
                                'isMemcacheConfigured' => true,
                                'memcacheDocs' => 'http://docs.example.org/server/go.php?to=admin-performance',
                                'isRandomnessSecure' => self::invokePrivate($this->checkSetupController, 'isRandomnessSecure'),