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 0777b3b

Browse files
committedJun 6, 2012
Prevent admin locking themselves out when resetting own password
Prior to this, when an admin attempted to reset their own password from manage_user_edit_page.php (with $g_send_reset_password = ON), they were no longer able to login because the sent confirmation hash was not valid anymore since the last_visit timestamp used to generate it is updated by every successful loading of the page (footer). This commit prevents such behavior by hiding the "Reset Password" button for the current user in the manage user page. One's own password should be changed in account_page.php (My Account). Fixes #14260
1 parent 1d75494 commit 0777b3b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎manage_user_edit_page.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@
180180

181181
<!-- RESET AND DELETE -->
182182
<?php
183-
$t_reset = helper_call_custom_function( 'auth_can_change_password', array() );
183+
$t_reset = $t_user['id'] != auth_get_current_user_id()
184+
&& helper_call_custom_function( 'auth_can_change_password', array() );
184185
$t_unlock = OFF != config_get( 'max_failed_login_count' ) && $t_user['failed_login_count'] > 0;
185186
$t_delete = !( ( user_is_administrator( $t_user_id ) && ( user_count_level( config_get_global( 'admin_site_threshold' ) ) <= 1 ) ) );
186187

0 commit comments

Comments
 (0)
Please sign in to comment.