Commit 134c9eb8 authored by Dries's avatar Dries

- Added some missing {} to make database prefixing work.  Patch by Moshe.
parent 7f6ecbec
......@@ -645,15 +645,15 @@ function user_login($edit = array(), $msg = "") {
if ($user->uid) {
// update the user's session if it already exists
db_query("UPDATE sessions SET timestamp = '%d' WHERE sid = '%s'", time(), session_id());
db_query("UPDATE {sessions} SET timestamp = '%d' WHERE sid = '%s'", time(), session_id());
// if no changes, this is a new session to be added
if (!db_affected_rows()) {
db_query("INSERT INTO sessions (uid, sid, hostname, timestamp) values(%d, '%s', '%s', %d)", $user->uid, session_id(), $_SERVER["REMOTE_ADDR"], time());
db_query("INSERT INTO {sessions} (uid, sid, hostname, timestamp) values(%d, '%s', '%s', %d)", $user->uid, session_id(), $_SERVER["REMOTE_ADDR"], time());
}
// also update the user table timestamp noting user has logged in
db_query("UPDATE users SET timestamp = '%d' WHERE uid = '%s'", time(), $user->uid);
db_query("UPDATE {users} SET timestamp = '%d' WHERE uid = '%s'", time(), $user->uid);
}
/*
......
......@@ -645,15 +645,15 @@ function user_login($edit = array(), $msg = "") {
if ($user->uid) {
// update the user's session if it already exists
db_query("UPDATE sessions SET timestamp = '%d' WHERE sid = '%s'", time(), session_id());
db_query("UPDATE {sessions} SET timestamp = '%d' WHERE sid = '%s'", time(), session_id());
// if no changes, this is a new session to be added
if (!db_affected_rows()) {
db_query("INSERT INTO sessions (uid, sid, hostname, timestamp) values(%d, '%s', '%s', %d)", $user->uid, session_id(), $_SERVER["REMOTE_ADDR"], time());
db_query("INSERT INTO {sessions} (uid, sid, hostname, timestamp) values(%d, '%s', '%s', %d)", $user->uid, session_id(), $_SERVER["REMOTE_ADDR"], time());
}
// also update the user table timestamp noting user has logged in
db_query("UPDATE users SET timestamp = '%d' WHERE uid = '%s'", time(), $user->uid);
db_query("UPDATE {users} SET timestamp = '%d' WHERE uid = '%s'", time(), $user->uid);
}
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment