[10.0.018.dev] préserver comptes import

This commit is contained in:
Fred Tempez 2019-12-17 16:04:40 +01:00
parent f70d77a25e
commit 0eacd56612
2 changed files with 8 additions and 8 deletions

View File

@ -34,7 +34,7 @@ class common {
const TEMP_DIR = 'site/tmp/'; const TEMP_DIR = 'site/tmp/';
// Numéro de version // Numéro de version
const ZWII_VERSION = '10.0.017.dev'; const ZWII_VERSION = '10.0.018.dev';
public static $actions = []; public static $actions = [];
public static $coreModuleIds = [ public static $coreModuleIds = [
@ -145,9 +145,10 @@ class common {
// Import version 9 // Import version 9
if (file_exists(self::DATA_DIR . 'core.json') === true && if (file_exists(self::DATA_DIR . 'core.json') === true &&
$this->getData(['core','dataVersion']) < 10000) { $this->getData(['core','dataVersion']) < 10000) {
$this->importData($_SESSION['KeepUsers']); $keepUsers = isset($_SESSION['KEEP_USERS']) ? $_SESSION['KEEP_USERS'] : false;
unset ($_SESSION['KeepUsers']); $this->importData($keepUsers);
unset ($_SESSION['KEEP_USERS']);
// Réinstaller htaccess // Réinstaller htaccess
copy('core/module/config/ressource/.htaccess', self::DATA_DIR . '.htaccess'); copy('core/module/config/ressource/.htaccess', self::DATA_DIR . '.htaccess');
common::$importNotices [] = "Importation réalisée avec succès" ; common::$importNotices [] = "Importation réalisée avec succès" ;

View File

@ -335,9 +335,8 @@ class config extends common {
// Préserver les comptes des utilisateurs d'une version 9 si option cochée // Préserver les comptes des utilisateurs d'une version 9 si option cochée
// Positionnement d'une variable de session lue au constructeur // Positionnement d'une variable de session lue au constructeur
if ($version === '9' && if ($version === '9') {
$this->getInput('configManageImportUser', helper::FILTER_BOOLEAN) === true) { $_SESSION['KEEP_USERS'] = $this->getInput('configManageImportUser', helper::FILTER_BOOLEAN);
$_SESSION['KeepUsers'] = true;
} }
// Extraire le zip // Extraire le zip
@ -349,7 +348,7 @@ class config extends common {
if (!empty($users) && if (!empty($users) &&
$version === '10' && $version === '10' &&
$this->getInput('configManageImportUser', helper::FILTER_BOOLEAN) === true) { $this->getInput('configManageImportUser', helper::FILTER_BOOLEAN) === true) {
$this->setData(['user',$users]); $this->setData(['user',$users]);
} }
// Message de notification // Message de notification