You are here

function hook_invite_target_roles_alter in Invite 7.4

Alters target roles for user.

Used when needed to add/change resulting roles for user.

Parameters

array $targets: Array of roles which will be added to invited user account.

Invite $invite: Invite object.

object $account: Invited user account object.

1 invocation of hook_invite_target_roles_alter()
invite_target_roles in ./invite.module
Determine target roles based on the roles of an inviter.

File

./invite.api.php, line 54
Hooks provided by the Invite.

Code

function hook_invite_target_roles_alter($targets, $invite, $account) {

  // Add 'friday invited' role if user registering on Friday.
  if (date("N", time()) == 5) {
    $targets[ROLE_FRIDAY_INVITED] = ROLE_FRIDAY_INVITED;
  }
}