Forums / Templates, Stylesheets, Page Layout / OH SNAP -- Locked out of Zen Cart Admin

OH SNAP -- Locked out of Zen Cart Admin

Locked

Started by smallarmsdealer on 16 Nov 2007, 5:05 PM · Views: 1,653

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
16 Nov 2007, 5:05 PM
#1
smallarmsdealer avatar

smallarmsdealer

New Zenner

Join Date:
Oct 2007
Posts:
16
Plugin Contributions:
0

OH SNAP -- Locked out of Zen Cart Admin

Hey everybody,

I'm locked out of my zen cart admin page. In fact, I tried to fix it in phpmyadmin and though I thought I knew what I was doing, I must not have. :-( However, on the good side, the store is still up...

I am wrapping up development of a store for a client and at the end went to change the admin e-mail to their e-mail address. I did, and assumed the password was the same (I didn't change it). I went to the client's computer, tried to login -- no luck. I requested a new password, the new password didn't work.

So I followed this thread: http://www.zen-cart.com/forum/showthread.php?p=456063

I have a prefix of zencart_ on my zen cart database, so I edited his SQL command:

DROP TABLE IF EXISTS zencart_admin;
CREATE TABLE zencart_admin (
  zencart_admin_id int(11) NOT NULL auto_increment,
  zencart_admin_name varchar(32) NOT NULL default '',
  zencart_admin_email varchar(96) NOT NULL default '',
  zencart_admin_pass varchar(40) NOT NULL default '',
  zencart_admin_level tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (zencart_admin_id),
  KEY idx_admin_name_zen (zencart_admin_name)
) TYPE=MyISAM;

and then

INSERT INTO admin VALUES (1, 'Admin', 'admin@localhost', '351683ea4e19efe34874b501fdbf9792:9b', 1);

**I now get this messages on /zencart/admin when I try to login: **

1054 Unknown column 'admin_name' in 'where clause'
in:
[select * from zencart_admin where admin_name='demo' or admin_name='Admin']
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

:frusty:

Your help very appreciated! I'll keep looking in phpMyAdmin carefully.

16 Nov 2007, 5:43 PM
#2
smallarmsdealer avatar

smallarmsdealer

New Zenner

Join Date:
Oct 2007
Posts:
16
Plugin Contributions:
0

Re: OH SNAP -- Locked out of Zen Cart Admin

I went crazy prefixing the SQL code, this corrected code works:

DROP TABLE IF EXISTS zencart_admin;
CREATE TABLE zencart_admin (
  admin_id int(11) NOT NULL auto_increment,
  admin_name varchar(32) NOT NULL default '',
  admin_email varchar(96) NOT NULL default '',
  admin_pass varchar(40) NOT NULL default '',
  admin_level tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (admin_id),
  KEY idx_admin_name_zen (admin_name)
) TYPE=MyISAM;

Notice that after the table zencart_admin is created it has its own columns or rows whatever...admin_id, admin_name and so on. Those aren't prefixed!

Then this worked just fine and all was canycanes and lollipops:

INSERT INTO admin VALUES (1, 'Admin', 'admin@localhost', '351683ea4e19efe34874b501fdbf9792:9b', 1);
16 Nov 2007, 5:45 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: OH SNAP -- Locked out of Zen Cart Admin

Thanks for the update ... hate when the global replace does exactly what we tell it to do ... :lamo:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

18 Nov 2007, 3:44 AM
#4
jaggers avatar

jaggers

New Zenner

Join Date:
Oct 2007
Location:
DFW, TX
Posts:
20
Plugin Contributions:
0

Re: OH SNAP -- Locked out of Zen Cart Admin

I had this same problem earlier today, so I just started over...

How often does this happen and is it a big issue?

Current Project: http://kpdclothing.com

18 Nov 2007, 4:12 AM
#5
drbyte avatar

drbyte

Sensei

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

Re: OH SNAP -- Locked out of Zen Cart Admin

jaggers:

How often does this happen and is it a big issue?

There are only a few reasons why you would get an "Invalid password" message from the admin while trying to log in.

  • someone changed the password ... either authorized or unauthorized
  • serious data corruption causing damage to the admin table ... in which case it's likely that other tables are damaged as well

If someone is changing your password without authorization, you might want to check on who's got access to your site. You might check the admin_activity_log records in the database to see whether all attempts to access admin pages are coming from authorized IP addresses ... and consider changing the folder your admin runs from (as suggested in the security guidelines ... see the FAQ and your Zen Cart /docs/ folder).

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.