ILIAS  release_8 Revision v8.24
class.ilSamlIdpMetadataInputGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
24
25 public function __construct(string $title, string $httpPostVar, ilSamlIdpXmlMetadataParser $idpMetadataParser)
26 {
27 parent::__construct($title, $httpPostVar);
28 $this->idpMetadataParser = $idpMetadataParser;
29 }
30
32 {
34 }
35
36 public function checkInput(): bool
37 {
38 $valid = parent::checkInput();
39 if (!$valid) {
40 return false;
41 }
42
43 try {
44 $httpValue = $this->raw($this->getPostVar());
45
46 $this->idpMetadataParser->parse($httpValue);
47 if ($this->idpMetadataParser->result()->isError()) {
48 $this->setAlert(implode(' ', [$this->lng->txt('auth_saml_add_idp_md_error'), $this->idpMetadataParser->result()->error()]));
49 return false;
50 }
51
52 if (!$this->idpMetadataParser->result()->value()) {
53 $this->setAlert($this->lng->txt('auth_saml_add_idp_md_error'));
54 return false;
55 }
56
57 $this->value = $this->stripSlashesAddSpaceFallback($this->idpMetadataParser->result()->value());
58 } catch (Exception $e) {
59 $this->setAlert($this->lng->txt('auth_saml_add_idp_md_error'));
60 return false;
61 }
62
63 return true;
64 }
65}
stripSlashesAddSpaceFallback(string $a_str)
Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727.
ilSamlIdpXmlMetadataParser $idpMetadataParser
__construct(string $title, string $httpPostVar, ilSamlIdpXmlMetadataParser $idpMetadataParser)
checkInput()
Check input, strip slashes etc.
This class represents a text area property in a property form.
$valid
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc