$v) { $k = explode('-', $k, 2); if (count($k) === 2 && $k[0] === 'src') { $source = base64_decode($k[1]); } } } if ($source !== null) { if ($as !== null) { $as->setPreviousSource($source); } \SimpleSAML\Module\multiauth\Auth\Source\MultiAuth::delegateAuthentication($source, $state); } if (array_key_exists('multiauth:preselect', $state)) { $source = $state['multiauth:preselect']; \SimpleSAML\Module\multiauth\Auth\Source\MultiAuth::delegateAuthentication($source, $state); } $globalConfig = \SimpleSAML\Configuration::getInstance(); $t = new \SimpleSAML\XHTML\Template($globalConfig, 'mymodule:selectsource.tpl.php'); $defaultLanguage = $globalConfig->getString('language.default', 'en'); $language = $t->getTranslator()->getLanguage()->getLanguage(); $sources = $state[\SimpleSAML\Module\multiauth\Auth\Source\MultiAuth::SOURCESID]; foreach ($sources as $key => $source) { $sources[$key]['source64'] = base64_encode($sources[$key]['source']); if (isset($sources[$key]['text'][$language])) { $sources[$key]['text'] = $sources[$key]['text'][$language]; } else { $sources[$key]['text'] = $sources[$key]['text'][$defaultLanguage]; } if (isset($sources[$key]['help'][$language])) { $sources[$key]['help'] = $sources[$key]['help'][$language]; } else { $sources[$key]['help'] = $sources[$key]['help'][$defaultLanguage]; } } $t->data['authstate'] = $authStateId; $t->data['sources'] = $sources; $t->data['selfUrl'] = $_SERVER['PHP_SELF']; if ($as !== null) { $t->data['preferred'] = $as->getPreviousSource(); } else { $t->data['preferred'] = null; } $t->show(); exit();