[pmwiki-users] Don't allow saving guest post for 0 modification

ABClf languefrancaise at gmail.com
Sat Dec 19 07:12:22 CST 2015


I'm testing this solution now and it looks like it's working fine, yet
(minor issue) the error message doesn't appear with my setup (might be
related to my skin).

This is usefull snippet, merci Dominique.

2015-12-17 0:01 GMT+01:00 Dominique Faure <dominique.faure at gmail.com>:
> Incidentally the test should be reverted:
>
> ...
> if ($new['text'] == $page['text']) {
> ...
>
>
> On Wed, Dec 16, 2015 at 11:59 PM, Dominique Faure
> <dominique.faure at gmail.com> wrote:
>>
>> Hi,
>>
>> A solution could be to handle this in the same way it is already done with
>> author requirement: Looking at scripts/author.php, you'll could easily see
>> that the form post is interrupted by setting the $EnablePost variable to 0;
>>
>> Have a try with the following code:
>>
>> array_unshift($EditFunctions, "DeltaPageContent");
>> function DeltaPagecontent($pagename,&$page,&$new) {
>>   global $EnablePost, $ModifiedPageContentRequiredFmt;
>>   if (!$EnablePost) return;
>>
>>   if ($new['text'] != $page['text']) {
>>     SDV($ModifiedPageContentRequiredFmt, "<h3 class='wikimessage'>$[The
>> page hasn't been modified.]</h3>");
>>     $MessagesFmt[] = $ModifiedPageContentRequiredFmt;
>>     $EnablePost = 0;
>>   }
>> }
>>
>> Regards,
>> Dominique
>>
>>
>> On Wed, Dec 16, 2015 at 2:57 PM, ABClf <languefrancaise at gmail.com> wrote:
>>>
>>> Hello,
>>>
>>> I'm facing a bit of spam on my wiki.
>>> For my defense, I use blocklist and Petko's Spamfilters cookbook.
>>>
>>> Problem is I have spammer posting unmodified pages (original text
>>> remains unaltered, yet spammer does appear in the page's history as a
>>> contributor and therefore the page is said to have been newly
>>> revised).
>>>
>>> What would be the right config lines to block such a possibility ?
>>> I would like to implement that rule : for other than admin, if page is
>>> not modified then dont allow saving it.
>>>
>>> Might the deltapagesize function (I'm using
>>> http://www.pmwiki.org/wiki/Cookbook/DeltaBytesRecentChanges) be
>>> completed, so that 0 modification means saving is unallowed ? Or is it
>>> doable to use Spamfilters Post Size option ?
>>>
>>> Thank you.
>>>
>>> _______________________________________________
>>> pmwiki-users mailing list
>>> pmwiki-users at pmichaud.com
>>> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>>
>>
>>
>>
>> --
>> Dominique
>
>
>
>
> --
> Dominique



More information about the pmwiki-users mailing list