|
Friday, 04 April 2008 21:30 |
|
Page 1 of 2
SecurityImages 5.X is only running with Joomla! 1.5 and the redesign of API has introduced some incompatibilities. Developers/Hackers/Individuals who want to use the latest version of SecurityImages may want to read the following. Basic PHP knowledge is recommended. Architecture SecurityImages 4.0.X - Only work with Joomla! 1.0.X
- Provide 2 files that 3rd party code must include:
- client.php in order to quickly create a captcha and the input box
- server.php in order to validate user entries and check correctness
- Everything is packed in one component.
- Patches for common 3rd party tool are included in code so it ca be referenced by external extensions :
akobook, akocomment, joomla to name a few. - You have to overwrite Joomla! files to add protection of form for login, register, lost password, contact
SecurityImages 5.0.X - Only work with Joomla! 1.5.X
- Use the event handling mechanism of Joomla! 1.5 to create captcha and check correctness
- You'll have to install a system content plugin and a component,
- it do not contains any patches anymore
- You have to overwrite Joomla! files to add protection of form for login, register, lost password, contact
Main differences in securityImages 5.X - There is no client.php and server.php file anymore
- API are a lot simpler, and dependency are reduced (no PHP code to include) as it use events.
- More object oriented
- Image creation is done inside the Joomla! framework while in 4.0.X it was done without any Joomla!
framework support.
with SecurityImages 4.0.X | In your PHP code displaying the form, can be a Pat template or a html code
1. Include my library in page scope if (file_exist($mosConfig_absolute_path.'/administrator/components/com_securityimages/client.php')) {<?php include ($mosConfig_absolute_path.'/administrator/components/com_securityimages/client.php'); ?> } $packageName = 'securityChooseUniqueKeyName';
2. At the position where You want the Captcha image to be inserted
<?php echo insertSecurityImage($packageName); ?> 3. This insert the help text and the input box where the user will have to enter his text
<?php echo getSecurityImageText($packageName); ?> Line at point 3. can be, in some case, depending how much space You have in the presentation HTML layer, replace with
//will be replace at runtime, depending on user locale //with "Please Enter what You see:" <?php echo getSecurityImageTextHeader(); ?> //will be replace at run time, depending on user locale with //"If You do not see ...Hit reload" <?php echo getSecurityImageTextHelp(); ?> //will be replace at run time with the input box <?php echo getSecurityImageField($packageName); ?> The code above insert the image, and the text, You page normally submit information to the server for processing. Most of the time, the last 2 lines are inserted in a <form> </form> HTML tags
In the server code where you process the data... Few lines are required...
if (file_exist($mosConfig_absolute_path.'/administrator/components/com_securityimages/server.php')) {include ($mosConfig_absolute_path.'/administrator/components/com_securityimages/server.php'); } $packageName = 'securityChooseUniqueKeyName'; $security_refid = mosGetParam( $_POST, $packageName.'_refid', '' ); $security_try = mosGetParam( $_POST, $packageName.'_try', '' ); $security_reload = mosGetParam( $_POST, $packageName.'_reload', '' ); $checkSecurity = checkSecurityImage($security_refid, $security_try);
If the has entered the right text then $checkSecurity = true
|
|
|
Last Updated on Friday, 04 April 2008 19:46 |