Commit 1239b356 authored by haemmer's avatar haemmer

Renamed Logo properties

If category 'unkonwn' is the only category, it won't be displayed
parent 17ef5c3e
......@@ -337,16 +337,20 @@ function processIDPRoleDescriptor($IDPRoleDescriptorNode){
$MDUILogos = getMDUILogos($IDPRoleDescriptorNode);
foreach ($MDUILogos as $Logo){
// Skip non-favicon logos
if ($Logo['height'] != 16 || $Logo['width'] != 16 ){
if ($Logo['Height'] != 16 || $Logo['Width'] != 16 ){
continue;
}
if ($Logo['lang'] == ''){
unset($Logo['lang']);
// Strip height and width
unset($Logo['Height']);
unset($Logo['Width']);
if ($Logo['Lang'] == ''){
unset($Logo['Lang']);
$IDP['Logo'] = $Logo;
} else {
$lang = $Logo['lang'];
unset($Logo['lang']);
$lang = $Logo['Lang'];
unset($Logo['Lang']);
$IDP[$lang]['Logo'] = $Logo;
}
}
......@@ -556,10 +560,10 @@ function getMDUILogos($RoleDescriptorNode){
$MDUILogos = $RoleDescriptorNode->getElementsByTagNameNS('urn:oasis:names:tc:SAML:metadata:ui', 'Logo');
foreach( $MDUILogos as $MDUILogoEntry ){
$Logo = Array();
$Logo['url'] = trim($MDUILogoEntry->nodeValue);
$Logo['height'] = ($MDUILogoEntry->getAttribute('height') != '') ? trim($MDUILogoEntry->getAttribute('height')) : '16';
$Logo['width'] = ($MDUILogoEntry->getAttribute('width') != '') ? trim($MDUILogoEntry->getAttribute('width')) : '16';
$Logo['lang'] = ($MDUILogoEntry->getAttribute('lang') != '') ? trim($MDUILogoEntry->getAttribute('lang')) : '';
$Logo['URL'] = trim($MDUILogoEntry->nodeValue);
$Logo['Height'] = ($MDUILogoEntry->getAttribute('height') != '') ? trim($MDUILogoEntry->getAttribute('height')) : '16';
$Logo['Width'] = ($MDUILogoEntry->getAttribute('width') != '') ? trim($MDUILogoEntry->getAttribute('width')) : '16';
$Logo['Lang'] = ($MDUILogoEntry->getAttribute('lang') != '') ? trim($MDUILogoEntry->getAttribute('lang')) : '';
$Logos[] = $Logo;
}
......
......@@ -136,10 +136,12 @@ function printDropDownList($IDProviders, $selectedIDP = ''){
</optgroup>';
}
// Add another category
echo '
<optgroup label="'.$IdPName.'">';
// Add another category unless first (and probably only) category is unknown
if (!empty($optgroup) && $key != 'unknown'){
echo '
<optgroup label="'.$IdPName.'">';
$optgroup = $key;
}
}
continue;
......@@ -152,12 +154,10 @@ function printDropDownList($IDProviders, $selectedIDP = ''){
$selected = '';
}
// Add logo to extension string
// Add logo (which is assumed to be 16x16px) to extension string
$logo = '';
if (isset($values['Logo'])){
if ($values['Logo']['height'] == 16 && $values['Logo']['width'] == 16){
$logo = 'logo="'.$values['Logo']['url']. '"';
}
$logo = 'logo="'.$values['Logo']['URL']. '"';
}
echo '
......@@ -203,7 +203,7 @@ function printNotice(){
if ($permanentUserIdP != ''){
$hiddenUserIdPInput = '<input type="hidden" name="user_idp" value="'.$permanentUserIdP.'">';
$permanentUserIdPName = $IDProviders[$permanentUserIdP]['Name'];
$permanentUserIdPLogo = $IDProviders[$permanentUserIdP]['Logo']['url'];
$permanentUserIdPLogo = $IDProviders[$permanentUserIdP]['Logo']['URL'];
}
// Check if footer template exists
......@@ -293,8 +293,8 @@ function printEmbeddedWAYFScript(){
}
// Logo URL
if (isset($IDProvider['Logo']['url'])){
$IdPLogoURL = $IDProvider['Logo']['url'];
if (isset($IDProvider['Logo']['URL'])){
$IdPLogoURL = $IDProvider['Logo']['URL'];
} else {
$IdPLogoURL = '';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment