Procházet zdrojové kódy

Show i2p address on user control panel

Bob Mottram před 7 roky
rodič
revize
c1c7a6c78c
1 změnil soubory, kde provedl 33 přidání a 17 odebrání
  1. 33
    17
      src/freedombone-controlpanel-user

+ 33
- 17
src/freedombone-controlpanel-user Zobrazit soubor

@@ -882,6 +882,20 @@ function menu_run_client_app {
882 882
     fi
883 883
 }
884 884
 
885
+function show_your_email_address {
886
+    GPG_FINGERPRINT=$(gpg --fingerprint $GPG_ID | sed -n '2p' | sed 's/^[ \t]*//')
887
+    GPG_DATE=$(gpg --fingerprint $GPG_ID | grep -i "pub" | head -n 1 | awk -F ' ' '{print $3}')
888
+    if [ ! -d /etc/bdsmail ]; then
889
+        dialog --title $"Show your Email Address" \
890
+               --backtitle $"Freedombone User Control Panel" \
891
+               --msgbox $"Email Address: $MY_EMAIL_ADDRESS\n\nKey ID: $GPG_ID\n\nFingerprint: $GPG_FINGERPRINT\n\nCreated: $GPG_DATE" 12 70
892
+    else
893
+        dialog --title $"Show your Email Address" \
894
+               --backtitle $"Freedombone User Control Panel" \
895
+               --msgbox $"\nYou can press SHIFT and then drag the mouse and right click to copy.\n\nEmail Address: $MY_EMAIL_ADDRESS\n\nKey ID: $GPG_ID\n\nFingerprint: $GPG_FINGERPRINT\n\nCreated: $GPG_DATE\n\nI2P Address: ${USER}@$(bdsmail_domain)" 17 90
896
+    fi
897
+}
898
+
885 899
 function menu_top_level {
886 900
     while true
887 901
     do
@@ -889,16 +903,17 @@ function menu_top_level {
889 903
         trap "rm -f $data" 0 1 2 5 15
890 904
         dialog --backtitle $"Freedombone User Control Panel" \
891 905
                --title $"User Control Panel" \
892
-               --radiolist $"Choose an operation:" 19 50 12 \
906
+               --radiolist $"Choose an operation:" 20 50 13 \
893 907
                1 $"Use Email" off \
894
-               2 $"Change Email Filtering Rules" off \
895
-               3 $"Run an App" off \
896
-               4 $"Browse the Web" off \
897
-               5 $"My Encryption Keys" off \
898
-               6 $"Set an outgoing email proxy" off \
899
-               7 $"Administrator controls" off \
900
-               8 $"Exit to the command line" off \
901
-               9 $"Log out" on 2> $data
908
+               2 $"Show your Email Address" off \
909
+               3 $"Change Email Filtering/Blocking Rules" off \
910
+               4 $"Run an App" off \
911
+               5 $"Browse the Web" off \
912
+               6 $"My Encryption Keys" off \
913
+               7 $"Set an outgoing email proxy" off \
914
+               8 $"Administrator controls" off \
915
+               9 $"Exit to the command line" off \
916
+               10 $"Log out" on 2> $data
902 917
         sel=$?
903 918
         case $sel in
904 919
             1) rm $data
@@ -908,15 +923,16 @@ function menu_top_level {
908 923
         esac
909 924
         case $(cat $data) in
910 925
             1) mutt;;
911
-            2) menu_email;;
912
-            3) menu_run_client_app;;
913
-            4) torify elinks -no-home;;
914
-            5) menu_encryption_keys;;
915
-            6) smtp_proxy;;
916
-            7) menu_admin;;
917
-            8) rm $data
926
+            2) show_your_email_address;;
927
+            3) menu_email;;
928
+            4) menu_run_client_app;;
929
+            5) torify elinks -no-home;;
930
+            6) menu_encryption_keys;;
931
+            7) smtp_proxy;;
932
+            8) menu_admin;;
933
+            9) rm $data
918 934
                break;;
919
-            9) kill -HUP `pgrep -s 0 -o`;;
935
+            10) kill -HUP `pgrep -s 0 -o`;;
920 936
         esac
921 937
         rm $data
922 938
     done