diff --git a/masquerade.module b/masquerade.module index b4311ef..35d29aa 100644 --- a/masquerade.module +++ b/masquerade.module @@ -555,9 +555,9 @@ function masquerade_block_1_submit($form, &$form_state) { */ function masquerade_autocomplete($string) { $matches = array(); - $result = db_query_range("SELECT u.name FROM {users} u WHERE LOWER(u.name) LIKE LOWER('%s%%')", $string, 0, 10); + $result = db_query_range("SELECT u.uid, u.name FROM {users} u WHERE LOWER(u.name) LIKE LOWER('%s%%')", $string, 0, 10); while ($user = db_fetch_object($result)) { - $matches[$user->name] = check_plain($user->name); + $matches[$user->name] = theme('username', $user); } if (stripos(variable_get('anonymous', t('Anonymous')), $string) === 0) { $matches[variable_get('anonymous', t('Anonymous'))] = variable_get('anonymous', t('Anonymous')); @@ -579,12 +579,12 @@ function masquerade_autocomplete_multiple($string) { $last_string = trim(array_pop($array)); $matches = array(); - $result = db_query_range("SELECT u.name FROM {users} u WHERE LOWER(u.name) LIKE LOWER('%s%%')", $last_string, 0, 10); + $result = db_query_range("SELECT u.uid, u.name FROM {users} u WHERE LOWER(u.name) LIKE LOWER('%s%%')", $last_string, 0, 10); $prefix = count($array) ? implode(', ', $array) .', ' : ''; while ($user = db_fetch_object($result)) { - $matches[$prefix . $user->name] = check_plain($user->name); + $matches[$prefix . $user->name] = theme('username', $user); } // This will add anonymous to the list, but not sorted. if (stripos(variable_get('anonymous', t('Anonymous')), $last_string) === 0) { @@ -612,9 +612,9 @@ function masquerade_autocomplete_user($string) { $matches = array(); if ($search) { $prefix = count($array) ? implode(', ', $array) .', ' : ''; - $result = db_query_range("SELECT name FROM {users} WHERE LOWER(name) LIKE LOWER('%s%%')", $search, 0, 10); + $result = db_query_range("SELECT uid, name FROM {users} WHERE LOWER(name) LIKE LOWER('%s%%')", $search, 0, 10); while ($user = db_fetch_object($result)) { - $matches[$prefix . $user->name] = check_plain($user->name); + $matches[$prefix . $user->name] = theme('username', $user); } }