- Patch #20255 by Cvbge: simplified a query in the throttle.module. Fixes a PostgreSQL compatibility bug too.
parent
246274eb16
commit
7e5d0c947a
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue