1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/chatonsinfos_ynh.git synced 2024-09-03 18:15:58 +02:00

[fix] local only in function

This commit is contained in:
ljf 2023-11-30 00:03:23 +01:00
parent e18efa389b
commit 400ff7d179
No known key found for this signature in database
2 changed files with 8 additions and 8 deletions

View file

@ -8,16 +8,16 @@ app=$1
install_dir=/var/www/chatonsinfos/ install_dir=/var/www/chatonsinfos/
service_path=${install_dir}public/${app}.properties service_path=${install_dir}public/${app}.properties
local groups_added=$4 groups_added=$4
local app_info="$(yunohost app info $app --full --json)" app_info="$(yunohost app info $app --full --json)"
get_info() { get_info() {
echo $app_info | jq -r ".$1" echo $app_info | jq -r ".$1"
} }
if [[ "$groups_added" == *"visitors"* ]] if [[ "$groups_added" == *"visitors"* ]]
then then
registration=$(ynh_read_var_in_file --file="$service_path" --key="service.registration") registration=$(ynh_read_var_in_file --file="$service_path" --key="service.registration")
local ldap="$(get_info 'manifest.integration.ldap')" ldap="$(get_info 'manifest.integration.ldap')"
local sso="$(get_info 'manifest.integration.sso')" sso="$(get_info 'manifest.integration.sso')"
if [[ "$registration" != "None" && "$registration" != "Free" ]] if [[ "$registration" != "None" && "$registration" != "Free" ]]
then then
if [[ "$ldap" == "not_relevant" && "$sso" == "not_relevant" ]] if [[ "$ldap" == "not_relevant" && "$sso" == "not_relevant" ]]

View file

@ -8,16 +8,16 @@ app=$1
install_dir=/var/www/chatonsinfos/ install_dir=/var/www/chatonsinfos/
service_path=${install_dir}public/${app}.properties service_path=${install_dir}public/${app}.properties
local groups_removed=$4 groups_removed=$4
local app_info="$(yunohost app info $app --full --json)" app_info="$(yunohost app info $app --full --json)"
get_info() { get_info() {
echo $app_info | jq -r ".$1" echo $app_info | jq -r ".$1"
} }
if [[ "$groups_removed" == *"visitors"* ]] if [[ "$groups_removed" == *"visitors"* ]]
then then
registration=$(ynh_read_var_in_file --file="$service_path" --key="service.registration") registration=$(ynh_read_var_in_file --file="$service_path" --key="service.registration")
local ldap="$(get_info 'manifest.integration.ldap')" ldap="$(get_info 'manifest.integration.ldap')"
local sso="$(get_info 'manifest.integration.sso')" sso="$(get_info 'manifest.integration.sso')"
if [[ "$registration" != "Member" && "$registration" != "Client" ]] if [[ "$registration" != "Member" && "$registration" != "Client" ]]
then then
ynh_write_var_in_file --file="$service_path" --key="service.registration" --value="Member" ynh_write_var_in_file --file="$service_path" --key="service.registration" --value="Member"