ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilSamlIdpMetadataInputGUI.php
Go to the documentation of this file.
1<?php declare(strict_types=1);
2/* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
3
8{
11
18 public function __construct($a_title = '', $a_postvar = '', ilSamlIdpXmlMetadataParser $idpMetadataParser = null)
19 {
20 parent::__construct($a_title, $a_postvar);
21 $this->idpMetadataParser = $idpMetadataParser;
22 }
23
27 public function getIdpMetadataParser()
28 {
30 }
31
35 public function checkInput()
36 {
37 $valid = parent::checkInput();
38 if (!$valid) {
39 return false;
40 }
41
42 try {
43 $httpValue = $_POST[$this->getPostVar()];
44
45 $this->idpMetadataParser->parse($httpValue);
46 if ($this->idpMetadataParser->hasErrors()) {
47 $this->setAlert(implode('<br />', $this->idpMetadataParser->getErrors()));
48 return false;
49 }
50
51 if (!$this->idpMetadataParser->getEntityId()) {
52 $this->setAlert($GLOBALS['DIC']->language()->txt('auth_saml_add_idp_md_error'));
53 return false;
54 }
55 } catch (\Exception $e) {
56 $this->setAlert($GLOBALS['DIC']->language()->txt('auth_saml_add_idp_md_error'));
57 return false;
58 }
59
60 return true;
61 }
62}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php: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
language()
Definition: language.php:2
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc