Reset user password tries from the control panel

This commit is contained in:
Bob Mottram 2016-11-29 19:12:17 +00:00
parent a686f2401c
commit c24e7a4d0c
1 changed files with 15 additions and 3 deletions

View File

@ -172,6 +172,16 @@ function passwords_show_apps {
fi fi
} }
function reset_password_tries {
passwords_select_user
if [ ! $SELECTED_USERNAME ]; then
return
fi
pam_tally --user $SELECTED_USERNAME --reset
dialog --title $"Reset password tries" \
--msgbox $"Password tries have been reset for $SELECTED_USERNAME" 6 60
}
function view_or_change_passwords { function view_or_change_passwords {
passwords_select_user passwords_select_user
if [ ! $SELECTED_USERNAME ]; then if [ ! $SELECTED_USERNAME ]; then
@ -1803,12 +1813,13 @@ function menu_users {
trap "rm -f $data" 0 1 2 5 15 trap "rm -f $data" 0 1 2 5 15
dialog --backtitle $"Freedombone Control Panel" \ dialog --backtitle $"Freedombone Control Panel" \
--title $"Manage Users" \ --title $"Manage Users" \
--radiolist $"Choose an operation:" 12 70 5 \ --radiolist $"Choose an operation:" 13 70 6 \
1 $"Add a user" off \ 1 $"Add a user" off \
2 $"Delete a user" off \ 2 $"Delete a user" off \
3 $"Change user password" off \ 3 $"Change user password" off \
4 $"Change user ssh public key" off \ 4 $"Change user ssh public key" off \
5 $"Back to main menu" on 2> $data 5 $"Reset password tries" off \
6 $"Back to main menu" on 2> $data
sel=$? sel=$?
case $sel in case $sel in
1) break;; 1) break;;
@ -1819,7 +1830,8 @@ function menu_users {
2) delete_user;; 2) delete_user;;
3) change_password;; 3) change_password;;
4) change_ssh_public_key;; 4) change_ssh_public_key;;
5) break;; 5) reset_password_tries;;
6) break;;
esac esac
done done
} }