Skip to content
Snippets Groups Projects
Commit 595fb43c authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Reformat and enhance IdP selection pages.

parent 54e93fd1
No related branches found
No related tags found
No related merge requests found
<?php <?php
/** /**
* Builtin IdP discovery service. * Built-in IdP discovery service.
*/ */
$discoHandler = new SimpleSAML_XHTML_IdPDisco(array('saml20-idp-remote', 'shib13-idp-remote'), 'saml'); $discoHandler = new SimpleSAML_XHTML_IdPDisco(array('saml20-idp-remote', 'shib13-idp-remote'), 'saml');
......
<?php <?php
if(!array_key_exists('header', $this->data)) { if (!array_key_exists('header', $this->data)) {
$this->data['header'] = 'selectidp'; $this->data['header'] = 'selectidp';
} }
$this->data['header'] = $this->t($this->data['header']); $this->data['header'] = $this->t($this->data['header']);
$this->data['autofocus'] = 'dropdownlist'; $this->data['autofocus'] = 'dropdownlist';
$this->includeAtTemplateBase('includes/header.php'); $this->includeAtTemplateBase('includes/header.php');
foreach ($this->data['idplist'] AS $idpentry) { foreach ($this->data['idplist'] as $idpentry) {
if (!empty($idpentry['name'])) { if (!empty($idpentry['name'])) {
$this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['name']); $this->includeInlineTranslation('idpname_'.$idpentry['entityid'], $idpentry['name']);
} elseif (!empty($idpentry['OrganizationDisplayName'])) { } elseif (!empty($idpentry['OrganizationDisplayName'])) {
$this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['OrganizationDisplayName']); $this->includeInlineTranslation('idpname_'.$idpentry['entityid'], $idpentry['OrganizationDisplayName']);
} }
if (!empty($idpentry['description'])) if (!empty($idpentry['description'])) {
$this->includeInlineTranslation('idpdesc_' . $idpentry['entityid'], $idpentry['description']); $this->includeInlineTranslation('idpdesc_'.$idpentry['entityid'], $idpentry['description']);
}
} }
?> ?>
<h2><?php echo $this->data['header']; ?></h2>
<h2><?php echo $this->data['header']; ?></h2> <p><?php echo $this->t('selectidp_full'); ?></p>
<form method="get" action="<?php echo $this->data['urlpattern']; ?>">
<p><?php echo $this->t('selectidp_full'); ?></p> <input type="hidden" name="entityID" value="<?php echo htmlspecialchars($this->data['entityID']); ?>"/>
<input type="hidden" name="return" value="<?php echo htmlspecialchars($this->data['return']); ?>"/>
<form method="get" action="<?php echo $this->data['urlpattern']; ?>"> <input type="hidden" name="returnIDParam"
<input type="hidden" name="entityID" value="<?php echo htmlspecialchars($this->data['entityID']); ?>" /> value="<?php echo htmlspecialchars($this->data['returnIDParam']); ?>"/>
<input type="hidden" name="return" value="<?php echo htmlspecialchars($this->data['return']); ?>" /> <select id="dropdownlist" name="idpentityid">
<input type="hidden" name="returnIDParam" value="<?php echo htmlspecialchars($this->data['returnIDParam']); ?>" /> <?php
<select id="dropdownlist" name="idpentityid"> usort($this->data['idplist'], function ($idpentry1, $idpentry2) {
<?php return strcmp($this->t('idpname_'.$idpentry1['entityid']), $this->t('idpname_'.$idpentry2['entityid']));
});
usort($this->data['idplist'], function($idpentry1, $idpentry2) {
return strcmp($this->t('idpname_' . $idpentry1['entityid']), foreach ($this->data['idplist'] as $idpentry) {
$this->t('idpname_' . $idpentry2['entityid'])); echo '<option value="'.htmlspecialchars($idpentry['entityid']).'"';
if (isset($this->data['preferredidp']) && $idpentry['entityid'] == $this->data['preferredidp']) {
}); echo ' selected="selected"';
}
foreach ($this->data['idplist'] AS $idpentry) { echo '>'.htmlspecialchars($this->t('idpname_'.$idpentry['entityid'])).'</option>';
}
echo '<option value="'.htmlspecialchars($idpentry['entityid']).'"'; ?>
if (isset($this->data['preferredidp']) && </select>
$idpentry['entityid'] == $this->data['preferredidp']) <button class="btn" type="submit"><?php echo $this->t('select'); ?></button>
echo ' selected="selected"'; <?php
if ($this->data['rememberenabled']) {
echo '>'.htmlspecialchars($this->t('idpname_' . $idpentry['entityid'])).'</option>'; echo('<br/><input type="checkbox" name="remember" value="1" />'.$this->t('remember'));
}
} ?>
?> </form>
</select>
<input type="submit" value="<?php echo $this->t('select'); ?>"/>
<?php
if($this->data['rememberenabled']) {
echo('<br/><input type="checkbox" name="remember" value="1" />' . $this->t('remember'));
}
?>
</form>
<?php $this->includeAtTemplateBase('includes/footer.php'); <?php $this->includeAtTemplateBase('includes/footer.php');
<?php <?php
if(!array_key_exists('header', $this->data)) { if (!array_key_exists('header', $this->data)) {
$this->data['header'] = 'selectidp'; $this->data['header'] = 'selectidp';
} }
$this->data['header'] = $this->t($this->data['header']); $this->data['header'] = $this->t($this->data['header']);
$this->data['autofocus'] = 'preferredidp'; $this->data['autofocus'] = 'preferredidp';
$this->includeAtTemplateBase('includes/header.php'); $this->includeAtTemplateBase('includes/header.php');
foreach ($this->data['idplist'] as $idpentry) {
foreach ($this->data['idplist'] AS $idpentry) { if (isset($idpentry['name'])) {
if (isset($idpentry['name'])) { $this->includeInlineTranslation('idpname_'.$idpentry['entityid'], $idpentry['name']);
$this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['name']); } elseif (isset($idpentry['OrganizationDisplayName'])) {
} elseif (isset($idpentry['OrganizationDisplayName'])) { $this->includeInlineTranslation('idpname_'.$idpentry['entityid'], $idpentry['OrganizationDisplayName']);
$this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['OrganizationDisplayName']); }
} if (isset($idpentry['description'])) {
if (isset($idpentry['description'])) $this->includeInlineTranslation('idpdesc_'.$idpentry['entityid'], $idpentry['description']);
$this->includeInlineTranslation('idpdesc_' . $idpentry['entityid'], $idpentry['description']); }
} }
?> ?>
<h2><?php echo $this->data['header']; ?></h2>
<form method="get" action="<?php echo $this->data['urlpattern']; ?>">
<h2><?php echo $this->data['header']; ?></h2> <input type="hidden" name="entityID" value="<?php echo htmlspecialchars($this->data['entityID']); ?>"/>
<input type="hidden" name="return" value="<?php echo htmlspecialchars($this->data['return']); ?>"/>
<form method="get" action="<?php echo $this->data['urlpattern']; ?>"> <input type="hidden" name="returnIDParam"
<input type="hidden" name="entityID" value="<?php echo htmlspecialchars($this->data['entityID']); ?>" /> value="<?php echo htmlspecialchars($this->data['returnIDParam']); ?>"/>
<input type="hidden" name="return" value="<?php echo htmlspecialchars($this->data['return']); ?>" /> <p><?php
<input type="hidden" name="returnIDParam" value="<?php echo htmlspecialchars($this->data['returnIDParam']); ?>" /> echo $this->t('selectidp_full');
if ($this->data['rememberenabled']) {
<p><?php echo '<br /><input type="checkbox" name="remember" value="1" title="'.$this->t('remember').'" />'.
echo $this->t('selectidp_full'); $this->t('remember');
if($this->data['rememberenabled']) { }
echo('<br /><input type="checkbox" name="remember" value="1" title="'.$this->t('remember').'" />' . $this->t('remember')); ?></p>
} <?php
?></p> if (!empty($this->data['preferredidp']) &&
array_key_exists($this->data['preferredidp'], $this->data['idplist'])
<?php ) {
$idpentry = $this->data['idplist'][$this->data['preferredidp']];
echo '<div class="preferredidp">';
if (!empty($this->data['preferredidp']) && array_key_exists($this->data['preferredidp'], $this->data['idplist'])) { echo ' <img src="/'.$this->data['baseurlpath'].
$idpentry = $this->data['idplist'][$this->data['preferredidp']]; 'resources/icons/experience/gtk-about.64x64.png" class="float-r" alt="'.
echo '<div class="preferredidp">'; $this->t('icon_prefered_idp').'" />';
echo ' <img src="/' . $this->data['baseurlpath'] .'resources/icons/experience/gtk-about.64x64.png" class="float-r" alt="'.$this->t('icon_prefered_idp').'" />';
if (array_key_exists('icon', $idpentry) && $idpentry['icon'] !== null) {
if(array_key_exists('icon', $idpentry) && $idpentry['icon'] !== NULL) { $iconUrl = \SimpleSAML\Utils\HTTP::resolveURL($idpentry['icon']);
$iconUrl = \SimpleSAML\Utils\HTTP::resolveURL($idpentry['icon']); echo '<img class="float-l" style="margin: 1em; padding: 3px; border: 1px solid #999" src="'.
echo '<img class="float-l" style="margin: 1em; padding: 3px; border: 1px solid #999" src="' . htmlspecialchars($iconUrl) . '" />'; htmlspecialchars($iconUrl).'" />';
} }
echo "\n" . ' <h3 style="margin-top: 8px">' . htmlspecialchars($this->t('idpname_' . $idpentry['entityid'])) . '</h3>'; echo "\n".' <h3 style="margin-top: 8px">'.
htmlspecialchars($this->t('idpname_'.$idpentry['entityid'])).'</h3>';
if (!empty($idpentry['description'])) {
echo ' <p>' . htmlspecialchars($this->t('idpdesc_' . $idpentry['entityid'])) . '<br />'; if (!empty($idpentry['description'])) {
} echo ' <p>'.htmlspecialchars($this->t('idpdesc_'.$idpentry['entityid'])).'<br />';
echo('<input id="preferredidp" type="submit" name="idp_' . }
htmlspecialchars($idpentry['entityid']) . '" value="' . echo('<button id="preferredidp" type="submit" class="btn" name="idp_'.
$this->t('select') . '" /></p>'); htmlspecialchars($idpentry['entityid']).'">'.
echo '</div>'; $this->t('select').'</button>"</p>');
} echo '</div>';
}
foreach ($this->data['idplist'] AS $idpentry) { foreach ($this->data['idplist'] as $idpentry) {
if ($idpentry['entityid'] != $this->data['preferredidp']) { if ($idpentry['entityid'] != $this->data['preferredidp']) {
if (array_key_exists('icon', $idpentry) && $idpentry['icon'] !== null) {
if(array_key_exists('icon', $idpentry) && $idpentry['icon'] !== NULL) { $iconUrl = \SimpleSAML\Utils\HTTP::resolveURL($idpentry['icon']);
$iconUrl = \SimpleSAML\Utils\HTTP::resolveURL($idpentry['icon']); echo '<img class="float-l" style="clear: both; margin: 1em; padding: 3px; border: 1px solid #999"'.
echo '<img class="float-l" style="clear: both; margin: 1em; padding: 3px; border: 1px solid #999" src="' . htmlspecialchars($iconUrl) . '" />'; ' src="'.htmlspecialchars($iconUrl).'" />';
} }
echo "\n" . ' <h3 style="margin-top: 8px">' . htmlspecialchars($this->t('idpname_' . $idpentry['entityid'])) . '</h3>'; echo "\n".' <h3 style="margin-top: 8px">'.htmlspecialchars($this->t('idpname_'.$idpentry['entityid']));
echo '</h3>';
if (!empty($idpentry['description'])) {
if (!empty($idpentry['description'])) {
echo ' <p>' . htmlspecialchars($this->t('idpdesc_' . $idpentry['entityid'])) . '<br />'; echo ' <p>'.htmlspecialchars($this->t('idpdesc_'.$idpentry['entityid'])).'<br />';
} }
echo('<input type="submit" name="idp_' . echo '<button type="submit" class="btn" name="idp_'.htmlspecialchars($idpentry['entityid']).'">'.
htmlspecialchars($idpentry['entityid']) . '" value="' . $this->t('select').'</button></p>';
$this->t('select') . '" /></p>'); }
} }
} ?>
</form>
?>
</form>
<?php $this->includeAtTemplateBase('includes/footer.php'); <?php $this->includeAtTemplateBase('includes/footer.php');
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