You are here

function birthdays_user in Birthdays 6

Same name and namespace in other branches
  1. 5 birthdays.module \birthdays_user()

Implementation of hook_user().

File

./birthdays.module, line 621
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_user($op, &$edit, &$account, $category = NULL) {
  global $_birthdays_field;

  // Do nothing with user when _birthdays_field is not yet set
  if (!isset($_birthdays_field)) {
    return;
  }
  switch ($op) {
    case 'load':
      return birthdays_load_user($account);
    case 'update':
    case 'insert':
      return birthdays_save_user($edit, $account, $category);
    case 'form':
      return birthdays_form_user($edit, $account, $category);
    case 'register':
      return birthdays_form_user($edit, $account, $category, TRUE);
    case 'delete':

      // Delete from {dob} table, other information is handled by profile.module and user.module
      db_query('DELETE FROM {dob} WHERE uid = %d', $account->uid);
      break;
  }
}