Skip to content
Snippets Groups Projects
Commit 82e31425 authored by Olav Morken's avatar Olav Morken
Browse files

login-feide: Changed to display error in template.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@723 44740490-163a-0410-bde0-09ae8108e29a
parent d7a762a5
No related branches found
No related tags found
No related merge requests found
...@@ -20,10 +20,17 @@ function attributealter_feideaccess(&$attributes, $spEntityId = null, $idpEntity ...@@ -20,10 +20,17 @@ function attributealter_feideaccess(&$attributes, $spEntityId = null, $idpEntity
$org = $org[1]; $org = $org[1];
if(!in_array($org, $allowedOrgs, TRUE)) { if(!in_array($org, $allowedOrgs, TRUE)) {
$session = SimpleSAML_Session::getInstance();
SimpleSAML_Logger::error('FEIDE access control: Organization "' . $org . SimpleSAML_Logger::error('FEIDE access control: Organization "' . $org .
'" not in list of allowed organization for SP "' . $spEntityId . '".'); '" 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 . SimpleSAML_Logger::info('FEIDE access control: Organization "' . $org .
......
<?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
<?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
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