1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/moncycle_ynh.git synced 2024-09-03 19:46:16 +02:00
This commit is contained in:
Limezy 2024-02-21 23:19:58 +07:00
parent 4b8e3ed8bf
commit dbc061f0b8
2 changed files with 40 additions and 26 deletions

View file

@ -2,25 +2,23 @@ version = "1.0"
[main]
name = "Moncycle.app configuration"
# [main.comptes]
# name = "comptes"
[main.comptes]
name = "comptes"
# [main.comptes.creation_compte]
# ask.en = "Enable account creation"
# ask.fr = "Permettre la création de nouveaux comptes"
# type = "select"
# choices = ["true", "false"]
# default = "true"
# help = "Don't disable account creation before creating one for yourself !"
# bind = "CREATION_COMPTE:__INSTALL_DIR__/config.php"
#
# [main.comptes.connexion_compte]
# ask.en = "Enable account connexion"
# ask.fr = "Permettre la connexion aux comptes"
# type = "select"
# choices = ["true", "false"]
# default = "true"
# bind = "CONNEXION_COMPTE:__INSTALL_DIR__/config.php"
[main.comptes.creation_compte]
ask.en = "Enable account creation"
ask.fr = "Permettre la création de nouveaux comptes"
type = "select"
choices = ["true", "false"]
default = "true"
help = "Don't disable account creation before creating one for yourself !"
[main.comptes.connexion_compte]
ask.en = "Enable account connexion"
ask.fr = "Permettre la connexion aux comptes"
type = "select"
choices = ["true", "false"]
default = "true"
[main.export]
name = "export"

View file

@ -32,6 +32,22 @@ set__csv_sep(){
sed -i "s/define(\"CSV_SEP\",.*);/define(\"CSV_SEP\", \"$csv_sep\");/" "$install_dir/config.php"
}
get__creation_compte(){
grep -oPi 'define\("CREATION_COMPTE",[\s"]*\K[^\")]+' "$install_dir/config.php"
}
set__creation_compte(){
sed -i "s/define(\"CREATION_COMPTE\",.*);/define(\"CSV_SEP\", \"$creation_compte\");/" "$install_dir/config.php"
}
get__connexion_compte(){
grep -oPi 'define\("CONNEXION_COMPTE",[\s"]*\K[^\")]+' "$install_dir/config.php"
}
set__connexion_compte(){
sed -i "s/define(\"CONNEXION_COMPTE\",.*);/define(\"CSV_SEP\", \"$connexion_compte\");/" "$install_dir/config.php"
}
#=================================================
# GENERIC FINALIZATION