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,32 +2,30 @@ version = "1.0"
[main] [main]
name = "Moncycle.app configuration" name = "Moncycle.app configuration"
# [main.comptes] [main.comptes]
# name = "comptes" name = "comptes"
# [main.comptes.creation_compte] [main.comptes.creation_compte]
# ask.en = "Enable account creation" ask.en = "Enable account creation"
# ask.fr = "Permettre la création de nouveaux comptes" ask.fr = "Permettre la création de nouveaux comptes"
# type = "select" type = "select"
# choices = ["true", "false"] choices = ["true", "false"]
# default = "true" default = "true"
# help = "Don't disable account creation before creating one for yourself !" 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.export]
name = "export"
[main.export.csv_sep] [main.comptes.connexion_compte]
ask.en = "Separator for data export in csv format" ask.en = "Enable account connexion"
ask.fr = "Séparateur pour l'export des données au format csv" ask.fr = "Permettre la connexion aux comptes"
type = "string" type = "select"
default = ";" choices = ["true", "false"]
default = "true"
[main.export]
name = "export"
[main.export.csv_sep]
ask.en = "Separator for data export in csv format"
ask.fr = "Séparateur pour l'export des données au format csv"
type = "string"
default = ";"

View file

@ -32,6 +32,22 @@ set__csv_sep(){
sed -i "s/define(\"CSV_SEP\",.*);/define(\"CSV_SEP\", \"$csv_sep\");/" "$install_dir/config.php" 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 # GENERIC FINALIZATION