How to get the details of the just logged-in user in the post_user_login event in PyroCMS?

What I have tried:

  1. $this->current_user does not work, unless page is refreshed, even though the controllers are inheriting Public_Controller or Admin_Controller, thus implying availability of $this->current_user (documentation).

Why do I need this:

  1. To get (at least) user id or profile id, so that I can fetch more details and take action.
有帮助吗?

解决方案

$data = $this->ci->current_user ? $this->ci->current_user : $this->ci->ion_auth->get_user();

Source: https://forum.pyrocms.com/discussion/25095/get-logged-in-user-in-post_user_login-event Author: andym

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top