Allow custom SSL logos when using choice
Concerned version
Version: 2.0.9
Summary
I use SSL with the Choice module, but I want to customize the logo:
The only way to do it for now is to overwrite static/common/modules/SSL.png with my custom file.
But this is not very good for maintenance. On every update I have to replace the logo again. Using a rewriterule can mitigate this but not very elegantly.
Possible fixes
When building $authLoop
, I noticed the following code:
# If displayType is logo, check if key.png is available
if ( -e $self->conf->{templateDir}
. "/../htdocs/static/common/modules/"
. $logo
. ".png" )
{
$optionsLoop->{logoFile} = $logo . ".png";
}
else {
$optionsLoop->{logoFile} = $auth . ".png";
}
So, if my "SSL" choice is registered as 1_Smartcard
in the config, LLNG searches for 1_Smartcard.png....
and indeed it is found :
{
'module' => 'SSL',
'sslform' => 1,
'url' => '#',
'logoFile' => '1_Smartcard.png',
'name' => ' Smartcard',
'key' => '1_Smartcard'
},
... but sslChoice.tpl
does not use it :(
<input type="hidden" name="nossl" value="1" />
<div class="sslclick">
<img src="<TMPL_VAR NAME="STATIC_PREFIX">common/modules/SSL.png" alt="<TMPL_VAR NAME="module">" class="img-thumbnail mb-3" />
</div>
I will fix this template to use logoFile
if available. But I think we should also work on a system that allows skins to package their own module logos