Another Z*wiki! --DeanG, Mon, 05 Nov 2007 06:33:47 -0800 reply

http://www.mooseyard.com/Jens/2007/11/review-zackandwiki/ Good for a couple chuckles. :-)

Captcha --flemmingbjerke, Mon, 05 Nov 2007 19:08:14 -0800 reply

I try to make a captcha for zwiki by adding a captchatest to checkSufficientId in Utils.py. However, I am unable to fetch the user inserted code from checkSufficientId. The REQUEST object does not seem to have any form variables, which I don't really understand.

Captcha --betabug, Tue, 06 Nov 2007 00:23:31 -0800 reply

Hmm, I can't confirm this, I've placed a line with print REQUEST.form in checkSufficientId() and it printed out the form fields just fine. It wouldn't make any sense if checkSufficientId() did not have a REQUEST, as we are trying to get the username from the REQUEST in there.

Are you perhaps running this from unit tests? In the test environment we do not always have a real request.

Captcha --flemmingbjerke, Tue, 06 Nov 2007 15:07:42 -0800 reply

Yes, you are right, but. If I change checkSufficientId (where capcode is the code inserted):

def checkSufficientId(self, REQUEST=None):
    REQUEST = REQUEST or getattr(self,'REQUEST',None)
    print REQUEST.form.get('capcode')
    return (self.requestHasUsername(REQUEST) or
            not getattr(self,'edits_need_username',0))

And I start zope with runzope. Then I get:

Here I use Plone where I have put captcha in the comment template in portal_skins. If I insert "print REQUEST.form" and uses a zwiki outside Plone, I get:

Probably, here is the reason why I have problems. I seems like a comment implies that checkSufficientId is run 8 times, where only the first time has a proper REQUEST object. This means that a successful captcha test would be wiped out 7 times. (I use zwiki-0.59 because I still use Plone-2.5.3.)

Captcha --betabug, Wed, 07 Nov 2007 00:16:15 -0800 reply

OK, now I think I understand better what you are trying to do. I tried out the same print REQUEST.form and noticed the following:

(This is on an almost completely closed down test wiki, on an open wiki more prints will happen for anonymous users.)

Conclusion 1: Some places in the page rendering code check privileges and "sufficient ID" status to decide if displaying user interface elements. This might be slightly inefficient, but I doubt it - we're getting stuff from REQUEST, which is straightforward.

Conclusion 2: You seem to try to return False if your captcha code is not found - and since for a logged in user that code is not found quite often, all kind of stuff stops working.

Conclusion of the conclusions: Your approach is wrong, you are inserting your captcha test in the wrong place. Instead of extending checkSufficientId, better make a new method checkCaptchaCode and place a single check of that method in the relevant spot (somewhere in Editing.py, where checkSufficientId is used).

If you need help with this (of anyway it would be useful I'd say), please open a new issue with severity "wishlist" and we should bring the discussion there. Also feel free to come to #zwiki on freenode and I might help you there in (more or less) realtime.

Captcha --flemmingbjerke, Wed, 07 Nov 2007 13:50:06 -0800 reply

Using checkCaptchaCode 8 or 7 each time you edit or add a comment, isn't it overkill?

I have opened a new issue: [#1395]?.

Installing on Windows --BrianKennison, Wed, 07 Nov 2007 15:13:15 -0800 reply

Hey everyone,

I was trying to help some people today who need/want a wiki but they have to work on Windows. I told the person that I'd come and help and was thinking it would be a breeze. Well...

Zope installed easily (package by Enfield Systems) but getting ZWiki upacked was hard. Rather than having to deal with a gnu zip/unix tar file (.tgz) I was wondering how much trouble it would be to put up a Windows friendly archive?

I tried Winzip today but the free version didn't want to convert the file. I tried 7-z but no luck there. I finally installed cygwin just to unpack ZWiki.

What do you think?

-- Brian Kennison

Installing on Windows --EmmaLaurijssens, Wed, 07 Nov 2007 23:07:18 -0800 reply

Two things:

1 when you download the file with Internet Explorer, make sure you do save it as a .tgz file, because IE tends to change the extension to .tar.tar. It does that based on MIME type and it really shouldn't.

2 At least WinRAR?, but I thought WinZip? as well, can unpack .tgz files. The evaluation version of WinRAR? works fine.

Installing on Windows --BrianKennison, Thu, 08 Nov 2007 06:36:24 -0800 reply

I didn't notice that IE was changing the extension to tar. Winzip would try to open it but complain about the headers. Winzip opens it fine with the tgz extension. Thanks for the tip. --Brian