From da02afcb07c150823f94d721d5a30d5a33743321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 16 Feb 2024 23:26:56 +0100 Subject: [PATCH] Set to default value when settings are hidden on panel --- scripts/config | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/config b/scripts/config index 02edf91..3c256e6 100644 --- a/scripts/config +++ b/scripts/config @@ -9,6 +9,20 @@ source ./_common.sh source /usr/share/yunohost/helpers +ynh_app_config_validate() { + # Depending of the status of the $enable_regirtration we should default value of the hidden fields + if $enable_registration; then + # Must enable password authentication when free registration is enabled as any user must be able to authenticate + password_enabled=true + else + registrations_require_3pid=email + allowed_local_3pids_email='' + allowed_local_3pids_msisdn='' + disable_msisdn_registration=true + fi + _ynh_app_config_validate +} + ynh_app_config_apply() { _ynh_app_config_apply configure_nginx