25 ini_set(
"soap.wsdl_cache_enabled",
"0");
46 isset(
$_GET[
'return'])
47 && isset(
$_GET[
'action'])
48 &&
$_GET[
'action'] ==
'logout'
52 require_once
"include/inc.header.php";
75 require_once(
"Services/Init/classes/class.ilInitialisation.php");
81 $server =
new SoapServer(
'https://'.$_SERVER[
'HTTP_HOST'].$_SERVER[
'PHP_SELF'].
'/LogoutNotification.wsdl');
82 $server->addFunction(
"LogoutNotification");
95 header(
'Content-Type: text/xml');
98 <?xml version =
"1.0" encoding =
"UTF-8" ?>
99 <definitions name=
"LogoutNotification"
100 targetNamespace=
"urn:mace:shibboleth:2.0:sp:notify"
101 xmlns:notify=
"urn:mace:shibboleth:2.0:sp:notify"
102 xmlns:soap=
"http://schemas.xmlsoap.org/wsdl/soap/"
103 xmlns=
"http://schemas.xmlsoap.org/wsdl/">
106 <schema targetNamespace=
"urn:mace:shibboleth:2.0:sp:notify"
107 xmlns=
"http://www.w3.org/2000/10/XMLSchema"
108 xmlns:notify=
"urn:mace:shibboleth:2.0:sp:notify">
110 <simpleType name=
"string">
111 <restriction base=
"string">
112 <minLength value=
"1"/>
116 <element name=
"OK" type=
"notify:OKType"/>
117 <complexType name=
"OKType">
124 <message name=
"getLogoutNotificationRequest">
125 <part name=
"SessionID" type=
"notify:string" />
128 <message name=
"getLogoutNotificationResponse" >
132 <portType name=
"LogoutNotificationPortType">
133 <operation name=
"LogoutNotification">
134 <input message=
"getLogoutNotificationRequest"/>
135 <output message=
"getLogoutNotificationResponse"/>
139 <binding name=
"LogoutNotificationBinding" type=
"notify:LogoutNotificationPortType">
140 <soap:binding style=
"rpc" transport=
"http://schemas.xmlsoap.org/soap/http"/>
141 <operation name=
"LogoutNotification">
142 <soap:operation soapAction=
"urn:xmethods-logout-notification#LogoutNotification"/>
146 <service name=
"LogoutNotificationService">
147 <port name=
"LogoutNotificationPort" binding=
"notify:LogoutNotificationBinding">
148 <soap:address location=
"https://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}"/>
159 function LogoutNotification($SessionID){
169 $q =
"SELECT session_id, data FROM usr_session WHERE expires > 'NOW()'";
170 $r = $ilDB->query($q);
174 $user_session = unserializesession($session_entry[
'data']);
178 foreach($user_session as $user_session_entry){
180 is_array($user_session_entry)
181 && array_key_exists(
'shibboleth_session_id', $user_session_entry)
182 && $user_session_entry[
'shibboleth_session_id'] == $SessionID){
186 return new SoapFault(
'LogoutError',
'Could not delete session entry in database.');
197 function unserializesession( $serialized_string ){
198 $variables = array( );
199 $a = preg_split(
"/(\w+)\|/", $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
200 for( $i = 0; $i < count( $a ); $i = $i+2 ) {
201 $variables[$a[$i]] = unserialize( $a[$i+1] );
203 return( $variables );