From 2ddca1edcf434857361dd4e708c3120de1d761f5 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sun, 8 Jan 2023 00:42:34 +0100 Subject: [PATCH] release 1.0 --- _define.php | 8 ++--- _install.php | 2 +- _prepend.php | 13 +++++++- dcstore.xml | 4 +-- inc/Core.php | 1 - inc/Install.php | 6 ++-- inc/Prepend.php | 2 +- inc/ReservedWhiteList.php | 3 +- inc/UnmoderatedWhiteList.php | 4 +++ locales/fr/main.lang.php | 14 ++++---- locales/fr/main.po | 64 +++++++++++++++--------------------- 11 files changed, 63 insertions(+), 58 deletions(-) diff --git a/_define.php b/_define.php index 61a5358..b3af75d 100644 --- a/_define.php +++ b/_define.php @@ -18,7 +18,7 @@ $this->registerModule( 'Whitelist comments', 'Whitelists for comments moderation', 'Jean-Christian Denis and Contributors', - '0.9', + '1.0', [ 'requires' => [['core', '2.24']], 'permissions' => dcCore::app()->auth->makePermissions([ @@ -27,8 +27,8 @@ $this->registerModule( ]), 'priority' => 200, 'type' => 'plugin', - 'support' => 'https://github.com/JcDenis/whiteListCom', - 'details' => 'https://plugins.dotaddict.org/dc2/details/whiteListCom', - 'repository' => 'https://raw.githubusercontent.com/JcDenis/whiteListCom/master/dcstore.xml', + 'support' => 'https://github.com/JcDenis/' . basename(__DIR__), + 'details' => 'https://plugins.dotaddict.org/dc2/details/' . basename(__DIR__), + 'repository' => 'https://raw.githubusercontent.com/JcDenis/' . basename(__DIR__) . '/master/dcstore.xml', ] ); diff --git a/_install.php b/_install.php index 8ac3be3..24d3123 100644 --- a/_install.php +++ b/_install.php @@ -5,7 +5,7 @@ * @package Dotclear * @subpackage Plugin * - * @author Jean-Christian Denis + * @author Jean-Christian Denis and Contributors * * @copyright Jean-Christian Denis * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html diff --git a/_prepend.php b/_prepend.php index 0631e66..be0d3c2 100644 --- a/_prepend.php +++ b/_prepend.php @@ -1,4 +1,15 @@ Whitelist comments - 0.9 + 1.0 Jean-Christian Denis and Contributors Whitelists for comments moderation - https://github.com/JcDenis/whiteListCom/releases/download/v0.9/plugin-whiteListCom.zip + https://github.com/JcDenis/whiteListCom/releases/download/v1.0/plugin-whiteListCom.zip 2.24 https://plugins.dotaddict.org/dc2/details/whiteListCom https://github.com/JcDenis/whiteListCom diff --git a/inc/Core.php b/inc/Core.php index b2f487c..6010cd6 100644 --- a/inc/Core.php +++ b/inc/Core.php @@ -19,7 +19,6 @@ use dcBlog; use dcCore; use dcUtils; - /** * @ingroup DC_PLUGIN_WHITELISTCOM * @brief White list filters methods diff --git a/inc/Install.php b/inc/Install.php index 76aafb3..d7aedf2 100644 --- a/inc/Install.php +++ b/inc/Install.php @@ -1,11 +1,11 @@ fetch()) { if (preg_match('/^whiteListCom(.*?)$/', $record->setting_id, $match)) { - $value = @unserialize(@base64_decode($x)); + $value = @unserialize(@base64_decode($record->setting_value)); $cur = dcCore::app()->con->openCursor(dcCore::app()->prefix . dcNamespace::NS_TABLE_NAME); $cur->setting_id = $match[1]; $cur->setting_ns = self::$pid; diff --git a/inc/Prepend.php b/inc/Prepend.php index 9da5262..4ec2385 100644 --- a/inc/Prepend.php +++ b/inc/Prepend.php @@ -15,6 +15,7 @@ declare(strict_types=1); namespace Dotclear\Plugin\whiteListCom; /* dotclear ns */ +use dcBlog; use dcCore; /* clearbricks ns */ @@ -78,4 +79,3 @@ class Prepend return true; } } - diff --git a/inc/ReservedWhiteList.php b/inc/ReservedWhiteList.php index 270a0f9..7ede74a 100644 --- a/inc/ReservedWhiteList.php +++ b/inc/ReservedWhiteList.php @@ -27,7 +27,6 @@ use http; /* php ns */ use Exception; - /** * @ingroup DC_PLUGIN_WHITELISTCOM * @brief Filter for reserved names. @@ -88,7 +87,7 @@ class ReservedWhiteList extends dcSpamFilter $wlc->addReserved($name, $_POST['reserved_email'][$i]); } $wlc->commit(); - dcPage::addSuccessNotice(__('Reserved name have been successfully updated.')); + dcPage::addSuccessNotice(__('Reserved names have been successfully updated.')); http::redirect($url); } diff --git a/inc/UnmoderatedWhiteList.php b/inc/UnmoderatedWhiteList.php index 7946c8f..047b007 100644 --- a/inc/UnmoderatedWhiteList.php +++ b/inc/UnmoderatedWhiteList.php @@ -16,11 +16,13 @@ namespace Dotclear\Plugin\whiteListCom; /* dotclear ns */ use dcCore; +use dcPage; use dcSpamFilter; /* clearbricks ns */ use form; use html; +use http; /* php ns */ use Exception; @@ -77,6 +79,8 @@ class UnmoderatedWhiteList extends dcSpamFilter $wlc->addUnmoderated($email); } $wlc->commit(); + dcPage::addSuccessNotice(__('Unmoderated names have been successfully updated.')); + http::redirect($url); } $posts = $wlc->getPostsUsers(); $comments = $wlc->getCommentsUsers(); diff --git a/locales/fr/main.lang.php b/locales/fr/main.lang.php index 720847b..ea86299 100644 --- a/locales/fr/main.lang.php +++ b/locales/fr/main.lang.php @@ -9,14 +9,16 @@ # DOT NOT MODIFY THIS FILE ! # -l10n::$locales['Unmoderated authors'] = 'Auteurs non modérés'; -l10n::$locales['Whitelist of unmoderated authors'] = 'Liste blanche des auteurs non modérés'; -l10n::$locales['This filter is used only if comments are moderates'] = 'Ce filtre est utilisé seulement si les commentaires sont modérés.'; -l10n::$locales['Check the users who can make comments without being moderated.'] = 'Cocher les utilisateurs qui peuvent faire des commentaires sans être modérés.'; -l10n::$locales['Posts authors list'] = 'Liste des auteurs de billets'; -l10n::$locales['Comments authors list'] = 'Liste des auteurs de commentaires'; l10n::$locales['Reserved names'] = 'Noms réservés'; l10n::$locales['Whitelist of reserved names of users'] = 'Liste blanche des noms d\'utilisateurs réservés'; l10n::$locales['This name is reserved to an other user.'] = 'Ce nom est réservé à un autre utilisateur.'; +l10n::$locales['Reserved names have been successfully updated.'] = 'Le noms réservés ont été mis à jour.'; +l10n::$locales['Check the users who can make comments without being moderated.'] = 'Cocher les utilisateurs qui peuvent faire des commentaires sans être modérés.'; +l10n::$locales['Comments authors list'] = 'Liste des auteurs de commentaires'; +l10n::$locales['Unmoderated authors'] = 'Auteurs non modérés'; +l10n::$locales['Whitelist of unmoderated authors'] = 'Liste blanche des auteurs non modérés'; +l10n::$locales['Unmoderated names have been successfully updated.'] = 'Les noms non modérés ont été mis à jour.'; +l10n::$locales['This filter is used only if comments are moderates'] = 'Ce filtre est utilisé seulement si les commentaires sont modérés.'; +l10n::$locales['Posts authors list'] = 'Liste des auteurs de billets'; l10n::$locales['Whitelists for comments moderation'] = 'Listes blanches pour la modération de commentaires'; l10n::$locales['Whitelist comments'] = 'Liste blanche des commentaires'; diff --git a/locales/fr/main.po b/locales/fr/main.po index 404bc7f..1e4cb50 100644 --- a/locales/fr/main.po +++ b/locales/fr/main.po @@ -1,58 +1,48 @@ -# Language: Français -# Module: whiteListCom - 0.6 -# Date: 2013-11-13 08:01:14 -# Translated with translater 2013.05.11 - msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" -"Project-Id-Version: whiteListCom 0.6\n" +"Project-Id-Version: whiteListCom 1.0\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2013-11-13T08:01:14+00:00\n" +"PO-Revision-Date: 2023-01-07T23:39:35+00:00\n" "Last-Translator: Jean-Christian Denis\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: inc/lib.whitelistcom.php:34 -msgid "Unmoderated authors" -msgstr "Auteurs non modérés" - -#: inc/lib.whitelistcom.php:35 -msgid "Whitelist of unmoderated authors" -msgstr "Liste blanche des auteurs non modérés" - -#: inc/lib.whitelistcom.php:87 -msgid "This filter is used only if comments are moderates" -msgstr "Ce filtre est utilisé seulement si les commentaires sont modérés." - -#: inc/lib.whitelistcom.php:93 -#: inc/lib.whitelistcom.php:216 -msgid "Check the users who can make comments without being moderated." -msgstr "Cocher les utilisateurs qui peuvent faire des commentaires sans être modérés." - -#: inc/lib.whitelistcom.php:96 -msgid "Posts authors list" -msgstr "Liste des auteurs de billets" - -#: inc/lib.whitelistcom.php:117 -#: inc/lib.whitelistcom.php:217 -msgid "Comments authors list" -msgstr "Liste des auteurs de commentaires" - -#: inc/lib.whitelistcom.php:158 msgid "Reserved names" msgstr "Noms réservés" -#: inc/lib.whitelistcom.php:159 msgid "Whitelist of reserved names of users" msgstr "Liste blanche des noms d'utilisateurs réservés" -#: inc/lib.whitelistcom.php:187 -#: inc/lib.whitelistcom.php:193 msgid "This name is reserved to an other user." msgstr "Ce nom est réservé à un autre utilisateur." +msgid "Reserved names have been successfully updated." +msgstr "Le noms réservés ont été mis à jour." + +msgid "Check the users who can make comments without being moderated." +msgstr "Cocher les utilisateurs qui peuvent faire des commentaires sans être modérés." + +msgid "Comments authors list" +msgstr "Liste des auteurs de commentaires" + +msgid "Unmoderated authors" +msgstr "Auteurs non modérés" + +msgid "Whitelist of unmoderated authors" +msgstr "Liste blanche des auteurs non modérés" + +msgid "Unmoderated names have been successfully updated." +msgstr "Les noms non modérés ont été mis à jour." + +msgid "This filter is used only if comments are moderates" +msgstr "Ce filtre est utilisé seulement si les commentaires sont modérés." + +msgid "Posts authors list" +msgstr "Liste des auteurs de billets" + msgid "Whitelists for comments moderation" msgstr "Listes blanches pour la modération de commentaires"