aboutsummaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-10-10 14:12:10 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-10-10 14:12:10 +0200
commit20a5ce217a47c9e3d5dd4016e96e0cc557c51417 (patch)
tree5dbcb468ce4dab6cb0d205e5e2b3818e7ec2345d /settings
parentd143b43a0454528905c751579b4ab482abe39f36 (diff)
downloadnextcloud-server-20a5ce217a47c9e3d5dd4016e96e0cc557c51417.tar.gz
nextcloud-server-20a5ce217a47c9e3d5dd4016e96e0cc557c51417.zip
Add check for well known URL of WebFinger in the settings overview
If the WebFinger service is not set in Nextcloud configuration no check is performed. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'settings')
-rw-r--r--settings/Application.php16
-rw-r--r--settings/js/admin.js5
2 files changed, 19 insertions, 2 deletions
diff --git a/settings/Application.php b/settings/Application.php
index 5b2b606353f..4dee85f263d 100644
--- a/settings/Application.php
+++ b/settings/Application.php
@@ -121,6 +121,8 @@ class Application extends App {
Util::connectHook('OC_User', 'post_setPassword', $this, 'onChangePassword');
Util::connectHook('OC_User', 'changeUser', $this, 'onChangeInfo');
+
+ Util::connectHook('\OCP\Config', 'js', $this, 'extendJsConfig');
}
/**
@@ -152,4 +154,18 @@ class Application extends App {
$hooks = $this->getContainer()->query(Hooks::class);
$hooks->onChangeEmail($parameters['user'], $parameters['old_value']);
}
+
+ /**
+ * @param array $settings
+ */
+ public function extendJsConfig(array $settings) {
+ $appConfig = json_decode($settings['array']['oc_appconfig'], true);
+
+ $publicWebFinger = \OC::$server->getConfig()->getAppValue('core', 'public_webfinger', '');
+ if (!empty($publicWebFinger)) {
+ $appConfig['core']['public_webfinger'] = $publicWebFinger;
+ }
+
+ $settings['array']['oc_appconfig'] = json_encode($appConfig);
+ }
}
diff --git a/settings/js/admin.js b/settings/js/admin.js
index de5bc2b9537..35f3d949ab6 100644
--- a/settings/js/admin.js
+++ b/settings/js/admin.js
@@ -248,13 +248,14 @@ $(document).ready(function(){
// run setup checks then gather error messages
$.when(
OC.SetupChecks.checkWebDAV(),
+ OC.SetupChecks.checkWellKnownUrl('/.well-known/webfinger', oc_defaults.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true && !!oc_appconfig.core.public_webfinger, 200),
OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav', oc_defaults.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true),
OC.SetupChecks.checkWellKnownUrl('/.well-known/carddav', oc_defaults.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true),
OC.SetupChecks.checkSetup(),
OC.SetupChecks.checkGeneric(),
OC.SetupChecks.checkDataProtected()
- ).then(function(check1, check2, check3, check4, check5, check6) {
- var messages = [].concat(check1, check2, check3, check4, check5, check6);
+ ).then(function(check1, check2, check3, check4, check5, check6, check7) {
+ var messages = [].concat(check1, check2, check3, check4, check5, check6, check7);
var $el = $('#postsetupchecks');
$('#security-warning-state-loading').addClass('hidden');