28if (!defined(
'NOREQUIREMENU')) {
29 define(
'NOREQUIREMENU',
'1');
31if (!defined(
'NOREQUIREHTML')) {
32 define(
'NOREQUIREHTML',
'1');
34if (!defined(
'NOREQUIREAJAX')) {
35 define(
'NOREQUIREAJAX',
'1');
43if (!defined(
'EVEN_IF_ONLY_LOGIN_ALLOWED')) {
44 define(
'EVEN_IF_ONLY_LOGIN_ALLOWED',
'1');
47require_once
'../main.inc.php';
50if (!empty($_SESSION[
"dol_authmode"]) && ($_SESSION[
"dol_authmode"] ==
'forceuser' || $_SESSION[
"dol_authmode"] ==
'http')) {
51 unset($_SESSION[
"dol_login"]);
52 unset($_SESSION[
'dol_entity']);
53 unset($_SESSION[
'urlfrom']);
54 die(
"Applicative disconnection should be useless when connection was made in mode ".$_SESSION[
"dol_authmode"]);
67$result = $user->call_trigger(
'USER_LOGOUT', $user);
75$hookmanager->initHooks(array(
'logout'));
77$reshook = $hookmanager->executeHooks(
'afterLogout', $parameters, $user, $action);
83$urlfrom = empty($_SESSION[
"urlfrom"]) ?
GETPOST(
'urlfrom') : $_SESSION[
"urlfrom"];
86$url = DOL_URL_ROOT.
"/index.php";
88 $url = DOL_URL_ROOT.$urlfrom;
94if (
GETPOST(
'dol_hide_topmenu')) {
95 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'dol_hide_topmenu=1';
97if (
GETPOST(
'dol_hide_leftmenu')) {
98 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'dol_hide_leftmenu=1';
100if (
GETPOST(
'dol_optimize_smallscreen')) {
101 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'dol_optimize_smallscreen=1';
103if (
GETPOST(
'dol_no_mouse_hover')) {
104 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'dol_no_mouse_hover=1';
106if (
GETPOST(
'dol_use_jmobile')) {
107 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'dol_use_jmobile=1';
113 if (strpos($url,
'/') === 0) {
114 $url = DOL_MAIN_URL_ROOT . $url;
121if (session_status() === PHP_SESSION_ACTIVE) {
127unset($_SESSION[
'dol_login']);
128unset($_SESSION[
'dol_entity']);
129unset($_SESSION[
'urlfrom']);
134header(
"Location: ".$url);
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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 a Dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.