27 if (!defined(
'NOREQUIREMENU')) {
28 define(
'NOREQUIREMENU',
'1');
30 if (!defined(
'NOREQUIREHTML')) {
31 define(
'NOREQUIREHTML',
'1');
33 if (!defined(
'NOREQUIREAJAX')) {
34 define(
'NOREQUIREAJAX',
'1');
42 if (!defined(
'EVEN_IF_ONLY_LOGIN_ALLOWED')) {
43 define(
'EVEN_IF_ONLY_LOGIN_ALLOWED',
'1');
46 require_once
'../main.inc.php';
49 if (!empty($_SESSION[
"dol_authmode"]) && ($_SESSION[
"dol_authmode"] ==
'forceuser' || $_SESSION[
"dol_authmode"] ==
'http')) {
50 unset($_SESSION[
"dol_login"]);
51 die(
"Applicative disconnection should be useless when connection was made in mode ".$_SESSION[
"dol_authmode"]);
54 global $conf, $langs, $user;
57 $result = $user->call_trigger(
'USER_LOGOUT', $user);
65 $hookmanager->initHooks(array(
'logout'));
66 $parameters = array();
67 $reshook = $hookmanager->executeHooks(
'afterLogout', $parameters, $user, $action);
73 $urlfrom = empty($_SESSION[
"urlfrom"]) ?
'' : $_SESSION[
"urlfrom"];
76 $url = DOL_URL_ROOT.
"/index.php";
78 $url = DOL_URL_ROOT.$urlfrom;
80 if (!empty($conf->global->MAIN_LOGOUT_GOTO_URL)) {
81 $url = $conf->global->MAIN_LOGOUT_GOTO_URL;
84 if (
GETPOST(
'dol_hide_topmenu')) {
85 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'dol_hide_topmenu=1';
87 if (
GETPOST(
'dol_hide_leftmenu')) {
88 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'dol_hide_leftmenu=1';
90 if (
GETPOST(
'dol_optimize_smallscreen')) {
91 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'dol_optimize_smallscreen=1';
93 if (
GETPOST(
'dol_no_mouse_hover')) {
94 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'dol_no_mouse_hover=1';
96 if (
GETPOST(
'dol_use_jmobile')) {
97 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'dol_use_jmobile=1';
102 if (session_status() === PHP_SESSION_ACTIVE) {
108 unset($_SESSION[
'dol_login']);
109 unset($_SESSION[
'dol_entity']);
110 unset($_SESSION[
'urlfrom']);
115 header(
"Location: ".$url);
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.