27if (!defined(
'NOREQUIREMENU')) {
28 define(
'NOREQUIREMENU',
'1');
30if (!defined(
'NOREQUIREHTML')) {
31 define(
'NOREQUIREHTML',
'1');
33if (!defined(
'NOREQUIREAJAX')) {
34 define(
'NOREQUIREAJAX',
'1');
42if (!defined(
'EVEN_IF_ONLY_LOGIN_ALLOWED')) {
43 define(
'EVEN_IF_ONLY_LOGIN_ALLOWED',
'1');
46require_once
'../main.inc.php';
49if (!empty($_SESSION[
"dol_authmode"]) && ($_SESSION[
"dol_authmode"] ==
'forceuser' || $_SESSION[
"dol_authmode"] ==
'http')) {
50 unset($_SESSION[
"dol_login"]);
51 unset($_SESSION[
'dol_entity']);
52 unset($_SESSION[
'urlfrom']);
53 die(
"Applicative disconnection should be useless when connection was made in mode ".$_SESSION[
"dol_authmode"]);
59$result = $user->call_trigger(
'USER_LOGOUT', $user);
67$hookmanager->initHooks(array(
'logout'));
69$reshook = $hookmanager->executeHooks(
'afterLogout', $parameters, $user, $action);
75$urlfrom = empty($_SESSION[
"urlfrom"]) ?
GETPOST(
'urlfrom') : $_SESSION[
"urlfrom"];
78$url = DOL_URL_ROOT.
"/index.php";
80 $url = DOL_URL_ROOT.$urlfrom;
86if (
GETPOST(
'dol_hide_topmenu')) {
87 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'dol_hide_topmenu=1';
89if (
GETPOST(
'dol_hide_leftmenu')) {
90 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'dol_hide_leftmenu=1';
92if (
GETPOST(
'dol_optimize_smallscreen')) {
93 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'dol_optimize_smallscreen=1';
95if (
GETPOST(
'dol_no_mouse_hover')) {
96 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'dol_no_mouse_hover=1';
98if (
GETPOST(
'dol_use_jmobile')) {
99 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'dol_use_jmobile=1';
104if (session_status() === PHP_SESSION_ACTIVE) {
110unset($_SESSION[
'dol_login']);
111unset($_SESSION[
'dol_entity']);
112unset($_SESSION[
'urlfrom']);
117header(
"Location: ".$url);
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.