﻿Index: node_limit_user.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_limit/node_limit_user/Attic/node_limit_user.module,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 node_limit_user.module
--- node_limit_user.module	9 Apr 2009 04:49:56 -0000	1.1.2.2
+++ node_limit_user.module	9 Apr 2009 18:57:57 -0000
@@ -105,4 +105,22 @@
   );
 }
 
+/**
+ * Implementation of hook_user().
+ * 
+ * Delete all limit rules related to the deleted user.
+ */
+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 limit rules.', array('!num' => $num)));
+      }
+      break;
+  }
+}
+
 ?>
\ No newline at end of file
