| 1 |
<?php |
<?php |
| 2 |
// $Id: simplenews.module,v 1.111 2008/06/30 05:15:53 sutharsan Exp $ |
// $Id: simplenews.module,v 1.112 2008/06/30 06:24:27 sutharsan Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @defgroup simplenews |
* @defgroup simplenews |
| 613 |
break; |
break; |
| 614 |
case 'delete': |
case 'delete': |
| 615 |
if (variable_get('simplenews_sync_account', TRUE)) { |
if (variable_get('simplenews_sync_account', TRUE)) { |
| 616 |
// Delete subscription and all newsletter subscriptions when account is removed |
// Delete subscription and all newsletter subscriptions when account is removed. |
| 617 |
$subscription = simplenews_get_subscription($account); |
// We don't use simplenews_get_subscription() here because the user is already |
| 618 |
db_query('DELETE FROM {simplenews_snid_tid} WHERE snid = %d', $subscription->snid); |
// deleted from the {user} table. |
| 619 |
db_query('DELETE FROM {simplenews_subscriptions} WHERE snid = %d', $subscription->snid); |
$snid = db_result(db_query("SELECT s.snid FROM {simplenews_subscriptions} s WHERE s.mail = '%s'", $account->mail)); |
| 620 |
|
db_query('DELETE FROM {simplenews_snid_tid} WHERE snid = %d', $snid); |
| 621 |
|
db_query('DELETE FROM {simplenews_subscriptions} WHERE snid = %d', $snid); |
| 622 |
} |
} |
| 623 |
else { |
else { |
| 624 |
// Only remove uid from subscription data when account is removed |
// Only remove uid from subscription data when account is removed |