Skip to content
Snippets Groups Projects
Commit 282bef33 authored by Maja Górecka-Wolniewicz's avatar Maja Górecka-Wolniewicz
Browse files

handling errors in parameters when fed_id is given

parent 6f09d97c
No related branches found
No related tags found
No related merge requests found
...@@ -72,7 +72,12 @@ class Validator { ...@@ -72,7 +72,12 @@ class Validator {
$this->params['federror'] = "No metadata URL registered in the eduGAIN database for federation ".$this->edugain->FEDS[$fed_id]['fed_id'].' - '.$this->edugain->FEDS[$fed_id]['name']; $this->params['federror'] = "No metadata URL registered in the eduGAIN database for federation ".$this->edugain->FEDS[$fed_id]['fed_id'].' - '.$this->edugain->FEDS[$fed_id]['name'];
} else { } else {
$this->params['fedname'] = $this->edugain->FEDS[$fed_id]['name']; $this->params['fedname'] = $this->edugain->FEDS[$fed_id]['name'];
if (isset($this->edugain->FEDS[$fed_id]['reg_auth'])) {
$this->params['regauth'] = $this->edugain->FEDS[$fed_id]['reg_auth']; $this->params['regauth'] = $this->edugain->FEDS[$fed_id]['reg_auth'];
} else {
$this->params['regauth'] = '';
}
if (isset($this->edugain->FEDS[$fed_id]['certificate'])) {
for ($n=0; $n<count($this->edugain->FEDS[$fed_id]['certificate']); $n++) { for ($n=0; $n<count($this->edugain->FEDS[$fed_id]['certificate']); $n++) {
$certificate = $this->edugain->FEDS[$fed_id]['certificate'][$n]['data']; $certificate = $this->edugain->FEDS[$fed_id]['certificate'][$n]['data'];
$certificate = trim($certificate, "\n"); $certificate = trim($certificate, "\n");
...@@ -97,6 +102,7 @@ class Validator { ...@@ -97,6 +102,7 @@ class Validator {
fputs($ff, json_encode($this->edugain->FEDS[$fed_id]['certificate'])); fputs($ff, json_encode($this->edugain->FEDS[$fed_id]['certificate']));
} }
} }
}
$this->params['auto'] = $this->params['validate'] = $this->params['edugain'] = 1; $this->params['auto'] = $this->params['validate'] = $this->params['edugain'] = 1;
if (isset($_REQUEST['xmlout']) || (!empty($_REQUEST['format']) && $_REQUEST['format'] == 'xml') ) if (isset($_REQUEST['xmlout']) || (!empty($_REQUEST['format']) && $_REQUEST['format'] == 'xml') )
$this->params['xmlout'] = 1; $this->params['xmlout'] = 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment