Index: signup.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/signup/signup.module,v
retrieving revision 1.129
diff -u -p -u -p -r1.129 signup.module
--- signup.module	26 Jan 2008 03:02:39 -0000	1.129
+++ signup.module	13 Mar 2008 23:07:32 -0000
@@ -331,6 +331,38 @@ function signup_perm() {
 }
 
 /**
+ * Implementatiion of hook_user().
+ *
+ * When a user is deleted, cancel all of that user's signups to remove all
+ * instances of that user from the {signup_log} table, free up space in events
+ * with signup limits, etc.
+ *
+ * @ingroup signup_core
+ */
+function signup_user($type, &$edit, &$user, $category = NULL) {
+  switch ($type) {
+    case 'delete':
+      $uids = array();
+      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[] = $edit['uid'];
+      }
+      foreach ($uids as $uid) {
+        $nids = db_query("SELECT nid FROM {signup_log} WHERE uid = %d", $uid);
+        while($data = db_fetch_object($nids)) {
+          signup_cancel_signup($uid, $data->nid);
+        }
+      }
+      break;
+  }
+}
+
+
+/**
  * Implementation of hook_form_alter().
  * @ingroup signup_core
  */
