[10.0.51.dev] Ajustement import users d'une v9
This commit is contained in:
parent
9f6620b50b
commit
b03bb7b857
|
@ -639,10 +639,18 @@ class common {
|
||||||
// Ecriture des données
|
// Ecriture des données
|
||||||
$this->setData(['config',$tempData['config']]);
|
$this->setData(['config',$tempData['config']]);
|
||||||
$this->setData(['core',$tempData['core']]);
|
$this->setData(['core',$tempData['core']]);
|
||||||
if (isset($_POST['configManageImportUser']) === true) {
|
|
||||||
$this->setData(['user',$tempData['user']]);
|
// Import des users
|
||||||
unset($_POST['configManageImportUser']);
|
if (isset($_POST['configManageImportUser']) === true ) {
|
||||||
}
|
if ($_POST['configManageImportUser'] === false) { // user non préservés
|
||||||
|
$this->setData(['user',$tempData['user']]); // On importe les nouveaux
|
||||||
|
}
|
||||||
|
unset($_POST['configManageImportUser']);
|
||||||
|
} else {
|
||||||
|
$this->setData(['user',$tempData['user']]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->setData(['page',$tempData['page']]);
|
$this->setData(['page',$tempData['page']]);
|
||||||
$this->setData(['module',$tempData['module']]);
|
$this->setData(['module',$tempData['module']]);
|
||||||
$this->setData(['theme',$tempTheme['theme']]);
|
$this->setData(['theme',$tempTheme['theme']]);
|
||||||
|
|
|
@ -294,16 +294,20 @@ class config extends common {
|
||||||
// Vérifier la présence des fichiers à minima theme et core (v9)
|
// Vérifier la présence des fichiers à minima theme et core (v9)
|
||||||
if (in_array('theme.json',$files) === true &&
|
if (in_array('theme.json',$files) === true &&
|
||||||
in_array('core.json',$files) === true) {
|
in_array('core.json',$files) === true) {
|
||||||
// Users d'une version 10 conservés
|
|
||||||
if ($this->getInput('configManageImportUser', helper::FILTER_BOOLEAN) === true ) {
|
// Users d'une version 10 conservés si option cochée
|
||||||
$users = $this->getData(['user']);
|
if (in_array('user.json',$files) === true &&
|
||||||
|
$this->getInput('configManageImportUser', helper::FILTER_BOOLEAN) === true ) {
|
||||||
|
$users = $this->getData(['user']);
|
||||||
|
} else {
|
||||||
|
// V9 on transmets l'option à la fonction importData
|
||||||
$_POST['configManageImportUser'] = $this->getInput('configManageImportUser', helper::FILTER_BOOLEAN);
|
$_POST['configManageImportUser'] = $this->getInput('configManageImportUser', helper::FILTER_BOOLEAN);
|
||||||
}
|
}
|
||||||
// Extraire le zip
|
// Extraire le zip
|
||||||
$success = $zip->extractTo( '.' );
|
$success = $zip->extractTo( '.' );
|
||||||
// Fermer l'archive
|
// Fermer l'archive
|
||||||
$zip->close();
|
$zip->close();
|
||||||
// Restaurer les users lus
|
// Restaurer les users originaux d'une v10 si option cochée
|
||||||
if (!empty($users)) {
|
if (!empty($users)) {
|
||||||
$this->setData(['user',$users]);
|
$this->setData(['user',$users]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<div class="col3 offset5">
|
<div class="col3 offset5">
|
||||||
<?php echo template::button('configManageButton', [
|
<?php echo template::button('configManageButton', [
|
||||||
'href' => helper::baseUrl() . 'config/manage',
|
'href' => helper::baseUrl() . 'config/manage',
|
||||||
'value' => 'Exporter / Importer'
|
'value' => 'Sauvegarder / Restaurer'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col2">
|
<div class="col2">
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>Exporter</h4>
|
<h4>Sauvegarder</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col10 offset1">
|
<div class="col10 offset1">
|
||||||
<?php echo template::button('configManageButton', [
|
<?php echo template::button('configManageButton', [
|
||||||
|
@ -30,16 +30,16 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>Importer</h4>
|
<h4>Restaurer</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<?php echo template::file('configManageImportFile', [
|
<?php echo template::file('configManageImportFile', [
|
||||||
'label' => 'Sauvegarde ZIP',
|
'label' => 'Sauvegarde au format ZIP',
|
||||||
'type' => 2,
|
'type' => 2,
|
||||||
'help' => 'Importe d\'une archive déposée dans le gestionaire de fichiers.'
|
'help' => 'Importe d\'une archive déposée dans le gestionaire de fichiers.'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<?php echo template::checkbox('configManageImportUser', true, 'Préserver les comptes utilisateurs d\'une sauvegarde de version 10 ou +', [
|
<?php echo template::checkbox('configManageImportUser', true, 'Préserver les comptes des utilisateurs déjà installés', [
|
||||||
'checked' => true
|
'checked' => true
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue