summaryrefslogtreecommitdiff
path: root/modules/user/user.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/user/user.module')
-rw-r--r--modules/user/user.module8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/user/user.module b/modules/user/user.module
index 2c02f8ce9..622fe4d25 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -933,14 +933,18 @@ function user_search_execute($keys = NULL, $conditions = NULL) {
$query = db_select('users')->extend('PagerDefault');
$query->fields('users', array('uid'));
if (user_access('administer users')) {
- // Administrators can also search in the otherwise private email field.
+ // Administrators can also search in the otherwise private email field,
+ // and they don't need to be restricted to only active users.
$query->fields('users', array('mail'));
$query->condition(db_or()->
condition('name', '%' . db_like($keys) . '%', 'LIKE')->
condition('mail', '%' . db_like($keys) . '%', 'LIKE'));
}
else {
- $query->condition('name', '%' . db_like($keys) . '%', 'LIKE');
+ // Regular users can only search via usernames, and we do not show them
+ // blocked accounts.
+ $query->condition('name', '%' . db_like($keys) . '%', 'LIKE')
+ ->condition('status', 1);
}
$uids = $query
->limit(15)