Joomla account activation bugs (not working links) - solution

Started by werian, March 10, 2013, 15:27:56 PM

Previous topic - Next topic

werian

After few days of reading topics like this one: account activation link problem, I decide to develop my own solution.
You don't need to edit any core Joomla or VM 2 files, which will be overwritten on update.


Problem issues:
1. Our client is in the shop cart page.
2. Virtuemart 2 option "On checkout, ask for registration" is enabled.
3. Client is sending form with Joomla user data & his own - client data.
4. E-mail with activation link is sended.
5a. After clicking the the activation link in mail - nothing happend.
5b. OR After clicking the the activation link - user is activated, but we have nothing in our cart.
5c. OR After clicking the the activation link - everything fine.

In points 5b, 5c - even after we activate our Joomla user account - we are not logged into Joomla - we are only logged in Virtuemart 2 cart (look at login module).

Solution:

1. Deal with your domain alias.

A lot of web pages has a very big problem, which is not always known.
I'm talking about domain aliases:
- www.your_domain.com
- your_domain.com

The problem exists, if your second page address (www or non-www), don't redirect users to the main page address (www or non-www).

You can check it - into web browser address bar put your shop domain name with "www" on the begin and without.
If the redirect is enabled - the one of "www" or "non-www" address, will be shortly redirected to your main address (www or non-www).
If you have redirection - go to the point 2 of this solution.

If you don't have redirection (you can navigate on your "your_domain.com" and also on "www.your_domain.com") - you have to set it manually in .htaccess file.

Now - you have to decide which address of your site will be main - address with "www" or "non-www" address.
Based on your decision, insert those lines after "RewriteEngine On" text in ".htaccess" file.

WWW to non-WWW redirect (more popular nowadays):

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]



non-WWW to WWW redirect:

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]


Important - if you are using SSL/HTTPS on your whole page - change "http" to "https".


2. Install plugin.

Install & enable this Joomla plugin - http://joomstuff.com/free/plg_vm2_joomla_user_activation.php


Now activation links should works, even if you are in your shop cart.
Additionally, you will be logged into Joomla profile after activation.



If you find any bugs - write about it!

Regards,
Łukasz Duda / Luke Duda
http://joomstuff.com/
http://dodatkijoomla.pl/

Milbo

Thank you for the nice FAQ. We explained also that way many times, but not so no nice summarized and clear written.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

K&K media production

The plg works, but for 2-3 seconds there is a error:


Warning: mysql_affected_rows() [function.mysql-affected-rows]: A link to the server could not be established in /plugins/system/vm2_joomla_user_activation/vm2_joomla_user_activation.php on line 24