ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
frontpage_federation.php
Go to the documentation of this file.
1<?php
2
3
4
5// Load SimpleSAMLphp, configuration
8
9// Check if valid local session exists.
10if ($config->getBoolean('admin.protectindexpage', false)) {
12}
15
16
17
18
19
20
21
22$links = array();
24$links_config = array();
25$links_auth = array();
27
28
29
30
31if($config->getBoolean('idpdisco.enableremember', FALSE)) {
32 $links_federation[] = array(
33 'href' => 'cleardiscochoices.php',
34 'text' => '{core:frontpage:link_cleardiscochoices}',
35 );
36}
37
38
40 'href' => \SimpleSAML\Utils\HTTP::getBaseURL() . 'admin/metadata-converter.php',
41 'text' => '{core:frontpage:link_xmlconvert}',
42);
43
44
45
46
47$allLinks = array(
48 'links' => &$links,
49 'welcome' => &$links_welcome,
50 'config' => &$links_config,
51 'auth' => &$links_auth,
52 'federation' => &$links_federation,
53);
55
56
59
60
61
62
63
64
65
66
67
69
70$metaentries = array('hosted' => $metadataHosted, 'remote' => array() );
71
72
73if ($isadmin) {
74 $metaentries['remote']['saml20-idp-remote'] = $metadata->getList('saml20-idp-remote');
75 $metaentries['remote']['shib13-idp-remote'] = $metadata->getList('shib13-idp-remote');
76}
77
78if ($config->getBoolean('enable.saml20-idp', FALSE) === true) {
79 try {
80 $metaentries['hosted']['saml20-idp'] = $metadata->getMetaDataCurrent('saml20-idp-hosted');
81 $metaentries['hosted']['saml20-idp']['metadata-url'] = $config->getBasePath() .
82 'saml2/idp/metadata.php?output=xhtml';
83 if ($isadmin)
84 $metaentries['remote']['saml20-sp-remote'] = $metadata->getList('saml20-sp-remote');
85 } catch(Exception $e) {
86 SimpleSAML\Logger::error('Federation: Error loading saml20-idp: ' . $e->getMessage());
87 }
88}
89if ($config->getBoolean('enable.shib13-idp', FALSE) === true) {
90 try {
91 $metaentries['hosted']['shib13-idp'] = $metadata->getMetaDataCurrent('shib13-idp-hosted');
92 $metaentries['hosted']['shib13-idp']['metadata-url'] = $config->getBasePath() .
93 'shib13/idp/metadata.php?output=xhtml';
94 if ($isadmin)
95 $metaentries['remote']['shib13-sp-remote'] = $metadata->getList('shib13-sp-remote');
96 } catch(Exception $e) {
97 SimpleSAML\Logger::error('Federation: Error loading shib13-idp: ' . $e->getMessage());
98 }
99}
100if ($config->getBoolean('enable.adfs-idp', FALSE) === true) {
101 try {
102 $metaentries['hosted']['adfs-idp'] = $metadata->getMetaDataCurrent('adfs-idp-hosted');
103 $metaentries['hosted']['adfs-idp']['metadata-url'] = SimpleSAML\Module::getModuleURL('adfs/idp/metadata.php',
104 array('output' => 'xhtml'));
105 if ($isadmin)
106 $metaentries['remote']['adfs-sp-remote'] = $metadata->getList('adfs-sp-remote');
107 } catch(Exception $e) {
108 SimpleSAML\Logger::error('Federation: Error loading adfs-idp: ' . $e->getMessage());
109 }
110}
111
112foreach ($metaentries['remote'] as $key => $value) {
113 if (empty($value)) {
114 unset($metaentries['remote'][$key]);
115 }
116}
117
118$t = new SimpleSAML_XHTML_Template($config, 'core:frontpage_federation.tpl.php');
119
120# look up translated string
121$mtype = array(
122 'saml20-sp-remote' => $t->noop('{admin:metadata_saml20-sp}'),
123 'saml20-sp-hosted' => $t->noop('{admin:metadata_saml20-sp}'),
124 'saml20-idp-remote' => $t->noop('{admin:metadata_saml20-idp}'),
125 'saml20-idp-hosted' => $t->noop('{admin:metadata_saml20-idp}'),
126 'shib13-sp-remote' => $t->noop('{admin:metadata_shib13-sp}'),
127 'shib13-sp-hosted' => $t->noop('{admin:metadata_shib13-sp}'),
128 'shib13-idp-remote' => $t->noop('{admin:metadata_shib13-idp}'),
129 'shib13-idp-hosted' => $t->noop('{admin:metadata_shib13-idp}'),
130 'adfs-sp-remote' => $t->noop('{admin:metadata_adfs-sp}'),
131 'adfs-sp-hosted' => $t->noop('{admin:metadata_adfs-sp}'),
132 'adfs-idp-remote' => $t->noop('{admin:metadata_adfs-idp}'),
133 'adfs-idp-hosted' => $t->noop('{admin:metadata_adfs-idp}'),
134);
135
136$t->data['pageid'] = 'frontpage_federation';
137$t->data['isadmin'] = $isadmin;
138$t->data['loginurl'] = $loginurl;
139
140
141$t->data['links'] = $links;
142$t->data['links_welcome'] = $links_welcome;
143$t->data['links_config'] = $links_config;
144$t->data['links_auth'] = $links_auth;
145$t->data['links_federation'] = $links_federation;
146
147
148
149$t->data['metaentries'] = $metaentries;
150$t->data['mtype'] = $mtype;
151
152
153$t->show();
154
An exception for terminatinating execution or to throw for unit testing.
static error($string)
Definition: Logger.php:168
static getModuleURL($resource, array $parameters=array())
Get absolute URL to a specified module resource.
Definition: Module.php:303
static callHooks($hook, &$data=null)
Call a hook in all enabled modules.
Definition: Module.php:364
static isAdmin()
Check whether the current user is admin.
Definition: Auth.php:42
static getAdminLoginURL($returnTo=null)
Retrieve a admin login URL.
Definition: Auth.php:22
static requireAdmin()
Require admin access to the current page.
Definition: Auth.php:60
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
static getMetadataHandler()
This function retrieves the current instance of the metadata handler.
static getSessionFromRequest()
Retrieves the current session.
Definition: Session.php:243
$key
Definition: croninfo.php:18
if($config->getBoolean('admin.protectindexpage', false)) $loginurl
if($isadmin) if( $config->getBoolean( 'enable.saml20-idp', FALSE)===true) if($config->getBoolean('enable.shib13-idp', FALSE)===true) if( $config->getBoolean( 'enable.adfs-idp', FALSE)===true) foreach($metaentries['remote'] as $key=> $value) $t
Attribute-related utility methods.
getBaseURL($t, $type='get', $key=null, $value=null)
Definition: showstats.php:133