Sécurise la réinitialisation des BDD

This commit is contained in:
Fred Tempez 2023-03-02 21:12:45 +01:00
parent 00a1f57665
commit a1e1b9dace
1 changed files with 10 additions and 9 deletions

View File

@ -330,17 +330,18 @@ class common
]); ]);
} }
// Installation fraîche, initialisation des modules manquants // Installation fraîche, initialisation des modules
if ($this->user === []) {
foreach ($this->dataFiles as $stageId => $item) { foreach ($this->dataFiles as $stageId => $item) {
$folder = $this->dataPath($stageId, self::$i18nContent); $folder = $this->dataPath($stageId, self::$i18nContent);
if ( if (
file_exists($folder . $stageId . '.json') === false || file_exists($folder . $stageId . '.json') === false
$this->getData([$stageId]) === NULL
) { ) {
$this->initData($stageId, self::$i18nContent); $this->initData($stageId, self::$i18nContent);
common::$coreNotices[] = $stageId; common::$coreNotices[] = $stageId;
} }
} }
}
// Langue de l'administration // Langue de l'administration
if ($this->getData(['user']) !== []) { if ($this->getData(['user']) !== []) {