2c2 < index b667d89..219de79 100644 --- > index 906a7c1..53ff064 100644 5c5 < @@ -1895,56 +1895,6 @@ function drupal_set_title($title = NULL, $output = CHECK_PLAIN) { --- > @@ -1881,56 +1881,6 @@ function drupal_set_title($title = NULL, $output = CHECK_PLAIN) { 62c62 < @@ -2326,7 +2276,6 @@ function _drupal_bootstrap_page_cache() { --- > @@ -2306,7 +2256,6 @@ function _drupal_bootstrap_page_cache() { 64c64 < $cache_enabled = $config->get('cache'); --- > $cache_enabled = $config->get('cache.page.enabled'); 70,78d69 < @@ -2459,7 +2408,7 @@ function drupal_get_bootstrap_phase() { < * @code < * // Register the LANGUAGE_TYPE_INTERFACE definition. Registered definitions < * // do not necessarily need to be named by a constant. < - * // See < + * // See < * // http://symfony.com/doc/current/components/dependency_injection/introduction.html < * // for usage examples of adding object initialization code after register(). < * $container = drupal_container(); 257c248 < index 0000000..d233232 --- > index 0000000..64c9af3 260c251 < @@ -0,0 +1,145 @@ --- > @@ -0,0 +1,144 @@ 336d326 < + $denied = FALSE; 408c398 < index 0000000..7644532 --- > index 0000000..47826a6 411c401 < @@ -0,0 +1,88 @@ --- > @@ -0,0 +1,94 @@ 423a414,426 > + > + /** > + * Modules to enable. > + * > + * @var array > + */ > + public static $modules = array('ban'); > + > + /** > + * The main user for testing. > + * > + * @var object > + */ 438,444d440 < + * Implement setUp(). < + */ < + function setUp() { < + parent::setUp('ban'); < + } < + < + /** 563c559 < index 1183155..f24165f 100644 --- > index b7e2d31..99617dc 100644 566c562 < @@ -27,7 +27,7 @@ class StatisticsTestBase extends WebTestBase { --- > @@ -34,7 +34,7 @@ abstract class StatisticsTestBase extends WebTestBase { 576c572 < index d84e07b..a43eab0 100644 --- > index 176e2af..6bb07c3 100644 579c575,581 < @@ -131,7 +131,7 @@ function statistics_top_visitors() { --- > @@ -126,12 +126,12 @@ function statistics_top_visitors() { > array('data' => t('Hits'), 'field' => 'hits', 'sort' => 'desc'), > array('data' => t('Visitor'), 'field' => 'u.name'), > array('data' => t('Total page generation time'), 'field' => 'total'), > - array('data' => user_access('block IP addresses') ? t('Operations') : '', 'colspan' => 2), > + array('data' => user_access('ban IP addresses') ? t('Operations') : '', 'colspan' => 2), > ); 612c614 < drupal_set_title(t('Top visitors in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200)))), PASS_THROUGH); --- > drupal_set_title(t('Top visitors in the past %interval', array('%interval' => format_interval(config('statistics.settings')->get('access_log.max_lifetime')))), PASS_THROUGH); 718c720 < index d956f05..49b3fc9 100644 --- > index 2bf4343..c180ad1 100644 721c723 < @@ -1355,111 +1355,6 @@ function system_modules_uninstall_submit($form, &$form_state) { --- > @@ -1372,111 +1372,6 @@ function system_modules_uninstall_submit($form, &$form_state) { 834c836 < index 91d5304..d50146e 100644 --- > index ac983aa..5db1017 100644 837c839,869 < @@ -1972,6 +1972,38 @@ function system_update_8013() { --- > @@ -626,29 +626,6 @@ function system_schema() { > ), > ); > > - $schema['blocked_ips'] = array( > - 'description' => 'Stores blocked IP addresses.', > - 'fields' => array( > - 'iid' => array( > - 'description' => 'Primary Key: unique ID for IP addresses.', > - 'type' => 'serial', > - 'unsigned' => TRUE, > - 'not null' => TRUE, > - ), > - 'ip' => array( > - 'description' => 'IP address', > - 'type' => 'varchar', > - 'length' => 40, > - 'not null' => TRUE, > - 'default' => '', > - ), > - ), > - 'indexes' => array( > - 'blocked_ip' => array('ip'), > - ), > - 'primary key' => array('iid'), > - ); > - > $schema['cache_tags'] = array( > 'description' => 'Cache table for tracking cache tags related to the cache bin.', > 'fields' => array( > @@ -1894,6 +1871,42 @@ function system_update_8019() { 841c873 < + * Enable the ban module if blocked ips exists. --- > + * Enable the ban module if blocked ips exists or statistics are enabled. 843c875 < +function system_update_8014() { --- > +function system_update_8020() { 845c877,886 < + if ($blocked_ips_exists) { --- > + if ($blocked_ips_exists || module_exists('statistics')) { > + // Update old permissions before enabling ban module. > + db_update('role_permission') > + ->fields(array( > + 'permission' => 'ban IP addresses', > + 'module' => 'ban', > + )) > + ->condition('permission', 'block IP addresses') > + ->execute(); > + 858,862d898 < + // Delete old permissions. < + db_delete('role_permission') < + ->condition('permission', 'block IP addresses') < + ->execute(); < + 877c913 < index 14cc390..95f013d 100644 --- > index 922b8a7..f99feee 100644 880c916 < @@ -136,8 +136,6 @@ function system_help($path, $arg) { --- > @@ -138,8 +138,6 @@ function system_help($path, $arg) { 889c925 < @@ -241,9 +239,6 @@ function system_permission() { --- > @@ -243,9 +241,6 @@ function system_permission() { 899c935 < @@ -772,23 +767,6 @@ function system_menu() { --- > @@ -759,23 +754,6 @@ function system_menu() { 923c959 < @@ -1866,19 +1844,6 @@ function system_stream_wrappers() { --- > @@ -2004,19 +1982,6 @@ function system_stream_wrappers() { 940c976 < * Menu item access callback - only admin or enabled themes can be accessed. --- > * Menu item access callback - only enabled themes can be accessed. 943c979 < @@ -3400,12 +3365,6 @@ function system_action_info() { --- > @@ -3540,12 +3505,6 @@ function system_action_info() { 956c992 < @@ -3627,19 +3586,6 @@ function system_goto_action($entity, $context) { --- > @@ -3767,19 +3726,6 @@ function system_goto_action($entity, $context) {