summaryrefslogtreecommitdiff
path: root/includes/session.inc
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-02-18 15:19:57 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-02-18 15:19:57 +0000
commitff9e842730ccf251cf8b76401e4df1b1c6edcea2 (patch)
tree2b10ab740305648bee997708b6d651a3816e3545 /includes/session.inc
parentdf591c8f4032041613192e1b7836725f92ea7b10 (diff)
downloadbrdo-ff9e842730ccf251cf8b76401e4df1b1c6edcea2.tar.gz
brdo-ff9e842730ccf251cf8b76401e4df1b1c6edcea2.tar.bz2
#330983 by recidive and boombatower: Rename users/users_roles tables to user/user_role for consistency.
Diffstat (limited to 'includes/session.inc')
-rw-r--r--includes/session.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/session.inc b/includes/session.inc
index aa06db4ca..141af2f8f 100644
--- a/includes/session.inc
+++ b/includes/session.inc
@@ -83,7 +83,7 @@ function _sess_read($key) {
// Otherwise, if the session is still active, we have a record of the
// client's session in the database.
- $user = db_query("SELECT u.*, s.* FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.sid = :sid", array(':sid' => $key))->fetchObject();
+ $user = db_query("SELECT u.*, s.* FROM {user} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.sid = :sid", array(':sid' => $key))->fetchObject();
// We found the client's session record and they are an authenticated user.
if ($user && $user->uid > 0) {
@@ -93,7 +93,7 @@ function _sess_read($key) {
// Add roles element to $user.
$user->roles = array();
$user->roles[DRUPAL_AUTHENTICATED_RID] = 'authenticated user';
- $user->roles += db_query("SELECT r.rid, r.name FROM {role} r INNER JOIN {users_roles} ur ON ur.rid = r.rid WHERE ur.uid = :uid", array(':uid' => $user->uid))->fetchAllKeyed(0, 1);
+ $user->roles += db_query("SELECT r.rid, r.name FROM {role} r INNER JOIN {user_role} ur ON ur.rid = r.rid WHERE ur.uid = :uid", array(':uid' => $user->uid))->fetchAllKeyed(0, 1);
}
// We didn't find the client's record (session has expired), or they
// are an anonymous user.
@@ -146,7 +146,7 @@ function _sess_write($key, $value) {
// Last access time is updated no more frequently than once every 180 seconds.
// This reduces contention in the users table.
if ($user->uid && REQUEST_TIME - $user->access > variable_get('session_write_interval', 180)) {
- db_update('users')
+ db_update('user')
->fields(array(
'access' => REQUEST_TIME
))