Issue #2020167 by mikeker, dawehner, irinaz, tim.plunkett: Add a name and email search field to the admin/people view.
parent
2fe57efec0
commit
7a0c707eeb
|
@ -608,7 +608,98 @@ display:
|
|||
access: '0'
|
||||
destination: '1'
|
||||
plugin_id: dropbutton
|
||||
mail:
|
||||
id: mail
|
||||
table: users
|
||||
field: mail
|
||||
relationship: none
|
||||
group_type: group
|
||||
admin_label: ''
|
||||
label: ''
|
||||
exclude: '1'
|
||||
alter:
|
||||
alter_text: '0'
|
||||
text: ''
|
||||
make_link: '0'
|
||||
path: ''
|
||||
absolute: '0'
|
||||
external: '0'
|
||||
replace_spaces: '0'
|
||||
path_case: none
|
||||
trim_whitespace: '0'
|
||||
alt: ''
|
||||
rel: ''
|
||||
link_class: ''
|
||||
prefix: ''
|
||||
suffix: ''
|
||||
target: ''
|
||||
nl2br: '0'
|
||||
max_length: ''
|
||||
word_boundary: '1'
|
||||
ellipsis: '1'
|
||||
more_link: '0'
|
||||
more_link_text: ''
|
||||
more_link_path: ''
|
||||
strip_tags: '0'
|
||||
trim: '0'
|
||||
preserve_tags: ''
|
||||
html: '0'
|
||||
element_type: ''
|
||||
element_class: ''
|
||||
element_label_type: ''
|
||||
element_label_class: ''
|
||||
element_label_colon: '0'
|
||||
element_wrapper_type: ''
|
||||
element_wrapper_class: ''
|
||||
element_default_classes: '1'
|
||||
empty: ''
|
||||
hide_empty: '0'
|
||||
empty_zero: '0'
|
||||
hide_alter_empty: '1'
|
||||
link_to_user: '0'
|
||||
plugin_id: user_mail
|
||||
filters:
|
||||
combine:
|
||||
id: combine
|
||||
table: views
|
||||
field: combine
|
||||
relationship: none
|
||||
group_type: group
|
||||
admin_label: ''
|
||||
operator: contains
|
||||
value: ''
|
||||
group: '1'
|
||||
exposed: '1'
|
||||
expose:
|
||||
operator_id: combine_op
|
||||
label: 'Name or e-mail contains'
|
||||
description: ''
|
||||
use_operator: '0'
|
||||
operator: combine_op
|
||||
identifier: user
|
||||
required: '0'
|
||||
remember: '0'
|
||||
multiple: '0'
|
||||
remember_roles:
|
||||
authenticated: authenticated
|
||||
anonymous: '0'
|
||||
administrator: '0'
|
||||
is_grouped: '0'
|
||||
group_info:
|
||||
label: ''
|
||||
description: ''
|
||||
identifier: ''
|
||||
optional: '1'
|
||||
widget: select
|
||||
multiple: '0'
|
||||
remember: '0'
|
||||
default_group: All
|
||||
default_group_multiple: { }
|
||||
group_items: { }
|
||||
fields:
|
||||
name: name
|
||||
mail: mail
|
||||
plugin_id: combine
|
||||
rid:
|
||||
id: rid
|
||||
table: users_roles
|
||||
|
@ -804,6 +895,10 @@ display:
|
|||
link_url: ''
|
||||
link_display: page_1
|
||||
css_class: ''
|
||||
filter_groups:
|
||||
operator: AND
|
||||
groups:
|
||||
1: AND
|
||||
page_1:
|
||||
display_plugin: page
|
||||
id: page_1
|
||||
|
|
|
@ -30,8 +30,9 @@ class UserAdminTest extends WebTestBase {
|
|||
* Registers a user and deletes it.
|
||||
*/
|
||||
function testUserAdmin() {
|
||||
|
||||
$user_a = $this->drupalCreateUser(array());
|
||||
$user_a = $this->drupalCreateUser();
|
||||
$user_a->mail = $this->randomName() . '@example.com';
|
||||
$user_a->save();
|
||||
$user_b = $this->drupalCreateUser(array('administer taxonomy'));
|
||||
$user_c = $this->drupalCreateUser(array('administer taxonomy'));
|
||||
|
||||
|
@ -48,6 +49,17 @@ class UserAdminTest extends WebTestBase {
|
|||
$link = l(t('Edit'), "user/$user_a->uid/edit", array('query' => array('destination' => 'admin/people')));
|
||||
$this->assertRaw($link, 'Found user A edit link on admin users page');
|
||||
|
||||
// Filter the users by name/e-mail.
|
||||
$this->drupalGet('admin/people', array('query' => array('user' => $user_a->name)));
|
||||
$result = $this->xpath('//table/tbody/tr');
|
||||
$this->assertEqual(1, count($result), 'Filter by username returned the right amount.');
|
||||
$this->assertEqual($user_a->name, (string) $result[0]->td[1]->span, 'Filter by username returned the right user.');
|
||||
|
||||
$this->drupalGet('admin/people', array('query' => array('user' => $user_a->mail)));
|
||||
$result = $this->xpath('//table/tbody/tr');
|
||||
$this->assertEqual(1, count($result), 'Filter by username returned the right amount.');
|
||||
$this->assertEqual($user_a->name, (string) $result[0]->td[1]->span, 'Filter by username returned the right user.');
|
||||
|
||||
// Filter the users by permission 'administer taxonomy'.
|
||||
$this->drupalGet('admin/people', array('query' => array('permission' => 'administer taxonomy')));
|
||||
|
||||
|
@ -76,6 +88,12 @@ class UserAdminTest extends WebTestBase {
|
|||
$account = user_load($user_c->uid, TRUE);
|
||||
$this->assertEqual($account->status, 0, 'User C blocked');
|
||||
|
||||
// Test filtering on admin page for blocked users
|
||||
$this->drupalGet('admin/people', array('query' => array('status' => 0)));
|
||||
$this->assertNoText($user_a->name, 'User A not on filtered by status on admin users page');
|
||||
$this->assertNoText($user_b->name, 'User B not on filtered by status on admin users page');
|
||||
$this->assertText($user_c->name, 'User C on filtered by status on admin users page');
|
||||
|
||||
// Test unblocking of a user from /admin/people page and sending of activation mail
|
||||
$editunblock = array();
|
||||
$editunblock['action'] = 'user_unblock_user_action';
|
||||
|
|
Loading…
Reference in New Issue