You are here

function uc_file_remove_user in Ubercart 7.3

Same name and namespace in other branches
  1. 8.4 uc_file/uc_file.module \uc_file_remove_user()
  2. 6.2 uc_file/uc_file.module \uc_file_remove_user()

Removes all of a user's downloadable files.

Parameters

$uid: A Drupal user ID.

1 call to uc_file_remove_user()
uc_file_user_cancel in uc_file/uc_file.module
Implements hook_user_cancel().

File

uc_file/uc_file.module, line 1430
Allows products to be associated with downloadable files.

Code

function uc_file_remove_user($user) {
  $query = db_delete('uc_file_users')
    ->condition('uid', $user->uid);

  // Echo the deletion only if something was actually deleted.
  if ($query
    ->execute()) {
    drupal_set_message(t('!user has had all of his/her downloadable files removed.', array(
      '!user' => theme('username', array(
        'account' => $user,
        'name' => check_plain($user->name),
        'link_path' => 'user/' . $user->uid,
      )),
    )));
  }
}