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 @@ -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_access('administer users')) { + $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 access !=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)); }