Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 16c85ff

Browse files
committedMar 3, 2012
Fixes #13993: Support search by email in manage users page
- Search by email, if no match by username. - Use the label 'Search' instead of 'Username' for the text field.
1 parent 7d072d5 commit 16c85ff

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
 

‎manage_user_edit_page.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@
3636
} else {
3737
$t_user_id = user_get_id_by_name( $f_username );
3838
if ( $t_user_id === false ) {
39-
error_parameters( $f_username );
40-
trigger_error( ERROR_USER_BY_NAME_NOT_FOUND, ERROR );
39+
# If we can't find the user by name, attempt to find by email.
40+
$t_user_id = user_get_id_by_email( $f_username );
41+
if ( $t_user_id === false ) {
42+
error_parameters( $f_username );
43+
trigger_error( ERROR_USER_BY_NAME_NOT_FOUND, ERROR );
44+
}
4145
}
4246
}
4347

‎manage_user_page.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@
348348
<br />
349349
<form method="get" action="manage_user_edit_page.php">
350350
<?php # CSRF protection not required here - form does not result in modifications ?>
351-
<?php echo lang_get( 'username' ) ?>
351+
<?php echo lang_get( 'search' ) ?>
352352
<input type="text" name="username" value="" />
353353
<input type="submit" class="button" value="<?php echo lang_get( 'manage_user' ) ?>" />
354354
</form>

0 commit comments

Comments
 (0)
Please sign in to comment.