You are here

function birthdays_load_user in Birthdays 5

Same name and namespace in other branches
  1. 6 birthdays.module \birthdays_load_user()

Inject information on a user load

Parameters

object $account: User object passed by reference

1 call to birthdays_load_user()
birthdays_user in ./birthdays.module
Implementation of hook_user().

File

./birthdays.module, line 1018
The Birthdays module allows users to add their birthday to their profile. It lists birthdays on a seperate page and in different blocks. Users can receive an e-mail on their birthday automatically, and the administrator can receive daily reminders of…

Code

function birthdays_load_user(&$account) {
  global $_birthdays_field;

  // Pre-load birthday-information into $account
  profile_load_profile($account);

  // If it was set by the user
  if ($account->{$_birthdays_field->name}) {

    // Set the user's age
    $account->age = _birthdays_get_age($account->{$_birthdays_field->name});
  }
}