VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: patbe60 on March 05, 2016, 11:58:58 AM

Title: Recaptcha not hiding for logged in users
Post by: patbe60 on March 05, 2016, 11:58:58 AM
Hello
I enabled the option "Use ReCaptcha for Registration". The Captcha field is also showing for logged in users. It is not hidden as it should be. See attached file.
The Recaptcha function works fine for "Ask a question". It is shown for unlogged users but hidden for logged in users.

Tested with J 3.4.8, protostar template, VM 3.0.13.6

Regards
Patrik
Title: Re: Recaptcha not hiding for logged in users
Post by: Studio 42 on March 07, 2016, 14:09:08 PM
I think, you use easy recaptcha, or simillar.
Some system captcha plugin do not check for user connected and are always active.
Title: Re: Recaptcha not hiding for logged in users
Post by: patbe60 on March 08, 2016, 09:06:02 AM
Thank you for your reply.

I'm just using the default Captcha of Joomla. It's the new Recaptcha 2. And as I said, it works fine with "Ask a question".

Regards
Patrik
Title: Re: Recaptcha not hiding for logged in users
Post by: patbe60 on March 12, 2016, 11:29:13 AM
Still not solved in VM 3.0.14

Here is a solution:

/components/com_virtuemart/views/user/tmpl/edit.php

Change the following code in line 76:

if(VmConfig::get ('reg_captcha')){

into:

if(VmConfig::get ('reg_captcha') && JFactory::getUser()->guest == 1){
Title: Re: Recaptcha not hiding for logged in users
Post by: Milbo on March 13, 2016, 11:14:55 AM
thx, added. But I use this line

if($this->userDetails->virtuemart_user_id!=0 and VmConfig::get ('reg_captcha')){
Title: Re: Recaptcha not hiding for logged in users
Post by: patbe60 on March 13, 2016, 15:05:33 PM
In this case I don't see the captcha when not logged in. But I see the captcha when logged in.
Title: Re: Recaptcha not hiding for logged in users
Post by: Milbo on March 14, 2016, 02:00:59 AM
lol of course
weekend mod, sry

It is just a == instead of the !=, or you can just add the whole "if" to the "else" above
Title: Re: Recaptcha not hiding for logged in users
Post by: patbe60 on March 14, 2016, 13:24:14 PM
thx, works fine now!