You are here

function pay_user in Pay 6

Implementation of hook_user().

File

./pay.module, line 62
Pay module allows for accepting payments using pluggable payment backends.

Code

function pay_user($op, &$edit, &$account, $category = NULL) {
  switch ($op) {
    case 'categories':

      // Return only a modes 'category' entry - the real work happens in the
      // page callback for payment settings.  See also hook_menu.
      return array(
        array(
          'name' => 'pay',
        ),
      );
    case 'delete':

      // Deactivate any payment forms this user may have created.
      db_query("UPDATE {pay_form} SET status = 0, uid = 0 WHERE uid = %d", $account->uid);

      // Remove reference to this user's uid in transaction history.
      db_query("UPDATE {pay_transaction} SET uid = 0 WHERE uid = %d", $account->uid);
      db_query("UPDATE {pay_activity} SET uid = 0 WHERE uid = %d", $account->uid);
      break;
  }
}