dolibarr 20.0.0
logout.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2023-2024 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2023-2024 Lionel Vessiller <lvessiller@easya.solutions>
4 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
26define('WEBPORTAL_NOREQUIREUSER', 1);
27define('WEBPORTAL_NOREQUIRETRAN', 1);
28define('WEBPORTAL_NOLOGIN', 1);
29
30if (!defined('NOREQUIREHTML')) {
31 define('NOREQUIREHTML', '1');
32}
33if (!defined('NOREQUIREAJAX')) {
34 define('NOREQUIREAJAX', '1');
35}
36
37include 'webportal.main.inc.php';
38
39global $db;
40
42$context = Context::getInstance();
43
44// Destroy session
45dol_syslog("End of session " . session_id());
46if (session_status() === PHP_SESSION_ACTIVE) {
47 session_destroy();
48}
49
50// Not sure this is required
51if (isset($_SESSION['webportal_logged_thirdparty_account_id'])) unset($_SESSION['webportal_logged_thirdparty_account_id']);
52
53if (GETPOST('noredirect')) {
54 return;
55}
56header("Location: " . $context->rootUrl); // Default behaviour is redirect to index.php page
57
58// End of page
59$db->close();
static getInstance()
Singleton method to create one instance of this object.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.