From 0a662de31010b5155d3612cb5a16de125ca6f544 Mon Sep 17 00:00:00 2001 From: Mike Date: Fri, 12 Nov 2010 11:25:52 -0500 Subject: [PATCH] [#529 state:resolved] Removed IPBan functionality since there are far more effective ways of handling this. --- build/sample.pm | 16 +--- lib/MT/App.pm | 11 +-- lib/MT/App/CMS.pm | 22 +---- lib/MT/App/Comments.pm | 81 ------------------ lib/MT/App/Trackback.pm | 25 +----- lib/MT/BackupRestore.pm | 7 -- lib/MT/Blog.pm | 1 - lib/MT/CMS/BanList.pm | 55 ------------- lib/MT/CMS/Blog.pm | 1 - lib/MT/CMS/Comment.pm | 10 +-- lib/MT/CMS/Common.pm | 38 +-------- lib/MT/CMS/TrackBack.pm | 1 - lib/MT/Callback.pod | 1 - lib/MT/Compat/v3.pm | 1 - lib/MT/Core.pm | 4 - lib/MT/IPBanList.pm | 114 -------------------------- lib/MT/L10N/de.pm | 21 ----- lib/MT/L10N/en_us.pm | 3 - lib/MT/L10N/es.pm | 21 ----- lib/MT/L10N/fr.pm | 21 ----- lib/MT/L10N/ja.pm | 22 ----- lib/MT/L10N/nl.pm | 21 ----- lib/MT/L10N/ru.pm | 22 ----- mt-static/css/structure.css | 6 +- schemas/mt.sql | 12 --- schemas/mysql.dump | 12 --- schemas/postgres.dump | 12 --- schemas/sqlite.dump | 12 --- t/00-compile.t | 2 - tmpl/cms/cfg_blog_settings.tmpl | 5 -- tmpl/cms/edit_comment.tmpl | 7 -- tmpl/cms/edit_ping.tmpl | 7 -- tmpl/cms/include/cfg_content_nav.tmpl | 3 - tmpl/cms/include/comment_table.tmpl | 5 -- tmpl/cms/include/ping_table.tmpl | 5 -- tmpl/cms/list_banlist.tmpl | 78 ------------------ tmpl/cms/list_comment.tmpl | 7 -- tmpl/cms/list_ping.tmpl | 7 -- tmpl/cms/prefs/ip-banning.tmpl | 54 ------------ tools/convert-db | 12 +-- tools/populate | 32 ++++---- 41 files changed, 36 insertions(+), 761 deletions(-) delete mode 100644 lib/MT/CMS/BanList.pm delete mode 100644 lib/MT/IPBanList.pm delete mode 100644 tmpl/cms/list_banlist.tmpl delete mode 100644 tmpl/cms/prefs/ip-banning.tmpl diff --git a/build/sample.pm b/build/sample.pm index 690a859e8..fe4749097 100644 --- a/build/sample.pm +++ b/build/sample.pm @@ -190,10 +190,9 @@ sub encoding {"iso-8859-1"} # Latin-1 ## Blog Config: Navigation 'Configuration' => '', - 'Core Setup' => '', - 'Preferences' => '', - 'Archiving' => '', - 'IP Banning' => '', + 'Core Setup' => '', + 'Preferences' => '', + 'Archiving' => '', ## Add a Category screen (category_add.tmpl) 'Add a Category' => '', @@ -212,15 +211,6 @@ sub encoding {"iso-8859-1"} # Latin-1 'Del' => '', '_USAGE_ARCHIVING_3' => '', - ## Blog Config | IP Banning (cfg_banlist.tmpl) - 'You did not select any IP addresses to delete.' => '', - '_USAGE_BANLIST' => '', - 'You have added [_1] to your list of banned IP addresses.' => '', - 'You have successfully deleted the selected IP addresses from the list.' - => '', - 'IP Ban List' => '', - 'You have [quant,_1,user] in your list of banned IP addresses.' => '', - ## Blog Config | Preferences (cfg_prefs.tmpl) '_USAGE_PREFS' => '', 'General Settings' => '', diff --git a/lib/MT/App.pm b/lib/MT/App.pm index 986262b7b..090b990a2 100644 --- a/lib/MT/App.pm +++ b/lib/MT/App.pm @@ -2260,15 +2260,7 @@ sub _send_comment_notification { id => $comment->id } ); - my $ban_link = $base - . $app->uri_params( - 'mode' => 'save', - args => { - '_type' => 'banlist', - blog_id => $blog->id, - ip => $comment->ip - } - ); + my %param = ( blog => $blog, entry => $entry, @@ -2276,7 +2268,6 @@ sub _send_comment_notification { approve_url => $approve_link, spam_url => $spam_link, edit_url => $edit_link, - ban_url => $ban_link, comment => $comment, unapproved => !$comment->visible(), state_editable => ( diff --git a/lib/MT/App/CMS.pm b/lib/MT/App/CMS.pm index 739c76332..8ca2983ba 100644 --- a/lib/MT/App/CMS.pm +++ b/lib/MT/App/CMS.pm @@ -1401,17 +1401,6 @@ sub core_menus { mode => "cfg_plugins", permission => "manage_plugins", }, - 'prefs:ip_info' => { - label => "IP Banning", - mode => 'list', - args => { _type => 'banlist' }, - order => 180, - permission => 'manage_feedback', - condition => sub { - $app->config->ShowIPInformation; - }, - view => "blog", - }, 'tools:activity_log' => { label => "Activity Log", @@ -1528,11 +1517,6 @@ sub init_core_callbacks { . 'post_delete.notification' => "${pfx}AddressBook::post_delete", - # banlist callbacks - $pkg - . 'save_permission_filter.banlist' => "${pfx}BanList::can_save", - $pkg . 'save_filter.banlist' => "${pfx}BanList::save_filter", - # associations $pkg . 'delete_permission_filter.association' => @@ -1781,8 +1765,7 @@ sub set_default_tmpl_params { || $param->{can_edit_categories} || $param->{can_edit_config} || $param->{can_edit_tags} - || $param->{can_set_publish_paths} - || $param->{show_ip_info}; + || $param->{can_set_publish_paths}; $param->{has_posting_label} = $param->{can_create_post} || $param->{can_edit_entries} @@ -1796,14 +1779,11 @@ sub set_default_tmpl_params { $param->{can_view_log} = $param->{can_view_blog_log}; $param->{can_publish_post} = $param->{can_publish_post} || $param->{can_edit_all_posts}; - $param->{show_ip_info} - = $app->config->ShowIPInformation && $param->{can_manage_feedback}; } ## end if ( my $perms = $app->permissions) my $static_app_url = $app->static_path; $param->{help_url} = $app->help_url() || $static_app_url . 'docs/'; - $param->{show_ip_info} ||= $app->config('ShowIPInformation'); my $type = $q->param('_type') || ''; $param->{ "mode_$mode" . ( $type ? "_$type" : '' ) } = 1; diff --git a/lib/MT/App/Comments.pm b/lib/MT/App/Comments.pm index 3e719b3d1..5a676f366 100644 --- a/lib/MT/App/Comments.pm +++ b/lib/MT/App/Comments.pm @@ -716,78 +716,6 @@ sub _builtin_throttle { return 0; # Put a collar on that puppy. } - return 1 unless $cfg->ShowIPInformation; - - # If IP banning is enabled, check for lots of comments from - # the user's IP within the throttle period * 10; if they - # exceed 8 comments within that period, ban the IP. - - @ts = MT::Util::offset_time_list( time - $throttle_period * 10 - 1, - $entry->blog_id ); - $from = sprintf( "%04d%02d%02d%02d%02d%02d", - $ts[5] + 1900, - $ts[4] + 1, - @ts[ 3, 2, 1, 0 ] ); - my $count = MT::Comment->count( { - ip => $user_ip, - created_on => [$from], - blog_id => $entry->blog_id - }, - { range => { created_on => 1 } } - ); - if ( $count >= 8 ) { - require MT::IPBanList; - my $ipban = MT::IPBanList->new(); - $ipban->blog_id( $entry->blog_id ); - $ipban->ip($user_ip); - $ipban->save(); - $app->log( { - message => - $app->translate( - "IP [_1] banned because comment rate exceeded 8 comments in [_2] seconds.", - $user_ip, - 10 * $throttle_period - ), - class => 'comment', - category => 'ip_ban', - blog_id => $entry->blog_id, - level => MT::Log::INFO(), - metadata => $user_ip, - } - ); - require MT::Mail; - my $author = $entry->author; - $app->set_language( $author->preferred_language ) - if $author && $author->preferred_language; - - my $blog = MT::Blog->load( $entry->blog_id ) - or return $app->error( - $app->translate( 'Can\'t load blog #[_1].', $entry->blog_id ) ); - if ( $author && $author->email ) { - my %head = ( - id => 'comment_throttle', - To => $author->email, - From => $cfg->EmailAddressMain, - Subject => '[' - . $blog->name . '] ' - . $app->translate("IP Banned Due to Excessive Comments") - ); - my $charset = $cfg->MailEncoding || $cfg->PublishCharset; - $head{'Content-Type'} = qq(text/plain; charset="$charset"); - my $body = - $app->build_email( - 'comment_throttle.tmpl', - { - blog => $blog, - throttled_ip => $user_ip, - throttle_seconds => 10 * $throttle_period, - } - ); - $body = wrap_text( $body, 72 ); - MT::Mail->send( \%head, $body ); - } ## end if ( $author && $author...) - return 0; - } ## end if ( $count >= 8 ) return 1; } ## end sub _builtin_throttle @@ -817,15 +745,6 @@ sub post { ) ) if $entry->status != RELEASE; - require MT::IPBanList; - my $iter = MT::IPBanList->load_iter( { blog_id => $entry->blog_id } ); - while ( my $ban = $iter->() ) { - my $banned_ip = $ban->ip; - if ( $app->remote_ip =~ /$banned_ip/ ) { - return $app->handle_error( $app->translate("Invalid request") ); - } - } - my $blog = $app->model('blog')->load( $entry->blog_id ) or return $app->error( $app->translate( 'Can\'t load blog #[_1].', $entry->blog_id ) ); diff --git a/lib/MT/App/Trackback.pm b/lib/MT/App/Trackback.pm index f7a006742..9bc6eb87a 100644 --- a/lib/MT/App/Trackback.pm +++ b/lib/MT/App/Trackback.pm @@ -184,23 +184,6 @@ sub ping { or return $app->_response( Error => $app->translate( "Invalid TrackBack ID '[_1]'", $tb_id ) ); - my $user_ip = $app->remote_ip; - - ## Check if this user has been banned from sending TrackBack pings. - require MT::IPBanList; - my $iter = MT::IPBanList->load_iter( { blog_id => $tb->blog_id } ); - while ( my $ban = $iter->() ) { - my $banned_ip = $ban->ip; - if ( $user_ip =~ /$banned_ip/ ) { - return - $app->_response( - Error => - $app->translate( - "You are not allowed to send TrackBack pings.") - ); - } - } - my ( $blog_id, $entry, $cat ); if ( $tb->entry_id ) { require MT::Entry; @@ -501,18 +484,12 @@ sub _send_ping_notification { args => { blog_id => $blog->id, '_type' => 'ping', id => $ping->id } ); - my $ban_link = $base - . $app->uri_params( - 'mode' => 'save', - args => - { '_type' => 'banlist', blog_id => $blog->id, ip => $ping->ip } - ); + my %param = ( blog => $blog, approve_url => $approve_link, spam_url => $spam_link, edit_url => $edit_link, - ban_url => $ban_link, ping => $ping, unapproved => !$ping->visible(), state_editable => ( diff --git a/lib/MT/BackupRestore.pm b/lib/MT/BackupRestore.pm index 01918c2f1..63db9383d 100644 --- a/lib/MT/BackupRestore.pm +++ b/lib/MT/BackupRestore.pm @@ -1426,13 +1426,6 @@ sub parents { }; } -package MT::IPBanList; - -sub parents { - my $obj = shift; - { blog_id => MT->model('blog'), }; -} - package MT::Blocklist; sub parents { diff --git a/lib/MT/Blog.pm b/lib/MT/Blog.pm index a98c9e836..06933e58b 100644 --- a/lib/MT/Blog.pm +++ b/lib/MT/Blog.pm @@ -633,7 +633,6 @@ sub clone_with_children { # Placement records # Template records # Permission records - # IPBanList records??? # Notification records??? my $new_blog_id; diff --git a/lib/MT/CMS/BanList.pm b/lib/MT/CMS/BanList.pm deleted file mode 100644 index 07e21644e..000000000 --- a/lib/MT/CMS/BanList.pm +++ /dev/null @@ -1,55 +0,0 @@ -package MT::CMS::BanList; - -use strict; - -sub can_save { - my ( $eh, $app, $id ) = @_; - my $perms = $app->permissions; - return $perms - && ( $perms->can_edit_config || $perms->can_manage_feedback ); -} - -sub save_filter { - my $eh = shift; - my ($app) = @_; - my $q = $app->query; - my $ip = $q->param('ip'); - $ip =~ s/(^\s+|\s+$)//g; - return $eh->error( - MT->translate("You did not enter an IP address to ban.") ) - if ( '' eq $ip ); - my $blog_id = $q->param('blog_id'); - require MT::IPBanList; - my $existing - = MT::IPBanList->load( { 'ip' => $ip, 'blog_id' => $blog_id } ); - my $id = $q->param('id'); - - if ( $existing && ( !$id || $existing->id != $id ) ) { - return - $eh->error( - $app->translate( - "The IP you entered is already banned for this blog.") - ); - } - return 1; -} ## end sub save_filter - -1; - -__END__ - -=head1 NAME - -MT::CMS::BanList - -=head1 METHODS - -=head2 can_save - -=head2 save_filter - -=head1 AUTHOR & COPYRIGHT - -Please see L. - -=cut diff --git a/lib/MT/CMS/Blog.pm b/lib/MT/CMS/Blog.pm index 3b8c52df0..221f73c46 100644 --- a/lib/MT/CMS/Blog.pm +++ b/lib/MT/CMS/Blog.pm @@ -16,7 +16,6 @@ sub edit { # my $output = $param->{output} ||= 'cfg_prefs.tmpl'; $param->{need_full_rebuild} = 1 if $q->param('need_full_rebuild'); $param->{need_index_rebuild} = 1 if $q->param('need_index_rebuild'); - $param->{show_ip_info} = $cfg->ShowIPInformation; $param->{use_plugins} = $cfg->UsePlugins; my $entries_on_index = ( $obj->entries_on_index || 0 ); diff --git a/lib/MT/CMS/Comment.pm b/lib/MT/CMS/Comment.pm index ebee9decd..01094759e 100644 --- a/lib/MT/CMS/Comment.pm +++ b/lib/MT/CMS/Comment.pm @@ -170,10 +170,7 @@ sub edit_commenter { sub list { my $app = shift; my $q = $app->query; - my $trim_length - = $app->config('ShowIPInformation') - ? const('DISPLAY_LENGTH_EDIT_COMMENT_TEXT_SHORT') - : const('DISPLAY_LENGTH_EDIT_COMMENT_TEXT_LONG'); + my $trim_length = const('DISPLAY_LENGTH_EDIT_COMMENT_TEXT_LONG'); my $author_max_len = const('DISPLAY_LENGTH_EDIT_COMMENT_AUTHOR'); my $comment_short_len = const('DISPLAY_LENGTH_EDIT_COMMENT_TEXT_BREAK_UP_SHORT'); @@ -1767,10 +1764,7 @@ sub build_comment_table { my $i; $i = 1; my ( %blogs, %entries, %perms, %cmntrs ); - my $trim_length - = $app->config('ShowIPInformation') - ? const('DISPLAY_LENGTH_EDIT_COMMENT_TEXT_SHORT') - : const('DISPLAY_LENGTH_EDIT_COMMENT_TEXT_LONG'); + my $trim_length = const('DISPLAY_LENGTH_EDIT_COMMENT_TEXT_LONG'); my $author_max_len = const('DISPLAY_LENGTH_EDIT_COMMENT_AUTHOR'); my $comment_short_len = const('DISPLAY_LENGTH_EDIT_COMMENT_TEXT_BREAK_UP_SHORT'); diff --git a/lib/MT/CMS/Common.pm b/lib/MT/CMS/Common.pm index 150037361..eeffb2dcb 100644 --- a/lib/MT/CMS/Common.pm +++ b/lib/MT/CMS/Common.pm @@ -69,7 +69,7 @@ sub save { $param{error} = $app->errstr; $param{return_args} = $q->param('return_args'); - if ( ( $type eq 'notification' ) || ( $type eq 'banlist' ) ) { + if ( $type eq 'notification' ) { return list( $app, \%param ); } else { @@ -277,19 +277,6 @@ sub save { $app->add_return_arg( no_writedir => 1 ) unless $fmgr->exists($site_path) && $fmgr->can_write($site_path); } ## end elsif ( my $cfg_screen = ...) - elsif ( $type eq 'banlist' ) { - return - $app->redirect( - $app->uri( - 'mode' => 'list', - args => { - '_type' => 'banlist', - blog_id => $blog_id, - saved => $obj->ip - } - ) - ); - } elsif ( $type eq 'template' && $q->param('rebuild') ) { if ( !$id ) { @@ -615,16 +602,11 @@ sub list { my $perms = $app->permissions; return $app->return_to_dashboard( redirect => 1 ) unless $perms; - # - # In order for a user to see the IP Address banlist, they must have - # can_manage_feedback on the current blog. - # if ( $perms && ( ( $type eq 'blog' && !$perms->can_edit_config ) || ( $type eq 'template' && !$perms->can_edit_templates ) - || ( $type eq 'notification' && !$perms->can_edit_notifications ) - || ( $type eq 'banlist' && !$perms->can_manage_feedback ) ) + || ( $type eq 'notification' && !$perms->can_edit_notifications ) ) ) { return $app->return_to_dashboard( permission => 1 ); @@ -647,10 +629,6 @@ sub list { $args{offset} = $offset; $args{limit} = $limit + 1; } - elsif ( $type eq 'banlist' ) { - $param{use_plugins} = $app->config->UsePlugins; - $limit = 0; - } my $iter = $class->load_iter( \%terms, \%args ); my ( @@ -789,17 +767,7 @@ sub list { } # add any breadcrumbs - if ( $type eq 'banlist' ) { - $app->add_breadcrumb( $app->translate('IP Banning') ); - $param{nav_config} = 1; - $param{object_type} = 'banlist'; - $param{show_ip_info} = 1; - $param{list_noncron} = 1; - $param{search_type} = 'entry'; - $param{can_edit_config_or_publish_paths} = $perms->can_edit_config - || $perms->can_set_publish_paths; - } - elsif ( $type eq 'ping' ) { + if ( $type eq 'ping' ) { $app->add_breadcrumb( $app->translate('TrackBacks') ); $param{nav_trackbacks} = 1; $param{object_type} = 'ping'; diff --git a/lib/MT/CMS/TrackBack.pm b/lib/MT/CMS/TrackBack.pm index 3fc0bbabd..f27afc9a1 100644 --- a/lib/MT/CMS/TrackBack.pm +++ b/lib/MT/CMS/TrackBack.pm @@ -245,7 +245,6 @@ sub list { $param{filter} ||= $filter_col; $param{filter_val} ||= $val; $param{is_filtered} = 1; - $param{is_ip_filter} = $filter_col eq "ip"; } ## end if ( $filter_col && ( ...)) elsif ($filter_key) { my $filters = $app->registry( "list_filters", "ping" ) || {}; diff --git a/lib/MT/Callback.pod b/lib/MT/Callback.pod index 891ed747a..b1cbbb0bc 100755 --- a/lib/MT/Callback.pod +++ b/lib/MT/Callback.pod @@ -402,7 +402,6 @@ registered datatypes for the CMS. The available types are: notification => MT::Notification templatemap => MT::TemplateMap category => MT::Category - banlist => MT::IPBanList ping => MT::TBPing ping_cat => MT::TBPing group => MT::Group diff --git a/lib/MT/Compat/v3.pm b/lib/MT/Compat/v3.pm index 3e1c0c980..f824d10ab 100644 --- a/lib/MT/Compat/v3.pm +++ b/lib/MT/Compat/v3.pm @@ -146,7 +146,6 @@ BEGIN { # $MT::CallbackAlias{'AppTemplateOutput'} = 'template_output'; my @names = qw( CMSSavePermissionFilter_notification CMSSaveFilter_notification - CMSSavePermissionFilter_banlist CMSSaveFilter_banlist CMSViewPermissionFilter_author CMSSavePermissionFilter_author CMSDeletePermissionFilter_author CMSSaveFilter_author CMSPreSave_author CMSPostSave_author CMSViewPermissionFilter_blog diff --git a/lib/MT/Core.pm b/lib/MT/Core.pm index c7bf68a13..826bacc1c 100644 --- a/lib/MT/Core.pm +++ b/lib/MT/Core.pm @@ -72,8 +72,6 @@ BEGIN { 'comment' => 'MT::Comment', 'notification' => 'MT::Notification', 'templatemap' => 'MT::TemplateMap', - 'banlist' => 'MT::IPBanList', - 'ipbanlist' => 'MT::IPBanList', 'tbping' => 'MT::TBPing', 'ping' => 'MT::TBPing', 'ping_cat' => 'MT::TBPing', @@ -465,11 +463,9 @@ BEGIN { 'LaunchBackgroundTasks' => { default => 0 }, 'TypeKeyVersion' => { default => '1.1' }, 'TransparentProxyIPs' => { default => 0, }, - # 11/Nov/2010 - Temporarily setting default DebugMode to 1. See # https://openmelody.lighthouseapp.com/projects/26604/tickets/567 'DebugMode' => { default => 1, }, - 'ShowIPInformation' => { default => 0, }, 'AllowComments' => { default => 1, }, 'AllowPings' => { default => 1, }, 'HelpURL' => diff --git a/lib/MT/IPBanList.pm b/lib/MT/IPBanList.pm deleted file mode 100644 index 72bcc0847..000000000 --- a/lib/MT/IPBanList.pm +++ /dev/null @@ -1,114 +0,0 @@ -# Movable Type (r) Open Source (C) 2001-2010 Six Apart, Ltd. -# This program is distributed under the terms of the -# GNU General Public License, version 2. -# -# $Id$ - -package MT::IPBanList; - -use strict; -use base qw( MT::Object ); - -__PACKAGE__->install_properties( { - column_defs => { - 'id' => 'integer not null auto_increment', - 'blog_id' => 'integer not null', - 'ip' => 'string(50) not null', - }, - indexes => { blog_id => 1, ip => 1, }, - audit => 1, - datasource => 'ipbanlist', - primary_key => 'id', - } -); - -sub class_label { - MT->translate("IP Ban"); -} - -sub class_label_plural { - MT->translate("IP Bans"); -} - -sub ban_ip { - my $class = shift; - my ( $ip, $blog_id ) = @_; - $class->set_by_key( { ip => $ip, blog_id => $blog_id } ); -} - -1; -__END__ - -=head1 NAME - -MT::IPBanList - Movable Type IP comment banning record - -=head1 SYNOPSIS - - use MT::IPBanList; - my $ban = MT::IPBanList->new; - $ban->blog_id($blog->id); - $ban->ip($ip_address); - $ban->save - or die $ban->errstr; - -=head1 DESCRIPTION - -An I object represents a single IP address that is banned from -commenting on one of your blogs. - -=head1 USAGE - -As a subclass of I, I inherits all of the -data-management and -storage methods from that class; thus you should look -at the I documentation for details about creating a new object, -loading an existing object, saving an object, etc. - -=head1 DATA ACCESS METHODS - -The I object holds the following pieces of data. These fields can -be accessed and set using the standard data access methods described in the -I documentation. - -=over 4 - -=item * id - -The numeric ID of the banlist record. - -=item * blog_id - -The numeric ID of the blog for which the IP address is banned. - -=item * ip - -The IP address. This can be a partial IP address--for example, a partial -address of C<10.100> will block the IP addresses C<10.100.2.1>, -C<10.100.100.3>, etc. - -=back - -=head2 ban_ip($ip, $blog_id) - -This convenience method can be used in place of setting the I and -I individually. - -=head1 DATA LOOKUP - -In addition to numeric ID lookup, you can look up or sort records by any -combination of the following fields. See the I documentation in -I for more information. - -=over 4 - -=item * blog_id - -=item * ip - -=back - -=head1 AUTHOR & COPYRIGHT - -Please see L. - -=cut diff --git a/lib/MT/L10N/de.pm b/lib/MT/L10N/de.pm index 0f2dc2d8c..590df16d8 100644 --- a/lib/MT/L10N/de.pm +++ b/lib/MT/L10N/de.pm @@ -501,10 +501,6 @@ use vars qw( @ISA %Lexicon ); ## default_templates/monthly_entry_listing.mtml -## lib/MT/IPBanList.pm - 'IP Ban' => 'IP-Sperre', - 'IP Bans' => 'IP-Sperren', - ## lib/MT/BasicAuthor.pm 'authors' => 'Autoren', @@ -2359,12 +2355,6 @@ use vars qw( @ISA %Lexicon ); 'Zum Klonen von TrackBacks müssen auch die Einträge geklont werden.' , # Translate - New # OK -## lib/MT/CMS/BanList.pm - 'You did not enter an IP address to ban.' => - 'Keine IP-Adresse angegeben.', - 'The IP you entered is already banned for this blog.' => - 'Die angegebene IP-Adresse ist für dieses Weblog bereits gesperrt.', - ## lib/MT/CMS/Plugin.pm 'Plugin Set: [_1]' => 'Plugin-Gruppe: [_1]', 'Individual Plugins' => 'Individuelle Plugins', @@ -4706,17 +4696,6 @@ use vars qw( @ISA %Lexicon ); 'Select the location of the entry editor’s action bar.' => 'Gewünschte Position der Menüleiste', -## tmpl/cms/list_banlist.tmpl - 'IP Banning Settings' => 'IP-Sperren-Einstellungen', - 'IP addresses' => 'IP-Adressen', - 'Delete selected IP Address (x)' => 'Gewählte IP-Adressen löschen (x)', - 'You have added [_1] to your list of banned IP addresses.' => - 'Sie haben [_1] zur Liste mit gesperrten IP-Adressen hinzugefügt.', - 'You have successfully deleted the selected IP addresses from the list.' - => 'Sie haben die ausgewählten IP-Adressen erfolgreich aus der Liste entfernt.', - 'Ban IP Address' => 'IP-Adresse sperren', - 'Date Banned' => 'gesperrt am', - ## tmpl/cms/cfg_registration.tmpl 'Registration Settings' => 'Registrierungs-Einstellungen', 'Your blog preferences have been saved.' => 'Einstellungen übernommen.', diff --git a/lib/MT/L10N/en_us.pm b/lib/MT/L10N/en_us.pm index a87a47c8b..73cd2c9d1 100644 --- a/lib/MT/L10N/en_us.pm +++ b/lib/MT/L10N/en_us.pm @@ -65,9 +65,6 @@ sub ascii_only { ( ( ref $_[0] ) || $_[0] ) eq __PACKAGE__ } '_USAGE_ARCHIVING_3' => 'Select the archive type to which you would like to add a new archive template. Then select the template to associate with that archive type.', - '_USAGE_BANLIST' => - 'Below is the list of IP addresses who you have banned from commenting on your site or from sending TrackBack pings to your site. To add a new IP address, enter the address in the form below. To delete a banned IP address, check the delete box in the table below, and press the DELETE button.', - '_USAGE_PREFS' => 'This screen allows you to set a variety of optional settings concerning your blog, your archives, your comments, and your publicity & notification settings. When you create a new blog, these values will be set to reasonable defaults.', diff --git a/lib/MT/L10N/es.pm b/lib/MT/L10N/es.pm index c519f9024..445b51069 100644 --- a/lib/MT/L10N/es.pm +++ b/lib/MT/L10N/es.pm @@ -966,12 +966,6 @@ use vars qw( @ISA %Lexicon ); 'Importer type [_1] was not found.' => 'No se encontró el tipo de importador [_1].', -## lib/MT/CMS/BanList.pm - 'You did not enter an IP address to ban.' => - 'No tecleó una dirección IP para bloquear.', - 'The IP you entered is already banned for this blog.' => - 'La IP que introdujo ya está bloqueada en este blog.', - ## lib/MT/CMS/System.pm 'Permission denied.' => 'Permiso denegado.', 'You don\'t have a system email address configured. Please set this first, save it, then try the test email again.' @@ -2043,10 +2037,6 @@ use vars qw( @ISA %Lexicon ); 'Tag Placement' => 'Gestión de Etiqueta', 'Tag Placements' => 'Gestión de las Etiquetas', -## lib/MT/IPBanList.pm - 'IP Ban' => 'Bloqueo de IP', - 'IP Bans' => 'Bloqueos de IP', - ## lib/MT/Log.pm 'Log message' => 'Mensaje del registro', 'Log messages' => 'Mensajes del registro', @@ -3809,17 +3799,6 @@ que la dirección provista es correcta y le pertenece.', 'Make Backup (b)' => 'Hacer copia (b)', 'Make Backup' => 'Hacer copia', -## tmpl/cms/list_banlist.tmpl - 'IP Banning Settings' => 'Bloqueo de IPs', - 'IP addresses' => 'Direcciones IP', - 'Delete selected IP Address (x)' => - 'Borrar la dirección IP seleccionada (x)', - 'You have added [_1] to your list of banned IP addresses.' => - 'Agregó [_1] a su lista de direcciones IP bloqueadas.', - 'You have successfully deleted the selected IP addresses from the list.' - => 'Eliminó correctamente las direcciones IP seleccionadas.', - 'Ban IP Address' => 'Bloquear la dirección IP', - ## tmpl/cms/preview_entry.tmpl 'Preview [_1]' => 'Pre-ver [_1]', 'Re-Edit this [_1]' => 'Re-editar [_1]', diff --git a/lib/MT/L10N/fr.pm b/lib/MT/L10N/fr.pm index 19097d478..043e22bfd 100644 --- a/lib/MT/L10N/fr.pm +++ b/lib/MT/L10N/fr.pm @@ -510,10 +510,6 @@ use vars qw( @ISA %Lexicon ); ## default_templates/monthly_entry_listing.mtml -## lib/MT/IPBanList.pm - 'IP Ban' => 'Interdiction IP', - 'IP Bans' => 'Interdictions IP', - ## lib/MT/BasicAuthor.pm 'authors' => 'auteurs', @@ -2432,11 +2428,6 @@ use vars qw( @ISA %Lexicon ); 'Les notes doivent être dupliquées si les trackbacks le sont' , # Translate - New -## lib/MT/CMS/BanList.pm - 'You did not enter an IP address to ban.' => - 'Vous devez saisir une adresse IP à bannir.', - 'The IP you entered is already banned for this blog.' => - 'L\'adresse IP saisie est déjà bannie pour ce blog.', ## lib/MT/CMS/Plugin.pm 'Plugin Set: [_1]' => 'Éventail de plugins : [_1]', @@ -4842,18 +4833,6 @@ use vars qw( @ISA %Lexicon ); 'Select the location of the entry editor’s action bar.' => 'Sélectionner l\'emplacement de la barre d\'action de l\'éditeur de note.', -## tmpl/cms/list_banlist.tmpl - 'IP Banning Settings' => 'Paramètres des IP bannies', - 'IP addresses' => 'Adresses IP', - 'Delete selected IP Address (x)' => - 'Effacer les adresses IP sélectionnées (x)', - 'You have added [_1] to your list of banned IP addresses.' => - 'L\'adresse [_1] a été ajoutée à la liste des adresses IP bannies.', - 'You have successfully deleted the selected IP addresses from the list.' - => 'L\'adresse IP sélectionnée a été supprimée de la liste.', - 'Ban IP Address' => 'Bannir l\'adresse IP', - 'Date Banned' => 'Bannie le :', - ## tmpl/cms/cfg_registration.tmpl 'Registration Settings' => 'Paramètres des enregistrements', 'Your blog preferences have been saved.' => diff --git a/lib/MT/L10N/ja.pm b/lib/MT/L10N/ja.pm index eb97a2919..9626b9b3c 100644 --- a/lib/MT/L10N/ja.pm +++ b/lib/MT/L10N/ja.pm @@ -1516,12 +1516,6 @@ LDAPディレクトリ上にユーザーがまだ残っている場合、いつ '<' => '<', '/' => '/', -## lib/MT/CMS/BanList.pm - 'You did not enter an IP address to ban.' => - '禁止するIPアドレスを指定してください。', - 'The IP you entered is already banned for this blog.' => - 'このIPアドレスはすでに禁止されています。', - ## lib/MT/CMS/Blog.pm 'General Settings' => '全般', 'Publishing Settings' => '公開設定', @@ -2347,10 +2341,6 @@ LDAPディレクトリ上にユーザーがまだ残っている場合、いつ 'Invalid date format \'[_1]\'; must be \'MM/DD/YYYY HH:MM:SS AM|PM\' (AM|PM is optional)' => '日付の形式が正しくありません。\'MM/DD/YYYY HH:MM:SS AM|PM\' (AM|PMは任意)でなければなりません。', -## lib/MT/IPBanList.pm - 'IP Ban' => 'IP禁止リスト', - 'IP Bans' => 'IP禁止リスト', - ## lib/MT/JunkFilter.pm 'Action: Junked (score below threshold)' => '結果: スパム(スコアがしきい値以下)', @@ -5025,18 +5015,6 @@ LDAPディレクトリ上にユーザーがまだ残っている場合、いつ '_USER_DISABLE' => '無効', 'Showing All Users' => 'すべてのユーザーを表示', -## tmpl/cms/list_banlist.tmpl - 'IP Banning Settings' => '禁止IPアドレス設定', - 'IP addresses' => 'IPアドレス', - 'Delete selected IP Address (x)' => - '選択されたIPアドレスを削除 (x)', - 'You have added [_1] to your list of banned IP addresses.' => - '禁止IPアドレスリストに[_1]を追加しました。', - 'You have successfully deleted the selected IP addresses from the list.' - => 'リストから選択したIPアドレスを削除しました。', - 'Ban IP Address' => 'IPアドレスの禁止', - 'Date Banned' => '禁止した日付', - ## tmpl/cms/list_blog.tmpl 'You have successfully deleted the blogs from the Melody system.' => 'システムからブログを削除しました。', diff --git a/lib/MT/L10N/nl.pm b/lib/MT/L10N/nl.pm index 3b1dce35e..c1cffce9a 100644 --- a/lib/MT/L10N/nl.pm +++ b/lib/MT/L10N/nl.pm @@ -503,10 +503,6 @@ use vars qw( @ISA %Lexicon ); ## default_templates/monthly_entry_listing.mtml -## lib/MT/IPBanList.pm - 'IP Ban' => 'IP ban', - 'IP Bans' => 'IP bans', - ## lib/MT/BasicAuthor.pm 'authors' => 'auteurs', @@ -2358,12 +2354,6 @@ use vars qw( @ISA %Lexicon ); 'Berichten moeten worden gekloond als trackbacks worden gekloond' , # Translate - New -## lib/MT/CMS/BanList.pm - 'You did not enter an IP address to ban.' => - 'U vulde geen IP adres in om te verbannen.', - 'The IP you entered is already banned for this blog.' => - 'Het IP adres dat u opgaf is al verbannen van deze weblog.', - ## lib/MT/CMS/Plugin.pm 'Plugin Set: [_1]' => 'Pluginset: [_1]', 'Individual Plugins' => 'Individuele plugins', @@ -4707,17 +4697,6 @@ use vars qw( @ISA %Lexicon ); 'Select the location of the entry editor’s action bar.' => 'Selecteer de locatie voor de actiebalk in de berichteneditor.', -## tmpl/cms/list_banlist.tmpl - 'IP Banning Settings' => 'IP-verbanningsinstellingen', - 'IP addresses' => 'IP adressen', - 'Delete selected IP Address (x)' => 'Verwijder geselecteerd IP adres (s)', - 'You have added [_1] to your list of banned IP addresses.' => - 'U hebt [_1] toegevoegd aan uw lijst met uitgesloten IP adressen.', - 'You have successfully deleted the selected IP addresses from the list.' - => 'U hebt de geselecteerde IP adressen uit de lijst is verwijderd.', - 'Ban IP Address' => 'Verban IP adres', - 'Date Banned' => 'Verbanningsdatum', - ## tmpl/cms/cfg_registration.tmpl 'Registration Settings' => 'Registratie-instellingen', 'Your blog preferences have been saved.' => diff --git a/lib/MT/L10N/ru.pm b/lib/MT/L10N/ru.pm index 0b656e88b..3b0ca1c43 100644 --- a/lib/MT/L10N/ru.pm +++ b/lib/MT/L10N/ru.pm @@ -2000,11 +2000,6 @@ sub numerate { 'Tag \'[_1]\' (ID:[_2]) deleted by \'[_3]\'' => 'Тег «[_1]» (ID:[_2]) удалён пользователм «[_3]»', -## lib/MT/CMS/BanList.pm - 'You did not enter an IP address to ban.' => - 'Вы не ввели IP адрес, который хотите заблокировать.', - 'The IP you entered is already banned for this blog.' => - 'Введённый IP уже заблокирован в этом блоге.', ## lib/MT/CMS/Tools.pm 'Password Recovery' => 'Восстановление пароля', @@ -2957,10 +2952,6 @@ sub numerate { ## lib/MT/Trackback.pm -## lib/MT/IPBanList.pm - 'IP Ban' => 'Блокировка IP', - 'IP Bans' => 'Блокировка IP', - ## lib/MT/Mail.pm 'Unknown MailTransfer method \'[_1]\'' => 'Неизвестный метод отправки почты — «[_1]»', @@ -4554,19 +4545,6 @@ sub numerate { 'Role Is Active' => 'Роль активна', 'Role Not Being Used' => 'Роль не используется', -## tmpl/cms/list_banlist.tmpl - 'IP Banning Settings' => - 'Параметры заблокированных IP', - 'IP addresses' => 'IP адреса', - 'Delete selected IP Address (x)' => - 'Удалить выбранные IP адреса (x)', - 'You have added [_1] to your list of banned IP addresses.' => - 'Адрес [_1] добавлен в список заблокированных IP адресов.', - 'You have successfully deleted the selected IP addresses from the list.' - => 'Выбранные IP адреса удалены из списка.', - 'Ban IP Address' => 'Заблокировать IP адрес', - 'Date Banned' => 'Дата блокировки:', - ## tmpl/cms/dialog/new_password.tmpl 'Choose New Password' => 'Выберите новый пароль', diff --git a/mt-static/css/structure.css b/mt-static/css/structure.css index 6e2492c4d..857f87eb7 100644 --- a/mt-static/css/structure.css +++ b/mt-static/css/structure.css @@ -5036,11 +5036,7 @@ background: #C9E1EE; .list-notification .create-inline, .edit-template .create-inline, .list-category .create-inline, -.list-banlist .create-inline { - padding: 8px 10px; - background-color: #cfc !important; - display: none; -} + .list-tag .create-inline { display: table-row; } diff --git a/schemas/mt.sql b/schemas/mt.sql index ed5a2d2c1..310a6978d 100644 --- a/schemas/mt.sql +++ b/schemas/mt.sql @@ -143,18 +143,6 @@ CREATE INDEX mt_entry_author_id ON mt_entry (entry_author_id); CREATE INDEX mt_entry_created_on ON mt_entry (entry_created_on); CREATE INDEX mt_entry_basename ON mt_entry (entry_basename); -CREATE TABLE mt_ipbanlist ( - ipbanlist_id INTEGER SERIAL PRIMARY KEY, - ipbanlist_blog_id INTEGER NOT NULL, - ipbanlist_ip VARCHAR(15) NOT NULL, - ipbanlist_created_on TIMESTAMP NOT NULL, - ipbanlist_modified_on TIMESTAMP NOT NULL, - ipbanlist_created_by INTEGER, - ipbanlist_modified_by INTEGER -); -CREATE INDEX mt_ipbanlist_blog_id ON mt_ipbanlist (ipbanlist_blog_id); -CREATE INDEX mt_ipbanlist_ip ON mt_ipbanlist (ipbanlist_ip); - CREATE TABLE mt_log ( log_id INTEGER SERIAL PRIMARY KEY, log_message VARCHAR(255), diff --git a/schemas/mysql.dump b/schemas/mysql.dump index b21269993..97ef7c713 100644 --- a/schemas/mysql.dump +++ b/schemas/mysql.dump @@ -148,18 +148,6 @@ create table mt_entry ( index (entry_week_number) ); -create table mt_ipbanlist ( - ipbanlist_id integer not null auto_increment primary key, - ipbanlist_blog_id integer not null, - ipbanlist_ip varchar(15) not null, - ipbanlist_created_on datetime not null, - ipbanlist_modified_on timestamp not null, - ipbanlist_created_by integer, - ipbanlist_modified_by integer, - index (ipbanlist_blog_id), - index (ipbanlist_ip) -); - create table mt_log ( log_id integer not null auto_increment primary key, log_message varchar(255), diff --git a/schemas/postgres.dump b/schemas/postgres.dump index 59c33a3bd..5512cba66 100644 --- a/schemas/postgres.dump +++ b/schemas/postgres.dump @@ -148,18 +148,6 @@ create index mt_entry_author_id on mt_entry (entry_author_id); create index mt_entry_created_on on mt_entry (entry_created_on); create index mt_entry_basename on mt_entry (entry_basename); -create table mt_ipbanlist ( - ipbanlist_id integer primary key not null, - ipbanlist_blog_id integer not null, - ipbanlist_ip varchar(15) not null, - ipbanlist_created_on timestamp not null, - ipbanlist_modified_on timestamp not null, - ipbanlist_created_by integer, - ipbanlist_modified_by integer -); -create sequence mt_ipbanlist_id; -create index mt_ipbanlist_blog_id on mt_ipbanlist (ipbanlist_blog_id); -create index mt_ipbanlist_ip on mt_ipbanlist (ipbanlist_ip); create table mt_log ( log_id integer primary key not null, diff --git a/schemas/sqlite.dump b/schemas/sqlite.dump index 8dc655a48..fb3cabc65 100644 --- a/schemas/sqlite.dump +++ b/schemas/sqlite.dump @@ -143,18 +143,6 @@ create index mt_entry_author_id on mt_entry (entry_author_id); create index mt_entry_created_on on mt_entry (entry_created_on); create index mt_entry_basename on mt_entry (entry_basename); -create table mt_ipbanlist ( - ipbanlist_id integer not null primary key, - ipbanlist_blog_id integer not null, - ipbanlist_ip varchar(15) not null, - ipbanlist_created_on timestamp not null, - ipbanlist_modified_on timestamp not null, - ipbanlist_created_by integer, - ipbanlist_modified_by integer -); -create index mt_ipbanlist_blog_id on mt_ipbanlist (ipbanlist_blog_id); -create index mt_ipbanlist_ip on mt_ipbanlist (ipbanlist_ip); - create table mt_log ( log_id integer not null primary key, log_message varchar(255), diff --git a/t/00-compile.t b/t/00-compile.t index 326d3dcff..0e9bf753b 100644 --- a/t/00-compile.t +++ b/t/00-compile.t @@ -29,7 +29,6 @@ use_ok('MT::CMS::Plugin'); use_ok('MT::CMS::Asset'); use_ok('MT::CMS::Entry'); use_ok('MT::CMS::Search'); -use_ok('MT::CMS::BanList'); use_ok('MT::CMS::Export'); use_ok('MT::CMS::Tag'); use_ok('MT::CMS::Blog'); @@ -83,7 +82,6 @@ use_ok('MT::Placement'); use_ok('MT::Category'); use_ok('MT::Comment'); use_ok('MT::Entry'); -use_ok('MT::IPBanList'); use_ok('MT::FileInfo'); use_ok('MT::Config'); use_ok('MT::Asset'); diff --git a/tmpl/cms/cfg_blog_settings.tmpl b/tmpl/cms/cfg_blog_settings.tmpl index 29197f7a5..83db346b7 100644 --- a/tmpl/cms/cfg_blog_settings.tmpl +++ b/tmpl/cms/cfg_blog_settings.tmpl @@ -171,11 +171,6 @@ TC.attachLoadEvent( init );
<$mt:include name="prefs/web_services.tmpl"$>
- -
- <$mt:include name="prefs/ip-banning.tmpl"$> -
-
- - - - - " ><__trans phrase="Delete"> - - - - - diff --git a/tmpl/cms/include/cfg_content_nav.tmpl b/tmpl/cms/include/cfg_content_nav.tmpl index 1c6d13762..822678273 100644 --- a/tmpl/cms/include/cfg_content_nav.tmpl +++ b/tmpl/cms/include/cfg_content_nav.tmpl @@ -32,9 +32,6 @@ $(document).ready( function() {
  • <__trans phrase="Login & Sign-up">
  • <__trans phrase="Spam">
  • <__trans phrase="Web Services">
  • - -
  • <__trans phrase="IP Banning">
  • -
    diff --git a/tmpl/cms/include/comment_table.tmpl b/tmpl/cms/include/comment_table.tmpl index a30a886dd..71a2eebb3 100644 --- a/tmpl/cms/include/comment_table.tmpl +++ b/tmpl/cms/include/comment_table.tmpl @@ -28,11 +28,6 @@ title="<__trans phrase="Delete all comments reported as Spam">" ><__trans phrase="Empty"> - - '); return false;" - ><__trans phrase="Ban This IP"> -
    diff --git a/tmpl/cms/include/ping_table.tmpl b/tmpl/cms/include/ping_table.tmpl index 6ba616e89..227334c30 100644 --- a/tmpl/cms/include/ping_table.tmpl +++ b/tmpl/cms/include/ping_table.tmpl @@ -28,11 +28,6 @@ title="<__trans phrase="Deletes all [_1] reported as Spam" params="<$mt:var name="object_label_plural"$>">" ><__trans phrase="Empty"> - - '); return false;" - ><__trans phrase="Ban This IP"> -
    diff --git a/tmpl/cms/list_banlist.tmpl b/tmpl/cms/list_banlist.tmpl deleted file mode 100644 index b48f2e13d..000000000 --- a/tmpl/cms/list_banlist.tmpl +++ /dev/null @@ -1,78 +0,0 @@ -"> - - - - - - - - - -listing-form'), '<__trans phrase="IP address" escape="js">', '<__trans phrase="IP addresses" escape="js">')" type="button" value="<__trans phrase="Delete">" - accesskey="x" - title="<__trans phrase="Delete selected IP Address (x)">" - ><__trans phrase="Delete"> - - - - - - - - - - - <__trans phrase="You have added [_1] to your list of banned IP addresses." params=""> - - - - - - <__trans phrase="You have successfully deleted the selected IP addresses from the list."> - - - - - - - - - - - - - diff --git a/tmpl/cms/list_comment.tmpl b/tmpl/cms/list_comment.tmpl index abdc4f90b..96a82aef6 100644 --- a/tmpl/cms/list_comment.tmpl +++ b/tmpl/cms/list_comment.tmpl @@ -121,13 +121,6 @@ function setFilterCol(choice) { } } -function doBanIP (ip) { - window.location = ("" - + "?__mode=save&_type=banlist" - + "&blog_id=" - + "&magic_token=&ip=" + ip); -} - var tableSelect; function init() { diff --git a/tmpl/cms/list_ping.tmpl b/tmpl/cms/list_ping.tmpl index 69c1bf78d..350302357 100644 --- a/tmpl/cms/list_ping.tmpl +++ b/tmpl/cms/list_ping.tmpl @@ -113,13 +113,6 @@ function setFilterCol(choice) { fld.options[fld.selectedIndex].text + ''; } -function doBanIP (ip) { - window.location = ("" - + "?__mode=save&_type=banlist" - + "&blog_id=" - + "&magic_token=&ip=" + ip); -} - var tableSelect; function init() { // setup diff --git a/tmpl/cms/prefs/ip-banning.tmpl b/tmpl/cms/prefs/ip-banning.tmpl deleted file mode 100644 index 5c9231603..000000000 --- a/tmpl/cms/prefs/ip-banning.tmpl +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - <__trans phrase="IP Address"> - <__trans phrase="Date Banned"> - - - - - oddeven"> - " /> - - - - - - - - -
    -
    "> - " /> - - - " /> - " /> - " - label_class="inline" - hint="" - show_hint="0"> - " maxlength="15" /> - - " - label_class="inline field-no-header" - hint="" - show_hint="0"> - - <__trans phrase="Save"> - <__trans phrase="Cancel"> - - -
    -
    diff --git a/tools/convert-db b/tools/convert-db index faababe65..cd0d76bcc 100755 --- a/tools/convert-db +++ b/tools/convert-db @@ -23,12 +23,12 @@ unless ($new_config) { $old_config ||= '.'; my @CLASSES = qw( MT::Author MT::Blog MT::Category MT::Comment MT::Entry - MT::IPBanList MT::Log MT::Notification MT::Permission - MT::Placement MT::Template MT::TemplateMap MT::Trackback - MT::TBPing MT::Session MT::PluginData MT::Config MT::FileInfo - MT::Tag MT::ObjectTag MT::Group MT::Role MT::Association - MT::Asset -); + MT::Log MT::Notification MT::Permission + MT::Placement MT::Template MT::TemplateMap MT::Trackback + MT::TBPing MT::Session MT::PluginData MT::Config MT::FileInfo + MT::Tag MT::ObjectTag MT::Group MT::Role MT::Association + MT::Asset + ); use File::Spec; diff --git a/tools/populate b/tools/populate index 4d193e555..548f65d9d 100755 --- a/tools/populate +++ b/tools/populate @@ -61,6 +61,7 @@ my @word_pool = qw( srand(1); # these are all the numbers that control how many of what are generated +<<<<<<< HEAD my $blog_count = sub { $blogs * $weight_factor }; my $authors_per_blog = sub { $authors * $weight_factor }; my $categories_per_blog = sub { $cats + int( rand(10) ) * $weight_factor }; @@ -70,17 +71,25 @@ my $bans_per_blog = sub { 2 + int( rand(10) ) }; my $comments_per_entry = sub { int( rand(10) ) * $weight_factor }; my $tags_per_entry = sub { int( rand(5) ) * $weight_factor }; my $pings_per_trackback = sub { int( rand(10) ) * $weight_factor }; +======= +my $blog_count = sub { $blogs * $weight_factor }; +my $authors_per_blog = sub { $authors * $weight_factor }; +my $categories_per_blog = sub { $cats + int(rand(10)) * $weight_factor }; +my $entries_per_blog = sub { $entries + int(rand(30)) * $weight_factor }; +my $notifications_per_blog = sub { 3 + int(rand(20)) }; +my $comments_per_entry = sub { int(rand(10)) * $weight_factor }; +my $tags_per_entry = sub { int(rand(5)) * $weight_factor }; +my $pings_per_trackback = sub { int(rand(10)) * $weight_factor }; my %defs = ( 'MT::Blog' => { table => 'blog', as_of => 1.0, needs => [ - 'MT::Author' => $authors_per_blog, - 'MT::Category' => $categories_per_blog, - 'MT::Entry' => $entries_per_blog, - 'MT::Template' => \&template_loader, - 'MT::Notification' => $notifications_per_blog, - 'MT::IPBanList' => $bans_per_blog, + 'MT::Author' => $authors_per_blog, + 'MT::Category' => $categories_per_blog, + 'MT::Entry' => $entries_per_blog, + 'MT::Template' => \&template_loader, + 'MT::Notification' => $notifications_per_blog ], fields => [ field( 'name', \&random_blog_name ), @@ -394,14 +403,9 @@ my %defs = ( # field('build_dynamic', [], 3.1), # ], }, - 'MT::TemplateMap' => { table => 'templatemap', as_of => 2.0, }, - 'MT::IPBanList' => { - table => 'ipbanlist', - as_of => 1.4, # ?? - fields => [ - field( 'blog_id', sub { $this_parent->id } ), - field( 'ip', \&random_ip ), - ], + 'MT::TemplateMap' => { + table => 'templatemap', + as_of => 2.0, }, 'MT::Log' => { table => 'log',