ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilSamlIdpTableGUI.php
Go to the documentation of this file.
1<?php declare(strict_types=1);
2/* Copyright (c) 1998-2016 ILIAS open source, Extended GPL, see docs/LICENSE */
3
9{
11 protected $ctrl;
13 protected $dic;
14
21 public function __construct($a_parent_obj, $a_parent_cmd = "")
22 {
23 global $DIC;
24
25 $this->dic = $DIC;
26
27 $f = $DIC->ui()->factory();
28 $renderer = $DIC->ui()->renderer();
29
30 $this->setId('saml_idp_list');
31 parent::__construct($a_parent_obj, $a_parent_cmd, '');
32
33 $this->ctrl = $GLOBALS['DIC']->ctrl();
34
35 $this->setTitle($this->lng->txt('auth_saml_idps'));
36
37 $federationMdUrl = rtrim(ILIAS_HTTP_PATH, '/') . '/Services/Saml/lib/metadata.php?client_id=' . CLIENT_ID;
38
39 $this->setDescription(sprintf(
40 $this->lng->txt('auth_saml_idps_info'),
41 'auth/saml/config/config.php',
42 'auth/saml/config/authsources.php',
43 $renderer->render($f->link()->standard('https://simplesamlphp.org/docs/stable/simplesamlphp-sp', 'https://simplesamlphp.org/docs/stable/simplesamlphp-sp')),
44 $renderer->render($f->link()->standard($federationMdUrl, $federationMdUrl))
45 ));
46 $this->setRowTemplate('tpl.saml_idp_row.html', 'Services/Saml');
47
48 $this->addColumn($this->lng->txt('saml_tab_head_idp'), '', '80%');
49 $this->addColumn($this->lng->txt('active'), '', '5%');
50 $this->addColumn($this->lng->txt('actions'), '', '15%');
51
52 $this->getItems();
53 }
54
58 private function getItems() : void
59 {
60 $idp_data = [];
61
62 foreach (ilSamlIdp::getAllIdps() as $idp) {
63 $idp_data[] = $idp->toArray();
64 }
65
66 $this->setData($idp_data);
67 }
68
72 protected function fillRow($a_set)
73 {
74 if ($a_set['is_active']) {
75 $this->tpl->setVariable('IMAGE_OK', ilUtil::getImagePath('icon_ok.svg'));
76 $this->tpl->setVariable('TXT_OK', $this->lng->txt('active'));
77 } else {
78 $this->tpl->setVariable('IMAGE_OK', ilUtil::getImagePath('icon_not_ok.svg'));
79 $this->tpl->setVariable('TXT_OK', $this->lng->txt('inactive'));
80 }
81
82 $this->tpl->setVariable('NAME', $a_set['entity_id']);
83
84 if ($this->dic->rbac()->system()->checkAccess('write', $_GET['ref_id'])) {
85 $list = new ilAdvancedSelectionListGUI();
86 $list->setSelectionHeaderClass('small');
87 $list->setItemLinkClass('small');
88 $list->setId('actl_' . $a_set['idp_id']);
89 $list->setListTitle($this->lng->txt('actions'));
90
91 $this->ctrl->setParameter($this->getParentObject(), 'saml_idp_id', $a_set['idp_id']);
92 $list->addItem($this->lng->txt('edit'), '', $this->ctrl->getLinkTarget($this->getParentObject(), 'showIdpSettings'));
93 if ($a_set['is_active']) {
94 $list->addItem($this->lng->txt('deactivate'), '', $this->ctrl->getLinkTarget($this->getParentObject(), 'deactivateIdp'));
95 } else {
96 $list->addItem($this->lng->txt('activate'), '', $this->ctrl->getLinkTarget($this->getParentObject(), 'activateIdp'));
97 }
98 $list->addItem($this->lng->txt('delete'), '', $this->ctrl->getLinkTarget($this->getParentObject(), 'confirmDeleteIdp'));
99 $this->ctrl->setParameter($this->getParentObject(), 'saml_idp_id', '');
100
101 $this->tpl->setVariable('ACTIONS', $list->getHTML());
102 }
103 }
104}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
User interface class for advanced drop-down selection lists.
Class ilSamlIdpTableGUI.
__construct($a_parent_obj, $a_parent_cmd="")
ilSamlIdpTableGUI constructor.
static getAllIdps()
Class ilTable2GUI.
getParentObject()
Get parent object.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setId($a_val)
Set id.
setDescription($a_val)
Set description.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46