I stumbled upon this because I wanted to add the group_id (s) user to the session after a successful login. In case someone is interested, here is how I did it (once I managed to find out where everything is done).
In ion_auth_model.php, I took the set_session function:
public function set_session($user) { $this->trigger_events('pre_set_session'); $session_data = array( 'identity' => $user->{$this->identity_column}, 'username' => $user->username, 'email' => $user->email, 'user_id' => $user->id,
and changed it to this:
public function set_session($user) { $this->trigger_events('pre_set_session'); $session_data = array( 'identity' => $user->{$this->identity_column}, 'username' => $user->username, 'email' => $user->email, 'user_id' => $user->id,
now it writes an array to a session called groups, which is a list of all the groups the user belongs to.
The only thing I needed to do was change the exit function in Ion_auth.php (in application / libraries) to make sure the group session variable is not set by adding
$this->session->unset_userdata('groups');
to the list of other unset_userdata () statements.
I know that I probably should have simply expanded the libraries / models to keep the kernel intact, but you could take what I did and it is easy to do.
hope this helps someone.
Rob
source share