From 72cb2bc73e71f54c2223bb78af29fee888590b53 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Sun, 13 Dec 2009 20:46:24 +0000 Subject: Bug 355283: Lock out a user account on a particular IP for 30 minutes if they fail to log in 5 times from that IP. Patch by Max Kanat-Alexander r=LpSolit, a=LpSolit --- Bugzilla/Config/Common.pm | 11 ++++++++++- Bugzilla/Config/Core.pm | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'Bugzilla/Config') diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm index 95866b032..6924761f3 100644 --- a/Bugzilla/Config/Common.pm +++ b/Bugzilla/Config/Common.pm @@ -34,6 +34,7 @@ package Bugzilla::Config::Common; use strict; +use Email::Address; use Socket; use Bugzilla::Util; @@ -50,7 +51,7 @@ use base qw(Exporter); check_user_verify_class check_mail_delivery_method check_notification check_utf8 check_bug_status check_smtp_auth check_theschwartz_available - check_maxattachmentsize + check_maxattachmentsize check_email ); # Checking functions for the various values @@ -94,6 +95,14 @@ sub check_regexp { return $@; } +sub check_email { + my ($value) = @_; + if ($value !~ $Email::Address::mailbox) { + return "must be a valid email address."; + } + return ""; +} + sub check_sslbase { my $url = shift; if ($url ne '') { diff --git a/Bugzilla/Config/Core.pm b/Bugzilla/Config/Core.pm index 91426b30a..1bfebfa69 100644 --- a/Bugzilla/Config/Core.pm +++ b/Bugzilla/Config/Core.pm @@ -43,7 +43,8 @@ sub get_param_list { { name => 'maintainer', type => 't', - default => 'THE MAINTAINER HAS NOT YET BEEN SET' + default => 'please.set.the.maintainer.parameter@administration.parameters', + checker => \&check_email, }, { -- cgit v1.2.3-24-g4f1b