Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
ab1d68d1
Commit
ab1d68d1
authored
Dec 4, 2006
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#90612
by Bart Jansens: user_logout should only end the current session.
parent
47f527fb
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
includes/bootstrap.inc
+1
-1
1 addition, 1 deletion
includes/bootstrap.inc
includes/session.inc
+11
-3
11 additions, 3 deletions
includes/session.inc
modules/user/user.module
+3
-3
3 additions, 3 deletions
modules/user/user.module
with
15 additions
and
7 deletions
includes/bootstrap.inc
+
1
−
1
View file @
ab1d68d1
...
...
@@ -731,7 +731,7 @@ function _drupal_bootstrap($phase) {
case
DRUPAL_BOOTSTRAP_SESSION
:
require_once
'./includes/session.inc'
;
session_set_save_handler
(
"
sess_open
"
,
"
sess_close
"
,
"
sess_read
"
,
"
sess_write
"
,
"
sess_destroy
"
,
"
sess_gc
"
);
session_set_save_handler
(
'
sess_open
'
,
'
sess_close
'
,
'
sess_read
'
,
'
sess_write
'
,
'
sess_destroy
_sid'
,
'
sess_gc
'
);
session_start
();
break
;
...
...
This diff is collapsed.
Click to expand it.
includes/session.inc
+
11
−
3
View file @
ab1d68d1
...
...
@@ -125,13 +125,21 @@ function sess_count($timestamp = 0, $anonymous = true) {
/**
* Called by PHP session handling with the PHP session ID to end a user's session.
* Can also be called directly, either with the PHP session ID or another identifier
* such as uid to end a specific user's session.
*
* @param string $sid
* the session id
*/
function
sess_destroy_sid
(
$sid
)
{
db_query
(
"DELETE FROM
{
sessions
}
WHERE sid = '%s'"
,
$sid
);
}
/**
* End a specific user's session
*
* @param string $uid
* the user id
*/
function
sess_destroy
(
$uid
)
{
function
sess_destroy
_uid
(
$uid
)
{
db_query
(
'DELETE FROM {sessions} WHERE uid = %d'
,
$uid
);
}
...
...
This diff is collapsed.
Click to expand it.
modules/user/user.module
+
3
−
3
View file @
ab1d68d1
...
...
@@ -148,7 +148,7 @@ function user_save($account, $array = array(), $category = 'account') {
// Delete a blocked user's sessions to kick them if they are online.
if
(
isset
(
$array
[
'status'
])
&&
$array
[
'status'
]
==
0
)
{
sess_destroy
(
$account
->
uid
);
sess_destroy
_uid
(
$account
->
uid
);
}
// Refresh user object
...
...
@@ -1014,7 +1014,7 @@ function user_logout() {
watchdog
(
'user'
,
t
(
'Session closed for %name.'
,
array
(
'%name'
=>
$user
->
name
)));
// Destroy the current session:
sess_destroy
(
$user
->
uid
);
sess
ion
_destroy
();
module_invoke_all
(
'user'
,
'logout'
,
NULL
,
$user
);
// Load the anonymous user
...
...
@@ -1444,7 +1444,7 @@ function user_confirm_delete($name, $uid) {
*/
function
user_delete
(
$edit
,
$uid
)
{
$account
=
user_load
(
array
(
'uid'
=>
$uid
));
sess_destroy
(
$uid
);
sess_destroy
_uid
(
$uid
);
db_query
(
'DELETE FROM {users} WHERE uid = %d'
,
$uid
);
db_query
(
'DELETE FROM {users_roles} WHERE uid = %d'
,
$uid
);
db_query
(
'DELETE FROM {authmap} WHERE uid = %d'
,
$uid
);
...
...
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