5 ini_set(
"soap.wsdl_cache_enabled",
"0");
26 isset(
$_GET[
'return'])
27 && isset(
$_GET[
'action'])
28 &&
$_GET[
'action'] ==
'logout'
32 require_once
"include/inc.header.php";
55 require_once(
"Services/Init/classes/class.ilInitialisation.php");
61 $server =
new SoapServer(
'https://'.$_SERVER[
'HTTP_HOST'].$_SERVER[
'PHP_SELF'].
'/LogoutNotification.wsdl');
62 $server->addFunction(
"LogoutNotification");
75 header(
'Content-Type: text/xml');
78 <?xml version =
"1.0" encoding =
"UTF-8" ?>
79 <definitions name=
"LogoutNotification"
80 targetNamespace=
"urn:mace:shibboleth:2.0:sp:notify"
81 xmlns:notify=
"urn:mace:shibboleth:2.0:sp:notify"
82 xmlns:soap=
"http://schemas.xmlsoap.org/wsdl/soap/"
83 xmlns=
"http://schemas.xmlsoap.org/wsdl/">
86 <schema targetNamespace=
"urn:mace:shibboleth:2.0:sp:notify"
87 xmlns=
"http://www.w3.org/2000/10/XMLSchema"
88 xmlns:notify=
"urn:mace:shibboleth:2.0:sp:notify">
90 <simpleType name=
"string">
91 <restriction base=
"string">
92 <minLength value=
"1"/>
96 <element name=
"OK" type=
"notify:OKType"/>
97 <complexType name=
"OKType">
104 <message name=
"getLogoutNotificationRequest">
105 <part name=
"SessionID" type=
"notify:string" />
108 <message name=
"getLogoutNotificationResponse" >
112 <portType name=
"LogoutNotificationPortType">
113 <operation name=
"LogoutNotification">
114 <input message=
"getLogoutNotificationRequest"/>
115 <output message=
"getLogoutNotificationResponse"/>
119 <binding name=
"LogoutNotificationBinding" type=
"notify:LogoutNotificationPortType">
120 <soap:binding style=
"rpc" transport=
"http://schemas.xmlsoap.org/soap/http"/>
121 <operation name=
"LogoutNotification">
122 <soap:operation soapAction=
"urn:xmethods-logout-notification#LogoutNotification"/>
126 <service name=
"LogoutNotificationService">
127 <port name=
"LogoutNotificationPort" binding=
"notify:LogoutNotificationBinding">
128 <soap:address location=
"https://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}"/>
139 function LogoutNotification($SessionID){
149 $q =
"SELECT session_id, data FROM usr_session WHERE expires > 'NOW()'";
150 $r = $ilDB->query($q);
154 $user_session = unserializesession($session_entry[
'data']);
158 foreach($user_session as $user_session_entry){
160 is_array($user_session_entry)
161 && array_key_exists(
'shibboleth_session_id', $user_session_entry)
162 && $user_session_entry[
'shibboleth_session_id'] == $SessionID){
166 return new SoapFault(
'LogoutError',
'Could not delete session entry in database.');
177 function unserializesession( $serialized_string ){
178 $variables = array( );
179 $a = preg_split(
"/(\w+)\|/", $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
180 for( $i = 0; $i < count( $a ); $i = $i+2 ) {
181 $variables[$a[$i]] = unserialize( $a[$i+1] );
183 return( $variables );