From: bryce-mozilla%nextbus.com <> Date: Tue, 4 May 1999 07:05:26 +0000 (+0000) Subject: Add parameter "usebrowserinfo", to allow disabling the setting of OS and Platform X-Git-Tag: bugzilla-2.6~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=daffcd74e36eab5a9813f5187329fb396f8d7b6d;p=thirdparty%2Fbugzilla.git Add parameter "usebrowserinfo", to allow disabling the setting of OS and Platform based on the brower the user makes the report from. Realign text box for narrower windows. Remove Mozilla-specific default parameter. --- diff --git a/defparams.pl b/defparams.pl index 9bcc9a5673..f5b3d41988 100644 --- a/defparams.pl +++ b/defparams.pl @@ -238,7 +238,7 @@ You will get this message once a day until you've dealt with these bugs! DefParam("defaultquery", "This is the default query that initially comes up when you submit a bug. It's in URL parameter format, which makes it hard to read. Sorry!", "t", - "bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&product=Mozilla&order=%22Importance%22"); + "bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=%22Importance%22"); DefParam("letsubmitterchoosepriority", @@ -286,8 +286,11 @@ DefParam("usestatuswhiteboard", "b", 0); - - +DefParam("usebrowserinfo", + "Do you want bug reports to be assigned an OS & Platform based on the browser + the user makes the report from?", + "b", + 1); 1; diff --git a/enter_bug.cgi b/enter_bug.cgi index 15d2571b90..0473a726c0 100755 --- a/enter_bug.cgi +++ b/enter_bug.cgi @@ -83,28 +83,33 @@ sub pickplatform { if ($value ne "") { return $value; } - for ($ENV{'HTTP_USER_AGENT'}) { - /Mozilla.*\(Windows/ && do {return "PC";}; - /Mozilla.*\(Macintosh/ && do {return "Macintosh";}; - /Mozilla.*\(Win/ && do {return "PC";}; - /Mozilla.*Linux.*86/ && do {return "PC";}; - /Mozilla.*Linux.*alpha/ && do {return "DEC";}; - /Mozilla.*OSF/ && do {return "DEC";}; - /Mozilla.*HP-UX/ && do {return "HP";}; - /Mozilla.*IRIX/ && do {return "SGI";}; - /Mozilla.*(SunOS|Solaris)/ && do {return "Sun";}; - # default - return "Other"; + if ( Param('usebrowserinfo') ) { + for ($ENV{'HTTP_USER_AGENT'}) { + /Mozilla.*\(Windows/ && do {return "PC";}; + /Mozilla.*\(Macintosh/ && do {return "Macintosh";}; + /Mozilla.*\(Win/ && do {return "PC";}; + /Mozilla.*Linux.*86/ && do {return "PC";}; + /Mozilla.*Linux.*alpha/ && do {return "DEC";}; + /Mozilla.*OSF/ && do {return "DEC";}; + /Mozilla.*HP-UX/ && do {return "HP";}; + /Mozilla.*IRIX/ && do {return "SGI";}; + /Mozilla.*(SunOS|Solaris)/ && do {return "Sun";}; + } } + # default + return "Other"; } sub pickversion { my $version = formvalue('version'); - if ($version eq "") { - if ($ENV{'HTTP_USER_AGENT'} =~ m@Mozilla[ /]([^ ]*)@) { - $version = $1; + + if ( Param('usebrowserinfo') ) { + if ($version eq "") { + if ($ENV{'HTTP_USER_AGENT'} =~ m@Mozilla[ /]([^ ]*)@) { + $version = $1; + } } } @@ -135,24 +140,26 @@ sub pickos { if (formvalue('op_sys') ne "") { return formvalue('op_sys'); } - for ($ENV{'HTTP_USER_AGENT'}) { - /Mozilla.*\(.*;.*; IRIX.*\)/ && do {return "IRIX";}; - /Mozilla.*\(.*;.*; 32bit.*\)/ && do {return "Windows 95";}; - /Mozilla.*\(.*;.*; 16bit.*\)/ && do {return "Windows 3.1";}; - /Mozilla.*\(.*;.*; 68K.*\)/ && do {return "Mac System 8.5";}; - /Mozilla.*\(.*;.*; PPC.*\)/ && do {return "Mac System 8.5";}; - /Mozilla.*\(.*;.*; OSF.*\)/ && do {return "OSF/1";}; - /Mozilla.*\(.*;.*; Linux.*\)/ && do {return "Linux";}; - /Mozilla.*\(.*;.*; SunOS 5.*\)/ && do {return "Solaris";}; - /Mozilla.*\(.*;.*; SunOS.*\)/ && do {return "SunOS";}; - /Mozilla.*\(.*;.*; SunOS.*\)/ && do {return "SunOS";}; - /Mozilla.*\(.*;.*; BSD\/OS.*\)/ && do {return "BSDI";}; - /Mozilla.*\(Win16.*\)/ && do {return "Windows 3.1";}; - /Mozilla.*\(Win95.*\)/ && do {return "Windows 95";}; - /Mozilla.*\(WinNT.*\)/ && do {return "Windows NT";}; - # default - return "other"; + if ( Param('usebrowserinfo') ) { + for ($ENV{'HTTP_USER_AGENT'}) { + /Mozilla.*\(.*;.*; IRIX.*\)/ && do {return "IRIX";}; + /Mozilla.*\(.*;.*; 32bit.*\)/ && do {return "Windows 95";}; + /Mozilla.*\(.*;.*; 16bit.*\)/ && do {return "Windows 3.1";}; + /Mozilla.*\(.*;.*; 68K.*\)/ && do {return "Mac System 8.5";}; + /Mozilla.*\(.*;.*; PPC.*\)/ && do {return "Mac System 8.5";}; + /Mozilla.*\(.*;.*; OSF.*\)/ && do {return "OSF/1";}; + /Mozilla.*\(.*;.*; Linux.*\)/ && do {return "Linux";}; + /Mozilla.*\(.*;.*; SunOS 5.*\)/ && do {return "Solaris";}; + /Mozilla.*\(.*;.*; SunOS.*\)/ && do {return "SunOS";}; + /Mozilla.*\(.*;.*; SunOS.*\)/ && do {return "SunOS";}; + /Mozilla.*\(.*;.*; BSD\/OS.*\)/ && do {return "BSDI";}; + /Mozilla.*\(Win16.*\)/ && do {return "Windows 3.1";}; + /Mozilla.*\(Win95.*\)/ && do {return "Windows 95";}; + /Mozilla.*\(WinNT.*\)/ && do {return "Windows NT";}; + } } + # default + return "other"; } @@ -226,10 +233,10 @@ print " Assigned To: $assign_element - (Leave blank to assign to default owner for component) + (Leave blank to assign to default component owner) - Cc: + Cc: $cc_element   @@ -247,9 +254,8 @@ print " value_quote(formvalue('short_desc')) . "\"> -   + Description: - Description:
@@ -266,9 +272,11 @@ print " - +\n"; -Some fields initialized from your user-agent, $ENV{'HTTP_USER_AGENT'}. -If you think it got it wrong, please tell " . Param('maintainer') . " what it should have been. +if ( Param('usebrowserinfo') ) { + print "Some fields initialized from your user-agent, $ENV{'HTTP_USER_AGENT'}. + If you think it got it wrong, please tell " . Param('maintainer') . " what it should have been."; +} +print "\n"; -";