ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilSamlIdpTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2016 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/Table/classes/class.ilTable2GUI.php';
5require_once 'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
6require_once 'Services/Saml/classes/class.ilSamlIdp.php';
7
13{
15 protected $mayEdit = true;
16
24 public function __construct($a_parent_obj, $a_parent_cmd = "", $mayEdit = true)
25 {
26 global $DIC;
27
28 $f = $DIC->ui()->factory();
29 $renderer = $DIC->ui()->renderer();
30 $this->mayEdit = $mayEdit;
31
32 $this->setId('saml_idp_list');
33 parent::__construct($a_parent_obj, $a_parent_cmd, '');
34
35 $this->ctrl = $GLOBALS['DIC']->ctrl();
36
37 $this->setTitle($this->lng->txt('auth_saml_idps'));
38
39 $federationMdUrl = rtrim(ILIAS_HTTP_PATH, '/') . '/Services/Saml/lib/metadata.php?client_id=' . CLIENT_ID;
40
41 $this->setDescription(sprintf(
42 $this->lng->txt('auth_saml_idps_info'),
43 'auth/saml/config/config.php',
44 'auth/saml/config/authsources.php',
45 $renderer->render($f->link()->standard('https://simplesamlphp.org/docs/stable/simplesamlphp-sp', 'https://simplesamlphp.org/docs/stable/simplesamlphp-sp')),
46 $renderer->render($f->link()->standard($federationMdUrl, $federationMdUrl))
47 ));
48 $this->setRowTemplate('tpl.saml_idp_row.html', 'Services/Saml');
49
50 $this->addColumn($this->lng->txt('saml_tab_head_idp'), '', '80%');
51 $this->addColumn($this->lng->txt('active'), '', '5%');
52 $this->addColumn($this->lng->txt('actions'), '', '15%');
53
54 $this->getItems();
55 }
56
60 protected function getItems()
61 {
62 $idp_data = array();
63
64 foreach (ilSamlIdp::getAllIdps() as $idp) {
65 $idp_data[] = $idp->toArray();
66 }
67
68 $this->setData($idp_data);
69 }
70
74 protected function fillRow($a_set)
75 {
76 if ($a_set['is_active']) {
77 $this->tpl->setVariable('IMAGE_OK', ilUtil::getImagePath('icon_ok.svg'));
78 $this->tpl->setVariable('TXT_OK', $this->lng->txt('active'));
79 } else {
80 $this->tpl->setVariable('IMAGE_OK', ilUtil::getImagePath('icon_not_ok.svg'));
81 $this->tpl->setVariable('TXT_OK', $this->lng->txt('inactive'));
82 }
83
84 $this->tpl->setVariable('NAME', $a_set['entity_id']);
85
87 $list->setSelectionHeaderClass('small');
88 $list->setItemLinkClass('small');
89 $list->setId('actl_' . $a_set['idp_id']);
90 $list->setListTitle($this->lng->txt('actions'));
91
92 $this->ctrl->setParameter($this->getParentObject(), 'saml_idp_id', $a_set['idp_id']);
93
94 $list->addItem(
95 $this->lng->txt('edit'),
96 '',
97 $this->ctrl->getLinkTarget($this->getParentObject(), 'showIdpSettings')
98 );
99
100 if ($a_set['is_active']) {
101 $list->addItem(
102 $this->lng->txt('deactivate'),
103 '',
104 $this->ctrl->getLinkTarget($this->getParentObject(), 'deactivateIdp')
105 );
106 } else {
107 $list->addItem(
108 $this->lng->txt('activate'),
109 '',
110 $this->ctrl->getLinkTarget($this->getParentObject(), 'activateIdp')
111 );
112 }
113
114 $list->addItem(
115 $this->lng->txt('delete'),
116 '',
117 $this->ctrl->getLinkTarget($this->getParentObject(), 'confirmDeleteIdp')
118 );
119 $this->ctrl->setParameter($this->getParentObject(), 'saml_idp_id', '');
120
121 if ($this->mayEdit) {
122 $this->tpl->setVariable('ACTIONS', $list->getHTML());
123 }
124 }
125}
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="", $mayEdit=true)
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)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
$idp
Definition: prp.php:13
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
global $DIC
Definition: saml.php:7