News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

account activation link problem

Started by rafipl, March 17, 2012, 19:58:54 PM

Previous topic - Next topic

thealmega

hi,

i think the problem is that virtuemart uses the current user object and doesnt create a new one

//To find out, if we have to register a new user, we take a look on the id of the usermodel object.
//The constructor sets automatically the right id.
$new = ($this->_id < 1);
if(empty($this->_id)){
//$user = JFactory::getUser();
$user = new JUser;
} else {
$user = JFactory::getUser($this->_id);
}


this fixed the problem for me

Milbo

Thank you, sounds valid added to the core. Lets test it.
Should I fix your bug, please support the VirtueMart project and become a [url=http://extensions.virtuemart.net/support/virtuemart-supporter-membership-detail]member[/url]
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

nascent

Hi thealmega,
Where is this code supposed to go?
I would like to test it on my site.

cheers,
n

Maxim Pishnyak

com_virtuemart.2.0.22\administrator\components\com_virtuemart\models\user.php
You can support Community by voting for Project on the JED
[url="https://extensions.joomla.org/extension/virtuemart/#reviews"]https://extensions.joomla.org/extension/virtuemart/#reviews[/url]
Join us at
[url="https://twitter.com/virtuemart"]https://twitter.com/virtuemart[/url]


ufo_hk

Hi,

for Joomla 2.5.14 VM 2.0.20b I applied fix as per thealmega's post and it resolved the registration problem I was having.

For others who are looking to test /use.
File is for above VM version: administrator\components\com_virtuemart\models\user.php

Line where edit starts: 490

Cheers

fastpat27

#66
Quote from: templeton on May 09, 2013, 23:06:37 PM
This is much simpler:

1)  Comment out the following lines in components/com_users/controllers/registration.php (line 34 for me):

      if ($user->get('id')) {
         $this->setRedirect('index.php');
         return true;
      }

So like this:

      /*if ($user->get('id')) {
         $this->setRedirect('index.php');
         return true;
      }*/


2) Modify the following line of code in components/com_users/models/registration.php (line 47 for me):

         ' AND '.$db->quoteName('lastvisitDate').' = '.$db->Quote($db->getNullDate())

So like this:

         '' //' AND '.$db->quoteName('lastvisitDate').' = '.$db->Quote($db->getNullDate())


It's a Joomla com_users hack but it's pretty simple to execute.

Seems to have worked for me, Thanks Templeton

FP

Edit: Just one question, will this need to be done if Joomla or Virtuemart is updated to newer versions?? Currently on Joomla 2.5.14 and VM 2.0.22a

rauschr

Quote from: fastpat27 on September 07, 2013, 18:50:59 PM
Quote from: templeton on May 09, 2013, 23:06:37 PM
This is much simpler:

1)  Comment out the following lines in components/com_users/controllers/registration.php (line 34 for me):

      if ($user->get('id')) {
         $this->setRedirect('index.php');
         return true;
      }

So like this:

      /*if ($user->get('id')) {
         $this->setRedirect('index.php');
         return true;
      }*/


2) Modify the following line of code in components/com_users/models/registration.php (line 47 for me):

         ' AND '.$db->quoteName('lastvisitDate').' = '.$db->Quote($db->getNullDate())

So like this:

         '' //' AND '.$db->quoteName('lastvisitDate').' = '.$db->Quote($db->getNullDate())


It's a Joomla com_users hack but it's pretty simple to execute.

Seems to have worked for me, Thanks Templeton

FP

Edit: Just one question, will this need to be done if Joomla or Virtuemart is updated to newer versions?? Currently on Joomla 2.5.14 and VM 2.0.22a

This is wrong way !
I think, it should not login without active users.
It is very big security problem.

serhiox

thealmega, Maxim Pishnyak> thanks guys, it works.  :) (2 days suffering) Спасибо Максим! 8)

kok

#69
Help, killed a few hours so not solved the problem.
Activation link not worked :-(
Activation link: http://www.softex.it-klub.ru/index.php?option=com_users&task=registration.activate&token=bfd01e78d58d4b85f78746a04040dc94 ,
but output error message "Warning    Registration failed: Verification code not found."

Ну просто жесть :-(
Столько времени убил, а активация так и не работает.
Joomla! 2.5.27
VirtueMart 2.6.10

kok

#70
Why is "out of the box" does not work for activation user by e-mail?
This is the is basic functionality!
On a clean system will work or not?
Why is www and non-www hemorrhoids?

I was caught on a hook with this VM :-(
Joomla! 2.5.27
VirtueMart 2.6.10

thanili

#71
Quote from: thealmega on June 26, 2013, 01:36:16 AM
hi,

i think the problem is that virtuemart uses the current user object and doesnt create a new one

//To find out, if we have to register a new user, we take a look on the id of the usermodel object.
//The constructor sets automatically the right id.
$new = ($this->_id < 1);
if(empty($this->_id)){
//$user = JFactory::getUser();
$user = new JUser;
} else {
$user = JFactory::getUser($this->_id);
}


this fixed the problem for me

This is the best solutions proposed and actually it is working. However there is a small "bug" in the flow. If the user tries to checkout without first having logged in then:

a) he fills his registration data
b) selects the button "Register & Checkout"
c)  check in the backend and found that his account IS NOT activated
d) he checks out succesfully (without loggin in)
e) the email sent to him includes a working link ... BUT the message he gets is "Registration failed: Verification code not found."

i assume that in step (e) the link is working because when i clicked on it, it Activated user's account!!

vixensjlin

Still have this issue with 2.026.  So we still don't have it fixed?  On top of it, I am using https when user start register......
Hopefully we will get it fixed in the next revision.

Everybody have nice holiday!

eag

When this change will be included in future updates?

With each update you have to re-edit the core to work the registration process correctly when activation by the customer is required.

Renata

Same issue here. I am using Joomla 2.5.17 and VM 2.0.26a

url: http://www.wingsofchange.nl/webwinkel

I see a lot of solutions here to add some script, but imho this is not the solution. Eacht time there is an update (which happens a lot) you have to add the script again. I hope the team of Virtuemart will come with a solution asap?

I hope to hear from you soon,

Kind regards
Renata
Please visit my website [url="https://responsivewebsitemaken.nl"]https://responsivewebsitemaken.nl[/url] for all your graphic webdesign and Joomla websites.