Zen Cart Logo
Forums / General Questions / Is there a way to auto-login to admin?

Is there a way to auto-login to admin?

Locked

Views: 1,905

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
2 Nov 2009, 10:47 AM
#1
mikejd avatar

mikejd

New Zenner

Join Date:
Oct 2009
Posts:
3
Plugin Contributions:
0

Is there a way to auto-login to admin?

I have added a ZenCart v1.3.8 to a site I am managing which uses a custom built CMS. I would like to add a direct link to the ZenCart admin interface from the admin interface of the CMS. There is already a similar link to a PhpList installation.

The Phplist link uses an href of the form ~/admin/?login="xxx"&password="xxx". I have tried a similar link for ZenCart but it just opens the login form and I have to enter the username and password. I would prefer it to login directly without having to input the details.

Can anyone suggest the correct syntax?

Mike

2 Nov 2009, 1:27 PM
#2
spid3r1987 avatar

spid3r1987

Zen Follower

Join Date:
Jul 2009
Posts:
497
Plugin Contributions:
0

Re: Is there a way to auto-login to admin?

i dont know if its possible to login without entering details, this would comprimise security surely?

2 Nov 2009, 3:42 PM
#3
peytonrm avatar

peytonrm

New Zenner

Join Date:
Jun 2008
Location:
Morrisville, NC
Posts:
47
Plugin Contributions:
0

Re: Is there a way to auto-login to admin?

That's not possible because the zencart admin login uses a random token that is different on every login that must be present and match for you to be able to login. You could hack the login process to bypass the token check under cetain conditions, but that smells really bad from a security perspective.

What I would probably do is modify login.php to check for login and password being passed as GET parameters and fill them into the form if they are. That way the user would only have to click "submit" to login. Something like this should only be done inside your CMS, where the user has already had to login to one system and even then only if you really trust the security of your CMS.

2 Nov 2009, 5:56 PM
#4
kiddo avatar

kiddo

Totally Zenned

Join Date:
Jul 2006
Location:
SF Bay Area
Posts:
837
Plugin Contributions:
1

Re: Is there a way to auto-login to admin?

You can do this with Curl in two steps.

retrieve the login screen and parse out the security token and then construct another Curl call to do the login.

drawback is that your curl script will have to store an admin password in plain text.

3 Nov 2009, 8:55 AM
#5
mikejd avatar

mikejd

New Zenner

Join Date:
Oct 2009
Posts:
3
Plugin Contributions:
0

Re: Is there a way to auto-login to admin?

Thanks all for the advice. Sounds like it will be easier and better security to just login again to ZenCart. Not sure about the security of the CMS as it is a one off system written more than 5 years ago, not a proprietary or open source system, and not actively maintained since.

Mike