ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilSamlIdpMetadataInputGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
3
8{
13
20 public function __construct($a_title = '', $a_postvar = '', \ilSamlIdpXmlMetadataParser $idpMetadataParser = null)
21 {
22 parent::__construct($a_title, $a_postvar);
23 $this->idpMetadataParser = $idpMetadataParser;
24 }
25
29 public function getIdpMetadataParser()
30 {
32 }
33
37 public function checkInput()
38 {
39 $valid = parent::checkInput();
40 if (!$valid) {
41 return false;
42 }
43
44 try {
45 $httpValue = $_POST[$this->getPostVar()];
46
47 $this->idpMetadataParser->parse($httpValue);
48 if ($this->idpMetadataParser->hasErrors()) {
49 $this->setAlert(implode('<br />', $this->idpMetadataParser->getErrors()));
50 return false;
51 }
52
53 if (!$this->idpMetadataParser->getEntityId()) {
54 $this->setAlert($GLOBALS['DIC']->language()->txt('auth_saml_add_idp_md_error'));
55 return false;
56 }
57 } catch (\Exception $e) {
58 $this->setAlert($GLOBALS['DIC']->language()->txt('auth_saml_add_idp_md_error'));
59 return false;
60 }
61
62 return true;
63 }
64}
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
Class ilSamlIdpMetadataInputGUI.
__construct($a_title='', $a_postvar='', \ilSamlIdpXmlMetadataParser $idpMetadataParser=null)
ilSamlIdpMetadataInputGUI constructor.
checkInput()
Check input, strip slashes etc.set alert, if input is not ok.boolean Input ok, true/false
Class ilSamlIdpXmlMetadataParser.
This class represents a text area property in a property form.
$valid
$GLOBALS['loaded']
Global hash that tracks already loaded includes.