# Script=Drupal View # Author=Michael, https://www.drupal.org/user/191508/ # Website=http://inet-design.com/ # Email=script_writer at the commercial domain inet-design # License=GPL # Script repository=none # Drupal Version=6.x # # # Written in response to: Search for username in Users list? https://www.drupal.org/node/744628 To import the below view, copy everything AFTER the "?php" tag and paste that into the: View >> Import >> "Paste view code here:" /admin/build/views/import You man leave the "View name:" blank. To use the view, you will need to be logged in as either admin or an account that has 'administer users' permissions. The path will be {youdomain.name}/admin/usersearch . For Drupal 7, go to {youdomain.name}/search/user . Best, Michael http://inet-design.com/ PS: No, I don't know why "Created date" isn't sortable. I agree it should be, but I'm not going to go dig into why the views defaults aren't making it sortable while the other date fields are. # # # name = 'admin_user_search'; $view->description = 'Administrator User Search'; $view->tag = ''; $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', 'Defaults', 'default'); $handler->override_option('fields', array( 'name' => array( 'id' => 'name', 'table' => 'users', 'field' => 'name', ), 'edit_node' => array( 'label' => 'Edit link', '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', ), 'uid' => array( 'id' => 'uid', 'table' => 'users', 'field' => 'uid', ), 'status' => array( 'label' => 'Active', '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' => 'yes-no', 'not' => 0, 'exclude' => 0, 'id' => 'status', 'table' => 'users', 'field' => 'status', 'relationship' => 'none', ), 'rid' => array( 'label' => 'Roles', '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', ), 'login' => array( 'label' => 'Last login', '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, 'date_format' => 'medium', 'custom_date_format' => '', 'exclude' => 0, 'id' => 'login', 'table' => 'users', 'field' => 'login', 'relationship' => 'none', ), 'access' => array( 'label' => 'Last access', '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, 'date_format' => 'medium', 'custom_date_format' => '', 'exclude' => 0, 'id' => 'access', 'table' => 'users', 'field' => 'access', 'relationship' => 'none', ), 'created' => array( 'label' => 'Created date', '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, 'date_format' => 'medium', 'custom_date_format' => '', 'exclude' => 0, 'id' => 'created', 'table' => 'users', 'field' => 'created', 'relationship' => 'none', ), )); $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' => 'Part of a User\'s name', 'remember' => 0, ), 'case' => 0, 'id' => 'name', 'table' => 'users', 'field' => 'name', 'relationship' => 'none', ), 'mail' => array( 'operator' => 'contains', 'value' => '', 'group' => '0', 'exposed' => TRUE, 'expose' => array( 'use_operator' => 0, 'operator' => 'mail_op', 'identifier' => 'mail', 'label' => 'Part of a User\'s E-mail', 'remember' => 0, ), 'case' => 0, 'id' => 'mail', 'table' => 'users', 'field' => 'mail', 'relationship' => 'none', ), )); $handler->override_option('access', array( 'type' => 'perm', 'perm' => 'administer users', )); $handler->override_option('cache', array( 'type' => 'none', )); $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( 'access' => 'access', 'login' => 'login', 'name' => 'name', 'uid' => 'uid', ), 'info' => array( 'access' => array( 'sortable' => 1, 'separator' => '', ), 'login' => array( 'sortable' => 1, 'separator' => '', ), 'name' => array( 'sortable' => 1, 'separator' => '', ), 'uid' => array( 'sortable' => 1, 'separator' => '', ), ), 'default' => 'name', )); $handler = $view->new_display('page', 'Page', 'page_1'); $handler->override_option('path', 'admin/usersearch'); $handler->override_option('menu', array( 'type' => 'none', 'title' => '', 'description' => '', 'weight' => 0, 'name' => 'navigation', )); $handler->override_option('tab_options', array( 'type' => 'none', 'title' => '', 'description' => '', 'weight' => 0, 'name' => 'navigation', ));