Member
Member
n20capri2   2015-08-18, 03:16
#1

I'm doing some custom stuff for a client where logged in users are able to select certain things then submit. Their selection then goes to the DB and an email is sent to client.

I've got everything except I can't figure out how to grab their username. Right now I'm hard coding it for testing - Doesn't even have to be username - ID or email address would work too.

Please help,
Thanks,
Mike

Administrator
Administrator
acrylian   2015-08-18, 08:11
#2

THe object of the current logged in user is availabe in the global variable $_zp_current_admin_obj. The object is from the Zenphoto_Administrator class:
http://www.zenphoto.org/documentation/classes/_lib-auth.php.html

To get a specific user use $userobj = Zenphoto_Authority::newAdministrator("', 1);

Administrator
Administrator
fretzl   2015-08-18, 09:00
#3

I think you're looking for something like this:

`

`
This gets the User name of the current logged-in user.

Administrator
Administrator
acrylian   2015-08-18, 09:42
#4

Right ;-) The naming of methods is a bit confusing as there is also a method getName() which actually refers to the optional "full name" and not the "user name".

Member
Member
n20capri2   2015-08-24, 19:15
#5

Cool I got it. Thanks guys. Now I'm having an issue with Safari only where the user gets logged out when I "add" something to a cart. (but they are really still logged in) It appears as if hitting the add button adds the www to the url bar and safari doesn't like this. If I manually remove the www I'm back to being logged in.

On the other hand IE works perfectly as-is...but if I manually remove the WWW it shows as if I'm logged out...but again really logged in...No issues there because it works fine as-is. But for some reason Safari is being weird...Mozilla works fine either way

Is this a DNS, WWW vs no WWW issue?

Any ideas are welcome...Everything else is perfect except this little issue. As it turns out both partners use MAC's so I kind of have to get this straightened out! lol

Thanks,
Mike

Administrator
Administrator
acrylian   2015-08-25, 08:42
#6

Since the cart you are using is not Zenphoto I would look for the issue there. Maybe a config issue of the cart?

Member
Member
n20capri2   2015-08-26, 20:50
#7

It's completely custom. Turned out to be a relative path issue that only Safari didn't like. It's all straightened out now.

Thanks again

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.