Author Topic: account activation link problem  (Read 104663 times)

rafipl

  • Beginner
  • *
  • Posts: 6
account activation link problem
« on: March 17, 2012, 19:58:54 pm »
UPDATE by Milbo: Should be fixed with http://forum.virtuemart.net/index.php?topic=122785.msg418993#msg418993


Here's last my topic  http://forum.virtuemart.net/index.php?topic=99735.0

I found half solution for this...
1. When user register from page http://mysite.com, he becomes activation link: http://mysite.com/index.php?option=com_users&task=registration.activate&token=xxxxxx - but it doesn't work (goes to index.php without any information)... but WHEN I correct link to http://WWW.mysite.com/index.php?option=com_users&task=registration.activate&token=xxxxxx so when I add "WWW" - all is ok and account is activated!
2.When user register from page http://www.mysite.com, he becomes activation link: http://www.mysite.com/index.php?option=com_users&task=registration.activate&token=xxxxxx - but it doesn't work (goes to index.php without any information)... but WHEN I correct link to http://mysite.com/index.php?option=com_users&task=registration.activate&token=xxxxxx so when I remove "WWW" - all is ok and account is activated!

what I should to do to repair it?

bajobongo

  • Beginner
  • *
  • Posts: 6
Re: account activation link problem
« Reply #1 on: April 07, 2012, 22:42:52 pm »
I've got the same issue on my VM 2.02 + Joomla 2.5.4

I noticed that problem is somewhere in session mechanism (or cookies). When I clear all my cookies for webpage , then I can activate my account via activation link from e-mail. Otherwise this link redirect me to main page. That's way you can activate your accounts for other domain name - your browser treats it as different host and doesn't use the same cookies. It's probably joomla/VM bug or we have got something misconfigured.

Just after register a new user during checkout, this user is automatically logged in (without confirmation. Why?). His activation link won't never work until he is logged in (or cookie exist).

Someone can help us?

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27595
  • Always on vacation
    • Jenkin Hill Internet
Re: account activation link problem
« Reply #2 on: April 09, 2012, 11:01:08 am »
There is a known JUser issue in Joomla 2.5.3/4 which has been reported to the Joomla bug squad. This may be related to the problem you see.
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 VM 3.6.10.10211 on Joomla 3.9.13 PHP 7.0.33

slammy

  • Jr. Member
  • **
  • Posts: 169
  • vm supporter member
  • VirtueMart Version: vm 3.0.x and jml 3.4.5
Re: account activation link problem
« Reply #3 on: June 10, 2012, 22:29:58 pm »
Hi,

I have the same issue. I am using joomla 2.5.4 and vm 2.0.7_d.

I didn´t test the registration until now because -normally - it´s such a easy thing.

I do not believe this is a problem related to joomla. The problem is like bajobongo said:
If you register, vm2 still logs the user in after sending the registration form. As long as this user is logged in, you cannot activate your account.
But what does this mean: This means the people will have to close all browser-instances after sending registration form and delete all temporarily internet files (cookies!!!) and then click the activation link.


Bounce rate will be very high. This is worse. This is a no-go. Does anyone have a solution for this?

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27595
  • Always on vacation
    • Jenkin Hill Internet
Re: account activation link problem
« Reply #4 on: June 10, 2012, 22:47:21 pm »
I don't use email confirmation of registration, as the last thing I want during a sale is for a customer to wait for a confirmation email.

I have not tested this with 2.0.7d which is a development version, and not for use on a live site (although some do...)
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 VM 3.6.10.10211 on Joomla 3.9.13 PHP 7.0.33

slammy

  • Jr. Member
  • **
  • Posts: 169
  • vm supporter member
  • VirtueMart Version: vm 3.0.x and jml 3.4.5
Re: account activation link problem
« Reply #5 on: June 11, 2012, 12:17:02 pm »
Hi Jenkinhill,

thx for ur post. Pls, i didn´t wanted to blame anyone with my last post. I was a little upset about myself that I didn´t test it earlier and of course I am on a test-envrionment and of course 2.0.7_d is a testversion.

You are right, normally it´s not good if the user have to wait for an account-confirmation email while making a order, but in some cases it´s required for securityreasons. We don´t have a adressdata confirmation with a external service, so its good to know that the person who is ordering is in property of the registered email-account. It´s something you can use if ppl try to betray u.

The only thing I was wondering was that if I have the possibilty to choose between free checkout as guest and account activation that last thing didn´t work.
Is account activation still a problem in the stable version releases like 2.0.4?
 
Last thing to make clear: VM2 is great, I use vm1.1.X since 4 years now. VM2 is the best I´ve ever seen, it has lots of improvements regarding payments, shipments, multilanguage, mulitvendor, SEO and on and on ...

Everyday I get more an more familar with it and I love it. You guys doing great work and I appreciate that, thank you.  ...

best regards
slam

Bedrock

  • Beginner
  • *
  • Posts: 8
Re: account activation link problem
« Reply #6 on: June 19, 2012, 15:30:53 pm »
Not very elegantly, but I solved the problem.
First you have to put a script to the beginning of the "components/com_virtuemart/views/user/tmpl/edit_address_userfields.php" file.

Code: [Select]
<script language="javascript">
if ('<?php echo $_SERVER[HTTP_HOST]; ?>' == 'www.yourdomain.com')
{
location.href="http://yourdomain.com/yourregistrationpage" ;
}
</script>

This way it redirects the visitor if s/he arrived from a "www" domain to the registration page, so this way you cannot register from a "www" domain.

Then you have to modify the activation email's activation link that can be found in the "components/com_virtuemart/views/user/tmpl/mail_html_reguser.php"  file.

This has to be modified (53th row):
Code: [Select]
$activationLink = '<a class="default" href="' . JURI::root() . $this->activationLink . '">' . JText::_('COM_VIRTUEMART_LINK_ACTIVATE_ACCOUNT') . '</a>';

To this:
Code: [Select]
$modifiedlink = str_replace ("http://","http://www.",JURI::root());

$activationLink = '<a class="default" href="' . $modifiedlink . $this->activationLink . '">' . JText::_('COM_VIRTUEMART_LINK_ACTIVATE_ACCOUNT') . '</a>';

So the user will get a "www" activation link and with that the account can be activated.

best regards
bedrock

mabeall32

  • Jr. Member
  • **
  • Posts: 116
Re: account activation link problem
« Reply #7 on: June 20, 2012, 18:36:42 pm »
I having issues with the activation link.  but it works in ie9 and chrome, but not firefox.

sukhrob

  • Beginner
  • *
  • Posts: 19
Re: account activation link problem
« Reply #8 on: July 11, 2012, 13:40:05 pm »
Not very elegantly, but I solved the problem.
First you have to put a script to the beginning of the "components/com_virtuemart/views/user/tmpl/edit_address_userfields.php" file.

Code: [Select]
<script language="javascript">
if ('<?php echo $_SERVER[HTTP_HOST]; ?>' == 'www.yourdomain.com')
{
location.href="http://yourdomain.com/yourregistrationpage" ;
}
</script>

This way it redirects the visitor if s/he arrived from a "www" domain to the registration page, so this way you cannot register from a "www" domain.

Then you have to modify the activation email's activation link that can be found in the "components/com_virtuemart/views/user/tmpl/mail_html_reguser.php"  file.

This has to be modified (53th row):
Code: [Select]
$activationLink = '<a class="default" href="' . JURI::root() . $this->activationLink . '">' . JText::_('COM_VIRTUEMART_LINK_ACTIVATE_ACCOUNT') . '</a>';

To this:
Code: [Select]
$modifiedlink = str_replace ("http://","http://www.",JURI::root());

$activationLink = '<a class="default" href="' . $modifiedlink . $this->activationLink . '">' . JText::_('COM_VIRTUEMART_LINK_ACTIVATE_ACCOUNT') . '</a>';

So the user will get a "www" activation link and with that the account can be activated.

best regards
bedrock

Thank you Bedrock, your fix took care of the problem. Much appreciated.

marcodelpercio

  • Beginner
  • *
  • Posts: 35
Re: account activation link problem
« Reply #9 on: July 11, 2012, 23:19:48 pm »
Hi,

I have the same problem however I am experiencing this only with Firefox (curious) moreover I have the same bug in localhost too where what you reported as workaround is not applicable.
I.e. on local VM 2.0.8c (Joomla 2.5.6) the website url is http://localhost.... if I register as a new user the activation link actually is http://localhost.... so it should be correct ...however that activation link doesn't work using Firefox. Same result if I click on it directly or use copy link location from context menu and paste the absolute URL directly in a firefox window.

It's very strange

bonbin

  • Beginner
  • *
  • Posts: 25
Re: account activation link problem
« Reply #10 on: July 13, 2012, 12:24:13 pm »
this trick doesnt work for someone who use 301 for non www to www
does anyone have a solution for a site with 301 redireft non www to www ?

Cotvi

  • Beginner
  • *
  • Posts: 1
Re: account activation link problem
« Reply #11 on: August 11, 2012, 13:19:41 pm »
anyone know how to do the opposite ?
www.domain.eu > domain.eu
for example:

http://domain.eu/index.php?option=com_users&task=registration.activate&token=a942112ddea534a486752a66ad770f65

because it does not work without www.

THX

xarkitu

  • Beginner
  • *
  • Posts: 1
Re: account activation link problem
« Reply #12 on: August 22, 2012, 19:36:09 pm »
anyone know how to do the opposite ?
www.domain.eu > domain.eu
for example:

http://domain.eu/index.php?option=com_users&task=registration.activate&token=a942112ddea534a486752a66ad770f65

because it does not work without www.

THX
Hi

On .htaccess include...

Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com$ [NC]
RewriteRule ^(.*)$ yourdomain.com/$1 [R=301,L]


Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9997
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: account activation link problem
« Reply #13 on: September 08, 2012, 16:57:12 pm »
Atm I think it has something todo with alias, forwards and dns stuff.

I think configure www as alias is wrong. The www must be a forward to the non www URL
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

bart198x

  • Beginner
  • *
  • Posts: 29
Re: account activation link problem
« Reply #14 on: September 11, 2012, 12:43:50 pm »
Is there any way (what to do) in VM 2.0.10 to register new user via VM registration form (with activation link) and make that user to be not logged in after registration (because I think that brake my activation link), maybe I'm wrong but I think that activation token is created and sent by email to user after register button is klicked, at the same time the new registered user is loging in and the activation token is destroyed - theoreticly is not needed for user, only for guests ?
So the things stays that user is logged but not activated, and having no chance to activate his account, because the link from mail is not readable.
I don't know where to search in php files.