You are here

function node_limit_user in Node Limit 6

Implementation of hook_user().

Delete all limit rules related to the deleted user.

2 string references to 'node_limit_user'
node_limit_user_install in node_limit_user/node_limit_user.install
Implementation of hook_install().
node_limit_user_uninstall in node_limit_user/node_limit_user.install

File

node_limit_user/node_limit_user.module, line 13
Module to restrict the number of nodes by user.

Code

function node_limit_user($op, &$edit, $account, $category = NULL) {
  switch ($op) {
    case 'delete':
      $sql = 'DELETE FROM {node_limit_user} WHERE uid = %d';
      db_query($sql, $account->uid);
      $num = db_affected_rows();
      if ($num > 0) {
        drupal_set_message(t('Deleted !num.', array(
          '!num' => format_plural((int) $num, '1 limit rule', '@count limit rules'),
        )));
      }
      break;
  }
}