ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 
9 chdir(dirname(__FILE__));
10 
12 
13 $i = 0;
14 while (!file_exists($ilias_main_directory . 'ilias.ini.php') && $i < 20) {
15  $ilias_main_directory .= '../';
16  ++$i;
17 
18  $cookie_path = dirname($cookie_path);
19 }
21 
22 if (!file_exists(getcwd() . '/ilias.ini.php')) {
23  die('Please ensure ILIAS is installed!');
24 }
25 
26 $cookie_path .= (!preg_match("/[\/|\\\\]$/", $cookie_path)) ? "/" : "";
27 
28 if (isset($_GET["client_id"])) {
29  if ($cookie_path == "\\") {
30  $cookie_path = '/';
31  }
32 
33  setcookie('ilClientId', $_GET['client_id'], 0, $cookie_path, '');
34  $_COOKIE['ilClientId'] = $_GET['client_id'];
35 }
36 define('IL_COOKIE_PATH', $cookie_path);
37 
38 require_once 'Services/Context/classes/class.ilContext.php';
40 
41 require_once 'Services/Init/classes/class.ilInitialisation.php';
43 
45 $auth = $factory->auth();
46 
48 $GLOBALS['DIC']['ilAuthSession']->logout();
49 
50 $GLOBALS['ilAppEventHandler']->raise(
51  'Services/Authentication',
52  'afterLogout',
53  [
54  'username' => $GLOBALS['DIC']->user()->getLogin(),
55  ]
56 );
57 
58 require_once 'libs/composer/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/saml2-logout.php';
$_GET['client_id']
Definition: saml2-logout.php:6
$_SERVER['PATH_INFO']
Definition: saml2-logout.php:7
$auth
user()
Definition: user.php:4
$ilias_main_directory
static initILIAS()
ilias initialisation
const CONTEXT_SAML
const SESSION_CLOSE_USER
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static init($a_type)
Init context by type.
static setClosingContext($a_context)
set closing context (for statistics)
Class ilSamlAuthFactory.
$_COOKIE[session_name()]
Definition: xapitoken.php:37
$factory
$cookie_path
Definition: saml2-logout.php:4
$i