Zen Cart Logo
Forums / Basic Configuration / How do I call the Username and Password of the current admin?

How do I call the Username and Password of the current admin?

Locked

Views: 3,875

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
16 Sep 2009, 7:30 PM
#1
bparker avatar

bparker

Zen Follower

Join Date:
Oct 2008
Location:
Rochester, NY
Posts:
232
Plugin Contributions:
0

How do I call the Username and Password of the current admin?

How do I call the Username and Password of the current admin? For programming purposes, I just want to echo it using PHP or show it through a JavaScript alert. I will do other things with this later.

What is the code to display them?

Thanks,
BP

16 Sep 2009, 7:38 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: How do I call the Username and Password of the current admin?

  1. Passwords are NEVER available in PHP. They are encrypted with one-way encryption, and not extractable or unencryptable.
  2. The admin username is never stored in any variable. The admin_id is accessible in the $_SESSION, but if you need the name, you'll need to look it up from the database.

"Why" you'd want to disclose that information to anyone is ... alarming.

16 Sep 2009, 7:58 PM
#3
bparker avatar

bparker

Zen Follower

Join Date:
Oct 2008
Location:
Rochester, NY
Posts:
232
Plugin Contributions:
0

Re: How do I call the Username and Password of the current admin?

It's not to be disclosed. It's so I can build some extra functions into the admin panel. I need to know the username in order to do this so I can record it.

16 Sep 2009, 8:04 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: How do I call the Username and Password of the current admin?

It would be simplest to use the admin number instead.

17 Sep 2009, 2:17 AM
#5
bparker avatar

bparker

Zen Follower

Join Date:
Oct 2008
Location:
Rochester, NY
Posts:
232
Plugin Contributions:
0

Re: How do I call the Username and Password of the current admin?

Thanks! How would I call the Admin number?

17 Sep 2009, 11:29 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: How do I call the Username and Password of the current admin?

bparker:

Thanks! How would I call the Admin number?
Um ... you've just asked the SAME question in FOUR places. That's considered poor etiquette as it floods the forum with disconnected questions, and is akin to spam.
http://www.zen-cart.com/forum/showthread.php?t=137263
http://www.zen-cart.com/forum/showthread.php?t=137265
http://www.zen-cart.com/forum/showthread.php?t=137269

Asking your question ONCE is sufficient, especially when it's already been answered for you previously:

DrByte:

  1. ... The admin_id is accessible in the $_SESSION ...
17 Sep 2009, 4:08 PM
#7
bparker avatar

bparker

Zen Follower

Join Date:
Oct 2008
Location:
Rochester, NY
Posts:
232
Plugin Contributions:
0

Re: How do I call the Username and Password of the current admin?

Yes, but I did not understand the response.

Are you saying that I can use $_SESSION['admin_id'] and get the value?

Thanks,
BP

17 Sep 2009, 4:40 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How do I call the Username and Password of the current admin?

That's correct. Just asking for a clarification following the answer would have been sufficient.