浏览代码

Set hubzilla channel directory server from the control panel

Bob Mottram 9 年前
父节点
当前提交
37732edba9
共有 2 个文件被更改,包括 45 次插入13 次删除
  1. 1
    0
      src/freedombone
  2. 44
    13
      src/freedombone-controlpanel

+ 1
- 0
src/freedombone 查看文件

@@ -10057,6 +10057,7 @@ quit" > $INSTALL_DIR/batch.sql
10057 10057
       chmod 600 /home/$MY_USERNAME/README
10058 10058
   fi
10059 10059
 
10060
+  echo "Hubzilla domain:$HUBZILLA_DOMAIN_NAME" >> $COMPLETION_FILE
10060 10061
   echo 'install_hubzilla' >> $COMPLETION_FILE
10061 10062
 }
10062 10063
 

+ 44
- 13
src/freedombone-controlpanel 查看文件

@@ -460,6 +460,35 @@ function reset_tripwire {
460 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 492
 function menu_backup_restore {
464 493
     while true
465 494
     do
@@ -555,15 +584,16 @@ function menu_top_level {
555 584
         trap "rm -f $data" 0 1 2 5 15
556 585
         dialog --backtitle "Freedombone Control Panel" \
557 586
                --title "Control Panel" \
558
-               --radiolist "Choose an operation:" 15 70 8 \
587
+               --radiolist "Choose an operation:" 16 70 9 \
559 588
                1 "Backup and Restore" off \
560 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 597
         sel=$?
568 598
         case $sel in
569 599
             1) exit 1;;
@@ -572,12 +602,13 @@ function menu_top_level {
572 602
         case $(cat $data) in
573 603
             1) menu_backup_restore;;
574 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 612
         esac
582 613
     done
583 614
 }