- Patch #20255 by Cvbge: simplified a query in the throttle.module. Fixes a PostgreSQL compatibility bug too.

4.7.x
Dries Buytaert 2005-08-30 15:04:54 +00:00
parent 246274eb16
commit 7e5d0c947a
2 changed files with 2 additions and 2 deletions

View File

@ -56,7 +56,7 @@ function throttle_exit() {
$guests = 0;
}
if ($max_users = variable_get('throttle_user', 0)) {
$users = db_result(db_query('SELECT COUNT(DISTINCT(uid)) AS count FROM {sessions} WHERE timestamp >= %d AND uid != 0 GROUP BY uid ORDER BY timestamp DESC', time() - $time_period));
$users = db_result(db_query('SELECT COUNT(DISTINCT(uid)) AS count FROM {sessions} WHERE timestamp >= %d AND uid != 0', time() - $time_period));
}
else {
$users = 0;

View File

@ -56,7 +56,7 @@ function throttle_exit() {
$guests = 0;
}
if ($max_users = variable_get('throttle_user', 0)) {
$users = db_result(db_query('SELECT COUNT(DISTINCT(uid)) AS count FROM {sessions} WHERE timestamp >= %d AND uid != 0 GROUP BY uid ORDER BY timestamp DESC', time() - $time_period));
$users = db_result(db_query('SELECT COUNT(DISTINCT(uid)) AS count FROM {sessions} WHERE timestamp >= %d AND uid != 0', time() - $time_period));
}
else {
$users = 0;