Skip to content

Commit

Permalink
Fixes #13993: Support search by email in manage users page
Browse files Browse the repository at this point in the history
- Search by email, if no match by username.
- Use the label 'Search' instead of 'Username' for the text field.
  • Loading branch information
vboctor committed Mar 3, 2012
1 parent 7d072d5 commit 16c85ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions manage_user_edit_page.php
Expand Up @@ -36,8 +36,12 @@
} else {
$t_user_id = user_get_id_by_name( $f_username );
if ( $t_user_id === false ) {
error_parameters( $f_username );
trigger_error( ERROR_USER_BY_NAME_NOT_FOUND, ERROR );
# If we can't find the user by name, attempt to find by email.
$t_user_id = user_get_id_by_email( $f_username );
if ( $t_user_id === false ) {
error_parameters( $f_username );
trigger_error( ERROR_USER_BY_NAME_NOT_FOUND, ERROR );
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion manage_user_page.php
Expand Up @@ -348,7 +348,7 @@
<br />
<form method="get" action="manage_user_edit_page.php">
<?php # CSRF protection not required here - form does not result in modifications ?>
<?php echo lang_get( 'username' ) ?>
<?php echo lang_get( 'search' ) ?>
<input type="text" name="username" value="" />
<input type="submit" class="button" value="<?php echo lang_get( 'manage_user' ) ?>" />
</form>
Expand Down

0 comments on commit 16c85ff

Please sign in to comment.