Use E-mail address instead of username 3.5.x & 4.0
Use E-mail address instead of username for X-Cart 3.5.x & 4.0.
Let users use either their email address or username to login instead of JUST the username. Edit include/login.php find: Code:
$user_data = func_query_first("SELECT * FROM $sql_tbl[customers] WHERE login='$username' AND usertype='$usertype' AND status='Y'"); Change to: Code:
$user_data=func_query_first("select * from $sql_tbl[customers] where (login='$username' or email='$username') and usertype='$usertype' and status='Y'"); :!: Should work without troubles on 3.5.x and 4.0.x |
You little beauty I was just about to start looking into this! :D
Nice one boomer. |
Rock on!!
Works for me. This should be standard. Most other places just use your email as the unique username, xcart should too. |
This is a nice little mod that should be implemented into x-cart. One question , it has probably been answered before, but how would you check to see if an e-mail address already exists and stop another person from registering an identical e-mail address. I am figuring it is somewhere in include/register.php, but can't seem to locate the where and what type of code to add.
Thanks for any comments. -Mike W. |
Thanks BOOMER,
If you were a leg, and I was a dog... well you get the point.. Awesome mod |
Quote:
Go into phpMyAdmin and set the email field to "Unique" and MySQL will take care of it for you ;) OR login to X-Cart and use the following MySQL code snippet in the Patch SQL area: Code:
ALTER TABLE `xcart_orders` ADD UNIQUE ( You may need to add some error catching in include/register.php but atleast noone can register the same email twice. |
Slight addition which adds a checkbox to copy the e-mail field to the username field.
in skin1/check_email_script.tpl add the following code: Code:
{* COPY E-MAIL AS USERNAME MOD *} then in skin1/main/register_account.tpl just below the comment Code:
{* NOT anonymous account *} add this code: Code:
{if $userinfo.login ne "" || ($login eq $userinfo.uname && $login ne '')} |
Add this to get it to work...
{/if}
:D |
thanks!
|
Good job! I have to use this ASAP on my sites. thanks!
|
All times are GMT -8. The time now is 05:41 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.