View Single Post
  #1   IP: 112.87.93.182
Old 2015-03-31, 12:41 AM
Xzavier Xzavier is offline
初级会员
 
Join Date: 2010-12-14
Posts: 4
Xzavier 现在声名狼藉
Default Recover Password By Email Or Username

his code change for X-Cart 4.4.x+ will allow your customers to recover their lost account information by Email or Username instead of one or the other.


Open /skin/common_files/help/Password_Recovery.tpl

Find:
Code:
{$login_field_name}

Replace with:
Code:
Email or Username
Open include/help.php

Find:
Code:
$account = func_query_first("SELECT id, login, password, email, usertype FROM $sql_tbl[customers] WHERE login='$username' AND usertype='$utype' AND status='Y'");
After add:
Code:
// WCM - Search by email if username doesn't match
if (empty($account))
$account = func_query_first("SELECT id, login, password, email, usertype FROM $sql_tbl[customers] WHERE email='" . mysql_real_escape_string(trim($username)) . "' AND usertype='$utype' AND status='Y'");
// / WCM - Search by email if username doesn't match
Reply With Quote