You are here

function bakery_user_update in Bakery Single Sign-On System 7.3

Same name and namespace in other branches
  1. 8.2 bakery.module \bakery_user_update()
  2. 7.4 bakery.module \bakery_user_update()
  3. 7.2 bakery.module \bakery_user_update()

Implements hook_user_update().

File

./bakery.module, line 140

Code

function bakery_user_update(&$edit, $account, $category) {
  global $user;

  // Need to push changes.
  if (variable_get('bakery_is_master', 0) && isset($_SESSION['bakery'])) {
    if ($user->uid === $account->uid) {
      $bakery = bakery_get_bakery();

      // Rebake SSO cookie in case any account properties changed.
      $params = array(
        'name' => $account->name,
        'mail' => $account->mail,
        'init' => _bakery_init_field($account->uid),
        'uid' => $account->uid,
      );
      $bakery
        ->setSsoCookie($params);
    }
  }
}