MDL-66582 auth: Fix empty auth_logo in CAS/Shibboleth auth plugins

* set $idp['iconurl'] = null if no auth_logo
* lib/templates/loginform.mustache will skip NULL iconurls
* lib/ajax/service?info=tool_mobile_get_public_config will validate the NULL values
This commit is contained in:
Johan Dobbelstein 2019-09-02 17:30:46 +02:00 committed by Juan Leyva
parent d7699706da
commit 5b39bf184d
2 changed files with 24 additions and 13 deletions

View File

@ -365,13 +365,17 @@ class auth_plugin_cas extends auth_plugin_ldap {
return [];
}
$iconurl = moodle_url::make_pluginfile_url(
context_system::instance()->id,
'auth_cas',
'logo',
null,
'/',
$this->config->auth_logo);
if ($this->config->auth_logo) {
$iconurl = moodle_url::make_pluginfile_url(
context_system::instance()->id,
'auth_cas',
'logo',
null,
null,
$this->config->auth_logo);
} else {
$iconurl = null;
}
return [
[

View File

@ -294,12 +294,19 @@ class auth_plugin_shibboleth extends auth_plugin_base {
}
$url = new moodle_url('/auth/shibboleth/index.php');
$iconurl = moodle_url::make_pluginfile_url(context_system::instance()->id,
'auth_shibboleth',
'logo',
null,
'/',
$config->auth_logo);
if ($config->auth_logo) {
$iconurl = moodle_url::make_pluginfile_url(
context_system::instance()->id,
'auth_shibboleth',
'logo',
null,
null,
$config->auth_logo);
} else {
$iconurl = null;
}
$result[] = ['url' => $url, 'iconurl' => $iconurl, 'name' => $config->login_name];
return $result;
}