clean up code

master
Jean-Christian Paul Denis 2021-09-02 23:54:55 +02:00
parent 635297e159
commit b397ea81fc
7 changed files with 85 additions and 71 deletions

View File

@ -1,26 +1,30 @@
whiteListCom 0.7 - 2021-08-19 0.7.1 - dev
* fix PSR2 coding style - [ ] ?
* update license - [x] clean up code
whiteListCom 0.6 - 2013-11-13 0.7 - 2021-08-19
* Clean up code - fix PSR2 coding style
- update license
whiteListCom 0.5 - 2011-01-19 0.6 - 2013-11-13
* Fixed calls to blog object - Clean up code
* Fixed (hope so) postgreSQL compatibility
* Added messages on admin
* New year copyright
whiteListCom 0.4 - 2010-06-05 0.5 - 2011-01-19
* Switched to DC 2.2 - Fixed calls to blog object
- Fixed (hope so) postgreSQL compatibility
- Added messages on admin
- New year copyright
whiteListCom 0.3 - 2009-11-08 0.4 - 2010-06-05
* Fixed whitout comment_trackback in admin comments list - Switched to DC 2.2
* Fixed typo
* Added LICENSE
whiteListCom 0.2 - 2009-09-27
* Changed to antispam system
whiteListCom 0.1 - 2009-09-16 0.3 - 2009-11-08
* First lab release - Fixed whitout comment_trackback in admin comments list
- Fixed typo
- Added LICENSE
0.2 - 2009-09-27
- Changed to antispam system
0.1 - 2009-09-16
- First lab release

View File

@ -2,7 +2,7 @@
## WHAT IS WHITELISTCOM ? ## WHAT IS WHITELISTCOM ?
whiteListCom "White list for comments" is a plugin for the open-source _whiteListCom_ "White list for comments" is a plugin for the open-source
web publishing software called Dotclear. web publishing software called Dotclear.
Set up a list of users which can publish comments without validation Set up a list of users which can publish comments without validation
@ -10,14 +10,14 @@ and a list of reserved names (pair of nickname / email ).
## REQUIREMENTS ## REQUIREMENTS
whiteListCom requires: _whiteListCom_ requires:
* permissions to manage antispam * permissions to manage antispam
* Dotclear 2.6 * Dotclear 2.6
## USAGE ## USAGE
First install whiteListCom, manualy from a zip package or from First install _whiteListCom_, manualy from a zip package or from
Dotaddict repository. (See Dotclear's documentation to know how do this) Dotaddict repository. (See Dotclear's documentation to know how do this)
Enable and configure "Unmoderated authors" of "Reserved names" Enable and configure "Unmoderated authors" of "Reserved names"
@ -28,4 +28,4 @@ Note: User must write a comment before able to be added to the list.
* License : GNU GPL v2 * License : GNU GPL v2
* Source & contribution : [GitHub Page](https://github.com/JcDenis/whiteListCom) * Source & contribution : [GitHub Page](https://github.com/JcDenis/whiteListCom)
* Packages & details: [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/whiteListCom) * Packages & details: [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/whiteListCom)

View File

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief whiteListCom, a plugin for Dotclear 2
# This file is part of whiteListCom, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis and Contributors
# A copy of this license is available in LICENSE file or at *
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * @copyright Jean-Christian Denis
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_RC_PATH')) { if (!defined('DC_RC_PATH')) {
return null; return null;
@ -21,11 +21,12 @@ $this->registerModule(
'Jean-Christian Denis and Contributors', 'Jean-Christian Denis and Contributors',
'0.7.1', '0.7.1',
[ [
'requires' => [['core', '2.19']],
'permissions' => 'admin', 'permissions' => 'admin',
'priority' => 200, 'priority' => 200,
'type' => 'plugin', 'type'=> 'plugin',
'dc_min' => '2.18', 'support'=> 'https://github.com/JcDenis/whiteListCom',
'support' => 'https://github.com/JcDenis/whiteListCom', 'details'=> 'https://plugins.dotaddict.org/dc2/details/whiteListCom',
'details' => 'https://plugins.dotaddict.org/dc2/details/whiteListCom' 'repository' => 'https://raw.githubusercontent.com/JcDenis/whiteListCom/master/dcstore.xml'
] ]
); );

View File

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief whiteListCom, a plugin for Dotclear 2
# This file is part of whiteListCom, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis and Contributors
# A copy of this license is available in LICENSE file or at *
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * @copyright Jean-Christian Denis
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_RC_PATH')) { if (!defined('DC_RC_PATH')) {
return null; return null;

11
dcstore.xml 100644
View File

@ -0,0 +1,11 @@
<modules xmlns:da="http://dotaddict.org/da/">
<module id="whiteListCom">
<name>Liste blanche des commentaires</name>
<version>0.7.1</version>
<author>Jean-Christian Denis and Contributors</author>
<desc>Whitelists for comments moderation</desc>
<file>https://github.com/JcDenis/whiteListCom/releases/download/v0.7.1/plugin-whiteListCom.zip</file>
<da:details>https://plugins.dotaddict.org/dc2/details/whiteListCom</da:details>
<da:support>https://github.com/JcDenis/whiteListCom</da:support>
</module>
</modules>

View File

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief whiteListCom, a plugin for Dotclear 2
# This file is part of whiteListCom, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis and Contributors
# A copy of this license is available in LICENSE file or at *
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * @copyright Jean-Christian Denis
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_RC_PATH')) { if (!defined('DC_RC_PATH')) {
return null; return null;
@ -263,13 +263,13 @@ class whiteListCom
$this->core = $core; $this->core = $core;
$this->con = $core->con; $this->con = $core->con;
$this->blog = $core->con->escape($core->blog->id); $this->blog = $core->con->escape($core->blog->id);
$core->blog->settings->addNamespace('whiteListCom'); $core->blog->settings->addNamespace('whiteListCom');
$this->settings = $core->blog->settings->whiteListCom; $this->settings = $core->blog->settings->whiteListCom;
$unmoderated = $this->settings->whiteListCom_unmoderated; $unmoderated = $this->settings->whiteListCom_unmoderated;
$this->unmoderated = self::decode($unmoderated); $this->unmoderated = self::decode($unmoderated);
$reserved = $this->settings->whiteListCom_reserved; $reserved = $this->settings->whiteListCom_reserved;
$this->reserved = self::decode($reserved); $this->reserved = self::decode($reserved);
} }
@ -283,7 +283,7 @@ class whiteListCom
'Whitelist of unmoderated users on comments', 'Whitelist of unmoderated users on comments',
true,false true,false
); );
$this->settings->put( $this->settings->put(
'whiteListCom_reserved', 'whiteListCom_reserved',
self::encode($this->reserved), self::encode($this->reserved),

View File

@ -36,6 +36,4 @@ $GLOBALS['__l10n']['This name is reserved to an other user.'] = 'Ce nom est rés
$GLOBALS['__l10n']['Whitelists for comments moderation'] = 'Listes blanches pour la modération de commentaires'; $GLOBALS['__l10n']['Whitelists for comments moderation'] = 'Listes blanches pour la modération de commentaires';
$GLOBALS['__l10n']['Whitelist comments'] = 'Liste blanche des commentaires'; $GLOBALS['__l10n']['Whitelist comments'] = 'Liste blanche des commentaires';
?>