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

use ynh_add_config, remove ynh_permission_update in upgrade script

This commit is contained in:
Kay0u 2022-01-07 18:06:24 +01:00
parent b3c6048718
commit 0f5758cc2f
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D
3 changed files with 3 additions and 9 deletions

View file

@ -14,7 +14,7 @@
"email": "pierre@kayou.io" "email": "pierre@kayou.io"
}, },
"requirements": { "requirements": {
"yunohost": ">= 4.2.4" "yunohost": ">= 4.3.2"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [

View file

@ -134,8 +134,7 @@ ynh_replace_string --match_string="'DC_ADMIN_URL', ''" --replace_string="'DC_ADM
ynh_replace_string --match_string="'DC_ADMIN_MAILFROM', ''" --replace_string="'DC_ADMIN_MAILFROM', '$email'" --target_file=$php_config ynh_replace_string --match_string="'DC_ADMIN_MAILFROM', ''" --replace_string="'DC_ADMIN_MAILFROM', '$email'" --target_file=$php_config
# Adding LDAP login # Adding LDAP login
cp ../conf/class.auth.ldap.php $final_path/inc/class.auth.ldap.php ynh_add_config --template="../conf/class.auth.ldap.php" --destination="$final_path/inc/class.auth.ldap.php"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/inc/class.auth.ldap.php"
cat << EOF >> $php_config cat << EOF >> $php_config

View file

@ -164,8 +164,7 @@ ynh_replace_string --match_string="'DC_ADMIN_URL', ''" --replace_string="'DC_ADM
ynh_replace_string --match_string="'DC_ADMIN_MAILFROM', ''" --replace_string="'DC_ADMIN_MAILFROM', '$email'" --target_file=$php_config ynh_replace_string --match_string="'DC_ADMIN_MAILFROM', ''" --replace_string="'DC_ADMIN_MAILFROM', '$email'" --target_file=$php_config
# Adding LDAP login # Adding LDAP login
cp ../conf/class.auth.ldap.php $final_path/inc/class.auth.ldap.php ynh_add_config --template="../conf/class.auth.ldap.php" --destination="$final_path/inc/class.auth.ldap.php"
ynh_replace_string "__APP__" "$app" $final_path/inc/class.auth.ldap.php
cat << EOF >> $php_config cat << EOF >> $php_config
@ -183,14 +182,10 @@ chown $app:$app "$php_config"
# UPDATING DATABASE # UPDATING DATABASE
#================================================= #=================================================
ynh_permission_update --permission "admin" --add "visitors"
# Navigate to the admin panel to upgrade the database: https://dotclear.org/documentation/2.0/admin/upgrades # Navigate to the admin panel to upgrade the database: https://dotclear.org/documentation/2.0/admin/upgrades
adminUrl="/admin/auth.php" adminUrl="/admin/auth.php"
ynh_local_curl $adminUrl ynh_local_curl $adminUrl
ynh_permission_update --permission "admin" --remove "visitors"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================