Migration SecurityImages 4.X to SecurityImages 5.X how to Print E-mail
User Rating: / 1
PoorBest 
Friday, 04 April 2008 21:30
Article Index
Migration SecurityImages 4.X to SecurityImages 5.X how to
with SecurityImages 5.0.X
All Pages

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.

joomla_1.5

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

  1. There is no client.php and server.php file anymore
  2. API are a lot simpler, and dependency are reduced (no PHP code to include) as it use events.
  3. More object oriented
  4. 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

 



Comments
Add New Search RSS
Write comment
Name:
Email:
 
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
:):grin;)8):p:roll:eek:upset:zzz:sigh:?:cry
:(:x
Please input the anti-spam code that you can read in the image.

3.20 Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated on Friday, 04 April 2008 19:46
 


Another articles:

Powered By relatedArticle

Content View Hits : 3452135

Enter Amount: