You are here

function notifications_page_unsubscribe_subscription in Notifications 7

Menu callback for unsubscribe page

Parameters

$type: Either 'sid' or 'uid' (for unsubscribe all)

$id: Subscription id or user id, depending on type

1 string reference to 'notifications_page_unsubscribe_subscription'
notifications_menu in ./notifications.module
Implementation of hook_menu().

File

./notifications.pages.inc, line 45
User pages for Notifications

Code

function notifications_page_unsubscribe_subscription($subscription) {

  // If everything is ok and signed to skip confirmation, go ahead
  if (notifications_check_signature('skip')) {
    $subscription
      ->delete();
    drupal_set_message(t('Your subscription has been removed.'));
    drupal_goto();
  }
  else {

    // Ask for confirmation
    drupal_set_title(t('Delete your subscription'));
    return drupal_get_form('notifications_subscription_unsubscribe_form', $subscription);
  }
  drupal_access_denied();
}