ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 {
12  protected $idpMetadataParser;
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 }
getPostVar()
Get Post Variable.
$valid
Class ilSamlIdpXmlMetadataParser.
setAlert($a_alert)
Set Alert Text.
Class ilSamlIdpMetadataInputGUI.
__construct($a_title='', $a_postvar='', \ilSamlIdpXmlMetadataParser $idpMetadataParser=null)
ilSamlIdpMetadataInputGUI constructor.
This class represents a text area property in a property form.
$_POST["username"]
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.