diff --git a/metadata-templates/saml20-idp-remote.php b/metadata-templates/saml20-idp-remote.php index 58f81c789ad51552ca0db29d1e95a187f0242e2f..fc05ee184b12b2ca4e92f971391fcb1719d631e7 100644 --- a/metadata-templates/saml20-idp-remote.php +++ b/metadata-templates/saml20-idp-remote.php @@ -81,8 +81,8 @@ $metadata = array( 'max.feide.no' => array( 'name' => array( 'en' => 'Feide Test environment', - 'en' => 'Feide testmiljż', - ) + 'no' => 'Feide testmiljø', + ), 'description' => 'Feide test environment (max.feide.no). Authenticate with your identity from a school or university in Norway.', 'send_metadata_email' => 'moria-support@uninett.no', 'SingleSignOnService' => 'https://max.feide.no/amserver/SSORedirect/metaAlias/idp', diff --git a/templates/default/metadata.php b/templates/default/metadata.php index a76bc3d72ca5aad06921649f15e68d6cd1c7fe38..07a49d02b4f9f8f76ad53004012958fdc2e57673 100644 --- a/templates/default/metadata.php +++ b/templates/default/metadata.php @@ -20,7 +20,21 @@ $this->includeAtTemplateBase('includes/header.php'); ?> <div style="border: 1px solid #444; margin: .5em 2em .5em 2em; padding: .5em 1em 1em 1em; background: #FFFFCC"> - <h2 style="margin-top: 0px" ></h2> + + + + <h2 style="margin-top: 0px" ><?php echo $this->t('metadata_send_title2'); ?></h2> + + <?php + + if ($this->data['sentok'] === TRUE) { + + echo '<p><strong>' . $this->t('metadata_send_success') . '</strong></p>'; + + } + + ?> + <form action="metadata.php" method="post"> diff --git a/www/saml2/sp/metadata.php b/www/saml2/sp/metadata.php index 8e7a4732ed95c5917dca5f171b5362b2cc42e9ac..f32d097e6450c7ddfa6d7be7f6efc1b9ab774d7c 100644 --- a/www/saml2/sp/metadata.php +++ b/www/saml2/sp/metadata.php @@ -74,12 +74,13 @@ try { ); - + $sentok = FALSE; /* * Send metadata to Identity Provider, if the user filled submitted the form */ if (array_key_exists('sendtoidp', $_POST)) { + if (!array_key_exists($_POST['sendtoidp'], $idpsend)) throw new Exception('Entity ID ' . $_POST['sendtoidp'] . ' not found in metadata. Cannot send metadata to this IdP.'); @@ -117,7 +118,7 @@ try { $email = new SimpleSAML_XHTML_EMail($emailadr, 'simpleSAMLphp SAML 2.0 Service Provider Metadata', $from); $email->setBody($message); $email->send(); - + $sentok = TRUE; } @@ -140,6 +141,7 @@ try { $t->data['metaurl'] = SimpleSAML_Utilities::selfURLNoQuery(); $t->data['idpsend'] = $idpsend; + $t->data['sentok'] = $sentok; $t->data['adminok'] = $adminok; $t->data['adminlogin'] = $adminlogin;