Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.682 diff -u -p -r1.682 user.module --- modules/user/user.module 17 Sep 2006 19:14:16 -0000 1.682 +++ modules/user/user.module 19 Sep 2006 12:01:29 -0000 @@ -421,6 +421,8 @@ function user_file_download($file) { * Implementation of hook_search(). */ function user_search($op = 'search', $keys = NULL) { + global $user; + switch ($op) { case 'name': if (user_access('access user profiles')) { @@ -431,7 +433,12 @@ function user_search($op = 'search', $ke $find = array(); // Replace wildcards with MySQL/PostgreSQL wildcards. $keys = preg_replace('!\*+!', '%', $keys); - $result = pager_query("SELECT * FROM {users} WHERE LOWER(name) LIKE LOWER('%%%s%%')", 15, 0, NULL, $keys); + if ($user->uid == 1) { + $result = pager_query("SELECT * FROM {users} WHERE LOWER(name) LIKE LOWER('%%%s%%')", 15, 0, NULL, $keys); + } + else { + $result = pager_query("SELECT * FROM {users} WHERE status != 0 AND LOWER(name) LIKE LOWER('%%%s%%')", 15, 0, NULL, $keys); + } while ($account = db_fetch_object($result)) { $find[] = array('title' => $account->name, 'link' => url('user/'. $account->uid)); }