From 0f5758cc2fbc2ca40da94460bf04768ab2f880d1 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 7 Jan 2022 18:06:24 +0100 Subject: [PATCH] use ynh_add_config, remove ynh_permission_update in upgrade script --- manifest.json | 2 +- scripts/install | 3 +-- scripts/upgrade | 7 +------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/manifest.json b/manifest.json index 1ef5656..78eca23 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "pierre@kayou.io" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3.2" }, "multi_instance": true, "services": [ diff --git a/scripts/install b/scripts/install index e0c5949..d03ecaf 100755 --- a/scripts/install +++ b/scripts/install @@ -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 # Adding LDAP login -cp ../conf/class.auth.ldap.php $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" +ynh_add_config --template="../conf/class.auth.ldap.php" --destination="$final_path/inc/class.auth.ldap.php" cat << EOF >> $php_config diff --git a/scripts/upgrade b/scripts/upgrade index efc421c..3e28a6a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 # Adding LDAP login -cp ../conf/class.auth.ldap.php $final_path/inc/class.auth.ldap.php -ynh_replace_string "__APP__" "$app" $final_path/inc/class.auth.ldap.php +ynh_add_config --template="../conf/class.auth.ldap.php" --destination="$final_path/inc/class.auth.ldap.php" cat << EOF >> $php_config @@ -183,14 +182,10 @@ chown $app:$app "$php_config" # 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 adminUrl="/admin/auth.php" ynh_local_curl $adminUrl -ynh_permission_update --permission "admin" --remove "visitors" - #================================================= # GENERIC FINALIZATION #=================================================