2023-09-04 16:06:35 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source /etc/yunohost/apps/chatonsinfos/scripts/_common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
app=$1
|
2023-11-29 21:33:18 +01:00
|
|
|
|
|
|
|
[ "${app}" == "chatonsinfos" ] && exit 0
|
|
|
|
|
2023-09-04 16:06:35 +02:00
|
|
|
install_dir=/var/www/chatonsinfos/
|
|
|
|
service_path=${install_dir}public/${app}.properties
|
2023-11-30 00:03:23 +01:00
|
|
|
groups_removed=$4
|
|
|
|
app_info="$(yunohost app info $app --full --json)"
|
2023-09-04 16:06:35 +02:00
|
|
|
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")
|
2023-11-30 00:03:23 +01:00
|
|
|
ldap="$(get_info 'manifest.integration.ldap')"
|
|
|
|
sso="$(get_info 'manifest.integration.sso')"
|
2023-09-04 16:06:35 +02:00
|
|
|
if [[ "$registration" != "Member" && "$registration" != "Client" ]]
|
|
|
|
then
|
|
|
|
ynh_write_var_in_file --file="$service_path" --key="service.registration" --value="Member"
|
|
|
|
fi
|
|
|
|
fi
|