You are here

function cas_attributes_cas_user_presave in CAS Attributes 7

Same name and namespace in other branches
  1. 6.3 cas_attributes.module \cas_attributes_cas_user_presave()

Implements hook_cas_user_presave().

File

./cas_attributes.module, line 47
Allows user account and profile attributes to be automatically populated using tokens. Provides basic tokens for attributes returned by the CAS server.

Code

function cas_attributes_cas_user_presave(&$edit, $account) {

  // We synchronize on the first login (always) and on future logins (if chosen).
  if ($account->login && !variable_get('cas_attributes_sync_every_login', NULL)) {

    // The user has logged in before and we are not set to always synchronize.
    return;
  }
  cas_attributes_map_fields($edit, $account);
  cas_attributes_map_roles($edit, $account);
}