Set hubzilla channel directory server from the control panel

This commit is contained in:
Bob Mottram 2015-11-03 12:25:10 +00:00
parent 0ff52c44f5
commit 37732edba9
2 changed files with 45 additions and 13 deletions

View File

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

View File

@ -460,6 +460,35 @@ function reset_tripwire {
any_key any_key
} }
function hubzilla_channel_directory_server {
if ! grep -q "Hubzilla domain" $COMPLETION_FILE; then
dialog --title "Hubzilla channel directory server" \
--msgbox "Hubzilla is not installed on this system" 6 40
return
fi
HUBZILLA_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Hubzilla domain" | awk -F ':' '{print $2}')
if [ ! -d /var/www/$HUBZILLA_DOMAIN_NAME ]; then
dialog --title "Hubzilla channel directory server" \
--msgbox "Hubzilla install directory not found" 6 40
return
fi
data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15
dialog --title "Hubzilla channel directory server" \
--backtitle "Freedombone Control Panel" \
--inputbox "When you click on 'channel directory' this is where Hubzilla will obtain its list from" 8 60 2>$data
sel=$?
case $sel in
0)
hubzilla_domain_server=$(<$data)
./var/www/$HUBZILLA_DOMAIN_NAME/htdocs/util/config system directory_server $hubzilla_domain_server
dialog --title "Hubzilla channel directory server" \
--msgbox "Domain channel directory server changed to $hubzilla_domain_server" 6 40
;;
esac
}
function menu_backup_restore { function menu_backup_restore {
while true while true
do do
@ -555,15 +584,16 @@ function menu_top_level {
trap "rm -f $data" 0 1 2 5 15 trap "rm -f $data" 0 1 2 5 15
dialog --backtitle "Freedombone Control Panel" \ dialog --backtitle "Freedombone Control Panel" \
--title "Control Panel" \ --title "Control Panel" \
--radiolist "Choose an operation:" 15 70 8 \ --radiolist "Choose an operation:" 16 70 9 \
1 "Backup and Restore" off \ 1 "Backup and Restore" off \
2 "Show SIP Phone Extensions" off \ 2 "Show SIP Phone Extensions" off \
3 "Logging on/off" off \ 3 "Reset Tripwire" off \
4 "Manage Users" off \ 4 "Logging on/off" off \
5 "Email Filtering Rules" off \ 5 "Manage Users" off \
6 "Security Settings" off \ 6 "Email Filtering Rules" off \
7 "Reset Tripwire" off \ 7 "Security Settings" off \
8 "Exit" on 2> $data 8 "Set Hubzilla channel directory server" off \
9 "Exit" on 2> $data
sel=$? sel=$?
case $sel in case $sel in
1) exit 1;; 1) exit 1;;
@ -572,12 +602,13 @@ function menu_top_level {
case $(cat $data) in case $(cat $data) in
1) menu_backup_restore;; 1) menu_backup_restore;;
2) show_sip_extensions;; 2) show_sip_extensions;;
3) logging_on_off;; 3) reset_tripwire;;
4) menu_users;; 4) logging_on_off;;
5) menu_email;; 5) menu_users;;
6) security_settings;; 6) menu_email;;
7) reset_tripwire;; 7) security_settings;;
8) break;; 8) hubzilla_channel_directory_server;;
9) break;;
esac esac
done done
} }