瀏覽代碼

Public or private option for email rule in control panel

Bob Mottram 9 年之前
父節點
當前提交
c23ec71ad0
共有 1 個檔案被更改,包括 14 行新增4 行删除
  1. 14
    4
      src/freedombone-controlpanel

+ 14
- 4
src/freedombone-controlpanel 查看文件

@@ -671,7 +671,7 @@ function add_to_mailing_list {
671 671
               $"List folder name:" 1 1 "" 1 35 26 25 \
672 672
               $"Name between [] on subject line:" 2 1 "" 2 35 26 25 \
673 673
               $"List email address:" 3 1 "" 3 35 26 25 \
674
-              $"Public:" 4 1 "yes" 4 35 4 25 \
674
+              $"Public:" 4 1 $"yes" 4 35 4 25 \
675 675
               2> $data
676 676
     sel=$?
677 677
     case $sel in
@@ -686,7 +686,7 @@ function add_to_mailing_list {
686 686
     if [ ${#LIST_PUBLIC} -lt 1 ]; then
687 687
         LIST_PUBLIC='no'
688 688
     fi
689
-    if [[ $LIST_PUBLIC == 'y' || $LIST_PUBLIC == 'Y' || $LIST_PUBLIC == 'true' || $LIST_PUBLIC == 'True' || $LIST_PUBLIC == 'yes' || $LIST_PUBLIC == 'Yes' || $LIST_PUBLIC == 'YES' ]]; then
689
+    if [[ $LIST_PUBLIC == $'y' || $LIST_PUBLIC == $'Y' || $LIST_PUBLIC == $'true' || $LIST_PUBLIC == $'True' || $LIST_PUBLIC == $'yes' || $LIST_PUBLIC == $'Yes' || $LIST_PUBLIC == $'YES' ]]; then
690 690
         LIST_PUBLIC='yes'
691 691
     else
692 692
         LIST_PUBLIC='no'
@@ -730,9 +730,10 @@ function email_rule {
730 730
     trap "rm -f $data" 0 1 2 5 15
731 731
     dialog --backtitle $"Freedombone Control Panel" \
732 732
            --title $"Email rule for user $SELECTED_USERNAME" \
733
-           --form "\n" 8 65 3 \
733
+           --form "\n" 9 65 4 \
734 734
               $"When email arrives from address:" 1 1 "" 1 35 24 28 \
735 735
               $"Move to folder:" 2 1 "" 2 35 24 28 \
736
+              $"Public:" 3 1 $"no" 3 35 4 25 \
736 737
               2> $data
737 738
     sel=$?
738 739
     case $sel in
@@ -741,7 +742,16 @@ function email_rule {
741 742
     esac
742 743
     RULE_EMAIL=$(cat $data | sed -n 1p)
743 744
     RULE_FOLDER=$(cat $data | sed -n 2p)
745
+    RULE_PUBLIC=$(cat $data | sed -n 3p)
744 746
 
747
+    if [ ${#RULE_PUBLIC} -lt 1 ]; then
748
+        RULE_PUBLIC='no'
749
+    fi
750
+    if [[ $RULE_PUBLIC == $'y' || $RULE_PUBLIC == $'Y' || $RULE_PUBLIC == $'true' || $RULE_PUBLIC == $'True' || $RULE_PUBLIC == $'yes' || $RULE_PUBLIC == $'Yes' || $RULE_PUBLIC == $'YES' ]]; then
751
+        RULE_PUBLIC='yes'
752
+    else
753
+        RULE_PUBLIC='no'
754
+    fi
745 755
     if [ ${#RULE_EMAIL} -lt 2 ]; then
746 756
         dialog --title $"Add email rule" \
747 757
                --msgbox $"No email address was given" 6 40
@@ -759,7 +769,7 @@ function email_rule {
759 769
     fi
760 770
 
761 771
     ${PROJECT_NAME}-addemail -u $SELECTED_USERNAME -e "$RULE_EMAIL" \
762
-                         -g "$RULE_FOLDER"
772
+                         -g "$RULE_FOLDER" --public $RULE_PUBLIC
763 773
     dialog --title $"Add email rule" \
764 774
            --msgbox $"Email rule for $RULE_EMAIL was added" 6 40
765 775
 }