16 require_once(
"libs/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)
139 $q =
"SELECT session_id, data FROM usr_session WHERE expires > 'NOW()'";
147 foreach ($user_session as $user_session_entry) {
148 if (is_array($user_session_entry)
149 && array_key_exists(
'shibboleth_session_id', $user_session_entry)
150 && $user_session_entry[
'shibboleth_session_id'] == $SessionID
154 return new SoapFault(
'LogoutError',
'Could not delete session entry in database.');
166 $variables = array();
167 $a = preg_split(
"/(\w+)\|/", $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
168 for ($i = 0; $i < count(
$a); $i = $i + 2) {
169 $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