1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/chatonsinfos_ynh.git synced 2024-09-03 18:15:58 +02:00
chatonsinfos_ynh/hooks/post_app_removeaccess
2023-11-30 00:04:28 +01:00

25 lines
793 B
Bash

#!/bin/bash
source /etc/yunohost/apps/chatonsinfos/scripts/_common.sh
source /usr/share/yunohost/helpers
app=$1
[ "${app}" == "chatonsinfos" ] && exit 0
install_dir=/var/www/chatonsinfos/
service_path=${install_dir}public/${app}.properties
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")
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"
fi
fi