I have about 350 users of my Drupal 6.16 web site. I need a way to quickly edit individual user records in the Administration section, which means finding them first. The Advanced User module doesn't work for me: I have to search on someone's exact name to find it; I need to be able to search on a partial name and then pick from the results.

(I searched for a module to do this but can't find one.)

Comments

drupalshrek’s picture

Me too! If you find one, let me know!

drupalshrek

drupalshrek’s picture

Don't know if this one is any good:
http://drupal.org/project/user_search

drupalshrek

drupalshrek’s picture

I've now tested it, and the story is as follows: basically it works!!

It is sure rough round the edges, but I was, for the first time able to search on a string and it would find all usernames with that string in. Great!!

A few things to note:

  • the download is a bit weird, because the module owner hasn't yet made it a "proper" module, but when you download the code file, it does unpack to a normal module structure
  • there is missing the essential "user_search.info" file. You will need to create such a file and put the following contents in it:
    name = User search
    description = User search
    core = 6.x
    

This file goes of course with the other files for this module.

  • When you've done that and uploaded, you can go to the following URL (on your site) and search for user names: http://example.com/search/user

    Great module! I'll try and get the owner to release it...

  • drupalshrek

    mcfilms’s picture

    You can do this with Views and it works great. You can easily create a view of all your users and expose certain fields (First Name, Last Name, User Name, Role) and type all or part of their name and find them. It's awesome.

    A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com

    ArtistConk’s picture

    I second that approach.

    drupalshrek’s picture

    I'm sure you're right with what you say, but...

    Can you please explain in more detail, to me and other rather-more-novice admins, exactly what the Views setup is. Thanks!

    drupalshrek

    mcfilms’s picture

    There is documentation in the Views help on how to do create a list of users:

    http://views-help.doc.logrus.com/help/views/example-users-by-role

    From there do some research on "Views Exposed Filters". There are some great Views video tutorials out there by Learn By The Drop and Mustardseed Media.

    A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com

    drupalshrek’s picture

    OK, thanks, I'll have a look.

    I must say that even if views can do it, I do like the user_search module, the fact that you can drop it in and get a search box straight away. Nothing to learn or read! :-)

    drupalshrek

    ArtistConk’s picture

    There are inherent limitations to adding lots of modules to your site. Take every opportunity to streamline your configuration, as this keeps administration cleaner and generally promotes better performance.

    ressa’s picture

    • Add a new View of View type 'User'
    • Add a filter, 'User: User raw name'
    • Add 2 Fields: 'User: Name' and 'User: Uid'
    • Change 'Style' to 'Table'
    • Under 'Access', select 'Role' and the 'Administrator' role (install http://drupal.org/project/adminrole)
    • Select 'Page' and click 'Add display'
    • Under 'Page settings' enter Path 'usernamesearch', and a Menu if you want to

    Check if it works, save it and start using it :-)


    Try Drupal 8 at simplytest.me
    Linuxgirl’s picture

    Thank you for your help, this was just what I needed. A perfect solution without module cluttering.

    And if you add also the field "User: edit link" (I'm not sure it's the right name, my Drupal is localized to German), you can even edit the user you were looking for right away just like in site user search.
    As for the search, the browser search will do fine.

    harryster’s picture

    $view = new view;
    $view->name = 'user_admin_view';
    $view->description = 'User admin page';
    $view->tag = 'User admin page';
    $view->base_table = 'users';
    $view->core = 6;
    $view->api_version = '2';
    $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
    $handler = $view->new_display('default', 'Standards', 'default');
    $handler->override_option('relationships', array(
    'content_profile_rel' => array(
    'id' => 'content_profile_rel',
    'table' => 'users',
    'field' => 'content_profile_rel',
    ),
    ));
    $handler->override_option('fields', array(
    'picture' => array(
    'label' => 'Bild',
    'alter' => array(
    'alter_text' => 0,
    'text' => '',
    'make_link' => 0,
    'path' => '',
    'absolute' => 0,
    'link_class' => '',
    'alt' => '',
    'rel' => '',
    'prefix' => '',
    'suffix' => '',
    'target' => '',
    'help' => '',
    'trim' => 0,
    'max_length' => '',
    'word_boundary' => 1,
    'ellipsis' => 1,
    'html' => 0,
    'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'hide_alter_empty' => 1,
    'imagecache_preset' => 'user-s',
    'exclude' => 0,
    'id' => 'picture',
    'table' => 'users',
    'field' => 'picture',
    'override' => array(
    'button' => 'Übersteuern',
    ),
    'relationship' => 'none',
    ),
    'name' => array(
    'label' => 'Name',
    'alter' => array(
    'alter_text' => 0,
    'text' => '',
    'make_link' => 0,
    'path' => '',
    'absolute' => 0,
    'link_class' => '',
    'alt' => '',
    'rel' => '',
    'prefix' => '',
    'suffix' => '',
    'target' => '',
    'help' => '',
    'trim' => 0,
    'max_length' => '',
    'word_boundary' => 1,
    'ellipsis' => 1,
    'html' => 0,
    'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'hide_alter_empty' => 1,
    'link_to_user' => 1,
    'overwrite_anonymous' => 0,
    'anonymous_text' => '',
    'exclude' => 0,
    'id' => 'name',
    'table' => 'users',
    'field' => 'name',
    'relationship' => 'none',
    ),
    'uid' => array(
    'label' => 'Uid',
    'alter' => array(
    'alter_text' => 0,
    'text' => '',
    'make_link' => 0,
    'path' => '',
    'absolute' => 0,
    'link_class' => '',
    'alt' => '',
    'rel' => '',
    'prefix' => '',
    'suffix' => '',
    'target' => '',
    'help' => '',
    'trim' => 0,
    'max_length' => '',
    'word_boundary' => 1,
    'ellipsis' => 1,
    'html' => 0,
    'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'hide_alter_empty' => 1,
    'link_to_user' => 1,
    'exclude' => 0,
    'id' => 'uid',
    'table' => 'users',
    'field' => 'uid',
    'relationship' => 'none',
    ),
    'rid' => array(
    'label' => 'Rollen',
    'alter' => array(
    'alter_text' => 0,
    'text' => '',
    'make_link' => 0,
    'path' => '',
    'absolute' => 0,
    'link_class' => '',
    'alt' => '',
    'rel' => '',
    'prefix' => '',
    'suffix' => '',
    'target' => '',
    'help' => '',
    'trim' => 0,
    'max_length' => '',
    'word_boundary' => 1,
    'ellipsis' => 1,
    'html' => 0,
    'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'hide_alter_empty' => 1,
    'type' => 'separator',
    'separator' => ', ',
    'exclude' => 0,
    'id' => 'rid',
    'table' => 'users_roles',
    'field' => 'rid',
    'relationship' => 'none',
    ),
    'groups' => array(
    'label' => 'User\'s groups',
    'alter' => array(
    'alter_text' => FALSE,
    'text' => '',
    'make_link' => FALSE,
    'path' => '',
    'absolute' => '',
    'alt' => '',
    'rel' => '',
    'link_class' => '',
    'prefix' => '',
    'suffix' => '',
    'target' => '',
    'trim' => FALSE,
    'max_length' => '',
    'word_boundary' => TRUE,
    'ellipsis' => TRUE,
    'strip_tags' => FALSE,
    'html' => FALSE,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'hide_alter_empty' => 1,
    'type' => 'separator',
    'separator' => ', ',
    'exclude' => 0,
    'id' => 'groups',
    'table' => 'og_uid',
    'field' => 'groups',
    'override' => array(
    'button' => 'Übersteuern',
    ),
    'relationship' => 'none',
    ),
    'edit_node' => array(
    'label' => '',
    'alter' => array(
    'alter_text' => 0,
    'text' => '',
    'make_link' => 0,
    'path' => '',
    'absolute' => 0,
    'link_class' => '',
    'alt' => '',
    'rel' => '',
    'prefix' => '',
    'suffix' => '',
    'target' => '',
    'help' => '',
    'trim' => 0,
    'max_length' => '',
    'word_boundary' => 1,
    'ellipsis' => 1,
    'html' => 0,
    'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'hide_alter_empty' => 1,
    'text' => '',
    'exclude' => 0,
    'id' => 'edit_node',
    'table' => 'users',
    'field' => 'edit_node',
    'relationship' => 'none',
    ),
    ));
    $handler->override_option('arguments', array(
    'name2' => array(
    'id' => 'name2',
    'table' => 'users',
    'field' => 'name2',
    'validate_user_argument_type' => 'uid',
    'validate_user_roles' => array(
    2 => 0,
    3 => 0,
    6 => 0,
    4 => 0,
    5 => 0,
    ),
    'relationship' => 'none',
    'title' => '',
    'breadcrumb' => '',
    'default_action' => 'ignore',
    'wildcard' => '',
    'wildcard_substitution' => '',
    'default_options_div_prefix' => '',
    'default_argument_type' => '',
    'default_taxonomy_tid_term_page' => 0,
    'default_taxonomy_tid_node' => 0,
    'default_taxonomy_tid_limit' => 0,
    'default_taxonomy_tid_vids' => array(
    3 => 0,
    1 => 0,
    2 => 0,
    5 => 0,
    4 => 0,
    8 => 0,
    6 => 0,
    ),
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_type' => 'user',
    'validate_argument_node_type' => array(
    'blog' => 0,
    'event' => 0,
    'feed_ical' => 0,
    'feed_ical_item' => 0,
    'group' => 0,
    'profile' => 0,
    'exhibit' => 0,
    'biblio' => 0,
    'focusgroup' => 0,
    'organisation' => 0,
    'project' => 0,
    'panel' => 0,
    'folder' => 0,
    'book' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
    3 => 0,
    1 => 0,
    2 => 0,
    5 => 0,
    4 => 0,
    8 => 0,
    6 => 0,
    ),
    'validate_argument_type' => 'tid',
    'validate_argument_transform' => 0,
    'validate_user_restrict_roles' => 0,
    'validate_argument_is_member' => '0',
    'validate_argument_group_node_type' => array(
    'group' => 0,
    'focusgroup' => 0,
    'project' => 0,
    ),
    'validate_argument_php' => '',
    'validate_fail' => 'ignore',
    ),
    ));
    $handler->override_option('filters', array(
    'name' => array(
    'operator' => 'contains',
    'value' => '',
    'group' => '0',
    'exposed' => TRUE,
    'expose' => array(
    'use_operator' => 0,
    'operator' => 'name_op',
    'identifier' => 'name',
    'label' => 'Benutzer: User raw name',
    'remember' => 1,
    ),
    'case' => 1,
    'id' => 'name',
    'table' => 'users',
    'field' => 'name',
    'relationship' => 'none',
    ),
    'rid' => array(
    'operator' => 'or',
    'value' => array(),
    'group' => '0',
    'exposed' => TRUE,
    'expose' => array(
    'use_operator' => 0,
    'operator' => 'rid_op',
    'identifier' => 'rid',
    'label' => 'Benutzer: Rollen',
    'optional' => 1,
    'single' => 1,
    'remember' => 0,
    'reduce' => 0,
    ),
    'id' => 'rid',
    'table' => 'users_roles',
    'field' => 'rid',
    'relationship' => 'none',
    'reduce_duplicates' => 0,
    ),
    ));
    $handler->override_option('access', array(
    'type' => 'role',
    'role' => array(
    3 => 3,
    6 => 6,
    ),
    ));
    $handler->override_option('cache', array(
    'type' => 'none',
    ));
    $handler->override_option('items_per_page', 100);
    $handler->override_option('use_pager', '1');
    $handler->override_option('style_plugin', 'table');
    $handler->override_option('style_options', array(
    'grouping' => '',
    'override' => 1,
    'sticky' => 0,
    'order' => 'asc',
    'summary' => '',
    'columns' => array(
    'name' => 'name',
    'uid' => 'uid',
    'rid' => 'rid',
    'edit_node' => 'edit_node',
    'delete_node' => 'delete_node',
    ),
    'info' => array(
    'name' => array(
    'sortable' => 0,
    'separator' => '',
    ),
    'uid' => array(
    'sortable' => 0,
    'separator' => '',
    ),
    'rid' => array(
    'separator' => '',
    ),
    'edit_node' => array(
    'separator' => '',
    ),
    'delete_node' => array(
    'separator' => '',
    ),
    ),
    'default' => '-1',
    ));
    $handler = $view->new_display('page', 'Seite', 'page_1');
    $handler->override_option('path', 'admin/userlist');
    $handler->override_option('menu', array(
    'type' => 'normal',
    'title' => 'View and update Users',
    'description' => 'View and update Users',
    'weight' => '20',
    'name' => 'admin',
    ));
    $handler->override_option('tab_options', array(
    'type' => 'none',
    'title' => '',
    'description' => '',
    'weight' => 0,
    'name' => 'navigation',
    ));
    $translatables['user_admin_view'] = array(
    t('Seite'),
    t('Standards'),
    );

    Michael-IDA’s picture

    Basic Drupal 6:

    http://inet-design.com/blogs/michael/view-search-usernames-or-email-drup...

    Search-able on:

    User Name
    User Email

    Shows:

    Name
    Edit link
    Uid
    Active
    Roles
    Last login
    Last access
    Created date

    Best,
    Michael

    sunward’s picture

    I installed the view and I tried it but kept getting timeouts.

    I went to my cpanel and then myphpadmin of my server. I was able to search on the user section of the database. Took a little time to get the hang of it, but easy to use now.

    kenbron’s picture

    This is great advice. I really needed to add this to my site; and being a relative novice drupal administrator, it should be added that in Step 2, you need to check the box to "expose" the filter. When this was not in the instructions and the views comments seem to warn one about exposing the filter, but if it is not exposed, you do not get to input a search string. Exposing the filter allows the user to search for any string in a user name, as long as other settings are correct. Thanks for posting this views recipe for searching for a user!

    brad_cable’s picture

    It is sure rough round the edges, but I was, for the first time able to search on a string and it would find all usernames with that string in. Great!!