Skip to content

Commit

Permalink
CIL-410 - Allow redirect URL parameter for ShibError.
Browse files Browse the repository at this point in the history
  • Loading branch information
terrencegf committed Aug 30, 2017
1 parent 5afbfad commit 75f8867
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Service/ShibError.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ class ShibError
* passed as parameters to the 'redirectErrors' handler URL, i.e.
* in the $_GET global variable.
*
* @param string|null $redirectUrl In case of Shibboleth error, redirect
* to this URL. If null, then print out error to user.
*
* @return ShibError A new ShibError object.
*/
public function __construct()
public function __construct($redirectUrl = null)
{
$this->errorarray = array();
foreach (static::$errorparams as $param) {
Expand All @@ -98,6 +101,8 @@ public function __construct()
$responseurl,
false
);
} elseif (!is_null($redirectUrl)) {
header('Location: ' . $redirectUrl);
} else {
$this->printError();
}
Expand Down

0 comments on commit 75f8867

Please sign in to comment.