Skip to content

Commit a62e8ab

Browse files
authored
Fix regression
1 parent 5c44777 commit a62e8ab

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

lib/IdP/ADFS.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,30 @@ private static function signResponse($response, $key, $cert, $algo, $passphrase)
186186
private static function postResponse($url, $wresult, $wctx)
187187
{
188188
$config = \SimpleSAML\Configuration::getInstance();
189+
$newui = $config->getBoolean('usenewui', false);
190+
191+
// Remove this in SSP 2.0 when Twig has become the default
192+
if ($newui === false) {
193+
$config = \SimpleSAML\Configuration::loadFromArray(['usenewui' => true]);
194+
}
195+
189196
$t = new \SimpleSAML\XHTML\Template($config, 'adfs:postResponse.twig');
190197
$t->data['baseurlpath'] = \SimpleSAML\Module::getModuleURL('adfs');
191198
$t->data['url'] = $url;
192199
$t->data['wresult'] = $wresult;
193200
$t->data['wctx'] = $wctx;
194-
$t->show();
201+
202+
// Remove the IF-part in SSP 2.0 when Twig has become the default
203+
if ($newui === false) {
204+
$twig = $t->getTwig();
205+
if (!isset($twig)) {
206+
throw new \Exception('Even though we explicitly configure that we want Twig, the Template class does not give us Twig. This is a bug.');
207+
}
208+
$result = $twig->render('adfs:postResponse.twig', $t->data);
209+
echo $result;
210+
} else {
211+
$t->show();
212+
}
195213
}
196214

197215

0 commit comments

Comments
 (0)