|
119 | 119 | ?>
|
120 | 120 | </td>
|
121 | 121 | </tr>
|
122 |
| - |
| 122 | + |
123 | 123 | <!-- Access Level -->
|
124 | 124 | <tr <?php echo helper_alternate_class() ?>>
|
125 | 125 | <td class="category">
|
|
175 | 175 | <br />
|
176 | 176 |
|
177 | 177 | <!-- RESET AND DELETE -->
|
| 178 | +<?php |
| 179 | + $t_reset = helper_call_custom_function( 'auth_can_change_password', array() ); |
| 180 | + $t_unlock = OFF != config_get( 'max_failed_login_count' ) && $t_user['failed_login_count'] > 0; |
| 181 | + $t_delete = !( ( user_is_administrator( $t_user_id ) && ( user_count_level( config_get_global( 'admin_site_threshold' ) ) <= 1 ) ) ); |
| 182 | + |
| 183 | + if( $t_reset || $t_unlock || $t_delete ) { |
| 184 | +?> |
178 | 185 | <div class="border center">
|
179 | 186 |
|
180 |
| -<!-- Reset Button --> |
181 |
| -<?php if( helper_call_custom_function( 'auth_can_change_password', array() ) ) { ?> |
| 187 | +<!-- Reset/Unlock Button --> |
| 188 | +<?php if( $t_reset || $t_unlock ) { ?> |
182 | 189 | <form method="post" action="manage_user_reset.php">
|
183 | 190 | <?php echo form_security_field( 'manage_user_reset' ) ?>
|
184 | 191 | <input type="hidden" name="user_id" value="<?php echo $t_user['id'] ?>" />
|
| 192 | +<?php if( $t_reset ) { ?> |
185 | 193 | <input type="submit" class="button" value="<?php echo lang_get( 'reset_password_button' ) ?>" />
|
| 194 | +<?php } else { ?> |
| 195 | + <input type="submit" class="button" value="<?php echo lang_get( 'account_unlock_button' ) ?>" /> |
| 196 | +<?php } ?> |
186 | 197 | </form>
|
187 | 198 | <?php } ?>
|
188 | 199 |
|
189 | 200 | <!-- Delete Button -->
|
190 |
| -<?php if ( !( ( user_is_administrator( $t_user_id ) && ( user_count_level( config_get_global( 'admin_site_threshold' ) ) <= 1 ) ) ) ) { ?> |
| 201 | +<?php if ( $t_delete ) { ?> |
191 | 202 | <form method="post" action="manage_user_delete.php">
|
192 | 203 | <?php echo form_security_field( 'manage_user_delete' ) ?>
|
193 |
| - |
194 | 204 | <input type="hidden" name="user_id" value="<?php echo $t_user['id'] ?>" />
|
195 | 205 | <input type="submit" class="button" value="<?php echo lang_get( 'delete_user_button' ) ?>" />
|
196 | 206 | </form>
|
197 | 207 | <?php } ?>
|
198 | 208 | </div>
|
199 |
| -<br /> |
200 |
| -<?php if( !$t_ldap ) { ?> |
201 |
| -<div align="center"> |
202 |
| -<?php |
203 |
| - if ( ( ON == config_get( 'send_reset_password' ) ) && ( ON == config_get( 'enable_email_notification' ) ) ) { |
204 |
| - echo lang_get( 'reset_password_msg' ); |
205 |
| - } else { |
206 |
| - echo lang_get( 'reset_password_msg2' ); |
207 |
| - } |
208 |
| -?> |
209 |
| -</div> |
| 209 | + <?php if( $t_reset ) { ?> |
| 210 | + <div align="center"> |
| 211 | + <br /> |
| 212 | + <?php |
| 213 | + if ( ( ON == config_get( 'send_reset_password' ) ) && ( ON == config_get( 'enable_email_notification' ) ) ) { |
| 214 | + echo lang_get( 'reset_password_msg' ); |
| 215 | + } else { |
| 216 | + echo lang_get( 'reset_password_msg2' ); |
| 217 | + } |
| 218 | + ?> |
| 219 | + </div> |
| 220 | + <?php } ?> |
210 | 221 | <?php } ?>
|
211 | 222 |
|
212 | 223 |
|
|
0 commit comments