diff --git a/core/core.php b/core/core.php index 13d6bf94..cc6f84b0 100644 --- a/core/core.php +++ b/core/core.php @@ -356,8 +356,9 @@ class common self::$i18nUI = $this->getInput('ZWII_UI') ? $this->getInput('ZWII_UI') : 'fr_FR'; } + // Stocker le cookie de langue pour l'éditeur de texte - setcookie('ZWII_UI', self::$i18nUI, time() + 3600, '/', '', helper::isHttps(), false); + setcookie('ZWII_UI', self::$i18nUI, time() + 3600, helper::baseUrl(false, false), '', helper::isHttps(), true); // Utilisateur connecté if ($this->user === []) { diff --git a/core/module/install/install.php b/core/module/install/install.php index 16016d06..187dbf9a 100644 --- a/core/module/install/install.php +++ b/core/module/install/install.php @@ -51,19 +51,20 @@ class install extends common ]); } // Accès autorisé - else { - // Soumission du formulaire - if ($this->isPost()) { - // Valeurs en sortie - $this->addOutput([ - 'redirect' => helper::baseUrl() . 'install/postinstall/' . $this->getInput('installLanguage') - ]); - } + // Soumission du formulaire + if ($this->isPost()) { + $lang = $this->getInput('installLanguage'); + // Place le cookie pour la suite de l'installation + setcookie('ZWII_UI', $lang, time() + 3600, helper::baseUrl(false, false), '', helper::isHttps(), true); + + // Valeurs en sortie + $this->addOutput([ + 'redirect' => helper::baseUrl() . 'install/postinstall/' . $lang + ]); } //Nettoyage anciennes installations helper::deleteCookie('ZWII_CONTENT'); - helper::deleteCookie('ZWII_UI'); // Liste des langues UI disponibles if (is_dir(self::I18N_DIR)) {