You are here

function notifications_page_unsubscribe in Notifications 5

Same name and namespace in other branches
  1. 6.4 notifications.pages.inc \notifications_page_unsubscribe()
  2. 6 notifications.pages.inc \notifications_page_unsubscribe()
  3. 6.2 notifications.pages.inc \notifications_page_unsubscribe()
  4. 6.3 notifications.pages.inc \notifications_page_unsubscribe()

Menu callback add subscription

This just admits one field/value pair

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

File

./notifications.admin.inc, line 530

Code

function notifications_page_unsubscribe($sid) {
  global $user;
  if (is_numeric($sid) && ($subscription = notifications_load_subscription($sid))) {
    if (user_access('administer notifications') || $user->uid && $user->uid == $subscription->uid || !empty($_GET['signature']) && $_GET['signature'] == _notifications_signature(array(
      'unsubscribe',
      $sid,
    ))) {

      // Force confirmation form for unsubscribe
      drupal_set_title(t('Unsubscribe'));
      return drupal_get_form('notifications_form_unsubscribe_confirm', $subscription);
    }
  }
  drupal_access_denied();
}