1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dokuwiki_ynh.git synced 2024-09-03 18:26:20 +02:00

[fix] issues spotted durring review

This commit is contained in:
Gofannon 2019-05-12 15:55:38 +02:00
parent 3a8b257c40
commit cc963615b4
2 changed files with 14 additions and 12 deletions

View file

@ -13,8 +13,6 @@ source /usr/share/yunohost/helpers
# RETRIEVE ARGUMENTS # RETRIEVE ARGUMENTS
#================================================= #=================================================
# Get authentication backend and set as lowercase
#auth_backend=${YNH_ACTION_IS_INTERNAL_USERS,,}
# Get "is_internal_users" and set as lowercase # Get "is_internal_users" and set as lowercase
is_internal_users=${YNH_ACTION_IS_INTERNAL_USERS,,} is_internal_users=${YNH_ACTION_IS_INTERNAL_USERS,,}
@ -32,6 +30,11 @@ is_internal_users_old=$(ynh_app_setting_get $app is_internal_users)
# CHECK IF ARGUMENTS AND REQUIREMENTS ARE CORRECT # CHECK IF ARGUMENTS AND REQUIREMENTS ARE CORRECT
#================================================= #=================================================
# Ensure that app is public
if [ $is_public -eq 0 ]; then
ynh_die "Wiki must be public if you want your people to be able to reach it. Run 'public_private' and come back here" 1
fi
#================================================= #=================================================
# CHECK IF AN ACTION HAS TO BE DONE # CHECK IF AN ACTION HAS TO BE DONE
#================================================= #=================================================
@ -118,16 +121,9 @@ ynh_replace_string "__YNH_ADMIN_USER__" "$admin" "$final_path/conf/loca
# Recalculate and store the config file checksum into the app settings # Recalculate and store the config file checksum into the app settings
ynh_store_file_checksum "$final_path/conf/local.protected.php" ynh_store_file_checksum "$final_path/conf/local.protected.php"
# Purge cache; see https://www.dokuwiki.org/faq:pluginproblems#cache
# Regen ssowat configuration touch $final_path/conf/local.php
yunohost app ssowatconf
# Update the config of the app # Update the config of the app
ynh_app_setting_set $app auth_backend $auth_backend ynh_app_setting_set $app auth_backend $auth_backend
ynh_app_setting_set $app is_internal_users $is_internal_users ynh_app_setting_set $app is_internal_users $is_internal_users
#=================================================
# RELOAD NGINX
#=================================================
systemctl reload nginx

View file

@ -23,7 +23,7 @@ is_public=$(ynh_app_setting_get $app is_public)
final_path=$(ynh_app_setting_get $app final_path) final_path=$(ynh_app_setting_get $app final_path)
auth_backend=$(ynh_app_setting_get $app auth_backend) auth_backend=$(ynh_app_setting_get $app auth_backend)
#is_internal_users=$(ynh_app_setting_get $app is_internal_users) is_internal_users=$(ynh_app_setting_get $app is_internal_users)
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
@ -58,6 +58,12 @@ if [ -z "$language" ]; then
ynh_app_setting_set $app language $language ynh_app_setting_set $app language $language
fi fi
# 'auth_backend' default value, if not set
if [ -z "$auth_backend" ]; then
auth_backend='authldap'
ynh_app_setting_set $app auth_backend $authldap
fi
# 'is_internal_users' default value, if not set # 'is_internal_users' default value, if not set
if [ -z "$is_internal_users" ]; then if [ -z "$is_internal_users" ]; then
ynh_app_setting_set $app is_internal_users 0 ynh_app_setting_set $app is_internal_users 0