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 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Config/Common.pm') 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 '') { -- cgit v1.2.1