From 51af8043c6f903f3a433e06feaea9c2b93a604bd Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 4 Nov 2023 22:07:38 +0100 Subject: [PATCH] code review --- CHANGELOG.md | 6 ++++++ README.md | 4 ++-- _define.php | 2 +- dcstore.xml | 4 ++-- src/BackendBehaviors.php | 4 ++-- src/My.php | 1 + 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05f59e1..c9a013f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +tweakStores 1.2 - 2023.11.04 +=========================================================== +* Require Dotclear 2.28 +* Require PHP 8.1 +* Code review + tweakStores 1.1 - 2023.10.21 =========================================================== * Require Dotclear 2.28 diff --git a/README.md b/README.md index 53b613f..51f4d5d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # README -[![Release](https://img.shields.io/badge/release-1.1-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/tweakStores/releases) -![Date](https://img.shields.io/badge/date-2023.10.21-c44d58.svg) +[![Release](https://img.shields.io/badge/release-1.2-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/tweakStores/releases) +![Date](https://img.shields.io/badge/date-2023.11.04-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/tweakStores) [![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/tweakStores/src/branch/master/LICENSE) diff --git a/_define.php b/_define.php index 04b03b7..31e84a0 100644 --- a/_define.php +++ b/_define.php @@ -17,7 +17,7 @@ $this->registerModule( 'Tweak stores', 'Helper to manage external repositories', 'Jean-Christian Denis and Contributors', - '1.1', + '1.2', [ 'requires' => [['core', '2.28']], 'permissions' => 'My', diff --git a/dcstore.xml b/dcstore.xml index 7872c19..336fe5a 100644 --- a/dcstore.xml +++ b/dcstore.xml @@ -2,10 +2,10 @@ Tweak stores - 1.1 + 1.2 Jean-Christian Denis and Contributors Helper to manage external repositories - https://git.dotclear.watch/JcDenis/tweakStores/releases/download/v1.1/plugin-tweakStores.zip + https://git.dotclear.watch/JcDenis/tweakStores/releases/download/v1.2/plugin-tweakStores.zip 2.28 https://git.dotclear.watch/JcDenis/tweakStores/src/branch/master/README.md https://git.dotclear.watch/JcDenis/tweakStores/issues diff --git a/src/BackendBehaviors.php b/src/BackendBehaviors.php index 02c9dcd..6130f07 100644 --- a/src/BackendBehaviors.php +++ b/src/BackendBehaviors.php @@ -300,7 +300,7 @@ class BackendBehaviors echo (new Para())->class('field')->items([ (new Label(__('Your password:')))->for('tweakstore_pwd')->class('required'), - (new Password(['your_pwd', 'tweakstore_pwd']))->size(20)->maxlenght(255)->required(true)->placeholder(__('Password'))->autocomplete('current-password'), + (new Password(['your_pwd', 'tweakstore_pwd']))->size(20)->maxlength(255)->required(true)->placeholder(__('Password'))->autocomplete('current-password'), ])->render() . '

' . '' . __('Copy to clipboard') . '' . @@ -329,7 +329,7 @@ class BackendBehaviors // s_file_pattern (new Para())->items([ (new Label(__('Predictable URL to zip file on the external repository')))->for('ts_file_pattern'), - (new Input('ts_file_pattern'))->size(65)->maxlenght(255)->class('maximal')->value(self::settings()->file_pattern), + (new Input('ts_file_pattern'))->size(65)->maxlength(255)->class('maximal')->value(self::settings()->file_pattern), ]), (new Note())->text(__('You can use widcard like %author%, %type%, %id%, %version%.'))->class('form-note'), (new Note())->text(__('For example on github https://github.com/MyGitName/%id%/releases/download/v%version%/%type%-%id%.zip'))->class('form-note'), diff --git a/src/My.php b/src/My.php index af83785..76dfce9 100644 --- a/src/My.php +++ b/src/My.php @@ -19,6 +19,7 @@ class My extends MyPlugin public static function checkCustomContext(int $context): ?bool { return match ($context) { + // Limit ot super admin self::MODULE => App::auth()->isSuperAdmin(), default => null, };