News:

Support the VirtueMart project and become a member

Main Menu

account activation link problem

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

Previous topic - Next topic

rafipl

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

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

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
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

slammy

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

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
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

slammy

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

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.


<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):

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


To this:

$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

I having issues with the activation link.  but it works in ie9 and chrome, but not firefox.

sukhrob

Quote from: Bedrock 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.


<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):

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


To this:

$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

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

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


xarkitu

Quote from: Cotvi 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
Hi

On .htaccess include...

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


Milbo

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
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

bart198x

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.