diff options
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/integritycheck-failed-notification.js | 38 | ||||
-rw-r--r-- | core/js/setupchecks.js | 14 | ||||
-rw-r--r-- | core/js/tests/specs/setupchecksSpec.js | 7 |
3 files changed, 59 insertions, 0 deletions
diff --git a/core/js/integritycheck-failed-notification.js b/core/js/integritycheck-failed-notification.js new file mode 100644 index 00000000000..5bc758d54cb --- /dev/null +++ b/core/js/integritycheck-failed-notification.js @@ -0,0 +1,38 @@ +/** + * @author Lukas Reschke + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + */ + +/** + * This gets only loaded if the integrity check has failed and then shows a notification + */ +$(document).ready(function(){ + var text = t( + 'core', + '<a href="{docUrl}">There were problems with the code integrity check. More information…</a>', + { + docUrl: OC.generateUrl('/settings/admin#security-warning') + } + ); + + OC.Notification.showHtml( + text, + { + isHTML: true + } + ); +}); + diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index 6e2058d54fc..5ac1945da73 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -104,6 +104,20 @@ type: OC.SetupChecks.MESSAGE_TYPE_WARNING }); } + if(!data.hasPassedCodeIntegrityCheck) { + messages.push({ + msg: t( + 'core', + 'Some files have not passed the integrity check. Further information on how to resolve this issue can be found in our <a href="{docLink}">documentation</a>. (<a href="{codeIntegrityDownloadEndpoint}">List of invalid files…</a> / <a href="{rescanEndpoint}">Rescan…</a>)', + { + docLink: data.codeIntegrityCheckerDocumentation, + codeIntegrityDownloadEndpoint: OC.generateUrl('/settings/integrity/failed'), + rescanEndpoint: OC.generateUrl('/settings/integrity/rescan?requesttoken={requesttoken}', {'requesttoken': OC.requestToken}) + } + ), + type: OC.SetupChecks.MESSAGE_TYPE_ERROR + }); + } } else { messages.push({ msg: t('core', 'Error occurred while checking server setup'), diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js index 8dd2214621a..4bad893cf37 100644 --- a/core/js/tests/specs/setupchecksSpec.js +++ b/core/js/tests/specs/setupchecksSpec.js @@ -75,6 +75,7 @@ describe('OC.SetupChecks tests', function() { memcacheDocs: 'https://doc.owncloud.org/server/go.php?to=admin-performance', forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, + hasPassedCodeIntegrityCheck: true, }) ); @@ -109,6 +110,7 @@ describe('OC.SetupChecks tests', function() { memcacheDocs: 'https://doc.owncloud.org/server/go.php?to=admin-performance', forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, + hasPassedCodeIntegrityCheck: true, }) ); @@ -145,6 +147,7 @@ describe('OC.SetupChecks tests', function() { isMemcacheConfigured: true, forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, + hasPassedCodeIntegrityCheck: true, }) ); @@ -178,6 +181,7 @@ describe('OC.SetupChecks tests', function() { isMemcacheConfigured: true, forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: true, + hasPassedCodeIntegrityCheck: true, }) ); @@ -206,6 +210,7 @@ describe('OC.SetupChecks tests', function() { isMemcacheConfigured: true, forwardedForHeadersWorking: true, isCorrectMemcachedPHPModuleInstalled: false, + hasPassedCodeIntegrityCheck: true, }) ); @@ -234,6 +239,7 @@ describe('OC.SetupChecks tests', function() { forwardedForHeadersWorking: false, reverseProxyDocs: 'https://docs.owncloud.org/foo/bar.html', isCorrectMemcachedPHPModuleInstalled: true, + hasPassedCodeIntegrityCheck: true, }) ); @@ -283,6 +289,7 @@ describe('OC.SetupChecks tests', function() { forwardedForHeadersWorking: true, phpSupported: {eol: true, version: '5.4.0'}, isCorrectMemcachedPHPModuleInstalled: true, + hasPassedCodeIntegrityCheck: true, }) ); |