Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
0f91dce4
Commit
0f91dce4
authored
Jan 07, 2005
by
Dries Buytaert
Browse files
- Patch
#15247
by Drumm: simplified the logout code.
parent
1e66e1ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/user.module
View file @
0f91dce4
...
...
@@ -691,15 +691,12 @@ function user_menu($may_cache) {
if
(
$user
->
uid
)
{
$items
[]
=
array
(
'path'
=>
'user/'
.
$user
->
uid
,
'title'
=>
t
(
'my account'
),
'callback'
=>
'user_page'
,
'access'
=>
TRUE
);
$items
[]
=
array
(
'path'
=>
'logout'
,
'title'
=>
t
(
'log out'
),
'access'
=>
TRUE
,
'callback'
=>
'user_logout'
,
'weight'
=>
10
);
}
else
{
$items
[]
=
array
(
'path'
=>
'logout'
,
'title'
=>
t
(
'log out'
),
'callback'
=>
'user_logout'
,
'access'
=>
FALSE
);
}
$items
[]
=
array
(
'path'
=>
'logout'
,
'title'
=>
t
(
'log out'
),
'access'
=>
$user
->
uid
!=
0
,
'callback'
=>
'user_logout'
,
'weight'
=>
10
);
}
else
{
if
(
arg
(
0
)
==
'user'
&&
is_numeric
(
arg
(
1
)))
{
...
...
@@ -897,14 +894,12 @@ function _user_authenticated_id() {
function
user_logout
()
{
global
$user
;
if
(
$user
->
uid
)
{
watchdog
(
'user'
,
t
(
'Session closed for %name.'
,
array
(
'%name'
=>
"<em>
$user->name
</em>"
)));
watchdog
(
'user'
,
t
(
'Session closed for %name.'
,
array
(
'%name'
=>
'<em>'
.
$user
->
name
.
'</em>'
)));
// Destroy the current session:
session_destroy
();
module_invoke_all
(
'user'
,
'logout'
,
NULL
,
$user
);
unset
(
$user
);
}
// Destroy the current session:
session_destroy
();
module_invoke_all
(
'user'
,
'logout'
,
NULL
,
$user
);
unset
(
$user
);
drupal_goto
();
}
...
...
@@ -1215,9 +1210,6 @@ function user_page() {
case
'login'
:
print
theme
(
'page'
,
user_login
(
$edit
));
break
;
case
'logout'
:
print
user_logout
();
break
;
default
:
if
(
!
arg
(
1
))
{
if
(
$user
->
uid
)
{
...
...
modules/user/user.module
View file @
0f91dce4
...
...
@@ -691,15 +691,12 @@ function user_menu($may_cache) {
if
(
$user
->
uid
)
{
$items
[]
=
array
(
'path'
=>
'user/'
.
$user
->
uid
,
'title'
=>
t
(
'my account'
),
'callback'
=>
'user_page'
,
'access'
=>
TRUE
);
$items[] = array('path' => 'logout', 'title' => t('log out'),
'access' => TRUE,
'callback' => 'user_logout',
'weight' => 10);
}
else {
$items[] = array('path' => 'logout', 'title' => t('log out'),
'callback' => 'user_logout', 'access' => FALSE);
}
$items
[]
=
array
(
'path'
=>
'logout'
,
'title'
=>
t
(
'log out'
),
'access'
=>
$user
->
uid
!=
0
,
'callback'
=>
'user_logout'
,
'weight'
=>
10
);
}
else
{
if
(
arg
(
0
)
==
'user'
&&
is_numeric
(
arg
(
1
)))
{
...
...
@@ -897,14 +894,12 @@ function _user_authenticated_id() {
function
user_logout
()
{
global
$user
;
if ($user->uid) {
watchdog('user', t('Session closed for %name.', array('%name' => "<em>$user->name</em>")));
watchdog
(
'user'
,
t
(
'Session closed for %name.'
,
array
(
'%name'
=>
'<em>'
.
$user
->
name
.
'</em>'
)));
// Destroy the current session:
session_destroy();
module_invoke_all('user', 'logout', NULL, $user);
unset($user);
}
// Destroy the current session:
session_destroy
();
module_invoke_all
(
'user'
,
'logout'
,
NULL
,
$user
);
unset
(
$user
);
drupal_goto
();
}
...
...
@@ -1215,9 +1210,6 @@ function user_page() {
case
'login'
:
print
theme
(
'page'
,
user_login
(
$edit
));
break
;
case 'logout':
print user_logout();
break;
default
:
if
(
!
arg
(
1
))
{
if
(
$user
->
uid
)
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment