Allow mediagoblin registrations to be disabled

This commit is contained in:
Bob Mottram 2016-12-23 22:19:21 +00:00
parent 58ba3aa693
commit 46d5099f50
1 changed files with 22 additions and 0 deletions

View File

@ -45,6 +45,7 @@ mediagoblin_variables=(ONION_ONLY
MY_USERNAME
MEDIAGOBLIN_DOMAIN_NAME
MEDIAGOBLIN_CODE
DEFAULT_DOMAIN_NAME
DDNS_PROVIDER)
function install_interactive_mediagoblin {
@ -58,6 +59,27 @@ function install_interactive_mediagoblin {
APP_INSTALLED=1
}
function configure_interactive_mediagoblin {
read_config_param 'MEDIAGOBLIN_DOMAIN_NAME'
MEDIAGOBLIN_BASE_DIR=/var/www/$MEDIAGOBLIN_DOMAIN_NAME/htdocs
dialog --title $"Mediagoblin" \
--backtitle $"Freedombone Control Panel" \
--defaultno \
--yesno $"\nAllow registration of new users?" 10 60
sel=$?
case $sel in
0)
sed -i 's|allow_registration.*|allow_registration = true|g' $MEDIAGOBLIN_BASE_DIR/mediagoblin/mediagoblin.ini
;;
1)
sed -i 's|allow_registration.*|allow_registration = false|g' $MEDIAGOBLIN_BASE_DIR/mediagoblin/mediagoblin.ini
;;
255) return;;
esac
systemctl restart mediagoblin
}
function change_password_mediagoblin {
curr_username="$1"
new_user_password="$2"