You are here

function autoban_ban_all_batch_finished in Automatic IP ban (Autoban) 7

Callback batch finished for ban all batch.

Parameters

bool $success: A boolean indicating whether the batch has completed successfully.

array $results: The value set in $context['results'] by callback_batch_operation().

array $operations: If $success is FALSE, contains the operations that remained unprocessed.

1 string reference to 'autoban_ban_all_batch_finished'
autoban_ban_all_form_submit in ./autoban.admin.inc
Form submission for autoban_ban_all_form().

File

./autoban.admin.inc, line 552
Configuration for autoban module.

Code

function autoban_ban_all_batch_finished($success, $results, $operations) {
  if ($success) {
    drupal_set_message(t('Successful IP ban.'));
    if (isset($_SESSION['autoban_ban_all_count'])) {
      drupal_set_message(t('IP ban for all rules has finished. Total IP insertion: @count.', array(
        '@count' => $_SESSION['autoban_ban_all_count'],
      )));
    }
  }
  else {
    drupal_set_message(t('Fail IP ban'), 'error');
  }
}