Forum
Get logged in admin data
Hello,
I was wondering whether it's possible to get the current Perch logged in user data with the API?
Use case: I have created my own app, and part of it you can send email reports and there is a select box where you choose who you want it sent to. One of which I want to be "Me" which sends to logged in Perch user.
Hopefully this makes sense.
Dexter. In your app you need to include the PerchMembers_Session class, then you can get the $Session object which contains all the information about the logged in user. I think I may have an exact example of this code on my office computer. Let me know if I need to dig it up for you.
Are you wanting to do this within the control panel or out on your site?
Hi Drew,
It would be in the control panel
In which case you probably have
$CurrentUser
in scope.Perfect!
Thanks Drew
Dexter, sorry but I was totally not thinking when I responded... My response was for member details, not admin... Oops. :(