]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 138456 - use proper error functions in DBNameToIdAndCheck. Patch by gerv; 2xr...
authorgerv%gerv.net <>
Thu, 25 Apr 2002 04:41:51 +0000 (04:41 +0000)
committergerv%gerv.net <>
Thu, 25 Apr 2002 04:41:51 +0000 (04:41 +0000)
globals.pl

index ced8b4f873910ffb2b3f4ba111a886c2e0e8d723..b457484d81fe1bb05ad7224494a0d2f108f81aa6 100644 (file)
@@ -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