Browse Source

Reset user password tries from the control panel

Bob Mottram 8 years ago
parent
commit
c24e7a4d0c
1 changed files with 15 additions and 3 deletions
  1. 15
    3
      src/freedombone-controlpanel

+ 15
- 3
src/freedombone-controlpanel View File

@@ -172,6 +172,16 @@ function passwords_show_apps {
172 172
     fi
173 173
 }
174 174
 
175
+function reset_password_tries {
176
+    passwords_select_user
177
+    if [ ! $SELECTED_USERNAME ]; then
178
+        return
179
+    fi
180
+    pam_tally --user $SELECTED_USERNAME --reset
181
+    dialog --title $"Reset password tries" \
182
+           --msgbox $"Password tries have been reset for $SELECTED_USERNAME" 6 60
183
+}
184
+
175 185
 function view_or_change_passwords {
176 186
     passwords_select_user
177 187
     if [ ! $SELECTED_USERNAME ]; then
@@ -1803,12 +1813,13 @@ function menu_users {
1803 1813
         trap "rm -f $data" 0 1 2 5 15
1804 1814
         dialog --backtitle $"Freedombone Control Panel" \
1805 1815
                --title $"Manage Users" \
1806
-               --radiolist $"Choose an operation:" 12 70 5 \
1816
+               --radiolist $"Choose an operation:" 13 70 6 \
1807 1817
                1 $"Add a user" off \
1808 1818
                2 $"Delete a user" off \
1809 1819
                3 $"Change user password" off \
1810 1820
                4 $"Change user ssh public key" off \
1811
-               5 $"Back to main menu" on 2> $data
1821
+               5 $"Reset password tries" off \
1822
+               6 $"Back to main menu" on 2> $data
1812 1823
         sel=$?
1813 1824
         case $sel in
1814 1825
             1) break;;
@@ -1819,7 +1830,8 @@ function menu_users {
1819 1830
             2) delete_user;;
1820 1831
             3) change_password;;
1821 1832
             4) change_ssh_public_key;;
1822
-            5) break;;
1833
+            5) reset_password_tries;;
1834
+            6) break;;
1823 1835
         esac
1824 1836
     done
1825 1837
 }