Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
bbe68e34
Commit
bbe68e34
authored
12 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix: dol_hide_topmenu and dol_hide_leftmenu not lost after logout
parent
df08d838
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/user/logout.php
+12
-10
12 additions, 10 deletions
htdocs/user/logout.php
with
12 additions
and
10 deletions
htdocs/user/logout.php
+
12
−
10
View file @
bbe68e34
...
...
@@ -33,12 +33,12 @@ if (! defined('EVEN_IF_ONLY_LOGIN_ALLOWED')) define('EVEN_IF_ONLY_LOGIN_ALLOWED
require_once
'../main.inc.php'
;
// This can happen only with a bookmark or forged url call.
if
(
!
empty
(
$_SESSION
[
"dol_authmode"
])
&&
(
$_SESSION
[
"dol_authmode"
]
==
'forceuser'
||
$_SESSION
[
"dol_authmode"
]
==
'http'
))
if
(
!
empty
(
$_SESSION
[
"dol_authmode"
])
&&
(
$_SESSION
[
"dol_authmode"
]
==
'forceuser'
||
$_SESSION
[
"dol_authmode"
]
==
'http'
))
{
die
(
"Disconnection does not work when connection was made in mode "
.
$_SESSION
[
"dol_authmode"
]);
}
// Appel des triggers
include_once
DOL_DOCUMENT_ROOT
.
'/core/class/interfaces.class.php'
;
$interface
=
new
Interfaces
(
$db
);
...
...
@@ -53,13 +53,16 @@ $urlfrom=empty($_SESSION["urlfrom"])?'':$_SESSION["urlfrom"];
// TODO external module
if
(
!
empty
(
$conf
->
phenix
->
enabled
)
&&
!
empty
(
$conf
->
phenix
->
cookie
))
{
// Destroy cookie
setcookie
(
$conf
->
phenix
->
cookie
,
''
,
1
,
"/"
);
}
// Destroy object of session
unset
(
$_SESSION
[
'dol_login'
]);
unset
(
$_SESSION
[
'dol_entity'
]);
// Define url to go
$url
=
DOL_URL_ROOT
.
"/index.php"
;
// By default go to login page
if
(
$urlfrom
)
$url
=
DOL_URL_ROOT
.
$urlfrom
;
if
(
!
empty
(
$conf
->
global
->
MAIN_LOGOUT_GOTO_URL
))
$url
=
$conf
->
global
->
MAIN_LOGOUT_GOTO_URL
;
if
(
!
empty
(
$_SESSION
[
'dol_hide_topmenu'
]))
$url
.
=
(
preg_match
(
'/\?/'
,
$url
)
?
'&'
:
'?'
)
.
'dol_hide_topmenu=1'
;
if
(
!
empty
(
$_SESSION
[
'dol_hide_leftmenu'
]))
$url
.
=
(
preg_match
(
'/\?/'
,
$url
)
?
'&'
:
'?'
)
.
'dol_hide_leftmenu=1'
;
// Destroy session
$prefix
=
dol_getprefix
();
...
...
@@ -70,10 +73,9 @@ session_name($sessionname);
session_destroy
();
dol_syslog
(
"End of session "
.
$sessionname
);
// Define url to go
$url
=
DOL_URL_ROOT
.
"/index.php"
;
// By default go to login page
if
(
$urlfrom
)
$url
=
DOL_URL_ROOT
.
$urlfrom
;
if
(
!
empty
(
$conf
->
global
->
MAIN_LOGOUT_GOTO_URL
))
$url
=
$conf
->
global
->
MAIN_LOGOUT_GOTO_URL
;
// TODO Not sure this is required
unset
(
$_SESSION
[
'dol_login'
]);
unset
(
$_SESSION
[
'dol_entity'
]);
//print 'url='.$url;exit;
header
(
"Location: "
.
$url
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment