1

I may just be being thick here - but I can't seem to find this even when debugging the code I am writing.

Here's my scenario:

  • I have an extension that does something whenever someone created or updates an entry.
  • What I'd like to do is log the user who made edits to an entry

The issue I am running into is when a user (who did not create the original entry) updates an existing entry. I can find the original author's ID in the $meta['author_id'] field, but don't seem to find any reference to the editing author's ID.

Am I missing something, or is this data really not passed to the hook?

Thanks in advance for your help!

MW

  • ehm, current user? e.g. session user_id – GDmac Apr 8 '14 at 7:54
2

To get the logged in member use

ee()->session->userdata('member_id')

or

$this->EE->session->userdata('member_id')
| improve this answer | |
  • Geesh - ever have one of those long days where you make a very very simple solution way over-complicated? Yeah, that must have been yesterday for me. I feel a little silly even having asked this question. But thank you so much for straightening me out. Cheers, Michael – Michael Witwicki Apr 8 '14 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.