You are here

function datereminder_user in Date Reminder 6

Same name and namespace in other branches
  1. 6.2 datereminder.module \datereminder_user()

Implements hook_user().

Remove any reminders for given users(s)

File

./datereminder.module, line 252
Support for reminders for nodes with dates.

Code

function datereminder_user($op, &$edit, &$account, $category = NULL) {
  switch ($op) {
    case 'delete':
      if (is_array($edit['accounts'])) {

        // A multi-user delete from Admin > User management > Users.
        $uids = $edit['accounts'];
      }
      else {

        // A single-user delete from the edit tab on the user's profile.
        $uids = array(
          $edit['_account']->uid,
        );
      }
      $ph = db_placeholders($uids);
      db_query('DELETE FROM {datereminder} WHERE uid IN (' . $ph . ')', $uids);
      break;
  }
}