Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Commit

Permalink
fix: 🐛 Add check of key existence in template - unauth-acc-reg
Browse files Browse the repository at this point in the history
The variable assignment has been missing checks if the keys exist in the
associative array. This might have caused error page to be displayed, or
at least the message has appeared in the logs. PR also includes small
refactoring in order of the commands and fixes HTML tags.
  • Loading branch information
Dominik Frantisek Bucik authored and vyskocilpavel committed Oct 12, 2021
1 parent 9879124 commit 34c10d5
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions templates/unauthorized-access-go-to-registration-tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
use SimpleSAML\XHTML\Template;

/**
* Template for inform user that he/she will be redirected to registration
*
* Allow type hinting in IDE
* Template displaying information user that user will be redirected to registration page
*
* @var Template $this
*/
Expand All @@ -16,22 +14,22 @@
$this->data['head'] = '<link rel="stylesheet" media="screen" type="text/css" href="' .
Module::getModuleUrl('perun/res/css/perun_identity_go_to_registration.css') . '" />';

$params = $this->data['params'];
if (isset($_POST['continueToRegistration'])) {
HTTP::redirectTrustedURL($_REQUEST['registerUrL'], $params);
}
$spMetadata = $this->data['SPMetadata'];

$serviceName = '';
$informationURL = '';
$params = $this->data['params'];
if ($spMetadata['name']['en']) {
if (isset($spMetadata['name']['en'])) {
$serviceName = $spMetadata['name']['en'];
}

if ($spMetadata['InformationURL']['en']) {
$informationURL = '';
if (isset($spMetadata['InformationURL']['en'])) {
$informationURL = $spMetadata['InformationURL']['en'];
}

if (isset($_POST['continueToRegistration'])) {
HTTP::redirectTrustedURL($_REQUEST['registerUrL'], $params);
}

$this->includeAtTemplateBase('includes/header.php');

$header = $this->t('{perun:perun:go-to-registration_header1}');
Expand All @@ -49,13 +47,12 @@
?>

<form method="post">
</hr>
</br>
<hr/>
<br/>
<input type="submit" name="continueToRegistration"
value="<?php echo $this->t('{perun:perun:go-to-registration_continue}') ?>"
class="btn btn-lg btn-primary btn-block">
<div class="form-group">
</div>
<div class="form-group"></div>
</form>

<?php
Expand Down

0 comments on commit 34c10d5

Please sign in to comment.