ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
logout-iframe-done.php
Go to the documentation of this file.
1
<?
php
2
3
if
(!isset($_REQUEST[
'id'
])) {
4
throw
new
SimpleSAML_Error_BadRequest
(
'Missing required parameter: id'
);
5
}
6
$state
=
SimpleSAML_Auth_State::loadState
($_REQUEST[
'id'
],
'core:Logout-IFrame'
);
7
$idp
=
SimpleSAML_IdP::getByState
(
$state
);
8
9
$associations
=
$idp
->getAssociations();
10
11
if
(!isset($_REQUEST[
'cancel'
])) {
12
SimpleSAML\Logger::stats
(
'slo-iframe done'
);
13
SimpleSAML_Stats::log
(
'core:idp:logout-iframe:page'
, array(
'type'
=>
'done'
));
14
$SPs
=
$state
[
'core:Logout-IFrame:Associations'
];
15
}
else
{
16
// user skipped global logout
17
SimpleSAML\Logger::stats
(
'slo-iframe skip'
);
18
SimpleSAML_Stats::log
(
'core:idp:logout-iframe:page'
, array(
'type'
=>
'skip'
));
19
$SPs
= array();
// no SPs should have been logged out
20
$state
[
'core:Failed'
] =
true
;
// mark as partial logout
21
}
22
23
// find the status of all SPs
24
foreach
(
$SPs
as
$assocId
=> &$sp) {
25
$spId =
'logout-iframe-'
.sha1(
$assocId
);
26
27
if
(isset($_REQUEST[$spId])) {
28
$spStatus
= $_REQUEST[$spId];
29
if
(
$spStatus
===
'completed'
||
$spStatus
===
'failed'
) {
30
$sp[
'core:Logout-IFrame:State'
] =
$spStatus
;
31
}
32
}
33
34
if
(!isset(
$associations
[
$assocId
])) {
35
$sp[
'core:Logout-IFrame:State'
] =
'completed'
;
36
}
37
}
38
39
40
// terminate the associations
41
foreach
(
$SPs
as
$assocId
=> $sp) {
42
if
($sp[
'core:Logout-IFrame:State'
] ===
'completed'
) {
43
$idp
->terminateAssociation(
$assocId
);
44
}
else
{
45
SimpleSAML\Logger::warning
(
'Unable to terminate association with '
.var_export(
$assocId
,
true
).
'.'
);
46
if
(isset($sp[
'saml:entityID'
])) {
47
$spId = $sp[
'saml:entityID'
];
48
}
else
{
49
$spId =
$assocId
;
50
}
51
SimpleSAML\Logger::stats
(
'slo-iframe-fail '
.$spId);
52
SimpleSAML_Stats::log
(
'core:idp:logout-iframe:spfail'
, array(
'sp'
=> $spId));
53
$state
[
'core:Failed'
] =
true
;
54
}
55
}
56
57
// we are done
58
$idp
->finishLogout(
$state
);
SimpleSAML_IdP\getByState
static getByState(array &$state)
Retrieve the IdP "owning" the state.
Definition:
IdP.php:145
SimpleSAML\Logger\stats
static stats($string)
Definition:
Logger.php:222
SimpleSAML_Error_BadRequest
Definition:
BadRequest.php:12
$state
if(!isset($_REQUEST['id'])) $state
Definition:
logout-iframe-done.php:6
$idp
$idp
Definition:
logout-iframe-done.php:7
SimpleSAML\Logger\warning
static warning($string)
Definition:
Logger.php:177
$SPs
$SPs
Definition:
logout-iframe-done.php:19
SimpleSAML_Auth_State\loadState
static loadState($id, $stage, $allowMissing=false)
Retrieve saved state.
Definition:
State.php:259
$spStatus
$spStatus
Definition:
logout-iframe.php:24
$assocId
if(!isset($_REQUEST['association'])) $assocId
Definition:
logout-iframe-post.php:12
php
$associations
$associations
Definition:
logout-iframe-done.php:9
SimpleSAML_Stats\log
static log($event, array $data=array())
Notify about an event.
Definition:
Stats.php:71
libs
composer
vendor
simplesamlphp
simplesamlphp
modules
core
www
idp
logout-iframe-done.php
Generated on Thu Jan 16 2025 19:01:56 for ILIAS by
1.8.13 (using
Doxyfile
)