diff --git a/attributealter/feideaccess.php b/attributealter/feideaccess.php index 92132294e16b37fa0f7c4ad92ba4dd037d3d2f7a..e939c43031a5211007e3e265352ec586cd9a5c17 100644 --- a/attributealter/feideaccess.php +++ b/attributealter/feideaccess.php @@ -20,10 +20,17 @@ function attributealter_feideaccess(&$attributes, $spEntityId = null, $idpEntity $org = $org[1]; if(!in_array($org, $allowedOrgs, TRUE)) { - $session = SimpleSAML_Session::getInstance(); SimpleSAML_Logger::error('FEIDE access control: Organization "' . $org . '" not in list of allowed organization for SP "' . $spEntityId . '".'); - SimpleSAML_Utilities::fatalError($session->getTrackId(), 'NOACCESS'); + $config = SimpleSAML_Configuration::getInstance(); + $t = new SimpleSAML_XHTML_Template($config, 'no_access.php', 'no_access_dictionary.php'); + if(array_key_exists('name', $spMetadata)) { + $t->data['sp_name'] = $spMetadata['name']; + } else { + $t->data['sp_name'] = $spEntityId; + } + $t->show(); + exit(); } SimpleSAML_Logger::info('FEIDE access control: Organization "' . $org . diff --git a/dictionaries/no_access_dictionary.php b/dictionaries/no_access_dictionary.php new file mode 100644 index 0000000000000000000000000000000000000000..7edc186a2118ad5178fddf64d465a922134be037 --- /dev/null +++ b/dictionaries/no_access_dictionary.php @@ -0,0 +1,20 @@ +<?php + +$lang = array( + 'access_denied' => array ( + 'da' => 'Du har ikke adgang til denne service', + 'en' => 'You do not have access to this service', + ), + 'no_access_to' => array ( + 'da' => 'Du har ikke adgang til servicen:', + 'en' => 'You do not have access to the service:', + ), + 'contact_home' => array ( + 'da' => 'Adgang til services bestemmes af din hjemmeorganisation. Kontakt venligst din lokale helpdesk for spørgsmål.', + 'en' => 'Access to services is controlled by your home organization. Please contact your local it support for questions.', + ), + +); + + +?> \ No newline at end of file diff --git a/templates/default/no_access.php b/templates/default/no_access.php new file mode 100644 index 0000000000000000000000000000000000000000..44468a0a0400d385aec73874c5b8b30b75c5b39f --- /dev/null +++ b/templates/default/no_access.php @@ -0,0 +1,13 @@ +<?php +$this->data['header'] = $this->t('access_denied'); +$this->includeAtTemplateBase('includes/header.php'); +$this->includeInlineTranslation('spname', $this->data['sp_name']); +?> +<div id="content"> + <h2><?php echo $this->t('access_denied');?></h2> + <p><?php echo $this->t('no_access_to');?></p> + <p><b><?php echo $this->t('spname');?></b></p> + <p><?php echo $this->t('contact_home');?></p> +<?php +$this->includeAtTemplateBase('includes/footer.php'); +?> \ No newline at end of file