Author Topic: Registration activation link fails on subdomain?  (Read 3298 times)

Sitestorm

  • Beginner
  • *
  • Posts: 6
Registration activation link fails on subdomain?
« on: January 27, 2014, 16:04:20 PM »
Hi, I think I have the problem described here: http://forum.virtuemart.net/index.php?topic=113802.0

(Clicking the registration confirmation link in the e-mail sends you to the home-page without activating the user)

My problem is a little different though, since I have virtuemart installed on a subdomain (webshop.maindomain.nl). I think the same thing which is happening with the www to non-www rewrites may be happening to me with the subdomain (the registration activation link redirects to home, without activating the user).

Any ideas how I can solve this? I have the vm2_joomla_user_activation plugin installed and activated.

Joomla version: 2.5.17
VM version: 2.0.26d

Sitestorm

  • Beginner
  • *
  • Posts: 6
Re: Registration activation link fails on subdomain?
« Reply #1 on: February 05, 2014, 11:54:28 AM »
I had assumed this is a pretty usual use-case, but I guess not?

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28746
  • Always on vacation
    • Jenkin Hill Internet
Re: Registration activation link fails on subdomain?
« Reply #2 on: February 05, 2014, 13:32:43 PM »
I don't use registration confirmation/activation on any of my sites so have never needed to work with this, but I wonder if you could use some url rewriting with .htaccess to solve your issue?
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 4.2.5 10924 J! 3.10.11 PHP 8.2.7

Sitestorm

  • Beginner
  • *
  • Posts: 6
Re: Registration activation link fails on subdomain?
« Reply #3 on: February 05, 2014, 14:55:56 PM »
Solved it (or at least, diagnosed it):

- Virtuemart apparently logs the user in on clicking 'register', even is account activation is required.
- When the activation link is clicked and the user is still logged in, com_users assumes he must be activated and therefore redirects to the homepage without activating.

Possible solution for the above: virtuemart shouldn't log in a non-activated user.

- If I log out, then click the activation link, I get the following error message: 'Warning: Registration failed: Verification code not found'

This is caused by the 'lastvisitDate' for the corresponding user in the _users table not being null, again due to virtuemart logging in a non-activated user. (a query in com_users/models/registration.php line 47 fails)

So basically: virtuemart should not log in a non-activated user, it causes issues :) Imma gonna find me a virtuemart bugtracker to bug this.

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28746
  • Always on vacation
    • Jenkin Hill Internet
Re: Registration activation link fails on subdomain?
« Reply #4 on: February 05, 2014, 15:04:33 PM »
VM has to allow unregistered users to be auto-logged in or guest/anonymous shoppers would not be able to buy anything. If you want it to work differently it will not be simple to do, and would have to be switchable. All you can do at the moment is to set "Only registered users can checkout "
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 4.2.5 10924 J! 3.10.11 PHP 8.2.7

Sitestorm

  • Beginner
  • *
  • Posts: 6
Re: Registration activation link fails on subdomain?
« Reply #5 on: February 05, 2014, 15:11:02 PM »
I have the setting set to 'Only registered users can checkout'.

I'm not talking about unregistered users, the issue is with registered but non-activated users. The only change which would be needed is to remove the auto-login of the new user after clicking 'register' (and only if user activation is set in the Joomla settings).

fildin

  • Beginner
  • *
  • Posts: 1
Re: Registration activation link fails on subdomain?
« Reply #6 on: March 28, 2014, 12:01:07 PM »
Hi, I have exactly the same problem on my subdomain.eshop.com
Tried all modification that I found on this forum, but none of them helped, neither the plugin.

Sitestorm, how have you got this fixed, please?

Sitestorm

  • Beginner
  • *
  • Posts: 6
Re: Registration activation link fails on subdomain?
« Reply #7 on: March 31, 2014, 09:57:12 AM »
I used the thealmega fix: http://forum.virtuemart.net/index.php?topic=99755.msg393758#msg393758

See the post 3 posts down from that for where to fix it. Later on on that thread there is a link to a new VM version 2.5.2 which supposedly fixes the problem as well. I haven't tested that.