I’ve been working with veriword.php and it kind of defeats itself, design-wise.
The veriword class definition is in the file but if you include veriword.php, it actually paints the image at that point because the code to do this is also in that file.
Ideally, the class definition should be in a separate file so users could subclass it and over-ride some of the functions.
The class could also use some extra functions to set the font directory, the noise directory, the name of the _SESSION variable used, and the maybe image directory. It would also be nice to be able to send it your own code string rather than having it use the default ones.
I’d be willing to work on this but I’m not sure about the best way. It might be hard to change the current file without breaking eForm and other current installations, although it might be possible.
OTOH, it might be better to just create a whole new class with a different name. The downside of that is the added potential for confusion and the redundant code added to MODx.
A third route would be to put the class definition code in a separate file (veriword.class.inc.php) and include it in veriword.php. Then people could subclass it, but it would make for some hard-to-understand code and a lot of coding/testing for people who wanted to add the functionality that maybe should be in the class to begin with.
Bob
If you look at the original author’s work that this class is derived from, it looks as if he has broken it into many classes. This might be the place to start looking:
http://www.phpclasses.org/browse/package/1768.html
I also found that the Veriword.php file at a small bug in it, at least on my server’s setup as described here:
http://modxcms.com/forums/index.php/topic,18849.msg117868.html#msg117868
Jesse R.
Consider trying something new and extraordinary.
Illinois Wine
Have you considered donating to MODx lately?
Donate now. Every contribution helps.
-
MODX Staff
- 10,725 Posts
This should be removed from the product for 0.9.7 completely, and put into specific add-ons or extension packages for user login. MODx should not IMO promote or sponsor any single approach to captcha images.
Quote from: OpenGeek at Oct 17, 2007, 09:13 AM
This should be removed from the product for 0.9.7 completely, and put into specific add-ons or extension packages for user login. MODx should not IMO promote or sponsor any single approach to captcha images.
That would make it easier for me, since I could package it with my form and do it the way I want to.
OTOH, removing it would break a number of current installs and I don’t see how migration to 0.9.7 could be automated since there would be no captcha support in MODx at all. Ultimately, users might end up with several different captcha-style classes scattered throughout the assets directory and used in different snippets. I think migrating this could be pretty tough on the less technical users.
If there was a class file in manager/includes, and veriword.php just had the minumu default image creation call (about 4-6 lines of code) migration would be easier (trivial if the class were written with this in mind) and people who wanted to do captcha in a different way could write a subclass that used their preferred method.
Bob