Zen Cart Logo
Forums / General Questions / Can't log into Admin

Can't log into Admin

Locked

Views: 11,355

Results 1 to 20 of 40
This thread is locked. New replies are disabled.
1 Dec 2006, 3:29 AM
#1
hhgal avatar

hhgal

New Zenner

Join Date:
Nov 2006
Posts:
8
Plugin Contributions:
0

Can't log into Admin

I tried logging into admin and it said I had the wrong password (weird). I thought I might have been having a brain fart so I had it email to me. However, there was an email error. I'm assuming the 'email me' function resets the password? Anyhoo, I can't get in at all now and I'm the only one with a logon. What do you suggest?

TIA.

1 Dec 2006, 4:02 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Can't log into Admin

You can reset the admin file by going to phpMyAdmin and running the following commands in the SQL ...

NOTE: this assumes you are not using prefixes on your database ...

This will drop the admin table and remake it clean:

DROP TABLE IF EXISTS admin;
CREATE TABLE 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),
  KEY idx_admin_email_zen (admin_email)
) TYPE=MyISAM;

This will add a new login ...

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

Login: Admin
Password: admin

NOTE: be sure to immediately go to the Tools ... Admin Settings ... and set your email address and new password and username ...

1 Dec 2006, 4:47 AM
#3
hhgal avatar

hhgal

New Zenner

Join Date:
Nov 2006
Posts:
8
Plugin Contributions:
0

Re: Can't log into Admin

THANK YOU! Please disregard the PM I just sent. I wasn't capitalizing the 'A' in Admin. Sometimes it's tough to see the trees through the forest. :blush:

Thanks again for all your help.

Sarah

1 Dec 2006, 4:50 AM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Can't log into Admin

You are most welcome ... thanks for the update! :smile:

Don't forget to change your email, password and login name right away! :cool:

8 Dec 2006, 8:06 PM
#5
goodmorning avatar

goodmorning

New Zenner

Join Date:
Nov 2005
Posts:
47
Plugin Contributions:
0

Re: Can't log into Admin

Hi Ajeh,

I am also having this problem. but, I just did what you suggested in phpadmin, and while it says my old password/username is incorrect, with the new password and username it just loops back to the log in screen, but with no error message. What should I do?

8 Dec 2006, 9:16 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Can't log into Admin

What happens if you edit the file:
/admin/includes/configure.php

And turn off the secure on your site by changing these from 'true' to 'false'

define('ENABLE_SSL_CATALOG', 'true');
define('ENABLE_SSL_ADMIN', 'true');

8 Dec 2006, 10:44 PM
#7
goodmorning avatar

goodmorning

New Zenner

Join Date:
Nov 2005
Posts:
47
Plugin Contributions:
0

Re: Can't log into Admin

I checked, and they are already set to false. I don't have SSL set up.

8 Dec 2006, 11:34 PM
#8
dscvry avatar

dscvry

New Zenner

Join Date:
Dec 2006
Location:
France
Posts:
20
Plugin Contributions:
0

Re: Can't log into Admin

joining the admin access-block issue (read/tried most of the posts since July '06 ... & still looking) ...
Ajeh - you're a vet on this issue - why is this prob persisting (user/password stuff must be platform independent, surely) ? shouldn't it be possible for us to edit the admin permissions directly via myphp somehow (go on, there's a box of Ferrero Rocher in it for just a couple of lines of sweet code)?

8 Dec 2006, 11:39 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: Can't log into Admin

The code for dropping and creating the admin table and then populating it should solve the problems ...

This doesn't make a lot of sense that you cannot do this via phpMyAdmin unless there is another reason for the admin to fail ...

The login is:
Admin
admin

Case sensative ...

If you use prefixes on your tables then you need to apply them to the sql so that the right table is dropped and created ...

Also, be sure that you are using the right database by looking at your file on the server for:
/admin/includes/configure.php

If you have a secure server, try turning off the secure settings in the /admin/includes/configure.php

NOTE: if your permissions were 444 you have to change that to 777 or 644 or delete the file before you can reload it via FTP ... then change it back either in FTP or your Control Panel to either 644 or 444 ...

If you are still having issues ... I'd almost would have to see your phpMyAdmin and FTP access to check your site to see what is up ...

Note: do not post any of those settings here ...

9 Dec 2006, 12:03 AM
#10
dscvry avatar

dscvry

New Zenner

Join Date:
Dec 2006
Location:
France
Posts:
20
Plugin Contributions:
0

Re: Can't log into Admin

I've tried both the short & long versions of dropping and creating the admin table, but still can't get past the login ...

Noted the case sensitive bit ... (tried also the same routine but substituting my original login parameters - no joy; also the literal encrypted versions - still no joy) ...

Prefixes not used ...

Secure settings do not apply for the moment, and I'm sticking with the 777s as requested at install until the admin access is sorted out ...

There's only one database to choose from, and I'm altering the code for the admin table each time - it's not clear from my host's cpanel layout that there's room for ambiguity with locating the table (all set out A-Z). Could this be the issue ?

Unless I ought to be doing the code substitution with a text browser elsewhere & not cpanel ?

Thanx, Disco

9 Dec 2006, 12:40 AM
#11
ajeh avatar

ajeh

Oba-san

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

Re: Can't log into Admin

Check your paths etc. between your two files:
/includes/configure.php
/admin/includes/configure.php

9 Dec 2006, 2:29 PM
#12
dscvry avatar

dscvry

New Zenner

Join Date:
Dec 2006
Location:
France
Posts:
20
Plugin Contributions:
0

Re: Can't log into Admin

Checked the two files and all common variables seem to have consistent values being assigned to them (not sure what else exactly to check for here ...).

Tried again with queries to see if login would work anyway - same issue persists. It seems that the password is being recognised - there's no username/password error message generated as there is if you just type anything in the boxes - but with the Admin/admin combo (which we know therefore is correct) the login page just sticks on the screen with the boxes emptied.

These are the two SQL queries tried:

DELETE FROM admin WHERE admin_name = 'Admin';
INSERT INTO admin (admin_name, admin_email, admin_pass, admin_level) VALUES ('Admin', 'admin@localhost', '351683ea4e19efe34874b501fdbf9792:9b', 1);

DROP TABLE IF EXISTS admin;
CREATE TABLE 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),
KEY idx_admin_email_zen (admin_email)
) TYPE=MyISAM;

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

Not sure what else to try ...? Here's the background info:
Server - Apache/2.2.3 (Unix)
PhP v 5.1.6
MySQL v5.0.30-Debian_1-log

Disco

9 Dec 2006, 4:36 PM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Can't log into Admin

Try only running this in phpMyAdmin ...

DROP TABLE IF EXISTS admin;
CREATE TABLE 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),
KEY idx_admin_email_zen (admin_email)
) TYPE=MyISAM;

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

Login: Admin
Password: admin

Once in be sure to update your login name, email address and password to your own ...

9 Dec 2006, 6:28 PM
#14
dscvry avatar

dscvry

New Zenner

Join Date:
Dec 2006
Location:
France
Posts:
20
Plugin Contributions:
0

Re: Can't log into Admin

Running it in cpanel on the SQL page (both with & without hitting the 'Create PHP Code' function) produces this response (but still no access to admin):

DROP TABLE IF EXISTS admin; # MySQL returned an empty result set (i.e. zero rows).
CREATE TABLE 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 ) ,
KEY idx_admin_email_zen( admin_email )
) TYPE = MYISAM ; # MySQL returned an empty result set (i.e. zero rows).
INSERT INTO admin( admin_name, admin_email, admin_pass, admin_level )
VALUES (
'Admin', 'admin@localhost', '351683ea4e19efe34874b501fdbf9792:9b', 1
); # Affected rows:1

Skipping through the other tabs in cpanel, there is an Error box on the Operations page with this message:
"PMA Database ... not OK[ Documentation ]
General relation features Disabled"

Could this be the spanner in the works (or maybe later on) ?

9 Dec 2006, 8:52 PM
#15
dscvry avatar

dscvry

New Zenner

Join Date:
Dec 2006
Location:
France
Posts:
20
Plugin Contributions:
0

Re: Can't log into Admin

Some other things to mention on the sticky-login business ...
... double-checked the browser is accepting the cookies - it is
... double-checked the .htaccess file issue; renaming as .bak doesn't alter the login page behaviour
... checking in the admin table after running the query, the password/login do change each time the query runs
There's probably going to be sthg mindnumbingly obvious that solves this in the end.
[BTW I'm beginning to have doubts about the apparent (lack of) functionality of MyphpAdmin at this host - being my first encounter with it, I've no idea what's supposed to be here or how to get at it - but squinting hard at thumbnails of the screen presentation options on the 'Welcome to MyphpAdmin' page, it looks like the LH sidebar with several functions on has gone MyAWOL. There's no obvious way of doing anything other than through MySQL (which is why the admin query was run from there ... )]

9 Dec 2006, 9:30 PM
#16
telepatico avatar

telepatico

New Zenner

Join Date:
Jun 2005
Posts:
17
Plugin Contributions:
0

Re: Can't log into Admin

What if you log on to your database with PHPMyAdmin and click on the "admin" table then up on the tabs, click on "browse" and delete the user, then click on "insert" and add another user? You can add another user and then try to log in to your admin. Notice that when creating a password this way, it will not be encrypted from your database table to your form and vice versa.

so try then to log in to the administrator and create a new one, look again to the admin table and see if it is encrypted. Remember to apply the password type on phpmyadmin on the function. Once again, you can delete the actual user and add anew one, or add a new one first then delete the old one.

Use the same process to add more administrators or users with administrative access if needed.

10 Dec 2006, 8:19 AM
#17
dscvry avatar

dscvry

New Zenner

Join Date:
Dec 2006
Location:
France
Posts:
20
Plugin Contributions:
0

Re: Can't log into Admin

Thanks for this telepatico ...

Ajeh's suggested routine does do what it sets out to do - it establishes a valid, replacement password - but for reasons unknown the login form does not shift from the screen. I still can't get access to the Zencart administrator.

I tried your suggestions: the extra admin-user fields are entered in the database's admin table directly, although the login routine will not recognise the new passwords as valid (I've tried various function assignments but might have missed a trick here). If it did recognise them though, I suspect that they would encounter the same access prob as the Admin/admin attempts.

Looking at other field details in the admin table, I noticed that the entire database has been set up with collation fields as latin1_swedish_ci (Zencart default setting ?). The default setting for the database (when created before Zencart install) was/is utf8-general-ci ... although switching these to the same now hasn't helped with the login issue. I'm wondering whether this discrepancy could cause a glitch in the encryption mechanics (probably does no harm to have the collation values all lined up & pointing in the same direction anyway I'd imagine?). But that wouldn't explain either (a) why the non-encrypted passwords are not being recognised or (b) why the recognised Admin/admin user/password combination isn't opening up access to the Zencart administrator.

I'm reluctant to torch the current upload and try reinstalling the works, since it was not easy to get zc_install to run in the first place ... For the moment my host site seems to be sloughing off a hangover, but any ideas for cracking this one would be welcome.

10 Dec 2006, 9:13 AM
#18
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: Can't log into Admin

When the easy or obvious solutions do not work, all we are left with are the hard solutions. In this case that would mean a complete reinstall.

Whether you toast the current setup or use a testbed is up to you, but with the time involved so far with no resolution in sight, it might be faster to just start again.

10 Dec 2006, 7:54 PM
#19
goodmorning avatar

goodmorning

New Zenner

Join Date:
Nov 2005
Posts:
47
Plugin Contributions:
0

Re: Can't log into Admin

Still having the problem. I put so much time into customizing the cart for this client, that I really need to fix this instead of reinstalling.

Ajeh, would you mind looking at my ftp, phpmyadmin? I will PM you the info.

10 Dec 2006, 8:01 PM
#20
ajeh avatar

ajeh

Oba-san

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

Re: Can't log into Admin

You may drop me a PM and I can peek when I get some time ... :smile: