From 118bd06eadcae982bdebca2a6517e789caa22cb6 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Mon, 9 Oct 2023 22:38:35 +0200 Subject: [PATCH] release 0.9.1 --- CHANGELOG.md | 7 +++++ README.md | 2 +- _define.php | 32 ++++++++++++----------- dcstore.xml | 4 +-- src/Backend.php | 20 +++++++------- src/Config.php | 20 +++++++------- src/Install.php | 23 +++++++---------- src/My.php | 27 +++++++------------ src/Utils.php | 69 ++++++++++++++++++++++++++++--------------------- 9 files changed, 105 insertions(+), 99 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cb2337..7f78038 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +DotclearWatch 0.9.1 - 2023.10.09 +=========================================================== +* Require dotclear 2.28 +* Require php 8.1 +* Fix permissions +* Code review + DotclearWatch 0.9 - 2023.10.07 =========================================================== * Require dotclear 2.28 diff --git a/README.md b/README.md index bce15ac..7ed9aee 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # README [![Release](https://img.shields.io/badge/release-0.9-a2cbe9.svg)](https://git.dotclear.watch/dw/DotclearWatch/releases) -![Date](https://img.shields.io/badge/date-2023.10.07-c44d58.svg)] +![Date](https://img.shields.io/badge/date-2023.10.07-c44d58.svg) [![Dotclear](https://img.shields.io/badge/dotclear-v2.28-137bbb.svg)](https://fr.dotclear.org/download) [![Dotaddict](https://img.shields.io/badge/dotaddict-official-9ac123.svg)](https://plugins.dotaddict.org/dc2/details/DotclearWatch) [![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/dw/DotclearWatch/src/branch/master/LICENSE) diff --git a/_define.php b/_define.php index ad6e9cf..a514480 100644 --- a/_define.php +++ b/_define.php @@ -1,28 +1,30 @@ registerModule( 'Dotclear Watch', 'Send report about your Dotclear', 'Jean-Christian Denis and contributors', - '0.9', + '0.9.1', [ - 'requires' => [ - ['php', '8.1'], - ['core', '2.28'], - ], - 'type' => 'plugin', - 'support' => 'https://git.dotclear.watch/dw/' . basename(__DIR__) . '/issues', - 'details' => 'https://git.dotclear.watch/dw/' . basename(__DIR__) . '/src/branch/master/README.md', - 'repository' => 'https://git.dotclear.watch/dw/' . basename(__DIR__) . '/raw/branch/master/dcstore.xml', + 'requires' => [['core', '2.28']], + 'permissions' => 'My', + 'type' => 'plugin', + 'support' => 'https://git.dotclear.watch/dw/' . basename(__DIR__) . '/issues', + 'details' => 'https://git.dotclear.watch/dw/' . basename(__DIR__) . '/src/branch/master/README.md', + 'repository' => 'https://git.dotclear.watch/dw/' . basename(__DIR__) . '/raw/branch/master/dcstore.xml', ] ); diff --git a/dcstore.xml b/dcstore.xml index b1d5e5d..9851ff4 100644 --- a/dcstore.xml +++ b/dcstore.xml @@ -2,10 +2,10 @@ Dotclear Watch - 0.9 + 0.9.1 Jean-Christian Denis and contributors Send report about your Dotclear - https://git.dotclear.watch/dw/DotclearWatch/releases/download/v0.9/plugin-DotclearWatch.zip + https://git.dotclear.watch/dw/DotclearWatch/releases/download/v0.9.1/plugin-DotclearWatch.zip 2.28 https://git.dotclear.watch/dw/DotclearWatch/src/branch/master/README.md https://git.dotclear.watch/dw/DotclearWatch/issues diff --git a/src/Backend.php b/src/Backend.php index 71f49a0..a8a6f5a 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -1,15 +1,5 @@ put( 'hidden_modules', 'DotclearWatch', diff --git a/src/My.php b/src/My.php index 6e0475f..7761fcf 100644 --- a/src/My.php +++ b/src/My.php @@ -1,27 +1,20 @@ isSuperAdmin(); - } + // Use default permissions } diff --git a/src/Utils.php b/src/Utils.php index 2de2054..09c6aa4 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -1,15 +1,5 @@ The hiddens modules IDs */ + /** + * The hiddens modules IDs. + * + * @var array $hiddens + */ private static array $hiddens = []; - /** @var string Multiblog unique identifiant */ + /** + * Multiblog unique identifiant. + * + * @var string $uid + */ private static string $uid = ''; /** @@ -74,7 +92,7 @@ class Utils if ($strict && in_array($define->getId(), $hiddens)) { continue; } - $modules[$define->getId()] = $define->get('version'); + $modules[(string) $define->getId()] = (string) $define->get('version'); } return $modules; @@ -100,7 +118,7 @@ class Utils if ($strict && in_array($define->getId(), $hiddens)) { continue; } - $modules[$define->getId()] = $define->get('version'); + $modules[(string) $define->getId()] = (string) $define->get('version'); } return $modules; @@ -240,12 +258,12 @@ class Utils private static function check(): bool { - return defined('DC_CRYPT_ALGO'); + return true; // not yet } private static function key(): string { - return Crypt::hmac(self::uid() . My::id(), DC_CRYPT_ALGO); + return Crypt::hmac(self::uid() . My::id(), App::config()->cryptAlgo()); } private static function uid(): string @@ -315,15 +333,6 @@ class Utils App::log()->addLog($cur); } - private static function read(): string - { - $rs = App::log()->getLogs([ - 'log_table' => My::id() . '_report', - ]); - - return $rs->isEmpty() || !is_string($rs->f('log_msg')) ? '' : $rs->f('log_msg'); - } - private static function expired(): bool { $rs = App::log()->getLogs([ @@ -349,7 +358,7 @@ class Utils 'count' => (int) App::blogs()->getBlogs([], true)->f(0), ], 'core' => [ - 'version' => DC_VERSION, + 'version' => App::config()->dotclearVersion(), ], 'server' => self::getServer(), 'php' => [