#! /usr/bonsaitools/bin/mysqltcl # -*- Mode: tcl; indent-tabs-mode: nil -*- # # The contents of this file are subject to the Mozilla Public License # Version 1.0 (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://www.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the # License for the specific language governing rights and limitations # under the License. # # The Original Code is the Bugzilla Bug Tracking System. # # The Initial Developer of the Original Code is Netscape Communications # Corporation. Portions created by Netscape are Copyright (C) 1998 # Netscape Communications Corporation. All Rights Reserved. # # Contributor(s): Terry Weissman source CGI.tcl confirm_login puts "Content-type: text/html\n" proc pickplatform {} { global env FORM if {[formvalue rep_platform] != ""} { return [formvalue rep_platform] } switch -regexp $env(HTTP_USER_AGENT) { {Mozilla.*\(X11} {return "X-Windows"} {Mozilla.*\(Windows} {return "PC"} {Mozilla.*\(Macintosh} {return "Macintosh"} {Mozilla.*\(Win} {return "PC"} default {return "PC"} } } proc pickproduct {} { global FORM env COOKIE product versions set product missingProductSoPickDefault set product [formvalue product] if {$product == ""} { if {[info exists COOKIE(PRODUCT)]} { set product $COOKIE(PRODUCT) } else { switch -regexp $env(HTTP_USER_AGENT) { {2.0Gold} {set product "Hearst"} {4\.0.*; *Nav} { set product "Ratbert"} {4\.0} {set product "Communicator"} {3\.0} {set product "Akbar"} {2\.0} {set product "Cheddar"} } } } if {![info exists versions($product)]} { set product "Communicator" } return $product } proc pickversion {} { global env versions product FORM set version [formvalue version] if {$version == ""} { regexp {Mozilla[ /]([^ ]*) } $env(HTTP_USER_AGENT) foo version switch -regexp $env(HTTP_USER_AGENT) { {4\.09} { set version "4.5" } } } if {[lsearch -exact $versions($product) $version] >= 0} { return $version } else { if {[info exists COOKIE(VERSION-$product)]} { if {[lsearch -exact $versions($product) $COOKIE(VERSION-$Product)] >= 0} { return $COOKIE(VERSION-$Product) } } } return [lindex $versions($product) 0] } proc pickcomponent {} { global components product FORM set result [formvalue component] if {![cequal $result ""] && \ [lsearch -exact $components($product) $result] < 0} { set result "" } return $result } proc pickos {} { global env FORM if {[formvalue op_sys] != ""} { return [formvalue op_sys] } switch -regexp $env(HTTP_USER_AGENT) { {Mozilla.*\(.*;.*; IRIX.*\)} {return "IRIX"} {Mozilla.*\(.*;.*; 32bit.*\)} {return "Windows 95"} {Mozilla.*\(.*;.*; 16bit.*\)} {return "Windows 3.1"} {Mozilla.*\(.*;.*; 68K.*\)} {return "System 7.5"} {Mozilla.*\(.*;.*; PPC.*\)} {return "System 7.5"} {Mozilla.*\(.*;.*; OSF.*\)} {return "OSF/1"} {Mozilla.*\(.*;.*; Linux.*\)} {return "Linux"} {Mozilla.*\(.*;.*; SunOS 5.*\)} {return "Solaris"} {Mozilla.*\(.*;.*; SunOS.*\)} {return "SunOS"} {Mozilla.*\(.*;.*; SunOS.*\)} {return "SunOS"} {Mozilla.*\(Win16.*\)} {return "Windows 3.1"} {Mozilla.*\(Win95.*\)} {return "Windows 95"} {Mozilla.*\(WinNT.*\)} {return "Windows NT"} default {return "other"} } } proc formvalue {name {default ""}} { global FORM if {[info exists FORM($name)]} { return [FormData $name] } return $default } GetVersionTable pickproduct set assign_element [GeneratePersonInput assigned_to 1 [formvalue assigned_to]] set cc_element [GeneratePeopleInput cc [formvalue cc ""]] set priority_popup [make_popup priority $legal_priority [formvalue priority "P2"] 0] set sev_popup [make_popup bug_severity $legal_severity [formvalue bug_severity "normal"] 0] set platform_popup [make_popup rep_platform $legal_platform [pickplatform] 0] set opsys_popup [make_popup op_sys $legal_opsys [pickos] 0] set component_popup [make_popup component $components($product) \ [formvalue component] 1] PutHeader "Enter Bug" "Enter Bug" puts "
Product: [Product_element $product] Version: [Version_element [pickversion] $product] Component: $component_popup
 
Platform: $platform_popup OS: $opsys_popup
Priority: $priority_popup Severity: $sev_popup
 
Assigned To: $assign_element (Leave blank to assign to default owner for component)
Cc: $cc_element
 
URL:
Summary:
 
Description:
         
Some fields initialized from your user-agent, $env(HTTP_USER_AGENT). If you think it got it wrong, please tell $maintainer what it should have been. " flush stdout