summaryrefslogtreecommitdiff
path: root/modules/poll
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-01-08 08:42:13 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-01-08 08:42:13 +0000
commit9a32ca468a320bec9769ed3c29c50b5a1f4459b1 (patch)
tree1986a66b2cdb4ca7df540a19427605ef905e9b8d /modules/poll
parent1eb5be733ab7df65ffa1713c6c5dbba1558547ff (diff)
downloadbrdo-9a32ca468a320bec9769ed3c29c50b5a1f4459b1.tar.gz
brdo-9a32ca468a320bec9769ed3c29c50b5a1f4459b1.tar.bz2
#8 by sun and most of #drupal: Users can now cancel their accounts. Fixing the 8th issue, almost 8 years later, on January 8th, after working 8 days full-time on it. GREAT WORK :D
Diffstat (limited to 'modules/poll')
-rw-r--r--modules/poll/poll.module14
1 files changed, 11 insertions, 3 deletions
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index 5152687df..f280276b6 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -815,9 +815,17 @@ function poll_cancel($form, &$form_state) {
}
/**
- * Implementation of hook_user_delete().
+ * Implementation of hook_user_cancel().
*/
-function poll_user_delete(&$edit, &$user) {
- db_query('UPDATE {poll_vote} SET uid = 0 WHERE uid = %d', $user->uid);
+function poll_user_cancel(&$edit, &$account, $method) {
+ switch ($method) {
+ case 'user_cancel_reassign':
+ db_update('poll_vote')->fields(array('uid' => 0))->condition('uid', $account->uid)->execute();
+ break;
+
+ case 'user_cancel_delete':
+ db_delete('poll_vote')->condition('uid', $account->uid)->execute();
+ break;
+ }
}