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:
committed by
Juan Leyva
parent
3d9b0a9b1b
commit
cf889e4fbd
+11
-7
@@ -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 [
|
||||
[
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user