diff options
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/AntiSpam/Config.pm | 21 | ||||
-rw-r--r-- | extensions/AntiSpam/Extension.pm | 86 |
2 files changed, 107 insertions, 0 deletions
diff --git a/extensions/AntiSpam/Config.pm b/extensions/AntiSpam/Config.pm new file mode 100644 index 000000000..92c32f629 --- /dev/null +++ b/extensions/AntiSpam/Config.pm @@ -0,0 +1,21 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. + +package Bugzilla::Extension::AntiSpam; +use strict; + +use constant NAME => 'AntiSpam'; +use constant REQUIRED_MODULES => [ + { + package => 'Email-Address', + module => 'Email::Address', + version => 0, + }, +]; +use constant OPTIONAL_MODULES => []; + +__PACKAGE__->NAME; diff --git a/extensions/AntiSpam/Extension.pm b/extensions/AntiSpam/Extension.pm new file mode 100644 index 000000000..5cb9928db --- /dev/null +++ b/extensions/AntiSpam/Extension.pm @@ -0,0 +1,86 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. + +package Bugzilla::Extension::AntiSpam; + +use strict; +use warnings; + +use base qw(Bugzilla::Extension); + +our $VERSION = '0'; + +sub db_schema_abstract_schema { + my ($self, $args) = @_; + $args->{'schema'}->{'antispam_domain_blocklist'} = { + FIELDS => [ + id => { + TYPE => 'MEDIUMSERIAL', + NOTNULL => 1, + PRIMARYKEY => 1, + }, + domain => { + TYPE => 'VARCHAR(255)', + NOTNULL => 1, + }, + comment => { + TYPE => 'VARCHAR(255)', + NOTNULL => 1, + }, + ], + INDEXES => [ + antispam_domain_blocklist_idx => { + FIELDS => [ 'domain' ], + TYPE => 'UNIQUE', + }, + ], + }; + $args->{'schema'}->{'antispam_comment_blocklist'} = { + FIELDS => [ + id => { + TYPE => 'MEDIUMSERIAL', + NOTNULL => 1, + PRIMARYKEY => 1, + }, + word => { + TYPE => 'VARCHAR(255)', + NOTNULL => 1, + }, + ], + INDEXES => [ + antispam_comment_blocklist_idx => { + FIELDS => [ 'word' ], + TYPE => 'UNIQUE', + }, + ], + }; + $args->{'schema'}->{'antispam_ip_blocklist'} = { + FIELDS => [ + id => { + TYPE => 'MEDIUMSERIAL', + NOTNULL => 1, + PRIMARYKEY => 1, + }, + ip_address => { + TYPE => 'VARCHAR(15)', + NOTNULL => 1, + }, + comment => { + TYPE => 'VARCHAR(255)', + NOTNULL => 1, + }, + ], + INDEXES => [ + antispam_ip_blocklist_idx => { + FIELDS => [ 'ip_address' ], + TYPE => 'UNIQUE', + }, + ], + }; +} + +__PACKAGE__->NAME; |