19 require_once(
"../vendor/composer/vendor/autoload.php");
21 $q =
$DIC->http()->wrapper()->query();
25 &&
$q->retrieve(
'action',
$DIC->refinery()->to()->string()) ===
'logout' 30 $GLOBALS[
'DIC'][
'ilAuthSession']->logout();
51 $server =
new SoapServer(
'https://' .
$_SERVER[
'HTTP_HOST'] .
$_SERVER[
'SCRIPT_NAME'] .
'/LogoutNotification.wsdl');
52 $server->addFunction(
"LogoutNotification");
64 header(
'Content-Type: text/xml');
66 $url = filter_var(
"https://{$_SERVER['HTTP_HOST']}/shib_logout.php", FILTER_SANITIZE_URL);
69 <?xml version =
"1.0" encoding =
"UTF-8" ?>
70 <definitions name=
"LogoutNotification" 71 targetNamespace=
"urn:mace:shibboleth:2.0:sp:notify" 72 xmlns:notify=
"urn:mace:shibboleth:2.0:sp:notify" 73 xmlns:soap=
"http://schemas.xmlsoap.org/wsdl/soap/" 74 xmlns=
"http://schemas.xmlsoap.org/wsdl/">
77 <schema targetNamespace=
"urn:mace:shibboleth:2.0:sp:notify" 78 xmlns=
"http://www.w3.org/2000/10/XMLSchema" 79 xmlns:notify=
"urn:mace:shibboleth:2.0:sp:notify">
81 <simpleType name=
"string">
82 <restriction
base=
"string">
83 <minLength value=
"1"/>
87 <element name=
"OK" type=
"notify:OKType"/>
88 <complexType name=
"OKType">
95 <message name=
"getLogoutNotificationRequest">
96 <part name=
"SessionID" type=
"notify:string" />
99 <message name=
"getLogoutNotificationResponse" >
103 <portType name=
"LogoutNotificationPortType">
104 <operation name=
"LogoutNotification">
105 <input message=
"getLogoutNotificationRequest"/>
106 <output message=
"getLogoutNotificationResponse"/>
110 <binding name=
"LogoutNotificationBinding" type=
"notify:LogoutNotificationPortType">
111 <soap:binding style=
"rpc" transport=
"http://schemas.xmlsoap.org/soap/http"/>
112 <operation name=
"LogoutNotification">
113 <soap:operation soapAction=
"urn:xmethods-logout-notification#LogoutNotification"/>
117 <service name=
"LogoutNotificationService">
118 <port name=
"LogoutNotificationPort" binding=
"notify:LogoutNotificationBinding">
119 <soap:address location=
"{$url}"/>
129 function LogoutNotification($SessionID): ?\
SoapFault 139 $q =
"SELECT session_id, data FROM usr_session WHERE expires > 'NOW()'";
147 foreach ($user_session as $user_session_entry) {
149 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'])
151 return new SoapFault(
'LogoutError',
'Could not delete session entry in database.');
167 $a = preg_split(
"/(\w+)\|/", (
string) $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
168 $counter = count(
$a);
169 for ($i = 0; $i < $counter; $i += 2) {
170 $variables[
$a[$i]] = unserialize($a[$i + 1]);
unserializesession($serialized_string)
global $HTTP_RAW_POST_DATA
global $DIC
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static initILIAS()
ilias initialisation
static redirect(string $a_script)
static _destroy($a_session_id, ?int $a_closing_context=null, $a_expired_at=null)
Destroy session.
static init(string $a_type)
Init context by type.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...