From 3ddda75a73e9696362d2d260ceffc32e8ced3515 Mon Sep 17 00:00:00 2001
From: Lars Toomre <ltoomre@23809.no-reply.drupal.org>
Date: Tue, 25 Sep 2012 15:39:26 -0400
Subject: [PATCH] Issue 1794754 by Lars Toomre: Documentation refinements.

---
 core/modules/ban/ban.admin.inc                     |   12 +++++++-----
 core/modules/ban/ban.module                        |   19 +++++++++----------
 .../Tests/StatisticsBlockVisitorsTest.php          |    2 +-
 3 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/core/modules/ban/ban.admin.inc b/core/modules/ban/ban.admin.inc
index d7940f9..24304a3 100644
--- a/core/modules/ban/ban.admin.inc
+++ b/core/modules/ban/ban.admin.inc
@@ -6,11 +6,14 @@
  */
 
 /**
- * Page callback; Displays banned IP addresses.
+ * Page callback: Displays banned IP addresses.
  *
  * @param string $default_ip
- *   (optional) IP address to be passed on to drupal_get_form() for
- *   use as the default value of the IP address form field.
+ *   (optional) IP address to be passed on to drupal_get_form() for use as the
+ *   default value of the IP address form field.
+ *
+ * @return array
+ *   A renderable array.
  */
 function ban_admin_page($default_ip = '') {
   $rows = array();
@@ -43,7 +46,6 @@ function ban_admin_page($default_ip = '') {
  *
  * @see ban_ip_form_validate()
  * @see ban_ip_form_submit()
- *
  * @ingroup forms
  */
 function ban_ip_form($form, &$form_state, $default_ip) {
@@ -109,7 +111,7 @@ function ban_ip_delete_form($form, &$form_state, array $ban_ip) {
     '#value' => $ban_ip,
   );
   return confirm_form($form,
-    t('Are you sure you want to delete %ip?', array('%ip' => $ban_ip['ip'])),
+    t('Are you sure you want to unblock %ip?', array('%ip' => $ban_ip['ip'])),
     'admin/config/people/ban',
     NULL,
     t('Delete')
diff --git a/core/modules/ban/ban.module b/core/modules/ban/ban.module
index 149ada9..869b8eb 100644
--- a/core/modules/ban/ban.module
+++ b/core/modules/ban/ban.module
@@ -2,7 +2,7 @@
 
 /**
  * @file
- * Enables banning of IP addresses.
+ * Allows capability to ban individual IP addresses.
  */
 
 /**
@@ -13,7 +13,7 @@ function ban_help($path, $arg) {
     case 'admin/help#ban':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Ban module allows administrators to ban visits to their site from given IP addresses.') . '</p>';
+      $output .= '<p>' . t('The Ban module allows administrators to ban visits to their site from individual IP addresses.') . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Banning IP addresses') . '</dt>';
@@ -67,10 +67,10 @@ function ban_boot() {
 }
 
 /**
- * Returns whether an IP address is blocked.
+ * Returns whether an individual IP address is blocked.
  *
  * Blocked IP addresses are stored in the database by default. However, for
- * performance reasons we allow an override in variables.
+ * performance reasons, we allow an override in variables.
  *
  * @param string $ip
  *   The IP address to check.
@@ -80,18 +80,17 @@ function ban_boot() {
  */
 function ban_is_denied($ip) {
   $denied = FALSE;
-  // Because this function is called on every page request, we first check
-  // for an array of IP addresses in settings.php before querying the
-  // database.
+  // Because this function is called on every page request, we first check for
+  // an array of IP addresses in settings.php before querying the database.
   $blocked_ips = variable_get('blocked_ips');
   if (isset($blocked_ips) && is_array($blocked_ips)) {
     $denied = in_array($ip, $blocked_ips);
   }
   // If $conf['page_cache_without_database'] = TRUE; is set in settings.php,
   // then the database is not available yet, so IPs recorded in the database
-  // won't be denied. However, the user asked explicitly not to use the
-  // database, and in this case it's also quite likely that the user relies
-  // on higher performance solutions like a firewall.
+  // will not be denied. However, the user asked explicitly not to use the
+  // database, and in this case it is also quite likely that the user relies on
+  // higher performance solutions like a firewall.
   elseif (class_exists('Drupal\Core\Database\Database', FALSE) && function_exists('db_query')) {
     $denied = (bool) db_query("SELECT 1 FROM {ban_ip} WHERE ip = :ip", array(':ip' => $ip))->fetchField();
   }
diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsBlockVisitorsTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsBlockVisitorsTest.php
index 4657d10..82990e3 100644
--- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsBlockVisitorsTest.php
+++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsBlockVisitorsTest.php
@@ -50,7 +50,7 @@ class StatisticsBlockVisitorsTest extends StatisticsTestBase {
 
     // Unblock the IP address.
     $this->clickLink('unban IP address');
-    $this->assertRaw(t('Are you sure you want to delete %ip?', array('%ip' => $test_ip_address)), 'IP address deletion confirmation found.');
+    $this->assertRaw(t('Are you sure you want to unblock %ip?', array('%ip' => $test_ip_address)), 'IP address deletion confirmation found.');
     $edit = array();
     $this->drupalPost('admin/config/people/ban/delete/1', NULL, t('Delete'));
     $this->assertRaw(t('The IP address %ip was deleted.', array('%ip' => $test_ip_address)), 'IP address deleted.');
-- 
1.7.6.msysgit.0

