19require_once(
"../vendor/composer/vendor/autoload.php");
21require_once(
"../artifacts/bootstrap_default.php");
25$q =
$DIC->http()->wrapper()->query();
29 &&
$q->retrieve(
'action',
$DIC->refinery()->to()->string()) ===
'logout'
34 $GLOBALS[
'DIC'][
'ilAuthSession']->logout();
48elseif (!empty(file_get_contents(
'php://input'))) {
55 $server =
new SoapServer(
'https://' .
$_SERVER[
'HTTP_HOST'] .
$_SERVER[
'SCRIPT_NAME'] .
'/LogoutNotification.wsdl');
56 $server->addFunction(
"LogoutNotification");
68 header(
'Content-Type: text/xml');
70 $url = filter_var(
"https://{$_SERVER['HTTP_HOST']}/shib_logout.php", FILTER_SANITIZE_URL);
73<?xml version =
"1.0" encoding =
"UTF-8" ?>
74<definitions name=
"LogoutNotification" targetNamespace=
"urn:mace:shibboleth:2.0:sp:notify"
75 xmlns:notify=
"urn:mace:shibboleth:2.0:sp:notify"
76 xmlns:soap=
"http://schemas.xmlsoap.org/wsdl/soap/"
77 xmlns=
"http://schemas.xmlsoap.org/wsdl/">
80 <schema targetNamespace=
"urn:mace:shibboleth:2.0:sp:notify"
81 xmlns=
"http://www.w3.org/2000/10/XMLSchema"
82 xmlns:notify=
"urn:mace:shibboleth:2.0:sp:notify">
84 <simpleType name=
"string">
85 <restriction
base=
"string">
86 <minLength value=
"1"/>
90 <element name=
"OK" type=
"notify:OKType"/>
91 <complexType name=
"OKType">
98 <message name=
"getLogoutNotificationRequest">
99 <part name=
"SessionID" type=
"notify:string" />
102 <message name=
"getLogoutNotificationResponse">
106 <portType name=
"LogoutNotificationPortType">
107 <operation name=
"LogoutNotification">
108 <input message=
"getLogoutNotificationRequest"/>
109 <output message=
"getLogoutNotificationResponse"/>
113 <binding name=
"LogoutNotificationBinding" type=
"notify:LogoutNotificationPortType">
114 <soap:binding style=
"rpc" transport=
"http://schemas.xmlsoap.org/soap/http"/>
115 <operation name=
"LogoutNotification">
116 <soap:operation soapAction=
"urn:xmethods-logout-notification#LogoutNotification"/>
120 <service name=
"LogoutNotificationService">
121 <port name=
"LogoutNotificationPort" binding=
"notify:LogoutNotificationBinding">
122 <soap:address location=
"{$url}"/>
132function LogoutNotification($SessionID): ?\SoapFault
142 $q =
"SELECT session_id, data FROM usr_session WHERE expires > 'NOW()'";
146 $session_data = unserializesession($session[
'data']);
149 is_array($session_data)
150 && array_key_exists(
'shibboleth_session_id', $session_data)
151 && $session_data[
'shibboleth_session_id'] === $SessionID
155 return new SoapFault(
'LogoutError',
'Could not delete session entry in database.');
167function unserializesession($serialized_string): array
172 for ($i = 0; $i <
$counter; $i += 2) {
173 $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)
$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...
PREG_SPLIT_NO_EMPTY PREG_SPLIT_DELIM_CAPTURE