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";
54 include_once
"Services/Context/classes/class.ilContext.php";
58 require_once(
"Services/Init/classes/class.ilInitialisation.php");
62 $server =
new SoapServer(
'https://'.$_SERVER[
'HTTP_HOST'].$_SERVER[
'PHP_SELF'].
'/LogoutNotification.wsdl');
63 $server->addFunction(
"LogoutNotification");
76 header(
'Content-Type: text/xml');
79 <?xml version =
"1.0" encoding =
"UTF-8" ?>
80 <definitions name=
"LogoutNotification"
81 targetNamespace=
"urn:mace:shibboleth:2.0:sp:notify"
82 xmlns:notify=
"urn:mace:shibboleth:2.0:sp:notify"
83 xmlns:soap=
"http://schemas.xmlsoap.org/wsdl/soap/"
84 xmlns=
"http://schemas.xmlsoap.org/wsdl/">
87 <schema targetNamespace=
"urn:mace:shibboleth:2.0:sp:notify"
88 xmlns=
"http://www.w3.org/2000/10/XMLSchema"
89 xmlns:notify=
"urn:mace:shibboleth:2.0:sp:notify">
91 <simpleType name=
"string">
92 <restriction base=
"string">
93 <minLength value=
"1"/>
97 <element name=
"OK" type=
"notify:OKType"/>
98 <complexType name=
"OKType">
105 <message name=
"getLogoutNotificationRequest">
106 <part name=
"SessionID" type=
"notify:string" />
109 <message name=
"getLogoutNotificationResponse" >
113 <portType name=
"LogoutNotificationPortType">
114 <operation name=
"LogoutNotification">
115 <input message=
"getLogoutNotificationRequest"/>
116 <output message=
"getLogoutNotificationResponse"/>
120 <binding name=
"LogoutNotificationBinding" type=
"notify:LogoutNotificationPortType">
121 <soap:binding style=
"rpc" transport=
"http://schemas.xmlsoap.org/soap/http"/>
122 <operation name=
"LogoutNotification">
123 <soap:operation soapAction=
"urn:xmethods-logout-notification#LogoutNotification"/>
127 <service name=
"LogoutNotificationService">
128 <port name=
"LogoutNotificationPort" binding=
"notify:LogoutNotificationBinding">
129 <soap:address location=
"https://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}"/>
140 function LogoutNotification($SessionID){
150 $q =
"SELECT session_id, data FROM usr_session WHERE expires > 'NOW()'";
151 $r = $ilDB->query($q);
155 $user_session = unserializesession($session_entry[
'data']);
159 foreach($user_session as $user_session_entry){
161 is_array($user_session_entry)
162 && array_key_exists(
'shibboleth_session_id', $user_session_entry)
163 && $user_session_entry[
'shibboleth_session_id'] == $SessionID){
167 return new SoapFault(
'LogoutError',
'Could not delete session entry in database.');
178 function unserializesession( $serialized_string ){
179 $variables = array( );
180 $a = preg_split(
"/(\w+)\|/", $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
181 for( $i = 0; $i < count( $a ); $i = $i+2 ) {
182 $variables[$a[$i]] = unserialize( $a[$i+1] );
184 return( $variables );