ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
saml2-logout.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4$cookie_path = dirname(str_replace($_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF']));
5
6$_GET['client_id'] = substr(rtrim($_SERVER['PATH_INFO'], '/'), strrpos($_SERVER['PATH_INFO'], '/') + 1);
7$_SERVER['PATH_INFO'] = substr($_SERVER['PATH_INFO'], 0, strrpos(rtrim($_SERVER['PATH_INFO'], '/'), '/'));
8
9chdir(dirname(__FILE__));
10
12
13$i = 0;
14while(!file_exists($ilias_main_directory . 'ilias.ini.php') && $i < 20)
15{
16 $ilias_main_directory .= '../';
17 ++$i;
18
19 $cookie_path = dirname($cookie_path);
20}
22
23if(!file_exists(getcwd() . '/ilias.ini.php'))
24{
25 die('Please ensure ILIAS is installed!');
26}
27
28$cookie_path .= (!preg_match("/[\/|\\\\]$/", $cookie_path)) ? "/" : "";
29
30if(isset($_GET["client_id"]))
31{
32 if($cookie_path == "\\")
33 {
34 $cookie_path = '/';
35 }
36
37 setcookie('ilClientId', $_GET['client_id'], 0, $cookie_path, '');
38 $_COOKIE['ilClientId'] = $_GET['client_id'];
39}
40define('IL_COOKIE_PATH', $cookie_path);
41
42require_once 'Services/Context/classes/class.ilContext.php';
44
45require_once 'Services/Init/classes/class.ilInitialisation.php';
47
48require_once 'Services/Saml/classes/class.ilSamlAuthFactory.php';
50$auth = $factory->auth();
51
53$GLOBALS['DIC']['ilAuthSession']->logout();
54
55$GLOBALS['ilAppEventHandler']->raise(
56 'Services/Authentication',
57 'afterLogout',
58 array(
59 'username' => $GLOBALS['DIC']->user()->getLogin()
60 )
61);
62
63require_once 'libs/composer/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/saml2-logout.php';
user()
Definition: user.php:4
$factory
$cookie_path
Definition: saml2-logout.php:4
$auth
$i
$_SERVER['PATH_INFO']
Definition: saml2-logout.php:7
$_GET['client_id']
Definition: saml2-logout.php:6
$ilias_main_directory
$_COOKIE['client_id']
Definition: server.php:9
An exception for terminatinating execution or to throw for unit testing.
static init($a_type)
Init context by type.
const CONTEXT_SAML
static initILIAS()
ilias initialisation
Class ilSamlAuthFactory.
const SESSION_CLOSE_USER
static setClosingContext($a_context)
set closing context (for statistics)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.