From ec59a0c77cf976c63390c36311ca35e44d9fd7dd Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sun, 25 Oct 2020 22:49:28 +0100 Subject: [PATCH 1/4] =?UTF-8?q?2=20bugs=20de=20th=C3=A8me=20:=20import=20a?= =?UTF-8?q?dmin=20et=20nettoyage=20tmp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 4 +++- core/core.php | 11 +++++++++++ core/module/install/install.php | 14 +------------- core/module/theme/theme.php | 13 ++++++++----- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index fbb496f3..203f2a1e 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,8 +1,10 @@ # Changelog ## version 10.3.04 -- Correction : +- Corrections : - Position des entrées de menu sur les écrans de smartphone. + - Thème : import d'un thème, d'administration impossible. + - Thème : import d'un thème, nettoyage du dossier tmp. ## version 10.3.03 - Correction : diff --git a/core/core.php b/core/core.php index c7d68d12..f0b1da93 100644 --- a/core/core.php +++ b/core/core.php @@ -1022,6 +1022,17 @@ class common { $db->save; } + /** + * Effacer un dossier non vide. + * @param string URL du dossier à supprimer + */ + public function removeDir ( $path ) { + foreach ( new DirectoryIterator($path) as $item ): + if ( $item->isFile() ) unlink($item->getRealPath()); + if ( !$item->isDot() && $item->isDir() ) $this->removeDir($item->getRealPath()); + endforeach; + rmdir($path); + } /** * Mises à jour diff --git a/core/module/install/install.php b/core/module/install/install.php index e3479ee8..7dfdf89f 100644 --- a/core/module/install/install.php +++ b/core/module/install/install.php @@ -18,8 +18,7 @@ class install extends common { public static $actions = [ 'index' => self::GROUP_VISITOR, 'steps' => self::GROUP_ADMIN, - 'update' => self::GROUP_ADMIN, - 'removeAll' => self::GROUP_ADMIN + 'update' => self::GROUP_ADMIN ]; @@ -253,16 +252,5 @@ class install extends common { ]); } - /** - * Effacer un dossier non vide. - */ - private function removeAll ( $path ) { - foreach ( new DirectoryIterator($path) as $item ): - if ( $item->isFile() ) unlink($item->getRealPath()); - if ( !$item->isDot() && $item->isDir() ) $this->removeAll($item->getRealPath()); - endforeach; - - rmdir($path); - } } \ No newline at end of file diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 177800cb..a97f8635 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -616,16 +616,19 @@ class theme extends common { mkdir (self::TEMP_DIR . $tempFolder); $zip->extractTo(self::TEMP_DIR . $tempFolder ); // Archive de thème ? - if ( file_exists(self::TEMP_DIR . $tempFolder . '/site/data/custom.css') - AND file_exists(self::TEMP_DIR . $tempFolder . '/site/data/theme.css') - AND file_exists(self::TEMP_DIR . $tempFolder . '/site/data/theme.json') ) { + if (( file_exists(self::TEMP_DIR . $tempFolder . '/site/data/custom.css') + AND file_exists(self::TEMP_DIR . $tempFolder . '/site/data/theme.css') + AND file_exists(self::TEMP_DIR . $tempFolder . '/site/data/theme.json') + ) OR ( + file_exists(self::TEMP_DIR . $tempFolder . '/site/data/admin.json') + ) + ) { // traiter l'archive $success = $zip->extractTo('.'); // traitement de l'erreur $notification = $success ? 'Le thème a été importé' : 'Erreur lors de l\'extraction, vérifiez les permissions.'; // Supprimmer le dossier temporaire - $install = new install; - $install->removeAll(self::TEMP_DIR . $tempFolder); + $this->removeDir(self::TEMP_DIR . $tempFolder); } else { // pas une archive de thème $success = false; From dd65cdb3c2ebad004ec92218f7ad04544d3612cd Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sun, 25 Oct 2020 22:55:21 +0100 Subject: [PATCH 2/4] =?UTF-8?q?Pr=C3=A9sentation=20am=C3=A9lior=C3=A9e=20d?= =?UTF-8?q?u=20mail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/layout/mail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/layout/mail.php b/core/layout/mail.php index 6638ee19..c8bc04b4 100644 --- a/core/layout/mail.php +++ b/core/layout/mail.php @@ -71,7 +71,7 @@
-