Author Topic: securityimages within virtuemart  (Read 18988 times)

cedricwalter

  • Administrator
  • phpBB Hero Member
  • *****
  • Posts: 1146
  • Karma: 0
    • View Profile
    • http://www.waltercedric.com
securityimages within virtuemart
« on: September 01, 2006, 06:36:18 pm »
I am currently trying to make virtuemart work with securityimages.

the first part was quite easy, the captcha picture get displayed everywhere where it has to. But virtuemart is playing with PHP sessions and seems to overwrite the values stored by the captcha plugins. So the check currently always fail. I am on it, but need more time to understand how Virtuemart internal deal with sessions.
« Last Edit: September 03, 2006, 04:19:00 pm by cedricwalter »

Anonymous

  • Guest
Re: securityimages within virtuemart
« Reply #1 on: September 18, 2006, 11:12:47 pm »
Does the recent launch of Virtuemart 1.0.7 make it easier to use securityimages, I think there was something in the changelog about handling sessions differently.
« Last Edit: September 18, 2006, 11:20:43 pm by Anonymous »

cedricwalter

  • Administrator
  • phpBB Hero Member
  • *****
  • Posts: 1146
  • Karma: 0
    • View Profile
    • http://www.waltercedric.com
Re: securityimages within virtuemart
« Reply #2 on: September 21, 2006, 11:58:42 am »
I don't know, ive strugle nearly 3 days on my renewed ladtop, 4 non working backups (backuping since months without errors), I did not lost any joomla code, but I will have to check everything. For virtuemart, I will give feedback as soon as I stabilize securityimages 4.0.0 and opencomment (too much people are waiting on it)

Legoland

  • Guest
Re: securityimages within virtuemart
« Reply #3 on: January 10, 2007, 03:50:07 pm »
Hey Walter, what's up?

I am a Joomla & Virtuemart user and I've installed Securityimages to avoid spammers from my store.

When I was trying to config the component in the Virtuemart register form I started to have some problems, and only after that I tried to figure what was happening in Virtuemart's and Securityimage's forum.

I notice that you are having some problems with Virtuemart PHP Sessions, and this situation made me think about some possible solutions.

Isn't it possible for you to adapt Securityimages to send their strings through Virtuemart extrafields? If I am not wrong they have 4, and this way you don't have to worry about the sessions anymore.

I really do hope you fix this problem, Securityimages is one heck of a component. Please, e-mail me if I can help you in anything.

Good luck.

Legoland.

cedricwalter

  • Administrator
  • phpBB Hero Member
  • *****
  • Posts: 1146
  • Karma: 0
    • View Profile
    • http://www.waltercedric.com
Re: securityimages within virtuemart
« Reply #4 on: January 14, 2007, 10:27:45 pm »
try the latest version of securityimages 4.1.2 it use the same session name as Joomla! and as such should be now working properly also with virtuemart.

Legoland

  • Guest
Re: securityimages within virtuemart
« Reply #5 on: January 16, 2007, 02:53:05 am »
Could you tell me what are the files that I have to change (php form and php form checking), just to make sure the component really works please?

Thank you very much.

Legoland.

cedricwalter

  • Administrator
  • phpBB Hero Member
  • *****
  • Posts: 1146
  • Karma: 0
    • View Profile
    • http://www.waltercedric.com
Re: securityimages within virtuemart
« Reply #6 on: January 16, 2007, 09:11:48 pm »
no I did not take time to look at it, last time was 8 months ago....

why not asking the author of virtuemart? it is better if it goes in main code and stay there instead of always hacking core files.

Currently I have no time to look at all 3PD components and develop new functionnalities in my components at the same time, but enter a change request in my bug tracking system: bugs.waltercedric.com

cedricwalter

  • Administrator
  • phpBB Hero Member
  • *****
  • Posts: 1146
  • Karma: 0
    • View Profile
    • http://www.waltercedric.com
Re: securityimages within virtuemart
« Reply #7 on: February 12, 2007, 08:03:18 pm »
get an email today from main virtuemart developer:

Hi Walter,

I'm sorry for not having replied to your post which was 169 days ago.
On the weekend I have updated the security images component on virtuemart.net to version 4.1.2 and I had to make changes to the server-side checking code to make it run when a session is already started. In this case this was the SMF session- on VirtueMart it's the VirtueMart session which is already started.

I can send you the change, which is a small modification that ends an existing session and starts a new one with the session_name (md5($mosconfig_live_site)). the problem is that if a session is already started, it has a different name and so your hash func values point into a wrong session.

Please let me know...I'm interested in integrating Security Images into VirtueMart registration and mail forms.

ciao, Sören


So I will put his code in securityimages 4.1.3 !

soeren

  • Guest
Re: securityimages within virtuemart
« Reply #8 on: February 13, 2007, 08:37:54 am »
Hi Walter,

thanks for pointing me to your forums  ;)

Well, the changes I have made are not big, but they should fix problems that occur when you're using a script on your Joomla! site that has started a session with a different session name than "md5($mosConfig_live_site)" before Security Images can do that (= SMF bridge, VirtueMart and many others).

The checker code is affected by such problems, not the image generation code.
So the checker code must check for an opened session with a different session name, stop that session and start a new one. EASY!

I'm using freecap, so I have changed the code in the file /administrator/components/com_securityimages/pluginsA/freecap/1.4/checker.php, function icheckSecurityImage


FROM
Code: [Select]
session_name( md5( $mosConfig_live_site ) );
session_start();

TO

Code: [Select]
if( empty( $_SESSION )) {
session_name( md5( $mosConfig_live_site ) );
session_start();
} elseif( session_name() != md5( $mosConfig_live_site ) ) {
$old_session = session_name();
session_write_close();

session_name( md5( $mosConfig_live_site ) );
session_start();
}

I have preserved the old session name in an extra variable, so we can stop the Security Images session and restart the session we had before, before returning "true" or "false".

Another small Javascript improvement can be done in the function SecurityImagesNew, file /components/com_securityimages/js/securityImages.js: It now needs 3 arguments (in the 3.1.x series it needed no argument). But one argument would be enough and the other 2 could be optional!

This is my changed function:

Code: [Select]
function SecurityImagesNew(packageName, packageNameTry,packageNameReload )
{
myImageGeneratorSource = getElement(packageName).src;   
    myImage= getElement(packageName);
    if( !packageNameTry ) { // Assemble the fieldname
packageNameTry = packageName + '_try';
    }
    if( !packageNameReload ) {
packageNameReload = packageName + '_reload';
    }
    myUserInputBox=  getElement(packageNameTry);
    myReloadHiddenField = getElement(packageNameReload);


    //reset input box
    myUserInputBox.value="";

   
    //ask server for a new picture, reload will be use to determine entry shift into DB
    myImage.src = myImageGeneratorSource+"&reload="+myReloadCounter;

    myImage.height = myImage.height;
    myImage.width = myImage.width;
   
    //reload counter submitted for checker
    myReloadHiddenField.value=myReloadCounter;
    myReloadCounter++;
    myUserInputBox.focus();
}

So you only need to pass one argument to the function. Example:

Code: [Select]
<script>SecurityImagesNew( 'security_vmreg' );</script>
I needed to call the function directly for my ajax-based registration form for the SMF forum.

I hope this helps others as well.

ciao, Sören

cedricwalter

  • Administrator
  • phpBB Hero Member
  • *****
  • Posts: 1146
  • Karma: 0
    • View Profile
    • http://www.waltercedric.com
Re: securityimages within virtuemart
« Reply #9 on: February 18, 2007, 08:26:27 pm »
thanks Soeren,

Ive made changes ad will build a new version securityimages 4.1.3
Which virtuemart version or virtuemart  plugins do users need for enjoying captcha in their shop?

Cédric

soeren

  • Guest
Re: securityimages within virtuemart
« Reply #10 on: February 26, 2007, 11:30:22 am »
Hi,

currently the integration with Security Images would require a manual modification of VirtueMart's registration page (/html/checkout_register_form.php) and the shopperAdd code (/classes/ps_shopper.php, function validate_add() ).

The next bigger version of Virtuemart (1.1) will include this feature, but the current version doesn't.

Thanks for integrating the changes into your component!

ciao, Sören

jsanglier

  • Guest
Re: securityimages within virtuemart
« Reply #11 on: March 30, 2007, 11:18:42 pm »
Hi Guys, very interesting thread!

I am developing a site with the current stable version of Virtuemart, the current stable version of Joomla and security image 4.1.2

Any chance someone could tell me what modifications I have to do to make them work together?

Thanks a million!!

On an unrelated side note - do any of you Joomla experts have a solution for a little problem I am having? I have put the News section on my mainmenu, then added two submenus using table category content.

It all shows up fine. However, when you click on the links for the various news articles, they are all out of sync. The first link just goes back to the list of articles. The second one links to the first article and the third to the second ... and so on!

Sorry, no link to demonstrate - I have switched the site off as I am gettting hit by spam registrations (which is why I want the captcha!)

Again - lots and lots thanks!!


Joss

aravot

  • Guest
Re: securityimages within virtuemart
« Reply #12 on: August 05, 2007, 03:27:21 am »
Quote from: "cedricwalter"
thanks Soeren,

Ive made changes ad will build a new version securityimages 4.1.3
Which virtuemart version or virtuemart  plugins do users need for enjoying captcha in their shop?

Cédric

Where to download Security Images 4.1.3, download section has v4.1.2

aravot

  • Guest
Re: securityimages within virtuemart
« Reply #13 on: August 17, 2007, 08:57:56 pm »
I found version 4.2 it is in descending order.

Is there a compatibility chance for VirtueMart 1.0.x series.

cedricwalter

  • Administrator
  • phpBB Hero Member
  • *****
  • Posts: 1146
  • Karma: 0
    • View Profile
    • http://www.waltercedric.com
Re: securityimages within virtuemart
« Reply #14 on: August 17, 2007, 09:17:48 pm »
from forums.waltercedric.com/index.php?topic=277.msg1062#msg1062
Quote
Soeren has provide me the needed patch in SI 4.2.0 for making it work with virtuemart. I do not know how much efforts or how to make all changes in virtuemart 1.0.10 to make both work together. You'll have to wait till 1.1 get out. Sorry.

normally with SI 4.2.0 and virtuemart >= 1.1 you are done

 

anything