16 require_once(
"../vendor/composer/vendor/autoload.php");
18 $q =
$DIC->http()->wrapper()->query();
22 &&
$q->retrieve(
'action',
$DIC->refinery()->to()->string()) ===
'logout' 27 $GLOBALS[
'DIC'][
'ilAuthSession']->logout();
48 $server =
new SoapServer(
'https://' .
$_SERVER[
'HTTP_HOST'] .
$_SERVER[
'SCRIPT_NAME'] .
'/LogoutNotification.wsdl');
49 $server->addFunction(
"LogoutNotification");
61 header(
'Content-Type: text/xml');
63 $url = filter_var(
"https://{$_SERVER['HTTP_HOST']}/shib_logout.php", FILTER_SANITIZE_URL);
66 <?xml version =
"1.0" encoding =
"UTF-8" ?>
67 <definitions name=
"LogoutNotification" 68 targetNamespace=
"urn:mace:shibboleth:2.0:sp:notify" 69 xmlns:notify=
"urn:mace:shibboleth:2.0:sp:notify" 70 xmlns:soap=
"http://schemas.xmlsoap.org/wsdl/soap/" 71 xmlns=
"http://schemas.xmlsoap.org/wsdl/">
74 <schema targetNamespace=
"urn:mace:shibboleth:2.0:sp:notify" 75 xmlns=
"http://www.w3.org/2000/10/XMLSchema" 76 xmlns:notify=
"urn:mace:shibboleth:2.0:sp:notify">
78 <simpleType name=
"string">
79 <restriction
base=
"string">
80 <minLength value=
"1"/>
84 <element name=
"OK" type=
"notify:OKType"/>
85 <complexType name=
"OKType">
92 <message name=
"getLogoutNotificationRequest">
93 <part name=
"SessionID" type=
"notify:string" />
96 <message name=
"getLogoutNotificationResponse" >
100 <portType name=
"LogoutNotificationPortType">
101 <operation name=
"LogoutNotification">
102 <input message=
"getLogoutNotificationRequest"/>
103 <output message=
"getLogoutNotificationResponse"/>
107 <binding name=
"LogoutNotificationBinding" type=
"notify:LogoutNotificationPortType">
108 <soap:binding style=
"rpc" transport=
"http://schemas.xmlsoap.org/soap/http"/>
109 <operation name=
"LogoutNotification">
110 <soap:operation soapAction=
"urn:xmethods-logout-notification#LogoutNotification"/>
114 <service name=
"LogoutNotificationService">
115 <port name=
"LogoutNotificationPort" binding=
"notify:LogoutNotificationBinding">
116 <soap:address location=
"{$url}"/>
126 function LogoutNotification($SessionID)
136 $q =
"SELECT session_id, data FROM usr_session WHERE expires > 'NOW()'";
144 foreach ($user_session as $user_session_entry) {
145 if (is_array($user_session_entry)
146 && array_key_exists(
'shibboleth_session_id', $user_session_entry)
147 && $user_session_entry[
'shibboleth_session_id'] == $SessionID
151 return new SoapFault(
'LogoutError',
'Could not delete session entry in database.');
163 $variables = array();
164 $a = preg_split(
"/(\w+)\|/", $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
165 for ($i = 0; $i < count(
$a); $i = $i + 2) {
166 $variables[
$a[$i]] = unserialize($a[$i + 1]);
global $HTTP_RAW_POST_DATA
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.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) unserializesession($serialized_string)
static init(string $a_type)
Init context by type.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples