Browse Source

Show i2p address on user control panel

Bob Mottram 7 years ago
parent
commit
c1c7a6c78c
1 changed files with 33 additions and 17 deletions
  1. 33
    17
      src/freedombone-controlpanel-user

+ 33
- 17
src/freedombone-controlpanel-user View File

882
     fi
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
 function menu_top_level {
899
 function menu_top_level {
886
     while true
900
     while true
887
     do
901
     do
889
         trap "rm -f $data" 0 1 2 5 15
903
         trap "rm -f $data" 0 1 2 5 15
890
         dialog --backtitle $"Freedombone User Control Panel" \
904
         dialog --backtitle $"Freedombone User Control Panel" \
891
                --title $"User Control Panel" \
905
                --title $"User Control Panel" \
892
-               --radiolist $"Choose an operation:" 19 50 12 \
906
+               --radiolist $"Choose an operation:" 20 50 13 \
893
                1 $"Use Email" off \
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
         sel=$?
917
         sel=$?
903
         case $sel in
918
         case $sel in
904
             1) rm $data
919
             1) rm $data
908
         esac
923
         esac
909
         case $(cat $data) in
924
         case $(cat $data) in
910
             1) mutt;;
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
                break;;
934
                break;;
919
-            9) kill -HUP `pgrep -s 0 -o`;;
935
+            10) kill -HUP `pgrep -s 0 -o`;;
920
         esac
936
         esac
921
         rm $data
937
         rm $data
922
     done
938
     done