summaryrefslogtreecommitdiffstats
path: root/createaccount.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-03-30 19:57:29 +0200
committerlpsolit%gmail.com <>2005-03-30 19:57:29 +0200
commit49951829ef77417122463d6df81e330010c0afae (patch)
treeca51d9013f13e84a625e13b5a879bafef689a169 /createaccount.cgi
parentaf6d1e20ea88f68693059d92e694263d51bb9a7c (diff)
downloadbugzilla-49951829ef77417122463d6df81e330010c0afae.tar.gz
bugzilla-49951829ef77417122463d6df81e330010c0afae.tar.xz
Bug 276543: createaccount.cgi should not be displayed if account creation is disabled - Patch by Olav Vitters <bugzilla-mozilla@bkor.dhs.org> r=LpSolit a=justdave
Diffstat (limited to 'createaccount.cgi')
-rwxr-xr-xcreateaccount.cgi24
1 files changed, 14 insertions, 10 deletions
diff --git a/createaccount.cgi b/createaccount.cgi
index de8dc6fde..c89de3819 100755
--- a/createaccount.cgi
+++ b/createaccount.cgi
@@ -38,17 +38,20 @@ use vars qw(
$vars
);
+# Just in case someone already has an account, let them get the correct footer
+# on an error message. The user is logged out just before the account is
+# actually created.
+Bugzilla->login();
+
# If we're using LDAP for login, then we can't create a new account here.
unless (Bugzilla::Auth->can_edit('new')) {
- # Just in case someone already has an account, let them get the correct
- # footer on the error message
- Bugzilla->login();
- ThrowUserError("auth_cant_create_account");
+ ThrowUserError("auth_cant_create_account");
}
-# Clear out the login cookies. Make people log in again if they create an
-# account; otherwise, they'll probably get confused.
-Bugzilla->logout();
+my $createexp = Param('createemailregexp');
+unless ($createexp) {
+ ThrowUserError("account_creation_disabled");
+}
my $cgi = Bugzilla->cgi;
print $cgi->header();
@@ -68,12 +71,13 @@ if (defined($login)) {
exit;
}
- my $createexp = Param('createemailregexp');
- if (!($createexp)
- || ($login !~ /$createexp/)) {
+ if ($login !~ /$createexp/) {
ThrowUserError("account_creation_disabled");
}
+ # Clear out the login cookies in case the user is currently logged in.
+ Bugzilla->logout();
+
# Create account
my $password = insert_new_user($login, $realname);
MailPassword($login, $password);