19require_once(
"../vendor/composer/vendor/autoload.php");
20require_once(
"../artifacts/bootstrap_default.php");
23$q =
$DIC->http()->wrapper()->query();
27 &&
$q->retrieve(
'action',
$DIC->refinery()->to()->string()) ===
'logout'
32 $GLOBALS[
'DIC'][
'ilAuthSession']->logout();
53 $server =
new SoapServer(
'https://' .
$_SERVER[
'HTTP_HOST'] .
$_SERVER[
'SCRIPT_NAME'] .
'/LogoutNotification.wsdl');
54 $server->addFunction(
"LogoutNotification");
66 header(
'Content-Type: text/xml');
68 $url = filter_var(
"https://{$_SERVER['HTTP_HOST']}/shib_logout.php", FILTER_SANITIZE_URL);
71<?xml version =
"1.0" encoding =
"UTF-8" ?>
72<definitions name=
"LogoutNotification"
73 targetNamespace=
"urn:mace:shibboleth:2.0:sp:notify"
74 xmlns:notify=
"urn:mace:shibboleth:2.0:sp:notify"
75 xmlns:soap=
"http://schemas.xmlsoap.org/wsdl/soap/"
76 xmlns=
"http://schemas.xmlsoap.org/wsdl/">
79 <schema targetNamespace=
"urn:mace:shibboleth:2.0:sp:notify"
80 xmlns=
"http://www.w3.org/2000/10/XMLSchema"
81 xmlns:notify=
"urn:mace:shibboleth:2.0:sp:notify">
83 <simpleType name=
"string">
84 <restriction
base=
"string">
85 <minLength value=
"1"/>
89 <element name=
"OK" type=
"notify:OKType"/>
90 <complexType name=
"OKType">
97 <message name=
"getLogoutNotificationRequest">
98 <part name=
"SessionID" type=
"notify:string" />
101 <message name=
"getLogoutNotificationResponse" >
105 <portType name=
"LogoutNotificationPortType">
106 <operation name=
"LogoutNotification">
107 <input message=
"getLogoutNotificationRequest"/>
108 <output message=
"getLogoutNotificationResponse"/>
112 <binding name=
"LogoutNotificationBinding" type=
"notify:LogoutNotificationPortType">
113 <soap:binding style=
"rpc" transport=
"http://schemas.xmlsoap.org/soap/http"/>
114 <operation name=
"LogoutNotification">
115 <soap:operation soapAction=
"urn:xmethods-logout-notification#LogoutNotification"/>
119 <service name=
"LogoutNotificationService">
120 <port name=
"LogoutNotificationPort" binding=
"notify:LogoutNotificationBinding">
121 <soap:address location=
"{$url}"/>
131function LogoutNotification($SessionID): ?\SoapFault
141 $q =
"SELECT session_id, data FROM usr_session WHERE expires > 'NOW()'";
145 $user_session = unserializesession($session_entry[
'data']);
149 foreach ($user_session as $user_session_entry) {
151 if (is_array($user_session_entry) && array_key_exists(
'shibboleth_session_id', $user_session_entry) && $user_session_entry[
'shibboleth_session_id'] == $SessionID && !
ilSession::_destroy($session_entry[
'session_id'])
153 return new SoapFault(
'LogoutError',
'Could not delete session entry in database.');
166function unserializesession($serialized_string): array
171 for ($i = 0; $i <
$counter; $i += 2) {
172 $variables[
$a[$i]] = unserialize(
$a[$i + 1]);
static init(string $a_type)
Init context by type.
static _destroy($a_session_id, ?int $a_closing_context=null, $a_expired_at=null)
Destroy session.
static redirect(string $a_script)
global $HTTP_RAW_POST_DATA
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
entry_point(string $name)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
PREG_SPLIT_NO_EMPTY PREG_SPLIT_DELIM_CAPTURE