Administrator email menu style

This commit is contained in:
Bob Mottram 2018-03-17 21:52:17 +00:00
parent 6c97c1601e
commit 44f8c11643
1 changed files with 12 additions and 23 deletions

View File

@ -1924,26 +1924,18 @@ function menu_backup_restore {
function menu_email { function menu_email {
while true while true
do do
data=$(mktemp 2>/dev/null) W=(1 $"Add a user to a mailing list"
dialog --backtitle $"Freedombone Control Panel" \ 2 $"Remove a user from a mailing list"
--title $"Email Menu" \ 3 $"Add an email rule"
--radiolist $"Choose an operation:" 15 70 8 \ 4 $"Block/Unblock an email address"
1 $"Add a user to a mailing list" off \ 5 $"Block/Unblock email with subject text"
2 $"Remove a user from a mailing list" off \ 6 $"Outgoing Email Proxy"
3 $"Add an email rule" off \ 7 $"Extra email domains")
4 $"Block/Unblock an email address" off \
5 $"Block/Unblock email with subject text" off \ # shellcheck disable=SC2068
6 $"Outgoing Email Proxy" off \ selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Email Menu" --menu $"Choose an operation, or ESC for main menu:" 15 70 8 "${W[@]}" 3>&2 2>&1 1>&3)
7 $"Extra email domains" off \
8 $"Back to main menu" on 2> "$data" case $selection in
sel=$?
case $sel in
1) rm -f "$data"
break;;
255) rm -f "$data"
break;;
esac
case $(cat "$data") in
1) add_to_mailing_list;; 1) add_to_mailing_list;;
2) remove_user_from_mailing_list;; 2) remove_user_from_mailing_list;;
3) email_rule;; 3) email_rule;;
@ -1951,10 +1943,7 @@ function menu_email {
5) block_unblock_subject;; 5) block_unblock_subject;;
6) email_smtp_proxy;; 6) email_smtp_proxy;;
7) email_extra_domains;; 7) email_extra_domains;;
8) rm -f "$data"
break;;
esac esac
rm -f "$data"
done done
} }