From 8324c74e20ecd0d3c2b471893c24051473e34023 Mon Sep 17 00:00:00 2001 From: ljf Date: Thu, 30 Nov 2023 00:03:23 +0100 Subject: [PATCH] [fix] local only in function --- hooks/post_app_addaccess | 8 ++++---- hooks/post_app_removeaccess | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hooks/post_app_addaccess b/hooks/post_app_addaccess index 662067d..5695c0e 100644 --- a/hooks/post_app_addaccess +++ b/hooks/post_app_addaccess @@ -8,16 +8,16 @@ app=$1 install_dir=/var/www/chatonsinfos/ service_path=${install_dir}public/${app}.properties -local groups_added=$4 -local app_info="$(yunohost app info $app --full --json)" +groups_added=$4 +app_info="$(yunohost app info $app --full --json)" get_info() { echo $app_info | jq -r ".$1" } if [[ "$groups_added" == *"visitors"* ]] then registration=$(ynh_read_var_in_file --file="$service_path" --key="service.registration") - local ldap="$(get_info 'manifest.integration.ldap')" - local sso="$(get_info 'manifest.integration.sso')" + ldap="$(get_info 'manifest.integration.ldap')" + sso="$(get_info 'manifest.integration.sso')" if [[ "$registration" != "None" && "$registration" != "Free" ]] then if [[ "$ldap" == "not_relevant" && "$sso" == "not_relevant" ]] diff --git a/hooks/post_app_removeaccess b/hooks/post_app_removeaccess index 3360b8c..7933110 100644 --- a/hooks/post_app_removeaccess +++ b/hooks/post_app_removeaccess @@ -8,16 +8,16 @@ app=$1 install_dir=/var/www/chatonsinfos/ service_path=${install_dir}public/${app}.properties -local groups_removed=$4 -local app_info="$(yunohost app info $app --full --json)" +groups_removed=$4 +app_info="$(yunohost app info $app --full --json)" get_info() { echo $app_info | jq -r ".$1" } if [[ "$groups_removed" == *"visitors"* ]] then registration=$(ynh_read_var_in_file --file="$service_path" --key="service.registration") - local ldap="$(get_info 'manifest.integration.ldap')" - local sso="$(get_info 'manifest.integration.sso')" + ldap="$(get_info 'manifest.integration.ldap')" + sso="$(get_info 'manifest.integration.sso')" if [[ "$registration" != "Member" && "$registration" != "Client" ]] then ynh_write_var_in_file --file="$service_path" --key="service.registration" --value="Member"