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
GitLab 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
No related tags found
No related merge requests found
Changes
1
Show 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
...
@@ -33,12 +33,12 @@ if (! defined('EVEN_IF_ONLY_LOGIN_ALLOWED')) define('EVEN_IF_ONLY_LOGIN_ALLOWED
require_once
'../main.inc.php'
;
require_once
'../main.inc.php'
;
// This can happen only with a bookmark or forged url call.
// This can happen only with a bookmark or forged url call.
if
(
!
empty
(
$_SESSION
[
"dol_authmode"
])
&&
(
$_SESSION
[
"dol_authmode"
]
==
'forceuser'
if
(
!
empty
(
$_SESSION
[
"dol_authmode"
])
&&
(
$_SESSION
[
"dol_authmode"
]
==
'forceuser'
||
$_SESSION
[
"dol_authmode"
]
==
'http'
))
||
$_SESSION
[
"dol_authmode"
]
==
'http'
))
{
{
die
(
"Disconnection does not work when connection was made in mode "
.
$_SESSION
[
"dol_authmode"
]);
die
(
"Disconnection does not work when connection was made in mode "
.
$_SESSION
[
"dol_authmode"
]);
}
}
// Appel des triggers
// Appel des triggers
include_once
DOL_DOCUMENT_ROOT
.
'/core/class/interfaces.class.php'
;
include_once
DOL_DOCUMENT_ROOT
.
'/core/class/interfaces.class.php'
;
$interface
=
new
Interfaces
(
$db
);
$interface
=
new
Interfaces
(
$db
);
...
@@ -53,13 +53,16 @@ $urlfrom=empty($_SESSION["urlfrom"])?'':$_SESSION["urlfrom"];
...
@@ -53,13 +53,16 @@ $urlfrom=empty($_SESSION["urlfrom"])?'':$_SESSION["urlfrom"];
// TODO external module
// TODO external module
if
(
!
empty
(
$conf
->
phenix
->
enabled
)
&&
!
empty
(
$conf
->
phenix
->
cookie
))
if
(
!
empty
(
$conf
->
phenix
->
enabled
)
&&
!
empty
(
$conf
->
phenix
->
cookie
))
{
{
// Destroy cookie
setcookie
(
$conf
->
phenix
->
cookie
,
''
,
1
,
"/"
);
setcookie
(
$conf
->
phenix
->
cookie
,
''
,
1
,
"/"
);
}
}
// Destroy object of session
// Define url to go
unset
(
$_SESSION
[
'dol_login'
]);
$url
=
DOL_URL_ROOT
.
"/index.php"
;
// By default go to login page
unset
(
$_SESSION
[
'dol_entity'
]);
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
// Destroy session
$prefix
=
dol_getprefix
();
$prefix
=
dol_getprefix
();
...
@@ -70,10 +73,9 @@ session_name($sessionname);
...
@@ -70,10 +73,9 @@ session_name($sessionname);
session_destroy
();
session_destroy
();
dol_syslog
(
"End of session "
.
$sessionname
);
dol_syslog
(
"End of session "
.
$sessionname
);
// Define url to go
// TODO Not sure this is required
$url
=
DOL_URL_ROOT
.
"/index.php"
;
// By default go to login page
unset
(
$_SESSION
[
'dol_login'
]);
if
(
$urlfrom
)
$url
=
DOL_URL_ROOT
.
$urlfrom
;
unset
(
$_SESSION
[
'dol_entity'
]);
if
(
!
empty
(
$conf
->
global
->
MAIN_LOGOUT_GOTO_URL
))
$url
=
$conf
->
global
->
MAIN_LOGOUT_GOTO_URL
;
//print 'url='.$url;exit;
//print 'url='.$url;exit;
header
(
"Location: "
.
$url
);
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