ILIAS  release_8 Revision v8.23
saml2-logout.php
Go to the documentation of this file.
1 <?php
2 
19 $cookie_path = dirname(str_replace($_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF']));
20 
21 $_GET['client_id'] = substr(rtrim($_SERVER['PATH_INFO'], '/'), strrpos($_SERVER['PATH_INFO'], '/') + 1);
22 $_SERVER['PATH_INFO'] = substr($_SERVER['PATH_INFO'], 0, strrpos(rtrim($_SERVER['PATH_INFO'], '/'), '/'));
23 
24 chdir(__DIR__);
25 
27 
28 $i = 0;
29 while (!is_file($ilias_main_directory . 'ilias.ini.php') && $i < 20) {
30  $ilias_main_directory .= '../';
31  ++$i;
32 
33  $cookie_path = dirname($cookie_path);
34 }
36 
37 if (!is_file(getcwd() . '/ilias.ini.php')) {
38  die('Please ensure ILIAS is installed!');
39 }
40 
41 $cookie_path .= (!preg_match("/[\/|\\\\]$/", $cookie_path)) ? "/" : "";
42 
43 if (isset($_GET["client_id"])) {
44  if ($cookie_path === "\\") {
45  $cookie_path = '/';
46  }
47 
48  setcookie('ilClientId', $_GET['client_id'], 0, $cookie_path, '');
49  $_COOKIE['ilClientId'] = $_GET['client_id'];
50 }
51 define('IL_COOKIE_PATH', $cookie_path);
52 
53 require_once 'Services/Context/classes/class.ilContext.php';
55 
56 require_once 'Services/Init/classes/class.ilInitialisation.php';
58 
60 $auth = $factory->auth();
61 
63 $GLOBALS['DIC']['ilAuthSession']->logout();
64 
65 $GLOBALS['ilAppEventHandler']->raise(
66  'Services/Authentication',
67  'afterLogout',
68  [
69  'username' => $GLOBALS['DIC']->user()->getLogin(),
70  ]
71 );
72 
73 require_once 'libs/composer/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/saml2-logout.php';
$_GET['client_id']
$cookie_path
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$_SERVER['PATH_INFO']
$auth
$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 setClosingContext(int $a_context)
set closing context (for statistics)
static init(string $a_type)
Init context by type.
Class ilSamlAuthFactory.
$_COOKIE[session_name()]
Definition: xapitoken.php:54
$factory
$i