Commit 905a679c authored by Dries's avatar Dries

- Patch #89964 by jvandyk: improved performance of user_is_blocked() by removing a redundant query.

parent e070e832
......@@ -375,10 +375,9 @@ function user_access($string, $account = NULL) {
* @return boolean TRUE for blocked users, FALSE for active
*/
function user_is_blocked($name) {
$allow = db_fetch_object(db_query("SELECT * FROM {users} WHERE status = 1 AND name = LOWER('%s')", $name));
$deny = db_fetch_object(db_query("SELECT * FROM {users} WHERE status = 0 AND name = LOWER('%s')", $name));
$deny = db_fetch_object(db_query("SELECT name FROM {users} WHERE status = 0 AND name = LOWER('%s')", $name));
return $deny && !$allow;
return $deny;
}
function user_fields() {
......
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