Selaa lähdekoodia

Administrator email menu style

Bob Mottram 7 vuotta sitten
vanhempi
commit
44f8c11643
1 muutettua tiedostoa jossa 12 lisäystä ja 23 poistoa
  1. 12
    23
      src/freedombone-controlpanel

+ 12
- 23
src/freedombone-controlpanel Näytä tiedosto

1924
 function menu_email {
1924
 function menu_email {
1925
     while true
1925
     while true
1926
     do
1926
     do
1927
-        data=$(mktemp 2>/dev/null)
1928
-        dialog --backtitle $"Freedombone Control Panel" \
1929
-               --title $"Email Menu" \
1930
-               --radiolist $"Choose an operation:" 15 70 8 \
1931
-               1 $"Add a user to a mailing list" off \
1932
-               2 $"Remove a user from a mailing list" off \
1933
-               3 $"Add an email rule" off \
1934
-               4 $"Block/Unblock an email address" off \
1935
-               5 $"Block/Unblock email with subject text" off \
1936
-               6 $"Outgoing Email Proxy" off \
1937
-               7 $"Extra email domains" off \
1938
-               8 $"Back to main menu" on 2> "$data"
1939
-        sel=$?
1940
-        case $sel in
1941
-            1) rm -f "$data"
1942
-               break;;
1943
-            255) rm -f "$data"
1944
-                 break;;
1945
-        esac
1946
-        case $(cat "$data") in
1927
+        W=(1 $"Add a user to a mailing list"
1928
+           2 $"Remove a user from a mailing list"
1929
+           3 $"Add an email rule"
1930
+           4 $"Block/Unblock an email address"
1931
+           5 $"Block/Unblock email with subject text"
1932
+           6 $"Outgoing Email Proxy"
1933
+           7 $"Extra email domains")
1934
+
1935
+        # shellcheck disable=SC2068
1936
+        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)
1937
+
1938
+        case $selection in
1947
             1) add_to_mailing_list;;
1939
             1) add_to_mailing_list;;
1948
             2) remove_user_from_mailing_list;;
1940
             2) remove_user_from_mailing_list;;
1949
             3) email_rule;;
1941
             3) email_rule;;
1951
             5) block_unblock_subject;;
1943
             5) block_unblock_subject;;
1952
             6) email_smtp_proxy;;
1944
             6) email_smtp_proxy;;
1953
             7) email_extra_domains;;
1945
             7) email_extra_domains;;
1954
-            8) rm -f "$data"
1955
-               break;;
1956
         esac
1946
         esac
1957
-        rm -f "$data"
1958
     done
1947
     done
1959
 }
1948
 }
1960
 
1949