keep DEFAUL_MODE in config.php file

This commit is contained in:
François 2024-06-04 20:46:17 +02:00
parent 705f4f71c5
commit 874dd95a25
2 changed files with 18 additions and 5 deletions

View File

@ -2,6 +2,7 @@
/* /*
* Kaz addon (see https://git.kaz.bzh/KAZ/depollueur for information) * Kaz addon (see https://git.kaz.bzh/KAZ/depollueur for information)
* create un archive for a set of file or update file deadline * create un archive for a set of file or update file deadline
* version : 2.21 (2024-06-04)
a.php?r=email => track a.php?r=email => track
a.php?p=email => period a.php?p=email => period
@ -31,6 +32,8 @@ define ('VAR_PERIOD', $cfg ['var_root'].'period/');
define ('VAR_LANG', $cfg ['var_root'].'lang/'); define ('VAR_LANG', $cfg ['var_root'].'lang/');
define ('VAR_FAKE', $cfg ['var_root'].'fake/'); define ('VAR_FAKE', $cfg ['var_root'].'fake/');
define ('VAR_ADMIN', $cfg ['var_root'].'admin/'); define ('VAR_ADMIN', $cfg ['var_root'].'admin/');
define ('VAR_CONFIG', $cfg ['var_root'].'config/');
define ('FILE_CONFIG', VAR_CONFIG.'default.php');
$domain="kaz.local"; $domain="kaz.local";
if (preg_match ("%^.*//([^/]*)/?.*$%", $cfg ['web_root'], $matches)) if (preg_match ("%^.*//([^/]*)/?.*$%", $cfg ['web_root'], $matches))
@ -40,9 +43,19 @@ define ('MAX_VALID_UPLOAD_TIME', 60);
define ('TOKEN_USE_LIMIT', "-2 hours"); define ('TOKEN_USE_LIMIT', "-2 hours");
define ('TOKEN_LOGIN_LIMIT', "-15 minutes"); define ('TOKEN_LOGIN_LIMIT', "-15 minutes");
define ('TOKEN_LOGOUT_LIMIT', "-8 hours"); define ('TOKEN_LOGOUT_LIMIT', "-8 hours");
define ('DEFAULT_MODE', "footer"); if (!file_exists (VAR_CONFIG))
define ('DEFAULT_PERIOD', "month"); mkdir (VAR_CONFIG, 0755);
define ('DEFAULT_LANG', "fr"); if (!file_exists (FILE_CONFIG)) {
file_put_contents (FILE_CONFIG, "<?php".NL.
"/* if error with DEFAULT_MODE, DEFAULT_PERIOD or DEFAULT_LANG then remove this file. */".NL.
"define ('DEFAULT_MODE', 'footer');".NL.
"define ('DEFAULT_PERIOD', 'month');".NL.
"define ('DEFAULT_LANG', 'fr');".NL.NL);
define ('DEFAULT_MODE', 'footer');
define ('DEFAULT_PERIOD', 'month');
define ('DEFAULT_LANG', 'fr');
} else
require (FILE_CONFIG);
define ('E_BAD_ARCHIVE_NAME', 'Bad archive name format'); define ('E_BAD_ARCHIVE_NAME', 'Bad archive name format');
define ('E_CREATE_ZIP', "Impossible de cr&eacute;er l'archive."); define ('E_CREATE_ZIP', "Impossible de cr&eacute;er l'archive.");

View File

@ -33,8 +33,8 @@
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
#include "version.hpp" #include "version.hpp"
const std::string kaz::LAST_VERSION_NUM ("2.20"); const std::string kaz::LAST_VERSION_NUM ("2.21");
const std::string kaz::LAST_VERSION_DATE ("2024-04-07"); const std::string kaz::LAST_VERSION_DATE ("2024-06-04");
const std::string kaz::LAST_VERSION (LAST_VERSION_NUM+" "+LAST_VERSION_DATE+" eMailShrinker"); const std::string kaz::LAST_VERSION (LAST_VERSION_NUM+" "+LAST_VERSION_DATE+" eMailShrinker");
#include <iostream> #include <iostream>