ILIAS  release_8 Revision v8.24
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
24chdir(__DIR__);
25
27
28$i = 0;
29while (!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
37if (!is_file(getcwd() . '/ilias.ini.php')) {
38 die('Please ensure ILIAS is installed!');
39}
40
41$cookie_path .= (!preg_match("/[\/|\\\\]$/", $cookie_path)) ? "/" : "";
42
43if (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}
51define('IL_COOKIE_PATH', $cookie_path);
52
53require_once 'Services/Context/classes/class.ilContext.php';
55
56require_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
73require_once 'libs/composer/vendor/simplesamlphp/simplesamlphp/modules/saml/www/sp/saml2-logout.php';
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
const CONTEXT_SAML
static init(string $a_type)
Init context by type.
static initILIAS()
ilias initialisation
Class ilSamlAuthFactory.
const SESSION_CLOSE_USER
static setClosingContext(int $a_context)
set closing context (for statistics)
$factory
$auth
$cookie_path
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$i
$_SERVER['PATH_INFO']
$_GET['client_id']
$ilias_main_directory
$_COOKIE[session_name()]
Definition: xapitoken.php:54