Zen Cart Logo
Forums / General Questions / Unable to delete customer

Unable to delete customer

Views: 3,469

Results 1 to 20 of 31
17 Apr 2014, 7:20 PM
#1
plc613 avatar

plc613

Zen Follower

Join Date:
Apr 2014
Location:
Canada
Posts:
249
Plugin Contributions:
0

Unable to delete customer

I've got someone that has created a suspicious account using nothing but numbers for name, last name and company. Nothing else. When I select the customer in admin I get nothing. The right side is blank. Clicking delete brings me to the confirmation, then "are you sure" then it brings me to the next customer. I suppose I need to manually delete this entry?

17 Apr 2014, 7:37 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,099
Plugin Contributions:
56

Re: Unable to delete customer

plc613:

I've got someone that has created a suspicious account using nothing but numbers for name, last name and company. Nothing else. When I select the customer in admin I get nothing. The right side is blank. Clicking delete brings me to the confirmation, then "are you sure" then it brings me to the next customer. I suppose I need to manually delete this entry?
Since the "right side is blank", you've got a partial whitescreen; check your /logs folder for a myDEBUG*.log file that identifies the details of the issue.

21 Apr 2014, 11:21 PM
#3
plc613 avatar

plc613

Zen Follower

Join Date:
Apr 2014
Location:
Canada
Posts:
249
Plugin Contributions:
0

Re: Unable to delete customer

lat9:

Since the "right side is blank", you've got a partial whitescreen; check your /logs folder for a myDEBUG*.log file that identifies the details of the issue.

I can't find anything in my logs that link back to that customer.

22 Apr 2014, 2:17 PM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,099
Plugin Contributions:
56

Re: Unable to delete customer

Try to delete that customer and then look in your /logs directory to see if there's a log that was created on/about the time you attempted the delete. That log will contain information identifying the problem. When you post the contents of that log, be sure to XXX-out the name of your admin folder!

22 Apr 2014, 3:17 PM
#5
plc613 avatar

plc613

Zen Follower

Join Date:
Apr 2014
Location:
Canada
Posts:
249
Plugin Contributions:
0

Re: Unable to delete customer

Your response just pointed me to an error in my config. I recently migrated to GeekHost(props!) and for some reason the path to my log never got updated despite the session path being correct(perhaps that has nothing to do with it!?) Anyway. I just set that right.

22 Apr 2014, 3:28 PM
#6
plc613 avatar

plc613

Zen Follower

Join Date:
Apr 2014
Location:
Canada
Posts:
249
Plugin Contributions:
0

Re: Unable to delete customer

Above I was referring to the config->Logging section. Looks like that might only related to page parse time logging...I still don't get any myDEBUG logs in the cache folder(since I've migrated on the 17th of apr.)

Does this help?
2014-04-22 11:12:26 1 admin 1.1.1.1 customers.php origin=index&page=1&action=deleteconfirm& 0 stdClass Object
(
[cID] =>
)
2014-04-22 11:12:26 1 admin 1.1.1.1 customers.php origin=index&page=1& 0
2014-04-22 11:12:23 1 admin 1.1.1.1 customers.php origin=index&page=1&cID=&action=confirm& 0
2014-04-22 11:12:21 1 admin 1.1.1.1 customers.php search=BLANKED######################&origin=index&page=1&cID=6& 0
2014-04-22 11:12:17 1 admin 1.1.1.1 customers.php search=BLANKED######################&origin=index&

That's from admin activity logs

22 Apr 2014, 5:29 PM
#8
plc613 avatar

plc613

Zen Follower

Join Date:
Apr 2014
Location:
Canada
Posts:
249
Plugin Contributions:
0

Re: Unable to delete customer

ah! I see. Didn't know that(just updated from 1.5.0) thx!

So there's this:
[22-Apr-2014 13:13:03 America/New_York] PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /public_html/includes/functions/functions_lookups.php on line 928

which I assume needs fixing but isn't related to this topic. And this:
[22-Apr-2014 15:29:57 UTC] PHP Warning: array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #1 is not an array in public_html/HIDDEN/customers.php on line 1106
[22-Apr-2014 15:29:57 UTC] PHP Warning: array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #2 is not an array in public_html/HIDDEN/customers.php on line 1108
[22-Apr-2014 15:29:57 UTC] PHP Warning: reset() expects parameter 1 to be array, null given in public_html/HIDDEN/includes/classes/object_info.php on line 29
[22-Apr-2014 15:29:57 UTC] PHP Warning: Variable passed to each() is not an array or object in public_html/HIDDEN/includes/classes/object_info.php on line 30

Odd. Because it did reflect the time around which I first tried deleting the customer earlier today but I just tried again and it didn't create an entry at all...

22 Apr 2014, 5:37 PM
#9
plc613 avatar

plc613

Zen Follower

Join Date:
Apr 2014
Location:
Canada
Posts:
249
Plugin Contributions:
0

Re: Unable to delete customer

Now I'm actually getting a bit concerned with this...

In the admin activity log, there was an email address. I did some digging and came up with this:

http://www.xjbz.gov.cn/cxfz/viewyjjy.asp?id=762

The number listed in that box(88952634) is the number that was used for the First Name and company fields.

22 Apr 2014, 5:42 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Unable to delete customer

So what exactly is the concern now?

22 Apr 2014, 5:57 PM
#11
plc613 avatar

plc613

Zen Follower

Join Date:
Apr 2014
Location:
Canada
Posts:
249
Plugin Contributions:
0

Re: Unable to delete customer

Primarily that I can't delete the customer but also that the entry links back to an Asian site. Should I suspect foul play here?

22 Apr 2014, 6:14 PM
#12
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,099
Plugin Contributions:
56

Re: Unable to delete customer

plc613:

ah! I see. Didn't know that(just updated from 1.5.0) thx!

So there's this:
[22-Apr-2014 13:13:03 America/New_York] PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /public_html/includes/functions/functions_lookups.php on line 928

which I assume needs fixing but isn't related to this topic.
Agreed.
plc613:

And this:
[22-Apr-2014 15:29:57 UTC] PHP Warning: array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #1 is not an array in public_html/HIDDEN/customers.php on line 1106
[22-Apr-2014 15:29:57 UTC] PHP Warning: array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #2 is not an array in public_html/HIDDEN/customers.php on line 1108
[22-Apr-2014 15:29:57 UTC] PHP Warning: reset() expects parameter 1 to be array, null given in public_html/HIDDEN/includes/classes/object_info.php on line 29
[22-Apr-2014 15:29:57 UTC] PHP Warning: Variable passed to each() is not an array or object in public_html/HIDDEN/includes/classes/object_info.php on line 30

Odd. Because it did reflect the time around which I first tried deleting the customer earlier today but I just tried again and it didn't create an entry at all...
As with most code-related problems that result in multiple errors/warnings being issued, the first item usually cascades into a slew of related issues. That's the case here.

The first warning indicates that, for some reason, there is no valid country reference found for the customer's record. The code, in customers.php, starting at line 1099 is, with the italicized line being 1106:

        $country = $db->Execute("select countries_name
                                 from " . TABLE_COUNTRIES . "
                                 where countries_id = '" . (int)$customers->fields['entry_country_id'] . "'");

        $reviews = $db->Execute("select count(*) as number_of_reviews
                                 from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers->fields['customers_id'] . "'");

        [I]$customer_info = array_merge($country->fields, $info->fields, $reviews->fields);[/I]

Are you familiar with phpMyAdmin usage? If so, it would be interesting to see what's in the customers table for this person.

What database collation (latin1 vs utf8) are you using? It could be as simple as a customer from China attempting to create a valid account on your site but having issues (as you are now) since there's a character-set mismatch somewhere in your configuration.

22 Apr 2014, 6:14 PM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Unable to delete customer

Foul play? Maybe. Bots and malicious visitors are always trying things on millions of sites every day. Could be they were hoping they could create an account that would let them send spam from your tell-a-friend page. But if you're using v151 then you probably don't have a tell-a-friend page, but they might not know that.

Anyway, as lat9 has posted, your inability to delete the customer is probably connected to having missing country/zone details for whatever country/zone they specified. That could be a result of having deleted countries/states/zones from your database after they created that account. Whatever the cause, you can manually delete it from the database by finding the customers_id from the customers table, and then deleting that customer's record from every other table in the database (and there are lots) where that customers_id is in the table. Some tables may have multiple entries. customers_id will be in tables related to customers, addresses, orders, coupons, emails, discounts, and more: www.zen-cart.com/wiki/index.php/Developers_-_Database_Schema

22 Apr 2014, 6:29 PM
#14
plc613 avatar

plc613

Zen Follower

Join Date:
Apr 2014
Location:
Canada
Posts:
249
Plugin Contributions:
0

Re: Unable to delete customer

lat9:

Agreed.

As with most code-related problems that result in multiple errors/warnings being issued, the first item usually cascades into a slew of related issues. That's the case here.

Are you familiar with phpMyAdmin usage? If so, it would be interesting to see what's in the customers table for this person.
Somewhat. monkey see monkey do ;)
lat9:

What database collation (latin1 vs utf8) are you using? It could be as simple as a customer from China attempting to create a valid account on your site but having issues (as you are now) since there's a character-set mismatch somewhere in your configuration.
There appears to be a mixture of latin1 and utf8. Is that fixable? I should prob. mention that prior to GeekHost I was on a shared server. So although I did not opt to using their "apps collection" to install ZC I may have been subjected to non-standard stuff. Upgrading to 1.5.1 was a breeze once I moved so at least my files are standards compliant(I use the Piccadilly Posh template)

22 Apr 2014, 6:38 PM
#15
plc613 avatar

plc613

Zen Follower

Join Date:
Apr 2014
Location:
Canada
Posts:
249
Plugin Contributions:
0

Re: Unable to delete customer

DrByte:

That could be a result of having deleted countries/states/zones from your database after they created that account.

Certainly not that I recall. There are currently 13 pages of countries & 10 pages of zones.

22 Apr 2014, 6:44 PM
#16
plc613 avatar

plc613

Zen Follower

Join Date:
Apr 2014
Location:
Canada
Posts:
249
Plugin Contributions:
0

Re: Unable to delete customer

Not certain this is what you're referring to or not:
6 m 88952634 88952634 0001-01-01 00:00:00 safe3q###################### 6 88952634 88952634 91d3baf3026eeed25f7fd5c0eaa00914:90 1 0 HTML 0 0

22 Apr 2014, 6:46 PM
#17
plc613 avatar

plc613

Zen Follower

Join Date:
Apr 2014
Location:
Canada
Posts:
249
Plugin Contributions:
0

Re: Unable to delete customer

I just noticed that customers_dob are all set to 0001-01-01 00:00:00 perhaps that links back to the chars encoding?

22 Apr 2014, 6:50 PM
#18
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,099
Plugin Contributions:
56

Re: Unable to delete customer

It's actually the customer's address_book entry that's got the invalid/unknown country ID. Go to your webhost's cPanel and bring up phpMyAdmin.

  1. Click on the address_book table's link on the lefthand side of the display.
  2. Click the Search button and enter the id of this rogue customer as the customers_id Value and click Go.
  3. When the customer's address_book record is displayed, write down what the values for entry_country_id and entry_zone_id are and post them back here.
22 Apr 2014, 6:55 PM
#19
plc613 avatar

plc613

Zen Follower

Join Date:
Apr 2014
Location:
Canada
Posts:
249
Plugin Contributions:
0

Re: Unable to delete customer

Both are "88952634" which is the same as almost every entry for this customer.

22 Apr 2014, 6:55 PM
#20
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Unable to delete customer

plc613:

I just noticed that customers_dob are all set to 0001-01-01 00:00:00 perhaps that links back to the chars encoding?
No, that's just the default when no dob is supplied.