You are here

function _subscriptions_user_suspend_form_submit in Subscriptions 7

Same name and namespace in other branches
  1. 2.0.x subscriptions.admin.old.php \_subscriptions_user_suspend_form_submit()

User suspend subform submit handler.

_state

Parameters

array $form:

1 string reference to '_subscriptions_user_suspend_form_submit'
subscriptions_user_suspend_form in ./subscriptions.admin.inc
Returns the form definition for the suspend part of the overview page.

File

./subscriptions.admin.inc, line 503
Subscriptions module (load-on-demand admin functions).

Code

function _subscriptions_user_suspend_form_submit(array $form, array &$form_state) {
  $form_values = $form_state['values'];
  if ($form_values['op'] == $form_values['save_notifications']) {
    $uid = $form_values['uid'];
    $suspended = $form_values['state'];
    if ($suspended == -1) {
      db_delete('subscriptions_queue')
        ->condition('uid', $uid)
        ->condition('suspended', 0, '<>')
        ->execute();
      $suspended = 0;
    }
    _subscriptions_user_suspend($uid, $suspended);
    drupal_set_message(t('The changes have been saved.'));
  }
}