Browse Source

Show irc password on admin control panel

Bob Mottram 9 years ago
parent
commit
ae34e8d144
1 changed files with 12 additions and 4 deletions
  1. 12
    4
      src/freedombone-controlpanel

+ 12
- 4
src/freedombone-controlpanel View File

@@ -632,6 +632,12 @@ function change_password {
632 632
            --msgbox $"Password for $SELECTED_USERNAME was changed" 6 40
633 633
 }
634 634
 
635
+function irc_show_password {
636
+    IRC_PASSWORD=$(cat /etc/ngircd/ngircd.conf | grep "Password =" | head -n 1 | awk -F '=' '{print $2}')
637
+    dialog --title $"IRC Password" \
638
+           --msgbox "$IRC_PASSWORD" 4 40
639
+}
640
+
635 641
 function irc_set_global_password {
636 642
     dialog --title $"IRC Password" \
637 643
            --clear \
@@ -1834,8 +1840,9 @@ function menu_irc {
1834 1840
                --title $"IRC Menu" \
1835 1841
                --radiolist $"Choose an operation:" 14 70 4 \
1836 1842
                1 $"Set a password for all IRC users" off \
1837
-               2 $"Access via the onion address" off \
1838
-               3 $"Exit" on 2> $data
1843
+               2 $"Show current IRC login password" off \
1844
+               3 $"Access via the onion address" off \
1845
+               4 $"Exit" on 2> $data
1839 1846
         sel=$?
1840 1847
         case $sel in
1841 1848
             1) break;;
@@ -1843,8 +1850,9 @@ function menu_irc {
1843 1850
         esac
1844 1851
         case $(cat $data) in
1845 1852
             1) irc_set_global_password;;
1846
-            2) irc_via_onion;;
1847
-            3) break;;
1853
+            2) irc_show_password;;
1854
+            3) irc_via_onion;;
1855
+            4) break;;
1848 1856
         esac
1849 1857
     done
1850 1858
 }