3if (!isset($_REQUEST[
'id'])) {
7if (isset($_REQUEST[
'type'])) {
8 $type = (string) $_REQUEST[
'type'];
9 if (!in_array(
$type, array(
'init',
'js',
'nojs',
'embed'),
true)) {
16if (
$type !==
'embed') {
25if (
$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;
67foreach (
$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;
77 }
catch (Exception $e) {
78 $sp[
'core:Logout-IFrame:State'] =
'failed';
84if (
$state[
'core:TerminatedAssocId'] !==
null) {
85 $mdset =
'saml20-sp-remote';
86 if (substr(
$state[
'core:TerminatedAssocId'], 0, 4) ===
'adfs') {
87 $mdset =
'adfs-sp-remote';
96 $mdset =
'saml20-sp-remote';
98 $mdset =
'adfs-sp-remote';
108 'metadata' =>
$mdh->getMetaDataConfig(
$association[
'saml:entityID'], $mdset)->toArray(),
110 if (isset(
$association[
'core:Logout-IFrame:Timeout'])) {
119if (
$type ===
'nojs') {
134$t->data[
'from'] =
$state[
'core:Logout-IFrame:From'];
137$t->data[
'SPs'] =
$state[
'core:Logout-IFrame:Associations'];
139if (
$type !==
'nojs') {
141 $t->data[
'jquery'] = array(
'core' =>
true,
'ui' =>
false,
'css' =>
false);
An exception for terminatinating execution or to throw for unit testing.
static saveState(&$state, $stage, $rawId=false)
Save the state.
static loadState($id, $stage, $allowMissing=false)
Retrieve saved state.
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
static getByState(array &$state)
Retrieve the IdP "owning" the state.
static log($event, array $data=array())
Notify about an event.
if(!isset($associations[$assocId])) $association
if(!isset($_REQUEST['association'])) $assocId
if($type !=='init') $associations
foreach($state['core:Logout-IFrame:Associations'] as $assocId=> &$sp) $terminated
if($state['core:TerminatedAssocId'] !==null) $remaining
if($type !=='embed') $state