I have created a patch to integrate alt_login in masquerade block.
If alt_login module is detected, autocomplete field is changed to search also in alt_login. It don't need to change anything else because just username is used.
--- a/masquerade.module
+++ b/masquerade.module
@@ -555,9 +555,14 @@ 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);
+ if (module_exists('alt_login')) {
+ $result = db_query_range("SELECT u.name, a.alt_login FROM {users} u LEFT JOIN {alt_login} a ON a.uid = u.uid WHERE LOWER(u.name) LIKE LOWER('%s%%') OR LOWER(a.alt_login) LIKE LOWER('%s%%')", $string, $string, 0, 10);
+ }
+ else {
+ $result = db_query_range("SELECT 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] = check_plain($user->name. (module_exists('alt_login') ? ' - '. $user->alt_login : ''));
}
if (stripos(variable_get('anonymous', t('Anonymous')), $string) === 0) {
$matches[variable_get('anonymous', t('Anonymous'))] = variable_get('anonymous', t('Anonymous'));
I think my patch complements #287496: bogus integration with alt_login
Comments
Comment #1
avpadernoI am closing this feature request, as Drupal 6 is no longer supported. Please re-open it if you would like the feature implemented in the Drupal 7 or 8 version of the module.