Email filtering menu style

This commit is contained in:
Bob Mottram 2018-03-17 21:33:26 +00:00
parent 8508da2f53
commit 498561ac49
2 changed files with 17 additions and 24 deletions

View File

@ -2298,7 +2298,7 @@ function menu_top_level {
21 $"Restart the system") 21 $"Restart the system")
# shellcheck disable=SC2068 # shellcheck disable=SC2068
selection=$(dialog --backtitle $"Freedombone Control Panel" --title $"Administrator Control Panel" --menu $"Choose an operation, or ESC to exit:" 28 60 28 "${W[@]}" 3>&2 2>&1 1>&3) selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Administrator Control Panel" --menu $"Choose an operation, or ESC to exit:" 28 60 28 "${W[@]}" 3>&2 2>&1 1>&3)
if [ ! "$selection" ]; then if [ ! "$selection" ]; then
break break
fi fi

View File

@ -775,35 +775,28 @@ function menu_encryption_keys {
function menu_email { function menu_email {
while true while true
do do
data=$(mktemp 2>/dev/null) W=(1 $"Add yourself to a mailing list"
dialog --backtitle $"Freedombone User Control Panel" \ 2 $"Remove yourself from a mailing list"
--title $"Change Email Filtering Rules" \ 3 $"Add an email rule for an address"
--radiolist $"Choose an operation:" 14 70 7 \ 4 $"Add an email rule for a subject"
1 $"Add yourself to a mailing list" off \ 5 $"Block or unblock an email address"
2 $"Remove yourself from a mailing list" off \ 6 $"Block or unblock email with subject text")
3 $"Add an email rule for an address" off \
4 $"Add an email rule for a subject" off \ # shellcheck disable=SC2068
5 $"Block or unblock an email address" off \ selection=$(dialog --backtitle $"Freedombone User Control Panel" --title $"Change Email Filtering Rules" --menu $"Choose an operation, or ESC for main menu:" 14 70 7 "${W[@]}" 3>&2 2>&1 1>&3)
6 $"Block or unblock email with subject text" off \
7 $"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_to_mailing_list;; 1) add_to_mailing_list;;
2) remove_user_from_mailing_list;; 2) remove_user_from_mailing_list;;
3) email_rule_address;; 3) email_rule_address;;
4) email_rule_subject;; 4) email_rule_subject;;
5) block_unblock_email;; 5) block_unblock_email;;
6) block_unblock_subject;; 6) block_unblock_subject;;
7) rm -f "$data"
break;;
esac esac
rm -f "$data"
done done
} }
@ -910,7 +903,7 @@ function menu_top_level {
9 $"Exit to the command line") 9 $"Exit to the command line")
# shellcheck disable=SC2068 # shellcheck disable=SC2068
selection=$(dialog --backtitle $"Freedombone Control Panel" --title $"User Control Panel" --menu $"Choose an operation, or ESC to log out:" 20 60 13 "${W[@]}" 3>&2 2>&1 1>&3) selection=$(dialog --backtitle $"Freedombone User Control Panel" --title $"User Control Panel" --menu $"Choose an operation, or ESC to log out:" 20 60 13 "${W[@]}" 3>&2 2>&1 1>&3)
if [ ! "$selection" ]; then if [ ! "$selection" ]; then
kill -HUP "$(pgrep -s 0 -o)" kill -HUP "$(pgrep -s 0 -o)"
break break