Can't hook into on_user_exit_group event.

Permalink
I am having trouble with hocking into this event.

I have discovered some chat on githttps://github.com/concrete5/concrete5/pull/781... that I think relates so have added the relevant lines to web/concrete/core/models/userinfo.php to actually fire the events.

I have added site_events.php to my config folder with the following code:
Events::extend('on_user_add', 'SiteEvents', 'addUser', false);
Events::extend('on_user_exit_group', 'SiteEvents', 'exitUserGroup', false);
class SiteEvents {
    public function exitUserGroup($ui,$gr) {
        Log::addEntry("exitUserGroup code");
    }
    public function addUser($ui) {
        Log::addEntry("addUser code");
    }
}


This Log entry is not created. I have tested on_user_add and that is working fine. To test I am using the dashboard to manually remove a user from a group. Ultimately it is when the user expires from a group that I want to capture.

Would really appreciate some pointers as I have tried for the last few hours to resolve this. (The code I want to run is to send some emails but just testing to get the LogEvent for now)

 
FatTony1952 replied on at Permalink Reply
FatTony1952
I've been trying to figure this one out too. I'm wondering if it doesn't get logged immediately because it needs a job to run to check the groups?