X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Identify Duplicate Accounts (https://forum.x-cart.com/showthread.php?t=16242)

Jon 08-30-2005 10:28 AM

Identify Duplicate Accounts
 
Here's a Free mod to identify accounts with the same first and last name:
http://www.websitecm.com/store/customer/product.php?productid=98

ShishaPipeUK 03-18-2006 10:59 AM

Jon, i used your duplicate account script, great work, thank you for this.

I have a small problem, when i use this on 4.0.18 it works great but then when i go to the users, with this script still open in a new window, i have to re log into admin.

I get:
Main page :: Warning

Access denied !
You are not allowed to access that resource!

Error ID: 37

I presume you wrote this to show in a new window so you can go to the users in admin and delete the duplicate accounts.

So is there a way where i dont have to re log in as an admin.

Code is below you supplied, i posted it because you offer it free as well, hope you dont mind.

I of cause edited my shopcart/skin1/admin/menu_admin.tpl and yes i put in a _blank command to show in a new window, code below.


I have the duplicate_accounts.php in my shopcart/admin directory

Code:

<?php
#
# WebsiteCM.com - Free Script
# This script will list duplicate accounts
#

require "./auth.php";
require $xcart_dir."/include/security.php";

echo "

<font face=arial size=3>Duplicate Accounts by First and Last Name</font></p>";

$duplicates = func_query("select login,firstname,lastname,email,count(*) as duplicate from xcart_customers WHERE usertype='C' GROUP BY lastname,firstname ORDER BY duplicate DESC");
echo "<table border=0 cellpadding=3 cellspacing=2>";
echo "<tr>";
echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>First Name</font></td>";
echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>Last Name</font></td>";
echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>Accounts</font></td>";
echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>Login Names</font></td>";
echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>Emails</font></td>";
echo "</tr>";

$bgcolor = "";

if (!empty($duplicates)) {
        foreach ($duplicates as $key=>$value) {
                if ($value[duplicate] > 1) {
                        if ($bgcolor == "") { $bgcolor = "#EEEEEE"; }
                        else { $bgcolor = ""; }
                        $logins = func_query("select login from xcart_customers WHERE firstname='$value[firstname]' AND lastname = '$value[lastname]'");
                        $login_names = "";
                        foreach ($logins as $login) {
                                $login_names .= $login[login] . "
";
                        }
                        $emails = func_query("select email from xcart_customers WHERE firstname='$value[firstname]' AND lastname = '$value[lastname]'");
                        $email_addys = "";
                        foreach ($emails as $email) {
                                $email_addys .= $email[email] . "
";
                        }
                        echo "<tr>";
                        echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $value[firstname] . "</font></td>";
                        echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $value[lastname] . "</font></td>";
                        echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $value[duplicate] . "</font></td>";
                        echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $login_names . "</font></td>";
                        echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $email_addys . "</font></td>";
                        echo "</tr>";
                }
        }
} else {
        echo "<tr><td><font face=arial size=2>There are no duplicate accounts to list.</font></td></tr>";
}
echo "</table>";

echo "

<font face=arial size=3>Duplicate Accounts by Email Address</font></p>";

$duplicates = func_query("select login,firstname,lastname,email,count(*) as duplicate from xcart_customers WHERE usertype='C' GROUP BY email ORDER BY duplicate DESC");
echo "<table border=0 cellpadding=3 cellspacing=2>";
echo "<tr>";
echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>First Name</font></td>";
echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>Last Name</font></td>";
echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>Accounts</font></td>";
echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>Login Names</font></td>";
echo "<td bgcolor=#000000><font face=arial size=2 color=#FFFFF>Email</font></td>";
echo "</tr>";

$bgcolor = "";

if (!empty($duplicates)) {
        foreach ($duplicates as $key=>$value) {
                if ($value[duplicate] > 1) {
                        if ($bgcolor == "") { $bgcolor = "#EEEEEE"; }
                        else { $bgcolor = ""; }
                        $logins = func_query("select login from xcart_customers WHERE email = '$value[email]'");
                        $login_names = "";
                        foreach ($logins as $login) {
                                $login_names .= $login[login] . "
";
                        }
                        echo "<tr>";
                        echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $value[firstname] . "</font></td>";
                        echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $value[lastname] . "</font></td>";
                        echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $value[duplicate] . "</font></td>";
                        echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $login_names . "</font></td>";
                        echo "<td valign=top bgcolor=" . $bgcolor . "><font face=arial size=2>" . $value[email] . "</font></td>";
                        echo "</tr>";
                }
        }
} else {
        echo "<tr><td><font face=arial size=2>There are no duplicate accounts to list.</font></td></tr>";
}
echo "</table>";
?>



All times are GMT -8. The time now is 08:15 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.