3.10.6. user_save_groups

This hook can be used to handle the groups data that is going to be stored in the database for a user. Modules can do some last minute change on the data or keep some external system in sync with the Phorum user data.

Call time:

Just before the groups for a user are stored in the database.

Hook input:

An array containing user_id and groups-data as another array.

Hook output:

The same array as the one that was used for the hook call argument, possibly with some updated fields in it.

Example code:

function phorum_mod_foo_user_save_groups($data)
{
    list($user_id,$groups) = $data;
    foreach($groups as $group_id => $group_permission) {
        // do something with the groups permissions
    }

    return array($user_id,$groups);
}