3 if (!isset($_REQUEST[
'id'])) {
7 if (isset($_REQUEST[
'type'])) {
9 if (!in_array(
$type,
array(
'init',
'js',
'nojs',
'embed'),
true)) {
16 if (
$type !==
'embed') {
25 if (
$type !==
'init') {
26 foreach (
$state[
'core:Logout-IFrame:Associations'] as
$assocId => &$sp) {
30 if ($sp[
'core:Logout-IFrame:State'] ===
'onhold') {
31 $sp[
'core:Logout-IFrame:State'] =
'inprogress';
35 if (isset($_REQUEST[$spId])) {
36 $s = $_REQUEST[$spId];
37 if (
$s ==
'completed' ||
$s ==
'failed') {
38 $sp[
'core:Logout-IFrame:State'] =
$s;
43 if (isset($sp[
'core:Logout-IFrame:Timeout']) && $sp[
'core:Logout-IFrame:Timeout'] <
time()) {
44 if ($sp[
'core:Logout-IFrame:State'] ===
'inprogress') {
45 $sp[
'core:Logout-IFrame:State'] =
'failed';
50 if ($sp[
'core:Logout-IFrame:State'] ===
'completed') {
54 if (!isset($sp[
'core:Logout-IFrame:Timeout'])) {
55 if (method_exists($sp[
'Handler'],
'getAssociationConfig')) {
57 $assocConfig = call_user_func(
array($sp[
'Handler'],
'getAssociationConfig'), $assocIdP, $sp);
58 $sp[
'core:Logout-IFrame:Timeout'] = $assocConfig->getInteger(
'core:logout-timeout', 5) +
time();
60 $sp[
'core:Logout-IFrame:Timeout'] =
time() + 5;
67 foreach (
$state[
'core:Logout-IFrame:Associations'] as
$assocId => &$sp) {
70 $sp[
'core:Logout-IFrame:State'] =
'completed';
75 $url = call_user_func(
array($sp[
'Handler'],
'getLogoutURL'), $assocIdP, $sp, null);
76 $sp[
'core:Logout-IFrame:URL'] =
$url;
78 $sp[
'core:Logout-IFrame:State'] =
'failed';
84 if (
$state[
'core:TerminatedAssocId'] !== null) {
85 $mdset =
'saml20-sp-remote';
86 if (substr(
$state[
'core:TerminatedAssocId'], 0, 4) ===
'adfs') {
87 $mdset =
'adfs-sp-remote';
95 $key = sha1($association[
'id']);
96 $mdset =
'saml20-sp-remote';
97 if (substr($association[
'id'], 0, 4) ===
'adfs') {
98 $mdset =
'adfs-sp-remote';
102 'id' => $association[
'id'],
103 'expires_on' => $association[
'Expires'],
104 'entityID' => $association[
'saml:entityID'],
105 'subject' => $association[
'saml:NameID'],
106 'status' => $association[
'core:Logout-IFrame:State'],
107 'logoutURL' => $association[
'core:Logout-IFrame:URL'],
108 'metadata' =>
$mdh->getMetaDataConfig($association[
'saml:entityID'], $mdset)->toArray(),
110 if (isset($association[
'core:Logout-IFrame:Timeout'])) {
111 $remaining[
$key][
'timeout'] = $association[
'core:Logout-IFrame:Timeout'];
119 if (
$type ===
'nojs') {
134 $t->data[
'from'] =
$state[
'core:Logout-IFrame:From'];
137 $t->data[
'SPs'] =
$state[
'core:Logout-IFrame:Associations'];
139 if (
$type !==
'nojs') {
141 $t->data[
'jquery'] =
array(
'core' =>
true,
'ui' =>
false,
'css' =>
false);
static getByState(array &$state)
Retrieve the IdP "owning" the state.
if($state['core:TerminatedAssocId'] !==null) $remaining
static loadState($id, $stage, $allowMissing=false)
Retrieve saved state.
Create styles array
The data for the language used.
if(!isset($associations[$assocId])) $association
if($type !=='init') $associations
if(!isset($_REQUEST['association'])) $assocId
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
foreach($state['core:Logout-IFrame:Associations'] as $assocId=> &$sp) $terminated
static saveState(&$state, $stage, $rawId=false)
Save the state.
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
if($type !=='embed') $state
static log($event, array $data=array())
Notify about an event.