You are here

function subuser_tweak_roles_of_subusers in Subuser 6

Function to add roles to subusers based on the parent's account change.

Parameters

$subusers: An array of user id's (key & value uid) as returned by subuser_get_subusers.

$op: Either 'add_role' or 'remove_role' as required by user_multiple_role_edit().

$diff: An array of role id's to add or remove from each of the subusers.

1 call to subuser_tweak_roles_of_subusers()
subuser_user in ./subuser.module
Implementation of hook_user().

File

./subuser.module, line 518
Allows users of a particular role to create sub user account in another role.

Code

function subuser_tweak_roles_of_subusers($subusers, $op, $diff) {
  if (is_array($diff) && is_array($subusers)) {
    foreach ($diff as $rid) {
      user_multiple_role_edit($subusers, $op, $rid);
    }
  }
}