diff --git a/dictionaries/attribute_check.definition.json b/dictionaries/attribute_check.definition.json index 912ca06..a3c4242 100644 --- a/dictionaries/attribute_check.definition.json +++ b/dictionaries/attribute_check.definition.json @@ -1,6 +1,22 @@ { + "header": { + "en": "Attribute conformance", + "cs": "Kontrola atributů" + }, "show_hide_btn": { "en": "Show / Hide all attributes", "cs": "Zobrazit / Skrýt všechny atributy" + }, + "sign_in_text": { + "en": "Welcome to the service for verifying Identity Provider conformance. This service will help you configure your Identity Provider (or report to its administrator) the status of meeting the requirements to work with the AAI.
Hit the sign-in button below to initiate the login process. By doing so, you will have to select the Identity Provider, which you want to use for login. After authenticating with your credentials, you will be presented with status information, describing if the requirements have been met or not.", + "cs": "Vítejte na službě pro ověření kompatibility Vašeho poskytovatele identit. Tato služba Vám pomůže při konfiguraci Identity Providera splnit požadavky AAI.
Pokračujte tlačítkem Přihlásit se na výběr poskytovatele identit. Po přihlášení Vám bude zobrazen stav kompatibility s AAI." + }, + "sign_in_btn": { + "en": "Sign in", + "cs": "Přihlásit se" + }, + "log_out_btn": { + "en": "Log out", + "cs": "Odhlásit se" } } diff --git a/templates/attribute_check-tpl.php b/templates/attribute_check-tpl.php index 7cfe8cf..683647c 100644 --- a/templates/attribute_check-tpl.php +++ b/templates/attribute_check-tpl.php @@ -10,9 +10,9 @@ * * @var SimpleSAML\XHTML\Template $this */ -$attributes = $this->data['attributes']; -$attributesGroupConfiguration = $this->data['attributes_group_config']; +$attributesGroupConfiguration = $this->data['attributes_group_config']; +$as = $this->data['as']; $this->data['header'] = ''; $this->data['head'] = '"; + echo '
' . $this->t('{attribute_check:attribute_check:sign_in_text}') . '
'; + echo sprintf( + "%s", + $as->getLoginURL(), + $this->t('{attribute_check:attribute_check:sign_in_btn}') + ); + echo ''; } -?> -
- -
-isAuthenticated()) { + $attributes = $as->getAttributes(); -echo "
"; -foreach ($attributes as $attributeName => $attributeValue) { - echo "
"; - echo "
"; - echo '
' . $attributeName . '
'; - echo '
'; + foreach ($attributesGroupConfiguration as $group) { + echo AttributeCheck::handleAttributesGroup($this, $group, $attributes); + } ?> +
+ +
+ "; + foreach ($attributes as $attributeName => $attributeValue) { + echo "
"; + echo "
"; + echo '
' . $attributeName . '
'; + echo '
'; - echo "
"; - if (count($attributeValue) > 1) { - echo '
    '; - foreach ($attributeValue as $value) { - echo '
  • ' . $value . '
  • '; + echo "
    "; + if (count($attributeValue) > 1) { + echo '
      '; + foreach ($attributeValue as $value) { + echo '
    • ' . $value . '
    • '; + } + echo '
    '; + } elseif (count($attributeValue) === 1) { + echo '
    ' . $attributeValue[0] . '
    '; + } else { + echo '
    '; } - echo '
'; - } elseif (count($attributeValue) === 1) { - echo '
' . $attributeValue[0] . '
'; - } else { - echo '
'; - } + echo '
'; + echo '
'; + } echo '
'; - echo '
'; } -echo ''; + +if ($as->isAuthenticated()) { + echo sprintf( + "%s", + $as->getLogoutURL(), + $this->t('{attribute_check:attribute_check:log_out_btn}') + ); +} $this->includeAtTemplateBase('includes/footer.php'); diff --git a/www/attribute_check.php b/www/attribute_check.php index 03621e6..b940a6b 100644 --- a/www/attribute_check.php +++ b/www/attribute_check.php @@ -15,8 +15,6 @@ const CONFIG_FILE_NAME = 'config_attribute_check.php'; $as = new Simple('default-sp'); -$as->requireAuth(); -$attributes = $as->getAttributes(); $config = Configuration::getInstance(); $conf = Configuration::getConfig(CONFIG_FILE_NAME); @@ -25,5 +23,5 @@ $t = new Template($config, 'attribute_check:attribute_check-tpl.php'); $t->data['attributes_group_config'] = $attributesGroupConfiguration; -$t->data['attributes'] = $attributes; +$t->data['as'] = $as; $t->show(); diff --git a/www/res/css/attribute_check.css b/www/res/css/attribute_check.css index 607d894..d56e52d 100644 --- a/www/res/css/attribute_check.css +++ b/www/res/css/attribute_check.css @@ -22,9 +22,14 @@ body, .btn { word-break: break-word; } -.btn-show-hide { +.btn { margin: 25px 10%; width: 80%; padding: 10px 25px; font-weight: bold; + color: white; +} + +a:link { + font-weight: bold; }