From 60b331bc2a1d89296f5c57df34171db3b3eca409 Mon Sep 17 00:00:00 2001 From: "gerv%gerv.net" <> Date: Wed, 2 Oct 2002 05:41:03 +0000 Subject: Bug 163114 - Templatise all calls to DisplayError. Patch C. Patch by gerv; r=burnus. --- post_bug.cgi | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'post_bug.cgi') diff --git a/post_bug.cgi b/post_bug.cgi index 206c75c57..c07d07d99 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -94,23 +94,15 @@ umask 0; # Some sanity checking if(Param("usebuggroupsentry") && GroupExists($product)) { - if(!UserInGroup($product)) { - DisplayError("Sorry; you do not have the permissions necessary to enter - a bug against this product.", "Permission Denied"); - exit; - } + UserInGroup($product) || + ThrowUserError("entry_access_denied", {product => $product}); } my $component_id = get_component_id($product_id, $::FORM{component}); -if (!$component_id) { - DisplayError("You must choose a component that corresponds to this bug. - If necessary, just guess."); - exit; -} +$component_id || ThrowUserError("require_component"); if (!defined $::FORM{'short_desc'} || trim($::FORM{'short_desc'}) eq "") { - DisplayError("You must enter a summary for this bug."); - exit; + ThrowUserError("require_summary"); } # If bug_file_loc is "http://", the default, strip it out and use an empty -- cgit v1.2.3-24-g4f1b