Users menu style

This commit is contained in:
Bob Mottram 2018-03-17 21:47:56 +00:00
parent 1464ea0613
commit d9689e22e8
1 changed files with 14 additions and 21 deletions

View File

@ -2106,33 +2106,26 @@ function domain_blocking {
function menu_users { function menu_users {
while true while true
do do
data=$(mktemp 2>/dev/null) W=(1 $"Add a user"
dialog --backtitle $"Freedombone Control Panel" \ 2 $"Delete a user"
--title $"Manage Users" \ 3 $"Change user password"
--radiolist $"Choose an operation:" 13 70 6 \ 4 $"Change user ssh public key"
1 $"Add a user" off \ 5 $"Reset password tries")
2 $"Delete a user" off \
3 $"Change user password" off \ # shellcheck disable=SC2068
4 $"Change user ssh public key" off \ selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Manage Users" --menu $"Choose an operation, or ESC for main menu:" 13 70 6 "${W[@]}" 3>&2 2>&1 1>&3)
5 $"Reset password tries" off \
6 $"Back to main menu" on 2> "$data" if [ ! "$selection" ]; then
sel=$? break
case $sel in fi
1) rm -f "$data"
break;; case $selection in
255) rm -f "$data"
break;;
esac
case $(cat "$data") in
1) add_user;; 1) add_user;;
2) delete_user;; 2) delete_user;;
3) change_password;; 3) change_password;;
4) change_ssh_public_key;; 4) change_ssh_public_key;;
5) reset_password_tries;; 5) reset_password_tries;;
6) rm -f "$data"
break;;
esac esac
rm -f "$data"
done done
} }