summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgerv%gerv.net <>2002-04-25 06:41:51 +0200
committergerv%gerv.net <>2002-04-25 06:41:51 +0200
commit1d1c3dca2a3c93b5bc5cc14cb4a9c20bb7aed597 (patch)
treefcf34b36a2151fffe2ef34d20b583796ee5f3784
parent924bcd7fdb6d6a6eb6e4601f5f0ea7b486c061d4 (diff)
downloadbugzilla-1d1c3dca2a3c93b5bc5cc14cb4a9c20bb7aed597.tar.gz
bugzilla-1d1c3dca2a3c93b5bc5cc14cb4a9c20bb7aed597.tar.xz
Bug 138456 - use proper error functions in DBNameToIdAndCheck. Patch by gerv; 2xr=myk.
-rw-r--r--globals.pl26
1 files changed, 6 insertions, 20 deletions
diff --git a/globals.pl b/globals.pl
index ced8b4f87..b457484d8 100644
--- a/globals.pl
+++ b/globals.pl
@@ -938,30 +938,16 @@ sub DBname_to_id {
sub DBNameToIdAndCheck {
- my ($name, $forceok) = (@_);
- $name = html_quote($name);
+ my ($name) = (@_);
my $result = DBname_to_id($name);
if ($result > 0) {
return $result;
}
- if ($forceok) {
- if(ValidateNewUser($name)) {
- InsertNewUser($name, "");
- $result = DBname_to_id($name);
- if ($result > 0) {
- return $result;
- }
- }
- print "Yikes; couldn't create user $name. Please report problem to " .
- Param("maintainer") ."\n";
- } else {
- print "\n"; # http://bugzilla.mozilla.org/show_bug.cgi?id=80045
- print "The name <TT>$name</TT> is not a valid username. Either you\n";
- print "misspelled it, or the person has not registered for a\n";
- print "Bugzilla account.\n";
- print "<P>Please hit the <B>Back</B> button and try again.\n";
- }
- exit(0);
+
+ $name = html_quote($name);
+ ThrowUserError("The name <TT>$name</TT> is not a valid username.
+ Either you misspelled it, or the person has not
+ registered for a Bugzilla account.");
}
# Use trick_taint() when you know that there is no way that the data