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>
This commit is contained in:
Daniel Calviño Sánchez 2018-10-10 14:12:10 +02:00
parent d143b43a04
commit 20a5ce217a
2 changed files with 19 additions and 2 deletions

View File

@ -121,6 +121,8 @@ class Application extends App {
Util::connectHook('OC_User', 'post_setPassword', $this, 'onChangePassword'); Util::connectHook('OC_User', 'post_setPassword', $this, 'onChangePassword');
Util::connectHook('OC_User', 'changeUser', $this, 'onChangeInfo'); 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 = $this->getContainer()->query(Hooks::class);
$hooks->onChangeEmail($parameters['user'], $parameters['old_value']); $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);
}
} }

View File

@ -248,13 +248,14 @@ $(document).ready(function(){
// run setup checks then gather error messages // run setup checks then gather error messages
$.when( $.when(
OC.SetupChecks.checkWebDAV(), 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/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.checkWellKnownUrl('/.well-known/carddav', oc_defaults.docPlaceholderUrl, $('#postsetupchecks').data('check-wellknown') === true),
OC.SetupChecks.checkSetup(), OC.SetupChecks.checkSetup(),
OC.SetupChecks.checkGeneric(), OC.SetupChecks.checkGeneric(),
OC.SetupChecks.checkDataProtected() OC.SetupChecks.checkDataProtected()
).then(function(check1, check2, check3, check4, check5, check6) { ).then(function(check1, check2, check3, check4, check5, check6, check7) {
var messages = [].concat(check1, check2, check3, check4, check5, check6); var messages = [].concat(check1, check2, check3, check4, check5, check6, check7);
var $el = $('#postsetupchecks'); var $el = $('#postsetupchecks');
$('#security-warning-state-loading').addClass('hidden'); $('#security-warning-state-loading').addClass('hidden');