I’ve been working on a version of SPForm that will work with both 0.9.6 and 0.9.7.
The only real stumbling block is the veriword (CAPTCHA) function. Once it generates an image, I need to store the string value so it can be compared with the user’s entry. The comparison is done on a separate page that has no access to what happened in the veriword function.
The current MODx code in the veriword file uses StartCMSSession() and has to include config.include.php for that function. The config file is in a different place in 0.9.7 and I guess I could do a version test before including it but I’d like to find a more robust solution.
I tried using regular sesssion variables but their value isn’t there later when I need them for some reason. I tried copying the StartCMSession() function from config.include.php into the veriword file but it didn’t work, probably because it needs the session info in config.inc.php. I think the reason this is so quirky may be that the veriword file is accessed via an image URL ( <img src="veriword.php"> ) rather than as an include. I’ve toyed with saving the string in a file or in the database, but it has to be session-specific since multiple users could be sending email at the same time so it would be a pain to implement. I’d have to use the session-id as a key and I’m not sure it would be available in the veriword function. Also, I think file output would trash the image production.
I’ve considered using setPlaceholder. I assume it’s session-specific (with different values possible in different user sessions) but I’m not sure it would work inside the veriword function which I think doesn’t have access to the $modx object.
Please excuse the rambling. I’m hoping somebody can help get me pointed in the right direction.
Bob