Browse Source

Set hubzilla channel directory server from the control panel

Bob Mottram 9 years ago
parent
commit
37732edba9
2 changed files with 45 additions and 13 deletions
  1. 1
    0
      src/freedombone
  2. 44
    13
      src/freedombone-controlpanel

+ 1
- 0
src/freedombone View File

10057
       chmod 600 /home/$MY_USERNAME/README
10057
       chmod 600 /home/$MY_USERNAME/README
10058
   fi
10058
   fi
10059
 
10059
 
10060
+  echo "Hubzilla domain:$HUBZILLA_DOMAIN_NAME" >> $COMPLETION_FILE
10060
   echo 'install_hubzilla' >> $COMPLETION_FILE
10061
   echo 'install_hubzilla' >> $COMPLETION_FILE
10061
 }
10062
 }
10062
 
10063
 

+ 44
- 13
src/freedombone-controlpanel View File

460
   any_key
460
   any_key
461
 }
461
 }
462
 
462
 
463
+function hubzilla_channel_directory_server {
464
+    if ! grep -q "Hubzilla domain" $COMPLETION_FILE; then
465
+       dialog --title "Hubzilla channel directory server" \
466
+              --msgbox "Hubzilla is not installed on this system" 6 40
467
+       return
468
+    fi
469
+    HUBZILLA_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Hubzilla domain" | awk -F ':' '{print $2}')
470
+    if [ ! -d /var/www/$HUBZILLA_DOMAIN_NAME ]; then
471
+       dialog --title "Hubzilla channel directory server" \
472
+              --msgbox "Hubzilla install directory not found" 6 40
473
+       return
474
+    fi
475
+
476
+    data=$(tempfile 2>/dev/null)
477
+    trap "rm -f $data" 0 1 2 5 15
478
+    dialog --title "Hubzilla channel directory server" \
479
+           --backtitle "Freedombone Control Panel" \
480
+           --inputbox "When you click on 'channel directory' this is where Hubzilla will obtain its list from" 8 60 2>$data
481
+    sel=$?
482
+    case $sel in
483
+        0)
484
+            hubzilla_domain_server=$(<$data)
485
+            ./var/www/$HUBZILLA_DOMAIN_NAME/htdocs/util/config system directory_server $hubzilla_domain_server
486
+            dialog --title "Hubzilla channel directory server" \
487
+                   --msgbox "Domain channel directory server changed to $hubzilla_domain_server" 6 40
488
+            ;;
489
+    esac       
490
+}
491
+
463
 function menu_backup_restore {
492
 function menu_backup_restore {
464
     while true
493
     while true
465
     do
494
     do
555
         trap "rm -f $data" 0 1 2 5 15
584
         trap "rm -f $data" 0 1 2 5 15
556
         dialog --backtitle "Freedombone Control Panel" \
585
         dialog --backtitle "Freedombone Control Panel" \
557
                --title "Control Panel" \
586
                --title "Control Panel" \
558
-               --radiolist "Choose an operation:" 15 70 8 \
587
+               --radiolist "Choose an operation:" 16 70 9 \
559
                1 "Backup and Restore" off \
588
                1 "Backup and Restore" off \
560
                2 "Show SIP Phone Extensions" off \
589
                2 "Show SIP Phone Extensions" off \
561
-               3 "Logging on/off" off \
562
-               4 "Manage Users" off \
563
-               5 "Email Filtering Rules" off \
564
-               6 "Security Settings" off \
565
-               7 "Reset Tripwire" off \
566
-               8 "Exit" on 2> $data
590
+               3 "Reset Tripwire" off \
591
+               4 "Logging on/off" off \
592
+               5 "Manage Users" off \
593
+               6 "Email Filtering Rules" off \
594
+               7 "Security Settings" off \
595
+               8 "Set Hubzilla channel directory server" off \
596
+               9 "Exit" on 2> $data
567
         sel=$?
597
         sel=$?
568
         case $sel in
598
         case $sel in
569
             1) exit 1;;
599
             1) exit 1;;
572
         case $(cat $data) in
602
         case $(cat $data) in
573
             1) menu_backup_restore;;
603
             1) menu_backup_restore;;
574
             2) show_sip_extensions;;
604
             2) show_sip_extensions;;
575
-            3) logging_on_off;;
576
-            4) menu_users;;
577
-            5) menu_email;;
578
-            6) security_settings;;
579
-            7) reset_tripwire;;
580
-            8) break;;
605
+            3) reset_tripwire;;
606
+            4) logging_on_off;;
607
+            5) menu_users;;
608
+            6) menu_email;;
609
+            7) security_settings;;
610
+            8) hubzilla_channel_directory_server;;
611
+            9) break;;
581
         esac
612
         esac
582
     done
613
     done
583
 }
614
 }