summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzach%zachlipton.com <>2001-10-28 12:40:59 +0100
committerzach%zachlipton.com <>2001-10-28 12:40:59 +0100
commit5fd4cf4381e34c57a6b1dcc7ea3fa57d8f42d0cf (patch)
treec8329523d8bc5c90cc8139b228efcc0af25bd477
parentd672813699ae015a80f79dcb7df5da65c1914c0a (diff)
downloadbugzilla-5fd4cf4381e34c57a6b1dcc7ea3fa57d8f42d0cf.tar.gz
bugzilla-5fd4cf4381e34c57a6b1dcc7ea3fa57d8f42d0cf.tar.xz
Fix for bug 96675: checksetup should require admin e-mail address satisfy emailregexp. This fix has
checksetup.pl use the emailregexp set in params if the params file exists, or ensures that it matches the default emailregexp from defparams.pl. r1=justdave, r2=bbaetz.
-rwxr-xr-xchecksetup.pl24
1 files changed, 23 insertions, 1 deletions
diff --git a/checksetup.pl b/checksetup.pl
index 424a23ca0..9c4474160 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -79,7 +79,7 @@
# add more MySQL-related checks --MYSQL--
# change table definitions --TABLE--
# add more groups --GROUPS--
-# create initial administrator account --ADMIN--
+# create initial administrator account --ADMIN--
#
# Note: sometimes those special comments occur more then once. For
# example, --LOCAL-- is at least 3 times in this code! --TABLE--
@@ -1488,6 +1488,23 @@ if ($sth->rows == 0) {
my $pass2 = "*";
my $admin_ok = 0;
my $admin_create = 1;
+ my $mailcheckexp = "";
+ my $mailcheck = "";
+
+ # Here we look to see what the emailregexp is set to so we can
+ # check the email addy they enter. Bug 96675. If they have no
+ # params (likely but not always the case), we use the default.
+ if (-e "data/params") {
+ require "data/params"; # if they have a params file, use that
+ }
+ if ($::params{emailregexp}) {
+ $mailcheckexp = $::params{emailregexp};
+ $mailcheck = $::params{emailregexpdesc};
+ } else {
+ $mailcheckexp = '^[^@]+@[^@]+\\.[^@]+$';
+ $mailcheck = 'A legal address must contain exactly one \'@\',
+ and at least one \'.\' after the @.';
+ }
print "\nLooks like we don't have an administrator set up yet. Either this is your\n";
print "first time using Bugzilla, or your administrator's privs might have accidently\n";
@@ -1500,6 +1517,11 @@ if ($sth->rows == 0) {
if(! $login ) {
print "\nYou DO want an administrator, don't you?\n";
}
+ unless ($login =~ /$mailcheckexp/) {
+ print "\nThe login address is invalid:\n";
+ print "$mailcheck\n";
+ die "Please try again\n";
+ }
}
$login = $dbh->quote($login);
$sth = $dbh->prepare(<<_End_Of_SQL_);