Skip to content
Snippets Groups Projects
Commit 5c34aa04 authored by Tim van Dijen's avatar Tim van Dijen
Browse files

multi-auth: some improvements and added #721 to Twig

parent f6896a5e
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,9 @@
{% else %}
<input type="submit" name="{{ name|escape('html') }}" id="{{ button|escape('html') }}" value="{{ source.text|escape('html') }}" />
{% endif %}
{% if source.help %}
<p>{{ source.help|escape('html') }}</p>
{% endif %}
</li>
{% endfor %}
</ul>
......
......@@ -16,7 +16,6 @@ if (!array_key_exists('AuthState', $_REQUEST)) {
}
$authStateId = $_REQUEST['AuthState'];
$state = SimpleSAML_Auth_State::loadState($authStateId, sspmod_multiauth_Auth_Source_MultiAuth::STAGEID);
if (array_key_exists("SimpleSAML_Auth_Source.id", $state)) {
$authId = $state["SimpleSAML_Auth_Source.id"];
$as = SimpleSAML_Auth_Source::getById($authId);
......@@ -49,12 +48,15 @@ if (array_key_exists('multiauth:preselect', $state)) {
$globalConfig = SimpleSAML_Configuration::getInstance();
$t = new SimpleSAML_XHTML_Template($globalConfig, 'multiauth:selectsource.php');
$defaultLanguage = $globalConfig->getString('language.default', 'en');
$language = $t->getLanguage();
$sources = $state[sspmod_multiauth_Auth_Source_MultiAuth::SOURCESID];
foreach ($sources as $key => $source){
$sources[$key]['source64'] = base64_encode($sources[$key]['source']);
$sources[$key]['text'] = $sources[$key]['text'][$language];
$sources[$key]['text'] = (isSet($sources[$key]['text'][$language]) ? $sources[$key]['text'][$language] : $sources[$key]['text'][$defaultLanguage]);
$sources[$key]['help'] = (isSet($sources[$key]['help'][$language]) ? $sources[$key]['help'][$language] : $sources[$key]['help'][$defaultLanguage]);
}
$t->data['authstate'] = $authStateId;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment