Skip to content

Commit f3420be

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 9b6ee5c commit f3420be

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
@@ -178,7 +178,8 @@
178178
<?php
179179
// User action buttons: RESET/UNLOCK and DELETE
180180

181-
$t_reset = helper_call_custom_function( 'auth_can_change_password', array() );
181+
$t_reset = $t_user['id'] != auth_get_current_user_id()
182+
&& helper_call_custom_function( 'auth_can_change_password', array() );
182183
$t_unlock = OFF != config_get( 'max_failed_login_count' ) && $t_user['failed_login_count'] > 0;
183184
$t_delete = !( ( user_is_administrator( $t_user_id ) && ( user_count_level( config_get_global( 'admin_site_threshold' ) ) <= 1 ) ) );
184185

0 commit comments

Comments
 (0)
Please sign in to comment.