Compare commits
1 Commits
src
...
tags/BUGZI
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10f2f1eca0 |
BIN
mozilla/webtools/bugzilla/1x1.gif
Normal file
BIN
mozilla/webtools/bugzilla/1x1.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 82 B |
551
mozilla/webtools/bugzilla/CGI.pl
Normal file
551
mozilla/webtools/bugzilla/CGI.pl
Normal file
@@ -0,0 +1,551 @@
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
# Contains some global routines used throughout the CGI scripts of Bugzilla.
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
use CGI::Carp qw(fatalsToBrowser);
|
||||
|
||||
require 'globals.pl';
|
||||
|
||||
sub GeneratePersonInput {
|
||||
my ($field, $required, $def_value, $extraJavaScript) = (@_);
|
||||
if (!defined $extraJavaScript) {
|
||||
$extraJavaScript = "";
|
||||
}
|
||||
if ($extraJavaScript ne "") {
|
||||
$extraJavaScript = "onChange=\" $extraJavaScript \"";
|
||||
}
|
||||
return "<INPUT NAME=\"$field\" SIZE=32 $extraJavaScript VALUE=\"$def_value\">";
|
||||
}
|
||||
|
||||
sub GeneratePeopleInput {
|
||||
my ($field, $def_value) = (@_);
|
||||
return "<INPUT NAME=\"$field\" SIZE=45 VALUE=\"$def_value\">";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
# Implementations of several of the below were blatently stolen from CGI.pm,
|
||||
# by Lincoln D. Stein.
|
||||
|
||||
|
||||
# Get rid of all the %xx encoding and the like from the given URL.
|
||||
|
||||
sub url_decode {
|
||||
my ($todecode) = (@_);
|
||||
$todecode =~ tr/+/ /; # pluses become spaces
|
||||
$todecode =~ s/%([0-9a-fA-F]{2})/pack("c",hex($1))/ge;
|
||||
return $todecode;
|
||||
}
|
||||
|
||||
|
||||
# Quotify a string, suitable for putting into a URL.
|
||||
|
||||
sub url_quote {
|
||||
my($toencode) = (@_);
|
||||
$toencode=~s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg;
|
||||
return $toencode;
|
||||
}
|
||||
|
||||
|
||||
sub ProcessFormFields {
|
||||
my ($buffer) = (@_);
|
||||
undef %::FORM;
|
||||
undef %::MFORM;
|
||||
|
||||
my %isnull;
|
||||
my $remaining = $buffer;
|
||||
while ($remaining ne "") {
|
||||
my $item;
|
||||
if ($remaining =~ /^([^&]*)&(.*)$/) {
|
||||
$item = $1;
|
||||
$remaining = $2;
|
||||
} else {
|
||||
$item = $remaining;
|
||||
$remaining = "";
|
||||
}
|
||||
|
||||
my $name;
|
||||
my $value;
|
||||
if ($item =~ /^([^=]*)=(.*)$/) {
|
||||
$name = $1;
|
||||
$value = url_decode($2);
|
||||
} else {
|
||||
$name = $item;
|
||||
$value = "";
|
||||
}
|
||||
if ($value ne "") {
|
||||
if (defined $::FORM{$name}) {
|
||||
$::FORM{$name} .= $value;
|
||||
my $ref = $::MFORM{$name};
|
||||
push @$ref, $value;
|
||||
} else {
|
||||
$::FORM{$name} = $value;
|
||||
$::MFORM{$name} = [$value];
|
||||
}
|
||||
} else {
|
||||
$isnull{$name} = 1;
|
||||
}
|
||||
}
|
||||
if (defined %isnull) {
|
||||
foreach my $name (keys(%isnull)) {
|
||||
if (!defined $::FORM{$name}) {
|
||||
$::FORM{$name} = "";
|
||||
$::MFORM{$name} = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub ProcessMultipartFormFields {
|
||||
my ($boundary) = (@_);
|
||||
$boundary =~ s/^-*//;
|
||||
my $remaining = $ENV{"CONTENT_LENGTH"};
|
||||
my $inheader = 1;
|
||||
my $itemname = "";
|
||||
# open(DEBUG, ">debug") || die "Can't open debugging thing";
|
||||
# print DEBUG "Boundary is '$boundary'\n";
|
||||
while ($remaining > 0 && ($_ = <STDIN>)) {
|
||||
$remaining -= length($_);
|
||||
# print DEBUG "< $_";
|
||||
if ($_ =~ m/^-*$boundary/) {
|
||||
# print DEBUG "Entered header\n";
|
||||
$inheader = 1;
|
||||
$itemname = "";
|
||||
next;
|
||||
}
|
||||
|
||||
if ($inheader) {
|
||||
if (m/^\s*$/) {
|
||||
$inheader = 0;
|
||||
# print DEBUG "left header\n";
|
||||
$::FORM{$itemname} = "";
|
||||
}
|
||||
if (m/^Content-Disposition:\s*form-data\s*;\s*name\s*=\s*"([^\"]+)"/i) {
|
||||
$itemname = $1;
|
||||
# print DEBUG "Found itemname $itemname\n";
|
||||
if (m/;\s*filename\s*=\s*"([^\"]+)"/i) {
|
||||
$::FILENAME{$itemname} = $1;
|
||||
}
|
||||
}
|
||||
|
||||
next;
|
||||
}
|
||||
$::FORM{$itemname} .= $_;
|
||||
}
|
||||
delete $::FORM{""};
|
||||
# Get rid of trailing newlines.
|
||||
foreach my $i (keys %::FORM) {
|
||||
chomp($::FORM{$i});
|
||||
$::FORM{$i} =~ s/\r$//;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
sub FormData {
|
||||
my ($field) = (@_);
|
||||
return $::FORM{$field};
|
||||
}
|
||||
|
||||
sub html_quote {
|
||||
my ($var) = (@_);
|
||||
$var =~ s/\&/\&/g;
|
||||
$var =~ s/</\</g;
|
||||
$var =~ s/>/\>/g;
|
||||
return $var;
|
||||
}
|
||||
|
||||
sub value_quote {
|
||||
my ($var) = (@_);
|
||||
$var =~ s/\&/\&/g;
|
||||
$var =~ s/</\</g;
|
||||
$var =~ s/>/\>/g;
|
||||
$var =~ s/"/\"/g;
|
||||
$var =~ s/\n/\
/g;
|
||||
$var =~ s/\r/\
/g;
|
||||
return $var;
|
||||
}
|
||||
|
||||
sub navigation_header {
|
||||
if (defined $::COOKIE{"BUGLIST"} && $::COOKIE{"BUGLIST"} ne "") {
|
||||
my @bugs = split(/:/, $::COOKIE{"BUGLIST"});
|
||||
my $cur = lsearch(\@bugs, $::FORM{"id"});
|
||||
print "<B>Bug List:</B> (@{[$cur + 1]} of @{[$#bugs + 1]})\n";
|
||||
print "<A HREF=\"show_bug.cgi?id=$bugs[0]\">First</A>\n";
|
||||
print "<A HREF=\"show_bug.cgi?id=$bugs[$#bugs]\">Last</A>\n";
|
||||
if ($cur > 0) {
|
||||
print "<A HREF=\"show_bug.cgi?id=$bugs[$cur - 1]\">Prev</A>\n";
|
||||
} else {
|
||||
print "<I><FONT COLOR=\#777777>Prev</FONT></I>\n";
|
||||
}
|
||||
if ($cur < $#bugs) {
|
||||
$::next_bug = $bugs[$cur + 1];
|
||||
print "<A HREF=\"show_bug.cgi?id=$::next_bug\">Next</A>\n";
|
||||
} else {
|
||||
print "<I><FONT COLOR=\#777777>Next</FONT></I>\n";
|
||||
}
|
||||
}
|
||||
print " <A HREF=query.cgi>Query page</A>\n";
|
||||
print " <A HREF=enter_bug.cgi>Enter new bug</A>\n"
|
||||
}
|
||||
|
||||
|
||||
sub make_options {
|
||||
my ($src,$default,$isregexp) = (@_);
|
||||
my $last = "";
|
||||
my $popup = "";
|
||||
my $found = 0;
|
||||
|
||||
if ($src) {
|
||||
foreach my $item (@$src) {
|
||||
if ($item eq "-blank-" || $item ne $last) {
|
||||
if ($item eq "-blank-") {
|
||||
$item = "";
|
||||
}
|
||||
$last = $item;
|
||||
if ($isregexp ? $item =~ $default : $default eq $item) {
|
||||
$popup .= "<OPTION SELECTED VALUE=\"$item\">$item";
|
||||
$found = 1;
|
||||
} else {
|
||||
$popup .= "<OPTION VALUE=\"$item\">$item";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$found && $default ne "") {
|
||||
$popup .= "<OPTION SELECTED>$default";
|
||||
}
|
||||
return $popup;
|
||||
}
|
||||
|
||||
|
||||
sub make_popup {
|
||||
my ($name,$src,$default,$listtype,$onchange) = (@_);
|
||||
my $popup = "<SELECT NAME=$name";
|
||||
if ($listtype > 0) {
|
||||
$popup .= " SIZE=5";
|
||||
if ($listtype == 2) {
|
||||
$popup .= " MULTIPLE";
|
||||
}
|
||||
}
|
||||
if (defined $onchange && $onchange ne "") {
|
||||
$popup .= " onchange=$onchange";
|
||||
}
|
||||
$popup .= ">" . make_options($src, $default,
|
||||
($listtype == 2 && $default ne ""));
|
||||
$popup .= "</SELECT>";
|
||||
return $popup;
|
||||
}
|
||||
|
||||
|
||||
sub PasswordForLogin {
|
||||
my ($login) = (@_);
|
||||
SendSQL("select cryptpassword from profiles where login_name = " .
|
||||
SqlQuote($login));
|
||||
my $result = FetchOneColumn();
|
||||
if (!defined $result) {
|
||||
$result = "";
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
sub quietly_check_login() {
|
||||
$::usergroupset = '0';
|
||||
my $loginok = 0;
|
||||
if (defined $::COOKIE{"Bugzilla_login"} &&
|
||||
defined $::COOKIE{"Bugzilla_logincookie"}) {
|
||||
ConnectToDatabase();
|
||||
SendSQL("select profiles.groupset, profiles.login_name = " .
|
||||
SqlQuote($::COOKIE{"Bugzilla_login"}) .
|
||||
" and profiles.cryptpassword = logincookies.cryptpassword " .
|
||||
"and logincookies.hostname = " .
|
||||
SqlQuote($ENV{"REMOTE_HOST"}) .
|
||||
" from profiles,logincookies where logincookies.cookie = " .
|
||||
SqlQuote($::COOKIE{"Bugzilla_logincookie"}) .
|
||||
" and profiles.userid = logincookies.userid");
|
||||
my @row;
|
||||
if (@row = FetchSQLData()) {
|
||||
$loginok = $row[1];
|
||||
if ($loginok) {
|
||||
$::usergroupset = $row[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$loginok) {
|
||||
delete $::COOKIE{"Bugzilla_login"};
|
||||
}
|
||||
return $loginok;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
sub CheckEmailSyntax {
|
||||
my ($addr) = (@_);
|
||||
if ($addr !~ /^[^@, ]*@[^@, ]*\.[^@, ]*$/) {
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
print "<H1>Invalid e-mail address entered.</H1>\n";
|
||||
print "The e-mail address you entered\n";
|
||||
print "(<b>$addr</b>) didn't match our minimal\n";
|
||||
print "syntax checking for a legal email address. A legal\n";
|
||||
print "address must contain exactly one '\@', and at least one\n";
|
||||
print "'.' after the \@, and may not contain any commas or.\n";
|
||||
print "spaces.\n";
|
||||
print "<p>Please click <b>back</b> and try again.\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub confirm_login {
|
||||
my ($nexturl) = (@_);
|
||||
|
||||
# Uncommenting the next line can help debugging...
|
||||
# print "Content-type: text/plain\n\n";
|
||||
|
||||
ConnectToDatabase();
|
||||
if (defined $::FORM{"Bugzilla_login"} &&
|
||||
defined $::FORM{"Bugzilla_password"}) {
|
||||
|
||||
my $enteredlogin = $::FORM{"Bugzilla_login"};
|
||||
my $enteredpwd = $::FORM{"Bugzilla_password"};
|
||||
CheckEmailSyntax($enteredlogin);
|
||||
|
||||
my $realcryptpwd = PasswordForLogin($::FORM{"Bugzilla_login"});
|
||||
|
||||
if (defined $::FORM{"PleaseMailAPassword"}) {
|
||||
my $realpwd;
|
||||
if ($realcryptpwd eq "") {
|
||||
$realpwd = InsertNewUser($enteredlogin);
|
||||
} else {
|
||||
SendSQL("select password from profiles where login_name = " .
|
||||
SqlQuote($enteredlogin));
|
||||
$realpwd = FetchOneColumn();
|
||||
}
|
||||
my $urlbase = Param("urlbase");
|
||||
my $template = "From: bugzilla-daemon
|
||||
To: %s
|
||||
Subject: Your bugzilla password.
|
||||
|
||||
To use the wonders of bugzilla, you can use the following:
|
||||
|
||||
E-mail address: %s
|
||||
Password: %s
|
||||
|
||||
To change your password, go to:
|
||||
${urlbase}changepassword.cgi
|
||||
|
||||
(Your bugzilla and CVS password, if any, are not currently synchronized.
|
||||
Top hackers are working around the clock to fix this, as you read this.)
|
||||
";
|
||||
my $msg = sprintf($template, $enteredlogin, $enteredlogin,
|
||||
$realpwd);
|
||||
|
||||
open SENDMAIL, "|/usr/lib/sendmail -t";
|
||||
print SENDMAIL $msg;
|
||||
close SENDMAIL;
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
print "<H1>Password has been emailed.</H1>\n";
|
||||
print "The password for the e-mail address\n";
|
||||
print "$enteredlogin has been e-mailed to that address.\n";
|
||||
print "<p>When the e-mail arrives, you can click <b>Back</b>\n";
|
||||
print "and enter your password in the form there.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
my $enteredcryptpwd = crypt($enteredpwd, substr($realcryptpwd, 0, 2));
|
||||
if ($realcryptpwd eq "" || $enteredcryptpwd ne $realcryptpwd) {
|
||||
print "Content-type: text/html\n\n";
|
||||
print "<H1>Login failed.</H1>\n";
|
||||
print "The username or password you entered is not valid.\n";
|
||||
print "Please click <b>Back</b> and try again.\n";
|
||||
exit;
|
||||
}
|
||||
$::COOKIE{"Bugzilla_login"} = $enteredlogin;
|
||||
SendSQL("insert into logincookies (userid,cryptpassword,hostname) values (@{[DBNameToIdAndCheck($enteredlogin)]}, @{[SqlQuote($realcryptpwd)]}, @{[SqlQuote($ENV{'REMOTE_HOST'})]})");
|
||||
SendSQL("select LAST_INSERT_ID()");
|
||||
my $logincookie = FetchOneColumn();
|
||||
|
||||
$::COOKIE{"Bugzilla_logincookie"} = $logincookie;
|
||||
print "Set-Cookie: Bugzilla_login=$enteredlogin ; path=/; expires=Sun, 30-Jun-2029 00:00:00 GMT\n";
|
||||
print "Set-Cookie: Bugzilla_logincookie=$logincookie ; path=/; expires=Sun, 30-Jun-2029 00:00:00 GMT\n";
|
||||
|
||||
# This next one just cleans out any old bugzilla passwords that may
|
||||
# be sitting around in the cookie files, from the bad old days when
|
||||
# we actually stored the password there.
|
||||
print "Set-Cookie: Bugzilla_password= ; path=/; expires=Sun, 30-Jun-80 00:00:00 GMT\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
my $loginok = quietly_check_login();
|
||||
|
||||
if ($loginok != 1) {
|
||||
print "Content-type: text/html\n\n";
|
||||
print "<H1>Please log in.</H1>\n";
|
||||
print "I need a legitimate e-mail address and password to continue.\n";
|
||||
if (!defined $nexturl || $nexturl eq "") {
|
||||
# Sets nexturl to be argv0, stripping everything up to and
|
||||
# including the last slash.
|
||||
$0 =~ m:[^/]*$:;
|
||||
$nexturl = $&;
|
||||
}
|
||||
my $method = "POST";
|
||||
if (defined $ENV{"REQUEST_METHOD"}) {
|
||||
$method = $ENV{"REQUEST_METHOD"};
|
||||
}
|
||||
print "
|
||||
<FORM action=$nexturl method=$method>
|
||||
<table>
|
||||
<tr>
|
||||
<td align=right><b>E-mail address:</b></td>
|
||||
<td><input size=35 name=Bugzilla_login></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right><b>Password:</b></td>
|
||||
<td><input type=password size=35 name=Bugzilla_password></td>
|
||||
</tr>
|
||||
</table>
|
||||
";
|
||||
foreach my $i (keys %::FORM) {
|
||||
if ($i =~ /^Bugzilla_/) {
|
||||
next;
|
||||
}
|
||||
print "<input type=hidden name=$i value=\"@{[value_quote($::FORM{$i})]}\">\n";
|
||||
}
|
||||
print "
|
||||
<input type=submit value=Login name=GoAheadAndLogIn><hr>
|
||||
If you don't have a password, or have forgotten it, then please fill in the
|
||||
e-mail address above and click
|
||||
here:<input type=submit value=\"E-mail me a password\"
|
||||
name=PleaseMailAPassword>
|
||||
</form>\n";
|
||||
|
||||
# This seems like as good as time as any to get rid of old
|
||||
# crufty junk in the logincookies table. Get rid of any entry
|
||||
# that hasn't been used in a month.
|
||||
SendSQL("delete from logincookies where to_days(now()) - to_days(lastused) > 30");
|
||||
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
# Update the timestamp on our logincookie, so it'll keep on working.
|
||||
SendSQL("update logincookies set lastused = null where cookie = $::COOKIE{'Bugzilla_logincookie'}");
|
||||
}
|
||||
|
||||
|
||||
sub PutHeader {
|
||||
my ($title, $h1, $h2) = (@_);
|
||||
|
||||
if (!defined $h1) {
|
||||
$h1 = $title;
|
||||
}
|
||||
if (!defined $h2) {
|
||||
$h2 = "";
|
||||
}
|
||||
|
||||
print "<HTML><HEAD>\n<TITLE>$title</TITLE>\n";
|
||||
print Param("headerhtml") . "\n</HEAD>\n";
|
||||
print "<BODY BGCOLOR=\"#FFFFFF\" TEXT=\"#000000\"\n";
|
||||
print "LINK=\"#0000EE\" VLINK=\"#551A8B\" ALINK=\"#FF0000\">\n";
|
||||
|
||||
print PerformSubsts(Param("bannerhtml"), undef);
|
||||
|
||||
print "<TABLE BORDER=0 CELLPADDING=12 CELLSPACING=0 WIDTH=\"100%\">\n";
|
||||
print " <TR>\n";
|
||||
print " <TD>\n";
|
||||
print " <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=2>\n";
|
||||
print " <TR><TD VALIGN=TOP ALIGN=CENTER NOWRAP>\n";
|
||||
print " <FONT SIZE=\"+3\"><B><NOBR>$h1</NOBR></B></FONT>\n";
|
||||
print " </TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER>\n";
|
||||
print " <B>$h2</B>\n";
|
||||
print " </TD></TR>\n";
|
||||
print " </TABLE>\n";
|
||||
print " </TD>\n";
|
||||
print " <TD>\n";
|
||||
|
||||
print Param("blurbhtml");
|
||||
|
||||
print "</TD></TR></TABLE>\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
############# Live code below here (that is, not subroutine defs) #############
|
||||
|
||||
|
||||
$| = 1;
|
||||
|
||||
# Uncommenting this next line can help debugging.
|
||||
# print "Content-type: text/html\n\nHello mom\n";
|
||||
|
||||
# foreach my $k (sort(keys %ENV)) {
|
||||
# print "$k $ENV{$k}<br>\n";
|
||||
# }
|
||||
|
||||
if (defined $ENV{"REQUEST_METHOD"}) {
|
||||
if ($ENV{"REQUEST_METHOD"} eq "GET") {
|
||||
if (defined $ENV{"QUERY_STRING"}) {
|
||||
$::buffer = $ENV{"QUERY_STRING"};
|
||||
} else {
|
||||
$::buffer = "";
|
||||
}
|
||||
ProcessFormFields $::buffer;
|
||||
} else {
|
||||
if ($ENV{"CONTENT_TYPE"} =~
|
||||
m@multipart/form-data; boundary=\s*([^; ]+)@) {
|
||||
ProcessMultipartFormFields($1);
|
||||
$::buffer = "";
|
||||
} else {
|
||||
read STDIN, $::buffer, $ENV{"CONTENT_LENGTH"} ||
|
||||
die "Couldn't get form data";
|
||||
ProcessFormFields $::buffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (defined $ENV{"HTTP_COOKIE"}) {
|
||||
foreach my $pair (split(/;/, $ENV{"HTTP_COOKIE"})) {
|
||||
$pair = trim($pair);
|
||||
if ($pair =~ /^([^=]*)=(.*)$/) {
|
||||
$::COOKIE{$1} = $2;
|
||||
} else {
|
||||
$::COOKIE{$pair} = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
274
mozilla/webtools/bugzilla/CHANGES
Normal file
274
mozilla/webtools/bugzilla/CHANGES
Normal file
@@ -0,0 +1,274 @@
|
||||
This file contains only important changes made to Bugzilla. If you
|
||||
are updating from an older verseion, make sure that you check this file!
|
||||
|
||||
For a more complete list of what has changed, use Bonsai
|
||||
(http://cvs-mirror.mozilla.org/webtools/bonsai/cvsqueryform.cgi) to
|
||||
query the CVS tree. For example,
|
||||
|
||||
http://cvs-mirror.mozilla.org/webtools/bonsai/cvsquery.cgi?module=all&branch=HEAD&branchtype=match&dir=mozilla%2Fwebtools%2Fbugzilla&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot
|
||||
|
||||
will tell you what has been changed in the last week.
|
||||
|
||||
|
||||
4/22/99 There was a bug where the long descriptions of bugs had a variety of
|
||||
newline characters at the end, depending on the operating system of the browser
|
||||
that submitted the text. This bug has been fixed, so that no further changes
|
||||
like that will happen. But to fix problems that have already crept into your
|
||||
database, you can run the following perl script (which is slow and ugly, but
|
||||
does work:)
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
use diagnostics;
|
||||
use strict;
|
||||
require "globals.pl";
|
||||
$|=1;
|
||||
ConnectToDatabase();
|
||||
SendSQL("select bug_id from bugs order by bug_id");
|
||||
my @list;
|
||||
while (MoreSQLData()) {
|
||||
push(@list, FetchOneColumn());
|
||||
}
|
||||
foreach my $id (@list) {
|
||||
if ($id % 50 == 0) {
|
||||
print "\n$id ";
|
||||
}
|
||||
SendSQL("select long_desc from bugs where bug_id = $id");
|
||||
my $comment = FetchOneColumn();
|
||||
my $orig = $comment;
|
||||
$comment =~ s/\r\n/\n/g; # Get rid of windows-style line endings.
|
||||
$comment =~ s/\r/\n/g; # Get rid of mac-style line endings.
|
||||
if ($comment ne $orig) {
|
||||
SendSQL("update bugs set long_desc = " . SqlQuote($comment) .
|
||||
" where bug_id = $id");
|
||||
print ".";
|
||||
} else {
|
||||
print "-";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
4/8/99 Added ability to store patches with bugs. This requires a new table
|
||||
to store the data, so you will need to run the "makeattachmenttable.sh" script.
|
||||
|
||||
3/25/99 Unfortunately, the HTML::FromText CPAN module had too many bugs, and
|
||||
so I had to roll my own. We no longer use the HTML::FromText CPAN module.
|
||||
|
||||
3/24/99 (This entry has been removed. It used to say that we required the
|
||||
HTML::FromText CPAN module, but that's no longer true.)
|
||||
|
||||
3/22/99 Added the ability to query by fields which have changed within a date
|
||||
range. To make this perform a bit better, we need a new index:
|
||||
|
||||
alter table bugs_activity add index (field);
|
||||
|
||||
3/10/99 Added 'groups' stuff, where we have different group bits that we can
|
||||
put on a person or on a bug. Some of the group bits control access to bugzilla
|
||||
features. And a person can't access a bug unless he has every group bit set
|
||||
that is also set on the bug. See the comments in makegroupstable.sh for a bit
|
||||
more info.
|
||||
|
||||
The 'maintainer' param is now used only as an email address for people to send
|
||||
complaints to. The groups table is what is now used to determine permissions.
|
||||
|
||||
You will need to run the new script "makegroupstable.sh". And then you need to
|
||||
feed the following lines to MySQL (replace XXX with the login name of the
|
||||
maintainer, the person you wish to be all-powerful).
|
||||
|
||||
alter table bugs add column groupset bigint not null;
|
||||
alter table profiles add column groupset bigint not null;
|
||||
update profiles set groupset=0x7fffffffffffffff where login_name = XXX;
|
||||
|
||||
|
||||
|
||||
3/8/99 Added params to control how priorities are set in a new bug. You can
|
||||
now choose whether to let submitters of new bugs choose a priority, or whether
|
||||
they should just accept the default priority (which is now no longer hardcoded
|
||||
to "P2", but is instead a param.) The default value of the params will cause
|
||||
the same behavior as before.
|
||||
|
||||
3/3/99 Added a "disallownew" field to the products table. If non-zero, then
|
||||
don't let people file new bugs against this product. (This is for when a
|
||||
product is retired, but you want to keep the bug reports around for posterity.)
|
||||
Feed this to MySQL:
|
||||
|
||||
alter table products add column disallownew tinyint not null;
|
||||
|
||||
|
||||
2/8/99 Added FreeBSD to the list of OS's. Feed this to MySQL:
|
||||
|
||||
alter table bugs change column op_sys op_sys enum("All", "Windows 3.1", "Windows 95", "Windows 98", "Windows NT", "Mac System 7", "Mac System 7.5", "Mac System 7.6.1", "Mac System 8.0", "Mac System 8.5", "AIX", "BSDI", "HP-UX", "IRIX", "Linux", "FreeBSD", "OSF/1", "Solaris", "SunOS", "OS/2", "other") not null;
|
||||
|
||||
|
||||
2/4/99 Added a new column "description" to the components table, and added
|
||||
links to a new page which will use this to describe the components of a
|
||||
given product. Feed this to MySQL:
|
||||
|
||||
alter table components add column description mediumtext not null;
|
||||
|
||||
|
||||
2/3/99 Added a new column "initialqacontact" to the components table that gives
|
||||
an initial QA contact field. It may be empty if you wish the initial qa
|
||||
contact to be empty. If you're not using the QA contact field, you don't need
|
||||
to add this column, but you might as well be safe and add it anyway:
|
||||
|
||||
alter table components add column initialqacontact tinytext not null;
|
||||
|
||||
|
||||
2/2/99 Added a new column "milestoneurl" to the products table that gives a URL
|
||||
which is to describe the currently defined milestones for a product. If you
|
||||
don't use target milestone, you might be able to get away without adding this
|
||||
column, but you might as well be safe and add it anyway:
|
||||
|
||||
alter table products add column milestoneurl tinytext not null;
|
||||
|
||||
|
||||
1/29/99 Whoops; had a mispelled op_sys. It was "Mac System 7.1.6"; it should
|
||||
be "Mac System 7.6.1". It turns out I had no bugs with this value set, so I
|
||||
could just do the below simple command. If you have bugs with this value, you
|
||||
may need to do something more complicated.
|
||||
|
||||
alter table bugs change column op_sys op_sys enum("All", "Windows 3.1", "Windows 95", "Windows 98", "Windows NT", "Mac System 7", "Mac System 7.5", "Mac System 7.6.1", "Mac System 8.0", "Mac System 8.5", "AIX", "BSDI", "HP-UX", "IRIX", "Linux", "OSF/1", "Solaris", "SunOS", "OS/2", "other") not null;
|
||||
|
||||
|
||||
|
||||
1/20/99 Added new fields: Target Milestone, QA Contact, and Status Whiteboard.
|
||||
These fields are all optional in the UI; there are parameters to turn them on.
|
||||
However, whether or not you use them, the fields need to be in the DB. There
|
||||
is some code that needs them, even if you don't.
|
||||
|
||||
To update your DB to have these fields, send the following to MySQL:
|
||||
|
||||
alter table bugs add column target_milestone varchar(20) not null,
|
||||
add column qa_contact mediumint not null,
|
||||
add column status_whiteboard mediumtext not null,
|
||||
add index (target_milestone), add index (qa_contact);
|
||||
|
||||
|
||||
|
||||
1/18/99 You can now query by CC. To make this perform reasonably, the CC table
|
||||
needs some indices. The following MySQL does the necessary stuff:
|
||||
|
||||
alter table cc add index (bug_id), add index (who);
|
||||
|
||||
|
||||
1/15/99 The op_sys field can now be queried by (and more easily tweaked).
|
||||
To make this perform reasonably, it needs an index. The following MySQL
|
||||
command will create the necessary index:
|
||||
|
||||
alter table bugs add index (op_sys);
|
||||
|
||||
|
||||
12/2/98 The op_sys and rep_platform fields have been tweaked. op_sys
|
||||
is now an enum, rather than having the legal values all hard-coded in
|
||||
perl. rep_platform now no longer allows a value of "X-Windows".
|
||||
|
||||
Here's how I ported to the new world. This ought to work for you too.
|
||||
Actually, it's probably overkill. I had a lot of illegal values for op_sys
|
||||
in my tables, from importing bugs from strange places. If you haven't done
|
||||
anything funky, then much of the below will be a no-op.
|
||||
|
||||
First, send the following commands to MySQL to make sure all your values for
|
||||
rep_platform and op_sys are legal in the new world..
|
||||
|
||||
update bugs set rep_platform="Sun" where rep_platform="X-Windows" and op_sys like "Solaris%";
|
||||
update bugs set rep_platform="SGI" where rep_platform="X-Windows" and op_sys = "IRIX";
|
||||
update bugs set rep_platform="SGI" where rep_platform="X-Windows" and op_sys = "HP-UX";
|
||||
update bugs set rep_platform="DEC" where rep_platform="X-Windows" and op_sys = "OSF/1";
|
||||
update bugs set rep_platform="PC" where rep_platform="X-Windows" and op_sys = "Linux";
|
||||
update bugs set rep_platform="other" where rep_platform="X-Windows";
|
||||
update bugs set rep_platform="other" where rep_platform="";
|
||||
update bugs set op_sys="Mac System 7" where op_sys="System 7";
|
||||
update bugs set op_sys="Mac System 7.5" where op_sys="System 7.5";
|
||||
update bugs set op_sys="Mac System 8.0" where op_sys="8.0";
|
||||
update bugs set op_sys="OSF/1" where op_sys="Digital Unix 4.0";
|
||||
update bugs set op_sys="IRIX" where op_sys like "IRIX %";
|
||||
update bugs set op_sys="HP-UX" where op_sys like "HP-UX %";
|
||||
update bugs set op_sys="Windows NT" where op_sys like "NT %";
|
||||
update bugs set op_sys="OSF/1" where op_sys like "OSF/1 %";
|
||||
update bugs set op_sys="Solaris" where op_sys like "Solaris %";
|
||||
update bugs set op_sys="SunOS" where op_sys like "SunOS%";
|
||||
update bugs set op_sys="other" where op_sys = "Motif";
|
||||
update bugs set op_sys="other" where op_sys = "Other";
|
||||
|
||||
Next, send the following commands to make sure you now have only legal
|
||||
entries in your table. If either of the queries do not come up empty, then
|
||||
you have to do more stuff like the above.
|
||||
|
||||
select bug_id,op_sys,rep_platform from bugs where rep_platform not regexp "^(All|DEC|HP|Macintosh|PC|SGI|Sun|X-Windows|Other)$";
|
||||
select bug_id,op_sys,rep_platform from bugs where op_sys not regexp "^(All|Windows 3.1|Windows 95|Windows 98|Windows NT|Mac System 7|Mac System 7.5|Mac System 7.1.6|Mac System 8.0|AIX|BSDI|HP-UX|IRIX|Linux|OSF/1|Solaris|SunOS|other)$";
|
||||
|
||||
Finally, once that's all clear, alter the table to make enforce the new legal
|
||||
entries:
|
||||
|
||||
alter table bugs change column op_sys op_sys enum("All", "Windows 3.1", "Windows 95", "Windows 98", "Windows NT", "Mac System 7", "Mac System 7.5", "Mac System 7.1.6", "Mac System 8.0", "AIX", "BSDI", "HP-UX", "IRIX", "Linux", "OSF/1", "Solaris", "SunOS", "other") not null, change column rep_platform rep_platform enum("All", "DEC", "HP", "Macintosh", "PC", "SGI", "Sun", "Other");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
11/20/98 Added searching of CC field. To better support this, added
|
||||
some indexes to the CC table. You probably want to execute the following
|
||||
mysql commands:
|
||||
|
||||
alter table cc add index (bug_id);
|
||||
alter table cc add index (who);
|
||||
|
||||
|
||||
10/27/98 security check for legal products in place. bug charts are not
|
||||
available as an option if collectstats.pl has never been run. all products
|
||||
get daily stats collected now. README updated: Chart::Base is listed as
|
||||
a requirement, instructions for using collectstats.pl included as
|
||||
an optional step. also got silly and added optional quips to bug
|
||||
reports.
|
||||
|
||||
10/17/98 modified README installation instructions slightly.
|
||||
|
||||
10/7/98 Added a new table called "products". Right now, this is used
|
||||
only to have a description for each product, and that description is
|
||||
only used when initially adding a new bug. Anyway, you *must* create
|
||||
the new table (which you can do by running the new makeproducttable.sh
|
||||
script). If you just leave it empty, things will work much as they
|
||||
did before, or you can add descriptions for some or all of your
|
||||
products.
|
||||
|
||||
|
||||
9/15/98 Everything has been ported to Perl. NO MORE TCL. This
|
||||
transition should be relatively painless, except for the "params"
|
||||
file. This is the file that contains parameters you've set up on the
|
||||
editparams.cgi page. Before changing to Perl, this was a tcl-syntax
|
||||
file, stored in the same directory as the code; after the change to
|
||||
Perl, it becomes a perl-syntax file, stored in a subdirectory named
|
||||
"data". See the README file for more details on what version of Perl
|
||||
you need.
|
||||
|
||||
So, if updating from an older version of Bugzilla, you will need to
|
||||
edit data/param, change the email address listed for
|
||||
$::param{'maintainer'}, and then go revisit the editparams.cgi page
|
||||
and reset all the parameters to your taste. Fortunately, your old
|
||||
params file will still be around, and so you ought to be able to
|
||||
cut&paste important bits from there.
|
||||
|
||||
Also, note that the "whineatnews" script has changed name (it now has
|
||||
an extension of .pl instead of .tcl), so you'll need to change your
|
||||
cron job.
|
||||
|
||||
And the "comments" file has been moved to the data directory. Just do
|
||||
"cat comments >> data/comments" to restore any old comments that may
|
||||
have been lost.
|
||||
|
||||
|
||||
|
||||
9/2/98 Changed the way password validation works. We now keep a
|
||||
crypt'd version of the password in the database, and check against
|
||||
that. (This is silly, because we're also keeping the plaintext
|
||||
version there, but I have plans...) Stop passing the plaintext
|
||||
password around as a cookie; instead, we have a cookie that references
|
||||
a record in a new database table, logincookies.
|
||||
|
||||
IMPORTANT: if updating from an older version of Bugzilla, you must run
|
||||
the following commands to keep things working:
|
||||
|
||||
./makelogincookiestable.sh
|
||||
echo "alter table profiles add column cryptpassword varchar(64);" | mysql bugs
|
||||
echo "update profiles set cryptpassword = encrypt(password,substring(rand(),3, 4));" | mysql bugs
|
||||
|
||||
399
mozilla/webtools/bugzilla/README
Normal file
399
mozilla/webtools/bugzilla/README
Normal file
@@ -0,0 +1,399 @@
|
||||
This is Bugzilla. See <http://www.mozilla.org/bugs/>.
|
||||
|
||||
|
||||
==========
|
||||
DISCLAIMER
|
||||
==========
|
||||
|
||||
This is not very well packaged code. It's not packaged at all. Don't
|
||||
come here expecting something you plop in a directory, twiddle a few
|
||||
things, and you're off and using it. Work has to be done to get there.
|
||||
We'd like to get there, but it wasn't clear when that would be, and so we
|
||||
decided to let people see it first.
|
||||
|
||||
============
|
||||
INSTALLATION
|
||||
============
|
||||
|
||||
0. Introduction
|
||||
|
||||
Installation of bugzilla is pretty straight forward, especially if your
|
||||
machine already has MySQL and the MySQL-related perl packages installed.
|
||||
If those aren't installed yet, then that's the first order of business. The
|
||||
other necessary ingredient is a web server set up to run cgi scripts.
|
||||
|
||||
1. Installing the Prerequisites
|
||||
|
||||
The software packages necessary for the proper running of bugzilla are:
|
||||
|
||||
1. MySQL database server and the mysql client
|
||||
2. Perl (5.004 or greater)
|
||||
3. DBI Perl module
|
||||
4. Data::Dumper Perl module
|
||||
5. MySQL related Perl module collection
|
||||
6. TimeDate Perl module collection
|
||||
7. GD perl module (1.18 or greater)
|
||||
8. Chart::Base Perl module (0.99 or greater)
|
||||
9. The web server of your choice
|
||||
|
||||
Bugzilla has quite a few prerequisites, but none of them are TCL.
|
||||
Previous versions required TCL, but it no longer needed (or used).
|
||||
|
||||
1.1. Getting and setting up MySQL database
|
||||
|
||||
Visit MySQL homepage at http://www.mysql.org and grab the latest stable
|
||||
release of the server. Both binaries and source are available and which you
|
||||
get shouldn't matter. Be aware that many of the binary versions of MySQL store
|
||||
their data files in /var which on many installations (particularly common with
|
||||
linux installations) is part of a smaller root partition. If you decide to
|
||||
build from sources you can easily set the dataDir as an option to configure.
|
||||
|
||||
If you've installed from source or non-package (RPM, deb, etc.) binaries
|
||||
you'll want to make sure to add mysqld to your init scripts so the server
|
||||
daemon will come back up whenever your machine reboots.
|
||||
|
||||
1.2. Perl (5.004 or greater)
|
||||
|
||||
Any machine that doesn't have perl on it is a sad machine indeed. Perl
|
||||
for *nix systems can be gotten in source form from http://www.perl.com.
|
||||
|
||||
Perl is now a far cry from the the single compiler/interpreter binary it
|
||||
once. It now includes a great many required modules and quite a few other
|
||||
support files. If you're not up to or not inclined to build perl from source,
|
||||
you'll want to install it on your machine using some sort of packaging system
|
||||
(be it RPM, deb, or what have you) to ensure a sane install. In the subsequent
|
||||
sections you'll be installing quite a few perl modules; this can be quite
|
||||
ornery if your perl installation isn't up to snuff.
|
||||
|
||||
1.3. DBI Perl module
|
||||
|
||||
The DBI module is a generic Perl module used by other database related
|
||||
Perl modules. For our purposes it's required by the MySQL-related
|
||||
modules. As long as your Perl installation was done correctly the DBI
|
||||
module should be a breeze. It's a mixed Perl/C module, but Perl's
|
||||
MakeMaker system simplifies the C compilation greatly.
|
||||
|
||||
Like almost all Perl modules DBI can be found on the Comprehensive Perl
|
||||
Archive Network (CPAN) at http://www.cpan.org . The CPAN servers have a
|
||||
real tendency to bog down, so please use mirrors. The current location at
|
||||
the time of this writing (02/17/99) can be found in Appendix A.
|
||||
|
||||
Quality, general Perl module installation instructions can be found on
|
||||
the CPAN website, but basically you'll just need to:
|
||||
|
||||
1. Untar the module tarball -- it should create its own directory
|
||||
2. Enter the following commands:
|
||||
perl Makefile.PL
|
||||
make
|
||||
make test
|
||||
make install
|
||||
|
||||
If everything went ok that should be all it takes. For the vast
|
||||
majority of perl modules this is all that's required.
|
||||
|
||||
1.4 Data::Dumper Perl module
|
||||
|
||||
The Data::Dumper module provides data structure persistence for Perl
|
||||
(similar to Java's serialization). It comes with later sub-releases of
|
||||
Perl 5.004, but a re-installation just to be sure it's available won't
|
||||
hurt anything.
|
||||
|
||||
Data::Dumper is used by the MySQL related Perl modules. It can be
|
||||
found on CPAN (link in Appendix A) and can be installed by following the
|
||||
same four step make sequence used for the DBI module.
|
||||
|
||||
1.5. MySQL related Perl module collection
|
||||
|
||||
The Perl/MySQL interface requires a few mutually-dependent perl
|
||||
modules. These modules are grouped together into the the
|
||||
Msql-Mysql-modules package. This package can be found at CPAN (link in
|
||||
Appendix A). After the archive file has been downloaded it should be
|
||||
untarred.
|
||||
|
||||
The MySQL modules are all build using one make file which is generated
|
||||
by running:
|
||||
|
||||
perl Makefile.PL
|
||||
|
||||
The MakeMaker process will ask you a few questions about the desired
|
||||
compilation target and your MySQL installation. For many of the questions
|
||||
the provided default will be adequate.
|
||||
|
||||
When asked if your desired target is the MySQL or mSQL packages
|
||||
selected the MySQL related ones. Later you will be asked if you wish to
|
||||
provide backwards compatibility with the older MySQL packages; you must
|
||||
answer YES to this question. The default will be no, and if you select it
|
||||
things won't work later.
|
||||
|
||||
A host of 'localhost' should be fine and a testing user of 'test'
|
||||
should find itself with sufficient access to run tests on the 'test'
|
||||
database which MySQL created upon installation. If 'make test' and 'make
|
||||
install' go through without errors you should be ready to go as far as
|
||||
database connectivity is concerned.
|
||||
|
||||
1.6. TimeDate Perl module collection
|
||||
|
||||
Many of the more common date/time/calendar related Perl modules have
|
||||
been grouped into a bundle similar to the MySQL modules bundle. This
|
||||
bundle is stored on the CPAN under the name TimeDate. A (hopefully
|
||||
current) link can be found in Appendix A. The component module we're most
|
||||
interested in is the Date::Format module, but installing all of them is
|
||||
probably a good idea anyway. The standard Perl module installation
|
||||
instructions should work perfectly for this simple package.
|
||||
|
||||
1.7. GD Perl module (1.18 or greater)
|
||||
|
||||
The GD library was written by Thomas Boutel a long while ago to
|
||||
programatically generate images in C. Since then it's become almost a
|
||||
defacto standard for programatic image construction. The Perl bindings to
|
||||
it found in the GD library are used on a million web pages to generate
|
||||
graphs on the fly. That's what bugzilla will be using it for so you'd
|
||||
better install it if you want any of the graphing to work.
|
||||
Actually bugzilla uses the Graph module which relies on GD itself, but
|
||||
isn't that always the way with OOP. At any rate, you can find the GD
|
||||
library on CPAN (link in Appendix A) and it installs beautifully in the
|
||||
usual fashion.
|
||||
|
||||
1.8. Chart::Base Perl module (0.99 or greater)
|
||||
|
||||
The Chart module provides bugzilla with on-the-fly charting abilities.
|
||||
It can be installed in the usual fashion after it has been fetched from
|
||||
CPAN where it is found as the Chart-x.x... tarball in a directory to be
|
||||
listed in Appendix A.
|
||||
|
||||
1.9. HTTP server
|
||||
|
||||
You have a freedom of choice here - Apache, Netscape or any other server on
|
||||
UNIX would do. The only thing - to make configuration easier you'd better run
|
||||
HTTP daemon on the same machine that you run MySQL server on. (Theoretically,
|
||||
it's possible to always use MySQL in a remote manner, but we don't know of
|
||||
anyone who has done that with Bugzilla yet.)
|
||||
|
||||
You'll want to make sure that your web server will run any file with the
|
||||
.cgi extension as a cgi and not just display it. If you're using apache that
|
||||
means uncommenting the following line in the srm.conf file:
|
||||
|
||||
AddHandler cgi-script .cgi
|
||||
|
||||
With apache you'll also want to make sure that within the access.conf
|
||||
file the line:
|
||||
|
||||
Options ExecCGI
|
||||
|
||||
is in the stanza that covers the directories you intend to put the
|
||||
bugzilla .html and .cgi files into.
|
||||
|
||||
2. Installing the Bugzilla Files
|
||||
|
||||
You should untar the bugzilla files into a directory that you're
|
||||
willing to make writable by the default web server user (probably
|
||||
'nobody'). You may decide to put the files off of the main web space for
|
||||
your web server or perhaps off of /usr/local with a symbolic link in the
|
||||
web space that points to the bugzilla directory. At any rate, just dump
|
||||
all the files in the same place (optionally omitting the CVS directory if
|
||||
it accidentally got tarred up with the rest of bugzilla) and make sure
|
||||
you can get at the files in that directory through your web server.
|
||||
|
||||
Once all the files are in a web accessible directory, make that
|
||||
directory writable by your webserver's user (which may require just
|
||||
making it world writable). Inside this main bugzilla directory issue the
|
||||
following commands:
|
||||
|
||||
touch comments
|
||||
touch nomail
|
||||
touch mail
|
||||
|
||||
Make sure the comments, nomail, and mail files are writable by the
|
||||
webserver too.
|
||||
|
||||
Lastly, you'll need to set up a symbolic link from /usr/bonsaitools/bin
|
||||
to the correct location of your perl executable (probably /usr/bin/perl). Or,
|
||||
you'll have to hack all the .cgi files to change where they look for perl.
|
||||
|
||||
3. Setting Up the MySQL database
|
||||
|
||||
After you've gotten all the software installed and working you're ready
|
||||
to start preparing the database for its life as a the back end to a high
|
||||
quality bug tracker.
|
||||
|
||||
First, you'll want to fix MySQL permissions. Bugzilla always logs in as
|
||||
user "bugs", with no password. That needs to work. MySQL permissions are a
|
||||
deep, nasty complicated thing. I've just turned them off. If you want to do
|
||||
that, too, then the magic is to do run "mysql mysql", and feed it commands like
|
||||
this (replace all instances of HOSTNAME with the name of the machine mysql is
|
||||
running on):
|
||||
|
||||
DELETE * FROM host;
|
||||
DELETE * FROM user;
|
||||
INSERT INTO host VALUES ('localhost','%','Y','Y','Y','Y','Y','Y');
|
||||
INSERT INTO host VALUES (HOSTNAME,'%','Y','Y','Y','Y','Y','Y');
|
||||
INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
|
||||
INSERT INTO user VALUES (HOSTNAME,'','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
|
||||
INSERT INTO user VALUES (HOSTNAME,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
|
||||
INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
|
||||
|
||||
This run of "mysql mysql" may need some extra parameters to deal with whatever
|
||||
database permissions were set up previously. In particular, you might have to say "mysql -uroot mysql", and give it an appropriate password.
|
||||
|
||||
For much more information about MySQL permissions, see the MySQL documentation.
|
||||
|
||||
Next we'll create the bugs database in MySQL. This is done using the
|
||||
'mysql' command line client. This client allows one to funnel SQL
|
||||
statements into the MySQL server directly. It's usage summary is
|
||||
available by running:
|
||||
|
||||
mysql --help
|
||||
|
||||
from the command line.
|
||||
|
||||
Once you've begun mysql you'll see a 'mysql>' prompt. At the prompt you
|
||||
should enter:
|
||||
|
||||
create database bugs;
|
||||
quit
|
||||
|
||||
|
||||
|
||||
To create the tables necessary for bug tracking and to minimally
|
||||
populate the bug tracking system you'll need to run the eight shell
|
||||
scripts found in your bugzilla directory that begin with 'make'. These
|
||||
scripts load data into the database by piping input into the mysql
|
||||
command.
|
||||
|
||||
|
||||
When calling the eight scripts order doesn't matter, but this one is
|
||||
fine:
|
||||
|
||||
./makeactivitytable.sh
|
||||
./makebugtable.sh
|
||||
./makecctable.sh
|
||||
./makecomponenttable.sh
|
||||
./makelogincookiestable.sh
|
||||
./makeproducttable.sh
|
||||
./makeprofilestable.sh
|
||||
./makeversiontable.sh
|
||||
./makegroupstable.sh
|
||||
|
||||
After running those you've got a nearly empty copy of the mozilla bug
|
||||
tracking setup.
|
||||
|
||||
4. Tweaking the Bugzilla->MySQL Connection Data
|
||||
|
||||
If you have played with MySQL permissions, rather than just opening it
|
||||
wide open as described above, then you may need to tweak the Bugzilla
|
||||
code to connect appropriately.
|
||||
|
||||
In order for bugzilla to be able to connect to the MySQL database
|
||||
you'll have to tell bugzilla where the database server is, what database
|
||||
you're connecting to, and whom to connect as. Simply open up the
|
||||
global.pl file in the bugzilla directory and find the line that begins
|
||||
like:
|
||||
|
||||
$::db = Mysql->Connect("
|
||||
|
||||
That line does the actual database connection. The Connect method
|
||||
takes four parameters which are (with appropriate values):
|
||||
|
||||
1. server's host: just use "localhost"
|
||||
2. database name: "bugs" if you're following these directions
|
||||
3. MySQL username: whatever you created for your webserver user
|
||||
probably "nobody"
|
||||
4. Password for the MySQL account in item 3.
|
||||
|
||||
Just fill in those values and close up global.pl
|
||||
|
||||
5. Setting up yourself as Maintainer
|
||||
|
||||
Start by creating your own bugzilla account. To do so, just try to "add
|
||||
a bug" from the main bugzilla menu (now available from your system through your
|
||||
web browser!). You'll be prompted for logon info, and you should enter your
|
||||
email address and then select 'mail me my password'. When you get the password
|
||||
mail, log in with it. Don't finish entering that new bug.
|
||||
|
||||
Now, bring up MySQL, and add yourself to every group. This will
|
||||
effectively make you 'superuser'. The SQL to type is:
|
||||
|
||||
update profiles set groupset=0x7fffffffffffffff where login_name = XXX;
|
||||
|
||||
replacing XXX with your email address in quotes.
|
||||
|
||||
Now, if you go to the query page (off of the bugzilla main menu) where you'll
|
||||
now find a 'edit parameters' option which is filled with editable treats.
|
||||
|
||||
6. Setting Up the Whining Cron Job (Optional)
|
||||
|
||||
By now you've got a fully functional bugzilla, but what good are bugs
|
||||
if they're not annoying? To help make those bugs more annoying you can
|
||||
set up bugzilla's automatic whining system. This can be done by adding
|
||||
the following command as a daily crontab entry (for help on that see that
|
||||
crontab man page):
|
||||
|
||||
cd <your-bugzilla-directory> ; ./whineatnews.pl
|
||||
|
||||
7. Bug Graphs (Optional)
|
||||
|
||||
As long as you installed the GD and Graph::Base Perl modules you might
|
||||
as well turn on the nifty bugzilla bug reporting graphs. Just add the
|
||||
command:
|
||||
|
||||
cd <your-bugzilla-directory> ; ./collectstats.pl
|
||||
|
||||
as a nightly entry to your crontab and after two days have passed you'll
|
||||
be able to view bug graphs from the Bug Reports page.
|
||||
|
||||
---------[ Appendices ]-----------------------
|
||||
|
||||
Appendix A. Required Software Download Links
|
||||
|
||||
All of these sites are current as of February 17, 1999. Hopefully
|
||||
they'll stay current for a while.
|
||||
|
||||
MySQL: http://www.mysql.org
|
||||
|
||||
Perl: http://www.perl.org
|
||||
|
||||
CPAN: http://www.cpan.org
|
||||
|
||||
DBI Perl module: ftp://ftp.cpan.org/pub/perl/CPAN/modules/by-module/DBI/
|
||||
|
||||
Data::Dumper module:
|
||||
ftp://ftp.cpan.org/pub/perl/CPAN/modules/by-module/Data/
|
||||
|
||||
MySQL related Perl modules:
|
||||
ftp://ftp.cpan.org/pub/perl/CPAN/modules/by-module/Mysql/
|
||||
|
||||
TimeDate Perl module collection:
|
||||
ftp://ftp.cpan.org/pub/perl/CPAN/modules/by-module/Date/
|
||||
|
||||
|
||||
GD Perl module: ftp://ftp.cpan.org/pub/perl/CPAN/modules/by-module/GD/
|
||||
|
||||
Chart::Base module:
|
||||
ftp://ftp.cpan.org/pub/perl/CPAN/modules/by-module/Chart/
|
||||
|
||||
|
||||
Appendix B. Modifying Your Running System
|
||||
|
||||
Bugzilla optimizes database lookups by storing all relatively static
|
||||
information in the versioncache file, located in the data/ subdirectory
|
||||
under your installation directory (we said before it needs to be writable,
|
||||
right?!)
|
||||
|
||||
If you make a change to the structural data in your database (the
|
||||
versions table for example), or to the "constants" encoded in
|
||||
defparams.pl, you will need to remove the cached content from the data
|
||||
directory (by doing a "rm data/versioncache"), or your changes won't show
|
||||
up!
|
||||
|
||||
That file gets automatically regenerated whenever it's more than an
|
||||
hour old, so Bugzilla will eventually notice your changes by itself, but
|
||||
generally you want it to notice right away, so that you can test things.
|
||||
|
||||
|
||||
Appendix C. History
|
||||
|
||||
This document was originally adapted from the Bonsai installation
|
||||
instructions by Terry Weissman <terry@mozilla.org>.
|
||||
|
||||
The February 25, 1999 re-write was done by Ry4an Brase
|
||||
<ry4an@ry4an.org>, with some edits by Terry Weissman.
|
||||
99
mozilla/webtools/bugzilla/addcomponent.cgi
Executable file
99
mozilla/webtools/bugzilla/addcomponent.cgi
Executable file
@@ -0,0 +1,99 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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): Sam Ziegler <sam@ziegler.org>
|
||||
# Terry Weissman <terry@mozilla.org>
|
||||
# Mark Hamby <mhamby@logicon.com>
|
||||
|
||||
# Code derived from editcomponents.cgi, reports.cgi
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
# Shut up misguided -w warnings about "used only once":
|
||||
|
||||
use vars @::legal_product;
|
||||
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
if (!UserInGroup("editcomponents")) {
|
||||
print "<H1>Sorry, you aren't a member of the 'editcomponents' group.</H1>\n";
|
||||
print "And so, you aren't allowed to add a new component.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
PutHeader("Add Component");
|
||||
|
||||
print "This page lets you add a component to bugzilla.\n";
|
||||
|
||||
unlink "data/versioncache";
|
||||
GetVersionTable();
|
||||
|
||||
my $prodcode = "P0";
|
||||
|
||||
my $product_popup = make_options (\@::legal_product, $::legal_product[0]);
|
||||
|
||||
print "
|
||||
<form method=post action=doaddcomponent.cgi>
|
||||
|
||||
<TABLE>
|
||||
<TR>
|
||||
<th align=right>Component:</th>
|
||||
<TD><input size=60 name=\"component\" value=\"\"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH align=right>Program:</TH>
|
||||
<TD><SELECT NAME=\"product\">
|
||||
$product_popup
|
||||
</SELECT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH align=right>Description:</TH>
|
||||
<TD><input size=60 name=\"description\" value=\"\"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH align=right>Initial owner:</TH>
|
||||
<TD><input size=60 name=\"initialowner\" value=\"\"></TD>
|
||||
</TR>
|
||||
";
|
||||
|
||||
if (Param('useqacontact')) {
|
||||
print "
|
||||
<TR>
|
||||
<TH align=right>Initial QA contact:</TH>
|
||||
<TD><input size=60 name=\"initialqacontact\" value=\"\"></TD>
|
||||
</TR>
|
||||
";
|
||||
}
|
||||
|
||||
print "
|
||||
</table>
|
||||
<hr>
|
||||
";
|
||||
|
||||
print "<input type=submit value=\"Submit changes\">\n";
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
print "<p><a href=query.cgi>Skip all this, and go back to the query page</a>\n";
|
||||
BIN
mozilla/webtools/bugzilla/ant.jpg
Normal file
BIN
mozilla/webtools/bugzilla/ant.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.3 KiB |
163
mozilla/webtools/bugzilla/backdoor.cgi
Executable file
163
mozilla/webtools/bugzilla/backdoor.cgi
Executable file
@@ -0,0 +1,163 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
# Provides a silly 'back-door' mechanism to let me automatically insert
|
||||
# bugs from the netscape bugsystem. Other installations of Bugzilla probably
|
||||
# don't need to worry about this file any.
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
# Shut up misguided -w warnings about "used only once":
|
||||
|
||||
use vars %::versions;
|
||||
|
||||
|
||||
ConnectToDatabase();
|
||||
|
||||
print "Content-type: text/plain\n\n";
|
||||
|
||||
# while (my ($key,$value) = each %ENV) {
|
||||
# print "$key=$value\n";
|
||||
# }
|
||||
|
||||
my $host = $ENV{'REMOTE_ADDR'};
|
||||
|
||||
SendSQL("select passwd from backdoor where host = '$host'");
|
||||
my $passwd = FetchOneColumn();
|
||||
if (!defined $passwd || !defined $::FORM{'passwd'} ||
|
||||
$passwd ne crypt($::FORM{'passwd'}, substr($passwd, 0, 2))) {
|
||||
print "Who are you?\n";
|
||||
print "Env:\n";
|
||||
while (my ($key,$value) = each %ENV) {
|
||||
print "$key=$value\n";
|
||||
}
|
||||
print "\nForm:\n";
|
||||
while (my ($key,$value) = each %::FORM) {
|
||||
print "$key=$value\n";
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
my $prod = $::FORM{'product'};
|
||||
my $comp = $::FORM{'component'};
|
||||
my $version = $::FORM{'version'};
|
||||
|
||||
GetVersionTable();
|
||||
|
||||
|
||||
sub Punt {
|
||||
my ($label, $value) = (@_);
|
||||
my $maintainer = Param("maintainer");
|
||||
print "I don't know how to move into Bugzilla a bug with a $label of $value.
|
||||
If you really do need to do this, speak to $maintainer and maybe he
|
||||
can teach me.";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
# Do remapping of things from BugSplat world to Bugzilla.
|
||||
|
||||
if ($prod eq "Communicator") {
|
||||
$prod = "Browser";
|
||||
$version = "other";
|
||||
}
|
||||
|
||||
|
||||
# Validate fields, and whine about things that we apparently couldn't remap
|
||||
# into something legal.
|
||||
|
||||
|
||||
if (!defined $::components{$prod}) {
|
||||
Punt("product", $prod);
|
||||
}
|
||||
if (lsearch($::components{$prod}, $comp) < 0) {
|
||||
Punt("component", $comp);
|
||||
}
|
||||
if (lsearch($::versions{$prod}, $version) < 0) {
|
||||
$version = "other";
|
||||
if (lsearch($::versions{$prod}, $version) < 0) {
|
||||
Punt("version", $version);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$::FORM{'product'} = $prod;
|
||||
$::FORM{'component'} = $comp;
|
||||
$::FORM{'version'} = $version;
|
||||
|
||||
|
||||
$::FORM{'long_desc'} =
|
||||
"(This bug imported from BugSplat, Netscape's internal bugsystem. It
|
||||
was known there as bug #$::FORM{'bug_id'}
|
||||
http://scopus.netscape.com/bugsplat/show_bug.cgi?id=$::FORM{'bug_id'}
|
||||
Imported into Bugzilla on " . time2str("%D %H:%M", time()) . ")
|
||||
|
||||
" . $::FORM{'long_desc'};
|
||||
|
||||
|
||||
$::FORM{'reporter'} =
|
||||
DBNameToIdAndCheck("$::FORM{'reporter'}\@netscape.com", 1);
|
||||
$::FORM{'assigned_to'} =
|
||||
DBNameToIdAndCheck("$::FORM{'assigned_to'}\@netscape.com", 1);
|
||||
if ($::FORM{'qa_contact'} ne "") {
|
||||
$::FORM{'qa_contact'} =
|
||||
DBNameToIdAndCheck("$::FORM{'qa_contact'}\@netscape.com", 1);
|
||||
} else {
|
||||
$::FORM{'qa_contact'} = 0;
|
||||
}
|
||||
|
||||
|
||||
my @list = ('reporter', 'assigned_to', 'product', 'version', 'rep_platform',
|
||||
'op_sys', 'bug_status', 'bug_severity', 'priority', 'component',
|
||||
'short_desc', 'long_desc', 'creation_ts', 'delta_ts',
|
||||
'bug_file_loc', 'qa_contact', 'groupset');
|
||||
|
||||
my @vallist;
|
||||
foreach my $i (@list) {
|
||||
push @vallist, SqlQuote($::FORM{$i});
|
||||
}
|
||||
|
||||
my $query = "insert into bugs (" .
|
||||
join(',', @list) .
|
||||
") values (" .
|
||||
join(',', @vallist) .
|
||||
")";
|
||||
|
||||
|
||||
SendSQL($query);
|
||||
|
||||
SendSQL("select LAST_INSERT_ID()");
|
||||
my $zillaid = FetchOneColumn();
|
||||
|
||||
foreach my $cc (split(/,/, $::FORM{'cc'})) {
|
||||
if ($cc ne "") {
|
||||
my $cid = DBNameToIdAndCheck("$cc\@netscape.com", 1);
|
||||
SendSQL("insert into cc (bug_id, who) values ($zillaid, $cid)");
|
||||
}
|
||||
}
|
||||
|
||||
print "Created bugzilla bug $zillaid\n";
|
||||
system("./processmail $zillaid < /dev/null > /dev/null 2> /dev/null &");
|
||||
421
mozilla/webtools/bugzilla/bug_form.pl
Normal file
421
mozilla/webtools/bugzilla/bug_form.pl
Normal file
@@ -0,0 +1,421 @@
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
|
||||
my %knownattachments;
|
||||
|
||||
# This routine quoteUrls contains inspirations from the HTML::FromText CPAN
|
||||
# module by Gareth Rees <garethr@cre.canon.co.uk>. It has been heavily hacked,
|
||||
# all that is really recognizable from the original is bits of the regular
|
||||
# expressions.
|
||||
|
||||
sub quoteUrls {
|
||||
my $text = shift; # Take a copy; don't modify in-place.
|
||||
return $text unless $text;
|
||||
|
||||
my $base = Param('urlbase');
|
||||
|
||||
my $protocol = join '|',
|
||||
qw(afs cid ftp gopher http https mid news nntp prospero telnet wais);
|
||||
|
||||
my %options = ( metachars => 1, @_ );
|
||||
|
||||
my $count = 0;
|
||||
|
||||
# Now, quote any "#" characters so they won't confuse stuff later
|
||||
$text =~ s/#/%#/g;
|
||||
|
||||
# Next, find anything that looks like a URL or an email address and
|
||||
# pull them out the the text, replacing them with a "##<digits>##
|
||||
# marker, and writing them into an array. All this confusion is
|
||||
# necessary so that we don't match on something we've already replaced,
|
||||
# which can happen if you do multiple s///g operations.
|
||||
|
||||
my @things;
|
||||
while ($text =~ s%((mailto:)?([\w\.\-\+\=]+\@\w+(?:\.\w+)+)\b|
|
||||
(\b((?:$protocol):\S+[\w/])))%"##$count##"%exo) {
|
||||
my $item = $&;
|
||||
|
||||
$item = value_quote($item);
|
||||
|
||||
if ($item !~ m/^$protocol:/o && $item !~ /^mailto:/) {
|
||||
# We must have grabbed this one because it looks like an email
|
||||
# address.
|
||||
$item = qq{<A HREF="mailto:$item">$item</A>};
|
||||
} else {
|
||||
$item = qq{<A HREF="$item">$item</A>};
|
||||
}
|
||||
|
||||
$things[$count++] = $item;
|
||||
}
|
||||
while ($text =~ s/\bbug(\s|%\#)*(\d+)/"##$count##"/ei) {
|
||||
my $item = $&;
|
||||
my $num = $2;
|
||||
$item = value_quote($item); # Not really necessary, since we know
|
||||
# there's no special chars in it.
|
||||
$item = qq{<A HREF="${base}show_bug.cgi?id=$num">$item</A>};
|
||||
$things[$count++] = $item;
|
||||
}
|
||||
while ($text =~ s/\*\*\* This bug has been marked as a duplicate of (\d+) \*\*\*/"##$count##"/ei) {
|
||||
my $item = $&;
|
||||
my $num = $1;
|
||||
$item =~ s@\d+@<A HREF="${base}show_bug.cgi?id=$num">$num</A>@;
|
||||
$things[$count++] = $item;
|
||||
}
|
||||
while ($text =~ s/Created an attachment \(id=(\d+)\)/"##$count##"/e) {
|
||||
my $item = $&;
|
||||
my $num = $1;
|
||||
if (exists $knownattachments{$num}) {
|
||||
$item = qq{<A HREF="showattachment.cgi?attach_id=$num">$item</A>};
|
||||
}
|
||||
$things[$count++] = $item;
|
||||
}
|
||||
|
||||
$text = value_quote($text);
|
||||
|
||||
# Stuff everything back from the array.
|
||||
for (my $i=0 ; $i<$count ; $i++) {
|
||||
$text =~ s/##$i##/$things[$i]/e;
|
||||
}
|
||||
|
||||
# And undo the quoting of "#" characters.
|
||||
$text =~ s/%#/#/g;
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
quietly_check_login();
|
||||
|
||||
my $query = "
|
||||
select
|
||||
bug_id,
|
||||
product,
|
||||
version,
|
||||
rep_platform,
|
||||
op_sys,
|
||||
bug_status,
|
||||
resolution,
|
||||
priority,
|
||||
bug_severity,
|
||||
component,
|
||||
assigned_to,
|
||||
reporter,
|
||||
bug_file_loc,
|
||||
short_desc,
|
||||
target_milestone,
|
||||
qa_contact,
|
||||
status_whiteboard,
|
||||
date_format(creation_ts,'Y-m-d'),
|
||||
groupset
|
||||
from bugs
|
||||
where bug_id = $::FORM{'id'}
|
||||
and bugs.groupset & $::usergroupset = bugs.groupset";
|
||||
|
||||
SendSQL($query);
|
||||
my %bug;
|
||||
my @row;
|
||||
if (@row = FetchSQLData()) {
|
||||
my $count = 0;
|
||||
foreach my $field ("bug_id", "product", "version", "rep_platform",
|
||||
"op_sys", "bug_status", "resolution", "priority",
|
||||
"bug_severity", "component", "assigned_to", "reporter",
|
||||
"bug_file_loc", "short_desc", "target_milestone",
|
||||
"qa_contact", "status_whiteboard", "creation_ts",
|
||||
"groupset") {
|
||||
$bug{$field} = shift @row;
|
||||
if (!defined $bug{$field}) {
|
||||
$bug{$field} = "";
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
} else {
|
||||
my $maintainer = Param("maintainer");
|
||||
print "<TITLE>Bug Splat Error</TITLE>\n";
|
||||
print "<H1>Query Error</H1>Somehow something went wrong. Possibly if\n";
|
||||
print "you mail this page to $maintainer, he will be able to fix\n";
|
||||
print "things.<HR>\n";
|
||||
print "Bug $::FORM{'id'} not found<H2>Query Text</H2><PRE>$query<PRE>\n";
|
||||
exit 0
|
||||
}
|
||||
|
||||
$bug{'assigned_to'} = DBID_to_name($bug{'assigned_to'});
|
||||
$bug{'reporter'} = DBID_to_name($bug{'reporter'});
|
||||
$bug{'long_desc'} = GetLongDescription($::FORM{'id'});
|
||||
|
||||
|
||||
GetVersionTable();
|
||||
|
||||
#
|
||||
# These should be read from the database ...
|
||||
#
|
||||
|
||||
my $resolution_popup = make_options(\@::legal_resolution_no_dup,
|
||||
$bug{'resolution'});
|
||||
my $platform_popup = make_options(\@::legal_platform, $bug{'rep_platform'});
|
||||
my $priority_popup = make_options(\@::legal_priority, $bug{'priority'});
|
||||
my $sev_popup = make_options(\@::legal_severity, $bug{'bug_severity'});
|
||||
|
||||
|
||||
my $component_popup = make_options($::components{$bug{'product'}},
|
||||
$bug{'component'});
|
||||
|
||||
my $cc_element = '<INPUT NAME=cc SIZE=30 VALUE="' .
|
||||
ShowCcList($::FORM{'id'}) . '">';
|
||||
|
||||
|
||||
my $URL = $bug{'bug_file_loc'};
|
||||
|
||||
if (defined $URL && $URL ne "none" && $URL ne "NULL" && $URL ne "") {
|
||||
$URL = "<B><A HREF=\"$URL\">URL:</A></B>";
|
||||
} else {
|
||||
$URL = "<B>URL:</B>";
|
||||
}
|
||||
|
||||
print "
|
||||
<HEAD><TITLE>Bug $::FORM{'id'} -- " . html_quote($bug{'short_desc'}) .
|
||||
"</TITLE></HEAD><BODY>
|
||||
<FORM NAME=changeform METHOD=POST ACTION=\"process_bug.cgi\">
|
||||
<INPUT TYPE=HIDDEN NAME=\"id\" VALUE=$::FORM{'id'}>
|
||||
<INPUT TYPE=HIDDEN NAME=\"was_assigned_to\" VALUE=\"$bug{'assigned_to'}\">
|
||||
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR>
|
||||
<TD ALIGN=RIGHT><B>Bug#:</B></TD><TD><A HREF=\"show_bug.cgi?id=$bug{'bug_id'}\">$bug{'bug_id'}</A></TD>
|
||||
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#rep_platform\">Platform:</A></B></TD>
|
||||
<TD><SELECT NAME=rep_platform>$platform_popup</SELECT></TD>
|
||||
<TD ALIGN=RIGHT><B>Version:</B></TD>
|
||||
<TD><SELECT NAME=version>" .
|
||||
make_options($::versions{$bug{'product'}}, $bug{'version'}) .
|
||||
"</SELECT></TD>
|
||||
</TR><TR>
|
||||
<TD ALIGN=RIGHT><B>Product:</B></TD>
|
||||
<TD><SELECT NAME=product>" .
|
||||
make_options(\@::legal_product, $bug{'product'}) .
|
||||
"</SELECT></TD>
|
||||
<TD ALIGN=RIGHT><B>OS:</B></TD>
|
||||
<TD><SELECT NAME=op_sys>" .
|
||||
make_options(\@::legal_opsys, $bug{'op_sys'}) .
|
||||
"</SELECT><TD ALIGN=RIGHT><B>Reporter:</B></TD><TD>$bug{'reporter'}</TD>
|
||||
</TR><TR>
|
||||
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html\">Status:</A></B></TD>
|
||||
<TD>$bug{'bug_status'}</TD>
|
||||
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#priority\">Priority:</A></B></TD>
|
||||
<TD><SELECT NAME=priority>$priority_popup</SELECT></TD>
|
||||
<TD ALIGN=RIGHT><B>Cc:</B></TD>
|
||||
<TD> $cc_element </TD>
|
||||
</TR><TR>
|
||||
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html\">Resolution:</A></B></TD>
|
||||
<TD>$bug{'resolution'}</TD>
|
||||
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#severity\">Severity:</A></B></TD>
|
||||
<TD><SELECT NAME=bug_severity>$sev_popup</SELECT></TD>
|
||||
<TD ALIGN=RIGHT><B><A HREF=\"describecomponents.cgi?product=" .
|
||||
url_quote($bug{'product'}) . "\">Component:</A></B></TD>
|
||||
<TD><SELECT NAME=component>$component_popup</SELECT></TD>
|
||||
</TR><TR>
|
||||
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#assigned_to\">Assigned To:
|
||||
</A></B></TD>
|
||||
<TD>$bug{'assigned_to'}</TD>";
|
||||
|
||||
if (Param("usetargetmilestone")) {
|
||||
my $url = "";
|
||||
if (defined $::milestoneurl{$bug{'product'}}) {
|
||||
$url = $::milestoneurl{$bug{'product'}};
|
||||
}
|
||||
if ($url eq "") {
|
||||
$url = "notargetmilestone.html";
|
||||
}
|
||||
if ($bug{'target_milestone'} eq "") {
|
||||
$bug{'target_milestone'} = " ";
|
||||
}
|
||||
push(@::legal_target_milestone, " ");
|
||||
print "
|
||||
<TD ALIGN=RIGHT><A href=\"$url\"><B>Target Milestone:</B></A></TD>
|
||||
<TD><SELECT NAME=target_milestone>" .
|
||||
make_options(\@::legal_target_milestone,
|
||||
$bug{'target_milestone'}) .
|
||||
"</SELECT></TD>";
|
||||
}
|
||||
|
||||
print "
|
||||
</TR>";
|
||||
|
||||
if (Param("useqacontact")) {
|
||||
my $name = $bug{'qa_contact'} > 0 ? DBID_to_name($bug{'qa_contact'}) : "";
|
||||
print "
|
||||
<TR>
|
||||
<TD ALIGN=\"RIGHT\"><B>QA Contact:</B>
|
||||
<TD COLSPAN=6>
|
||||
<INPUT NAME=qa_contact VALUE=\"" .
|
||||
value_quote($name) .
|
||||
"\" SIZE=60></
|
||||
</TR>";
|
||||
}
|
||||
|
||||
|
||||
print "
|
||||
<TR>
|
||||
<TD ALIGN=\"RIGHT\">$URL
|
||||
<TD COLSPAN=6>
|
||||
<INPUT NAME=bug_file_loc VALUE=\"$bug{'bug_file_loc'}\" SIZE=60></TD>
|
||||
</TR><TR>
|
||||
<TD ALIGN=\"RIGHT\"><B>Summary:</B>
|
||||
<TD COLSPAN=6>
|
||||
<INPUT NAME=short_desc VALUE=\"" .
|
||||
value_quote($bug{'short_desc'}) .
|
||||
"\" SIZE=60></TD>
|
||||
</TR>";
|
||||
|
||||
if (Param("usestatuswhiteboard")) {
|
||||
print "
|
||||
<TR>
|
||||
<TD ALIGN=\"RIGHT\"><B>Status Whiteboard:</B>
|
||||
<TD COLSPAN=6>
|
||||
<INPUT NAME=status_whiteboard VALUE=\"" .
|
||||
value_quote($bug{'status_whiteboard'}) .
|
||||
"\" SIZE=60></
|
||||
</TR>";
|
||||
}
|
||||
|
||||
print "<tr><td align=right><B>Attachments:</b></td>\n";
|
||||
SendSQL("select attach_id, creation_ts, description from attachments where bug_id = $::FORM{'id'}");
|
||||
while (MoreSQLData()) {
|
||||
my ($id, $date, $desc) = (FetchSQLData());
|
||||
if ($date =~ /^(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/) {
|
||||
$date = "$3/$4/$2 $5:$6";
|
||||
}
|
||||
my $link = "showattachment.cgi?attach_id=$id";
|
||||
$desc = value_quote($desc);
|
||||
print qq{<td><a href="$link">$date</a></td><td colspan=4>$desc</td></tr><tr><td></td>};
|
||||
$knownattachments{$id} = 1;
|
||||
}
|
||||
print "<td colspan=6><a href=createattachment.cgi?id=$::FORM{'id'}>Create a new attachment</a> (proposed patch, testcase, etc.)</td></tr>\n";
|
||||
|
||||
|
||||
print "
|
||||
</TABLE>
|
||||
<br>
|
||||
<B>Additional Comments:</B>
|
||||
<BR>
|
||||
<TEXTAREA WRAP=HARD NAME=comment ROWS=5 COLS=80></TEXTAREA><BR>";
|
||||
|
||||
|
||||
if ($::usergroupset ne '0') {
|
||||
SendSQL("select bit, description, (bit & $bug{'groupset'} != 0) from groups where bit & $::usergroupset != 0 and isbuggroup != 0 order by bit");
|
||||
while (MoreSQLData()) {
|
||||
my ($bit, $description, $ison) = (FetchSQLData());
|
||||
my $check0 = !$ison ? " SELECTED" : "";
|
||||
my $check1 = $ison ? " SELECTED" : "";
|
||||
print "<select name=bit-$bit><option value=0$check0>\n";
|
||||
print "People not in the \"$description\" group can see this bug\n";
|
||||
print "<option value=1$check1>\n";
|
||||
print "Only people in the \"$description\" group can see this bug\n";
|
||||
print "</select><br>\n";
|
||||
}
|
||||
}
|
||||
|
||||
print "<br>
|
||||
<INPUT TYPE=radio NAME=knob VALUE=none CHECKED>
|
||||
Leave as <b>$bug{'bug_status'} $bug{'resolution'}</b><br>";
|
||||
|
||||
|
||||
# knum is which knob number we're generating, in javascript terms.
|
||||
|
||||
my $knum = 1;
|
||||
|
||||
my $status = $bug{'bug_status'};
|
||||
|
||||
if ($status eq "NEW" || $status eq "ASSIGNED" || $status eq "REOPENED") {
|
||||
if ($status ne "ASSIGNED") {
|
||||
print "<INPUT TYPE=radio NAME=knob VALUE=accept>";
|
||||
print "Accept bug (change status to <b>ASSIGNED</b>)<br>";
|
||||
$knum++;
|
||||
}
|
||||
if ($bug{'resolution'} ne "") {
|
||||
print "<INPUT TYPE=radio NAME=knob VALUE=clearresolution>\n";
|
||||
print "Clear the resolution (remove the current resolution of\n";
|
||||
print "<b>$bug{'resolution'}</b>)<br>\n";
|
||||
$knum++;
|
||||
}
|
||||
print "<INPUT TYPE=radio NAME=knob VALUE=resolve>
|
||||
Resolve bug, changing <A HREF=\"bug_status.html\">resolution</A> to
|
||||
<SELECT NAME=resolution
|
||||
ONCHANGE=\"document.changeform.knob\[$knum\].checked=true\">
|
||||
$resolution_popup</SELECT><br>\n";
|
||||
$knum++;
|
||||
print "<INPUT TYPE=radio NAME=knob VALUE=duplicate>
|
||||
Resolve bug, mark it as duplicate of bug #
|
||||
<INPUT NAME=dup_id SIZE=6 ONCHANGE=\"document.changeform.knob\[$knum\].checked=true\"><br>\n";
|
||||
$knum++;
|
||||
my $assign_element = "<INPUT NAME=assigned_to SIZE=32 ONCHANGE=\"document.changeform.knob\[$knum\].checked=true\" VALUE=$bug{'assigned_to'}>";
|
||||
|
||||
print "<INPUT TYPE=radio NAME=knob VALUE=reassign>
|
||||
<A HREF=\"bug_status.html#assigned_to\">Reassign</A> bug to
|
||||
$assign_element
|
||||
<br>\n";
|
||||
$knum++;
|
||||
print "<INPUT TYPE=radio NAME=knob VALUE=reassignbycomponent>
|
||||
Reassign bug to owner of selected component<br>\n";
|
||||
$knum++;
|
||||
} else {
|
||||
print "<INPUT TYPE=radio NAME=knob VALUE=reopen> Reopen bug<br>\n";
|
||||
$knum++;
|
||||
if ($status eq "RESOLVED") {
|
||||
print "<INPUT TYPE=radio NAME=knob VALUE=verify>
|
||||
Mark bug as <b>VERIFIED</b><br>\n";
|
||||
$knum++;
|
||||
}
|
||||
if ($status ne "CLOSED") {
|
||||
print "<INPUT TYPE=radio NAME=knob VALUE=close>
|
||||
Mark bug as <b>CLOSED</b><br>\n";
|
||||
$knum++;
|
||||
}
|
||||
}
|
||||
|
||||
print "
|
||||
<INPUT TYPE=\"submit\" VALUE=\"Commit\">
|
||||
<INPUT TYPE=\"reset\" VALUE=\"Reset\">
|
||||
<INPUT TYPE=hidden name=form_name VALUE=process_bug>
|
||||
<BR>
|
||||
<FONT size=\"+1\"><B>
|
||||
<A HREF=\"show_activity.cgi?id=$::FORM{'id'}\">View Bug Activity</A>
|
||||
<A HREF=\"long_list.cgi?buglist=$::FORM{'id'}\">Format For Printing</A>
|
||||
</B></FONT><BR>
|
||||
</FORM>
|
||||
<table><tr><td align=left><B>Description:</B></td><td width=100%> </td>
|
||||
<td align=right>Opened: $bug{'creation_ts'}</td></tr></table>
|
||||
<HR>
|
||||
<PRE>
|
||||
";
|
||||
print quoteUrls($bug{'long_desc'}, email=>1, urls=>1);
|
||||
print "
|
||||
</PRE>
|
||||
<HR>\n";
|
||||
|
||||
# To add back option of editing the long description, insert after the above
|
||||
# long_list.cgi line:
|
||||
# <A HREF=\"edit_desc.cgi?id=$::FORM{'id'}\">Edit Long Description</A>
|
||||
|
||||
|
||||
navigation_header();
|
||||
|
||||
print "</BODY>\n";
|
||||
|
||||
1;
|
||||
210
mozilla/webtools/bugzilla/bug_status.html
Executable file
210
mozilla/webtools/bugzilla/bug_status.html
Executable file
@@ -0,0 +1,210 @@
|
||||
<HTML>
|
||||
|
||||
<!--
|
||||
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 <terry@mozilla.org>
|
||||
-->
|
||||
|
||||
<TITLE>A Bug's Life Cycle</TITLE>
|
||||
|
||||
<h1 ALIGN=CENTER>A Bug's Life Cycle</h1>
|
||||
|
||||
The <B>status</B> and <B>resolution</B> field define and track the
|
||||
life cycle of a bug.
|
||||
|
||||
<p>
|
||||
<TABLE BORDER=1 CELLPADDING=4>
|
||||
|
||||
<TR ALIGN=CENTER VALIGN=TOP>
|
||||
<TD WIDTH=50%><H1>STATUS</H1> <TD><H1>RESOLUTION</H1>
|
||||
|
||||
<TR VALIGN=TOP>
|
||||
<TD>The <B>status</B> field indicates the general health of a bug. Only
|
||||
certain status transitions are allowed.
|
||||
<TD>The <b>resolution</b> field indicates what happened to this bug.
|
||||
|
||||
<TR VALIGN=TOP><TD>
|
||||
<DL><DT><B>NEW</B>
|
||||
<DD> This bug has recently been added to the assignee's list of bugs
|
||||
and must be processed. Bugs in this state may be accepted, and
|
||||
become <B>ASSIGNED</B>, passed on to someone else, and remain
|
||||
<B>NEW</B>, or resolved and marked <B>RESOLVED</B>.
|
||||
<DT><B>ASSIGNED</B>
|
||||
<DD> This bug is not yet resolved, but is assigned to the proper
|
||||
person. From here bugs can be given to another person and become
|
||||
<B>NEW</B>, or resolved and become <B>RESOLVED</B>.
|
||||
<DT><B>REOPENED</B>
|
||||
<DD>This bug was once resolved, but the resolution was deemed
|
||||
incorrect. For example, a <B>WORKSFORME</B> bug is
|
||||
<B>REOPENED</B> when more information shows up and the bug is now
|
||||
reproducible. From here bugs are either marked <B>ASSIGNED</B>
|
||||
or <B>RESOLVED</B>.
|
||||
</DL>
|
||||
<TD>
|
||||
<DL>
|
||||
<DD> No resolution yet. All bugs which are <B>NEW</B> or
|
||||
<B>ASSIGNED</B> have the resolution set to blank. All other bugs
|
||||
will be marked with one of the following resolutions.
|
||||
</DL>
|
||||
|
||||
<TR VALIGN=TOP><TD>
|
||||
<DL>
|
||||
<DT><B>RESOLVED</B>
|
||||
<DD> A resolution has been taken, and it is awaiting verification by
|
||||
QA. From here bugs are either re-opened and become
|
||||
<B>REOPENED</B>, are marked <B>VERIFIED</B>, or are closed for good
|
||||
and marked <B>CLOSED</B>.
|
||||
<DT><B>VERIFIED</B>
|
||||
<DD> QA has looked at the bug and the resolution and agrees that the
|
||||
appropriate resolution has been taken. Bugs remain in this state
|
||||
until the product they were reported against actually ship, at
|
||||
which point the become <B>CLOSED</B>.
|
||||
<DT><B>CLOSED</B>
|
||||
<DD> The bug is considered dead, the resolution is correct. Any zombie
|
||||
bugs who choose to walk the earth again must do so by becoming
|
||||
<B>REOPENED</B>.
|
||||
</DL>
|
||||
|
||||
<TD>
|
||||
<DL>
|
||||
<DT><B>FIXED</B>
|
||||
<DD> A fix for this bug is checked into the tree and tested.
|
||||
<DT><B>INVALID</B>
|
||||
<DD> The problem described is not a bug
|
||||
<DT><B>WONTFIX</B>
|
||||
<DD> The problem described is a bug which will never be fixed.
|
||||
<DT><B>LATER</B>
|
||||
<DD> The problem described is a bug which will not be fixed in this
|
||||
version of the product.
|
||||
<DT><B>REMIND</B>
|
||||
<DD> The problem described is a bug which will probably not be fixed in this
|
||||
version of the product, but might still be.
|
||||
<DT><B>DUPLICATE</B>
|
||||
<DD> The problem is a duplicate of an existing bug. Marking a bug
|
||||
duplicate requires the bug# of the duplicating bug and will at
|
||||
least put that bug number in the description field.
|
||||
<DT><B>WORKSFORME</B>
|
||||
<DD> All attempts at reproducing this bug were futile, reading the
|
||||
code produces no clues as to why this behavior would occur. If
|
||||
more information appears later, please re-assign the bug, for
|
||||
now, file it.
|
||||
</DL>
|
||||
</TABLE>
|
||||
|
||||
<H1>Other Fields</H1>
|
||||
|
||||
<table border=1 cellpadding=4><tr><td>
|
||||
<a name="severity"><h2>Severity</h2></a>
|
||||
|
||||
This field describes the impact of a bug.
|
||||
|
||||
<p>
|
||||
<p>
|
||||
|
||||
<table>
|
||||
<tr><th>Critical</th><td>crashes, loss of data, severe memory leak
|
||||
<tr><th>Major</th><td>major loss of function
|
||||
<tr><th>Minor</th><td>minor loss of function, or other problem where easy workaround is present
|
||||
<tr><th>Trivial</th><td>cosmetic problem like misspelt words or misaligned text
|
||||
<tr><th>Enhancement</th><td>Request for enhancement
|
||||
</table>
|
||||
|
||||
</td><td>
|
||||
|
||||
<a name="priority"><h2>Priority</h2></a>
|
||||
|
||||
This field describes the importance and order in which a bug should be
|
||||
fixed. This field is utilized by the programmers/engineers to
|
||||
prioritized their work to be done. The available priorities are:
|
||||
|
||||
<p>
|
||||
<p>
|
||||
|
||||
<table>
|
||||
<tr><th>P1</th><td>Most important
|
||||
<tr><th>P2</th><td>
|
||||
<tr><th>P3</th><td>
|
||||
<tr><th>P4</th><td>
|
||||
<tr><th>P5</th><td>Least important
|
||||
</table>
|
||||
</tr></table>
|
||||
|
||||
|
||||
<a name="area"><h2>Area</h2></a>
|
||||
This is the general area which is covered by the bug report. This allows
|
||||
bugs to migrate over to testing, but not show up on the "daily bug list".
|
||||
Most bugs should have area set to <B>CODE</B>. Legal values include:
|
||||
<UL>
|
||||
<LI> CODE
|
||||
<LI> JAVA
|
||||
<LI> TEST
|
||||
<LI> UI
|
||||
<LI> BUILD
|
||||
<LI> PERF
|
||||
<LI> i18n <i>(internationalization)</i>
|
||||
<LI> l10n <i>(localization)</i>
|
||||
</UL>
|
||||
<a name="rep_platform"><h2>Platform</h2></a>
|
||||
This is the hardware platform against which the bug was reported. Legal
|
||||
platforms include:
|
||||
|
||||
<UL>
|
||||
<LI> All (happens on all platform; cross-platform bug)
|
||||
<LI> Macintosh
|
||||
<LI> PC
|
||||
<LI> Sun
|
||||
<LI> HP
|
||||
</UL>
|
||||
|
||||
<b>Note:</b> Selecting the option "All" does not select bugs assigned against all platforms. It
|
||||
merely selects bugs that <b>occur</b> on all platforms.
|
||||
|
||||
<a name="op_sys"><h2>Operating System</h2></a>
|
||||
This is the operating system against which the bug was reported. Legal
|
||||
operating systems include:
|
||||
|
||||
<UL>
|
||||
<LI> All (happens on all operating systems; cross-platform bug)
|
||||
<LI> Windows 95
|
||||
<LI> Mac System 8.0
|
||||
<LI> Linux
|
||||
</UL>
|
||||
|
||||
Note that the operating system implies the platform, but not always.
|
||||
For example, Linux can run on PC and Macintosh and others.
|
||||
|
||||
<a name="assigned_to"><h2>Assigned To</h2></a>
|
||||
|
||||
This is the person in charge of resolving the bug. Every time this
|
||||
field changes, the status changes to <B>NEW</B> to make it easy to see
|
||||
which new bugs have appeared on a person's list.
|
||||
|
||||
<p><A HREF="http://www.mozilla.org/owners.html">List of module owners.</a>
|
||||
<p>
|
||||
|
||||
|
||||
The default status for queries is set to NEW, ASSIGNED and REOPENED. When
|
||||
searching for bugs that have been resolved or verified, remember to set the
|
||||
status field appropriately.
|
||||
|
||||
<hr>
|
||||
<address><a href="http://home.netscape.com/people/terry/">Terry Weissman <terry@netscape.com></a></address>
|
||||
<!-- hhmts start -->
|
||||
Last modified: Mon Mar 8 18:31:07 1999
|
||||
<!-- hhmts end -->
|
||||
</body> </html>
|
||||
800
mozilla/webtools/bugzilla/buglist.cgi
Executable file
800
mozilla/webtools/bugzilla/buglist.cgi
Executable file
@@ -0,0 +1,800 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
use Date::Parse;
|
||||
|
||||
my $serverpush = 1;
|
||||
|
||||
if ($ENV{'HTTP_USER_AGENT'} =~ /MSIE/) {
|
||||
# Internet explorer doesn't seem to understand server push. What fun.
|
||||
$serverpush = 0;
|
||||
}
|
||||
|
||||
if ($serverpush) {
|
||||
print "Content-type: multipart/x-mixed-replace;boundary=thisrandomstring\n";
|
||||
print "\n";
|
||||
print "--thisrandomstring\n";
|
||||
}
|
||||
|
||||
# Shut up misguided -w warnings about "used only once":
|
||||
|
||||
use vars @::legal_platform,
|
||||
@::versions,
|
||||
@::legal_product,
|
||||
%::MFORM,
|
||||
@::components,
|
||||
@::legal_severity,
|
||||
@::legal_priority,
|
||||
@::default_column_list,
|
||||
@::legal_resolution_no_dup,
|
||||
@::legal_target_milestone;
|
||||
|
||||
|
||||
|
||||
ConnectToDatabase();
|
||||
|
||||
if (!defined $::FORM{'cmdtype'}) {
|
||||
# This can happen if there's an old bookmark to a query...
|
||||
$::FORM{'cmdtype'} = 'doit';
|
||||
}
|
||||
|
||||
|
||||
CMD: for ($::FORM{'cmdtype'}) {
|
||||
/^runnamed$/ && do {
|
||||
$::buffer = $::COOKIE{"QUERY_" . $::FORM{"namedcmd"}};
|
||||
ProcessFormFields($::buffer);
|
||||
last CMD;
|
||||
};
|
||||
/^editnamed$/ && do {
|
||||
my $url = "query.cgi?" . $::COOKIE{"QUERY_" . $::FORM{"namedcmd"}};
|
||||
print "Content-type: text/html
|
||||
Refresh: 0; URL=$url
|
||||
|
||||
<TITLE>What a hack.</TITLE>
|
||||
Loading your query named <B>$::FORM{'namedcmd'}</B>...";
|
||||
exit;
|
||||
};
|
||||
/^forgetnamed$/ && do {
|
||||
print "Set-Cookie: QUERY_" . $::FORM{'namedcmd'} . "= ; path=/ ; expires=Sun, 30-Jun-2029 00:00:00 GMT
|
||||
Content-type: text/html
|
||||
|
||||
<HTML>
|
||||
<TITLE>Forget what?</TITLE>
|
||||
OK, the <B>$::FORM{'namedcmd'}</B> query is gone.
|
||||
<P>
|
||||
<A HREF=query.cgi>Go back to the query page.</A>";
|
||||
exit;
|
||||
};
|
||||
/^asnamed$/ && do {
|
||||
if ($::FORM{'newqueryname'} =~ /^[a-zA-Z0-9_ ]+$/) {
|
||||
print "Set-Cookie: QUERY_" . $::FORM{'newqueryname'} . "=$::buffer ; path=/ ; expires=Sun, 30-Jun-2029 00:00:00 GMT
|
||||
Content-type: text/html
|
||||
|
||||
<HTML>
|
||||
<TITLE>OK, done.</TITLE>
|
||||
OK, you now have a new query named <B>$::FORM{'newqueryname'}</B>.
|
||||
|
||||
<P>
|
||||
|
||||
<A HREF=query.cgi>Go back to the query page.</A>";
|
||||
} else {
|
||||
print "Content-type: text/html
|
||||
|
||||
<HTML>
|
||||
<TITLE>Picky, picky.</TITLE>
|
||||
Query names can only have letters, digits, spaces, or underbars. You entered
|
||||
\"<B>$::FORM{'newqueryname'}</B>\", which doesn't cut it.
|
||||
<P>
|
||||
Click the <B>Back</B> button and type in a valid name for this query.";
|
||||
}
|
||||
exit;
|
||||
};
|
||||
/^asdefault$/ && do {
|
||||
print "Set-Cookie: DEFAULTQUERY=$::buffer ; path=/ ; expires=Sun, 30-Jun-2029 00:00:00 GMT
|
||||
Content-type: text/html
|
||||
|
||||
<HTML>
|
||||
<TITLE>OK, default is set.</TITLE>
|
||||
OK, you now have a new default query.
|
||||
|
||||
<P>
|
||||
|
||||
<A HREF=query.cgi>Go back to the query page, using the new default.</A>";
|
||||
exit;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
sub DefCol {
|
||||
my ($name, $k, $t, $s, $q) = (@_);
|
||||
|
||||
$::key{$name} = $k;
|
||||
$::title{$name} = $t;
|
||||
if (defined $s && $s ne "") {
|
||||
$::sortkey{$name} = $s;
|
||||
}
|
||||
if (!defined $q || $q eq "") {
|
||||
$q = 0;
|
||||
}
|
||||
$::needquote{$name} = $q;
|
||||
}
|
||||
|
||||
DefCol("opendate", "date_format(bugs.creation_ts,'Y-m-d')", "Opened",
|
||||
"bugs.creation_ts");
|
||||
DefCol("changeddate", "date_format(bugs.delta_ts,'Y-m-d')", "Changed",
|
||||
"bugs.delta_ts");
|
||||
DefCol("severity", "substring(bugs.bug_severity, 1, 3)", "Sev",
|
||||
"bugs.bug_severity");
|
||||
DefCol("priority", "substring(bugs.priority, 1, 3)", "Pri", "bugs.priority");
|
||||
DefCol("platform", "substring(bugs.rep_platform, 1, 3)", "Plt",
|
||||
"bugs.rep_platform");
|
||||
DefCol("owner", "assign.login_name", "Owner", "assign.login_name");
|
||||
DefCol("reporter", "report.login_name", "Reporter", "report.login_name");
|
||||
DefCol("qa_contact", "qacont.login_name", "QAContact", "qacont.login_name");
|
||||
DefCol("status", "substring(bugs.bug_status,1,4)", "State", "bugs.bug_status");
|
||||
DefCol("resolution", "substring(bugs.resolution,1,4)", "Result",
|
||||
"bugs.resolution");
|
||||
DefCol("summary", "substring(bugs.short_desc, 1, 60)", "Summary", "", 1);
|
||||
DefCol("summaryfull", "bugs.short_desc", "Summary", "", 1);
|
||||
DefCol("status_whiteboard", "bugs.status_whiteboard", "StatusSummary", "", 1);
|
||||
DefCol("component", "substring(bugs.component, 1, 8)", "Comp",
|
||||
"bugs.component");
|
||||
DefCol("product", "substring(bugs.product, 1, 8)", "Product", "bugs.product");
|
||||
DefCol("version", "substring(bugs.version, 1, 5)", "Vers", "bugs.version");
|
||||
DefCol("os", "substring(bugs.op_sys, 1, 4)", "OS", "bugs.op_sys");
|
||||
DefCol("target_milestone", "bugs.target_milestone", "TargetM",
|
||||
"bugs.target_milestone");
|
||||
|
||||
my @collist;
|
||||
if (defined $::COOKIE{'COLUMNLIST'}) {
|
||||
@collist = split(/ /, $::COOKIE{'COLUMNLIST'});
|
||||
} else {
|
||||
@collist = @::default_column_list;
|
||||
}
|
||||
|
||||
my $dotweak = defined $::FORM{'tweak'};
|
||||
|
||||
if ($dotweak) {
|
||||
confirm_login();
|
||||
} else {
|
||||
quietly_check_login();
|
||||
}
|
||||
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
my $query = "select bugs.bug_id, bugs.groupset";
|
||||
|
||||
|
||||
foreach my $c (@collist) {
|
||||
if (exists $::needquote{$c}) {
|
||||
$query .= ",
|
||||
\t$::key{$c}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($dotweak) {
|
||||
$query .= ",
|
||||
bugs.product,
|
||||
bugs.bug_status";
|
||||
}
|
||||
|
||||
|
||||
$query .= "
|
||||
from bugs,
|
||||
profiles assign,
|
||||
profiles report
|
||||
left join profiles qacont on bugs.qa_contact = qacont.userid,
|
||||
versions projector
|
||||
where bugs.assigned_to = assign.userid
|
||||
and bugs.reporter = report.userid
|
||||
and bugs.product = projector.program
|
||||
and bugs.version = projector.value
|
||||
and bugs.groupset & $::usergroupset = bugs.groupset
|
||||
";
|
||||
|
||||
if ((defined $::FORM{'emailcc1'} && $::FORM{'emailcc1'}) ||
|
||||
(defined $::FORM{'emailcc2'} && $::FORM{'emailcc2'})) {
|
||||
|
||||
# We need to poke into the CC table. Do weird SQL left join stuff so that
|
||||
# we can look in the CC table, but won't reject any bugs that don't have
|
||||
# any CC fields.
|
||||
$query =~ s/bugs,/bugs left join cc using (bug_id) left join profiles ccname on cc.who = ccname.userid,/;
|
||||
}
|
||||
|
||||
if (defined $::FORM{'sql'}) {
|
||||
$query .= "and (\n$::FORM('sql')\n)"
|
||||
} else {
|
||||
my @legal_fields = ("bug_id", "product", "version", "rep_platform", "op_sys",
|
||||
"bug_status", "resolution", "priority", "bug_severity",
|
||||
"assigned_to", "reporter", "component",
|
||||
"target_milestone");
|
||||
|
||||
foreach my $field (keys %::FORM) {
|
||||
my $or = "";
|
||||
if (lsearch(\@legal_fields, $field) != -1 && $::FORM{$field} ne "") {
|
||||
$query .= "\tand (\n";
|
||||
if ($field eq "assigned_to" || $field eq "reporter") {
|
||||
foreach my $p (split(/,/, $::FORM{$field})) {
|
||||
my $whoid = DBNameToIdAndCheck($p);
|
||||
$query .= "\t\t${or}bugs.$field = $whoid\n";
|
||||
$or = "or ";
|
||||
}
|
||||
} else {
|
||||
my $ref = $::MFORM{$field};
|
||||
foreach my $v (@$ref) {
|
||||
if ($v eq "(empty)") {
|
||||
$query .= "\t\t${or}bugs.$field is null\n";
|
||||
} else {
|
||||
if ($v eq "---") {
|
||||
$query .= "\t\t${or}bugs.$field = ''\n";
|
||||
} else {
|
||||
$query .= "\t\t${or}bugs.$field = " . SqlQuote($v) .
|
||||
"\n";
|
||||
}
|
||||
}
|
||||
$or = "or ";
|
||||
}
|
||||
}
|
||||
$query .= "\t)\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach my $id ("1", "2") {
|
||||
if (!defined ($::FORM{"email$id"})) {
|
||||
next;
|
||||
}
|
||||
my $email = trim($::FORM{"email$id"});
|
||||
if ($email eq "") {
|
||||
next;
|
||||
}
|
||||
my $qemail = SqlQuote($email);
|
||||
my $type = $::FORM{"emailtype$id"};
|
||||
my $emailid;
|
||||
if ($type eq "exact") {
|
||||
$emailid = DBNameToIdAndCheck($email);
|
||||
}
|
||||
|
||||
my $foundone = 0;
|
||||
my $lead= "and (\n";
|
||||
foreach my $field ("assigned_to", "reporter", "cc", "qa_contact") {
|
||||
my $doit = $::FORM{"email$field$id"};
|
||||
if (!$doit) {
|
||||
next;
|
||||
}
|
||||
$foundone = 1;
|
||||
my $table;
|
||||
if ($field eq "assigned_to") {
|
||||
$table = "assign";
|
||||
} elsif ($field eq "reporter") {
|
||||
$table = "report";
|
||||
} elsif ($field eq "qa_contact") {
|
||||
$table = "qacont";
|
||||
} else {
|
||||
$table = "ccname";
|
||||
}
|
||||
if ($type eq "exact") {
|
||||
if ($field eq "cc") {
|
||||
$query .= "\t$lead cc.who = $emailid\n";
|
||||
} else {
|
||||
$query .= "\t$lead $field = $emailid\n";
|
||||
}
|
||||
} elsif ($type eq "regexp") {
|
||||
$query .= "\t$lead $table.login_name regexp $qemail\n";
|
||||
} elsif ($type eq "notregexp") {
|
||||
$query .= "\t$lead $table.login_name not regexp $qemail\n";
|
||||
} else {
|
||||
$query .= "\t$lead instr($table.login_name, $qemail)\n";
|
||||
}
|
||||
$lead = " or ";
|
||||
}
|
||||
if (!$foundone) {
|
||||
print "You must specify one or more fields in which to search for <tt>$email</tt>.\n";
|
||||
exit;
|
||||
}
|
||||
if ($lead eq " or ") {
|
||||
$query .= ")\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (defined $::FORM{'changedin'}) {
|
||||
my $c = trim($::FORM{'changedin'});
|
||||
if ($c ne "") {
|
||||
if ($c !~ /^[0-9]*$/) {
|
||||
print "
|
||||
The 'changed in last ___ days' field must be a simple number. You entered
|
||||
\"$c\", which doesn't cut it.
|
||||
<P>
|
||||
Click the <B>Back</B> button and try again.";
|
||||
exit;
|
||||
}
|
||||
$query .= "and to_days(now()) - to_days(bugs.delta_ts) <= $c ";
|
||||
}
|
||||
}
|
||||
|
||||
my $ref = $::MFORM{'chfield'};
|
||||
|
||||
|
||||
sub SqlifyDate {
|
||||
my ($str) = (@_);
|
||||
if (!defined $str) {
|
||||
$str = "";
|
||||
}
|
||||
my $date = str2time($str);
|
||||
if (!defined $date) {
|
||||
print "The string '<tt>$str</tt>' is not a legal date.\n";
|
||||
print "<P>Please click the <B>Back</B> button and try again.\n";
|
||||
exit;
|
||||
}
|
||||
return time2str("'%Y/%m/%d %H:%M:%S'", $date);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (defined $ref && 0 < @$ref) {
|
||||
# Do surgery on the query to tell it to patch in the bugs_activity
|
||||
# table.
|
||||
$query =~ s/bugs,/bugs, bugs_activity,/;
|
||||
|
||||
my @list;
|
||||
foreach my $f (@$ref) {
|
||||
push(@list, "\nbugs_activity.field = " . SqlQuote($f));
|
||||
}
|
||||
$query .= "and bugs_activity.bug_id = bugs.bug_id and (" .
|
||||
join(' or ', @list) . ") ";
|
||||
$query .= "and bugs_activity.when >= " .
|
||||
SqlifyDate($::FORM{'chfieldfrom'}) . "\n";
|
||||
my $to = $::FORM{'chfieldto'};
|
||||
if (defined $to) {
|
||||
$to = trim($to);
|
||||
if ($to ne "" && $to !~ /^now$/i) {
|
||||
$query .= "and bugs_activity.when <= " . SqlifyDate($to) . "\n";
|
||||
}
|
||||
}
|
||||
my $value = $::FORM{'chfieldvalue'};
|
||||
if (defined $value) {
|
||||
$value = trim($value);
|
||||
if ($value ne "") {
|
||||
$query .= "and bugs_activity.newvalue = " .
|
||||
SqlQuote($value) . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach my $f ("short_desc", "long_desc", "bug_file_loc",
|
||||
"status_whiteboard") {
|
||||
if (defined $::FORM{$f}) {
|
||||
my $s = trim($::FORM{$f});
|
||||
if ($s ne "") {
|
||||
$s = SqlQuote($s);
|
||||
if ($::FORM{$f . "_type"} eq "regexp") {
|
||||
$query .= "and $f regexp $s\n";
|
||||
} else {
|
||||
$query .= "and instr($f, $s)\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (defined $::FORM{'order'} && $::FORM{'order'} ne "") {
|
||||
$query .= "order by ";
|
||||
ORDER: for ($::FORM{'order'}) {
|
||||
/\./ && do {
|
||||
# This (hopefully) already has fieldnames in it, so we're done.
|
||||
last ORDER;
|
||||
};
|
||||
/Number/ && do {
|
||||
$::FORM{'order'} = "bugs.bug_id";
|
||||
last ORDER;
|
||||
};
|
||||
/Import/ && do {
|
||||
$::FORM{'order'} = "bugs.priority, bugs.bug_severity";
|
||||
last ORDER;
|
||||
};
|
||||
/Assign/ && do {
|
||||
$::FORM{'order'} = "assign.login_name, bugs.bug_status, priority, bugs.bug_id";
|
||||
last ORDER;
|
||||
};
|
||||
# DEFAULT
|
||||
$::FORM{'order'} = "bugs.bug_status, priorities.rank, assign.login_name, bugs.bug_id";
|
||||
}
|
||||
$query .= $::FORM{'order'};
|
||||
}
|
||||
|
||||
if ($serverpush) {
|
||||
print "Please stand by ... <p>\n";
|
||||
if (defined $::FORM{'debug'}) {
|
||||
print "<pre>$query</pre>\n";
|
||||
}
|
||||
}
|
||||
|
||||
SendSQL($query);
|
||||
|
||||
my $count = 0;
|
||||
$::bugl = "";
|
||||
sub pnl {
|
||||
my ($str) = (@_);
|
||||
$::bugl .= $str;
|
||||
}
|
||||
|
||||
my $fields = $::buffer;
|
||||
$fields =~ s/[&?]order=[^&]*//g;
|
||||
$fields =~ s/[&?]cmdtype=[^&]*//g;
|
||||
|
||||
|
||||
my $oldorder;
|
||||
|
||||
if (defined $::FORM{'order'} && trim($::FORM{'order'}) ne "") {
|
||||
$oldorder = url_quote(", $::FORM{'order'}");
|
||||
} else {
|
||||
$oldorder = "";
|
||||
}
|
||||
|
||||
if ($dotweak) {
|
||||
pnl "<FORM NAME=changeform METHOD=POST ACTION=\"process_bug.cgi\">";
|
||||
}
|
||||
|
||||
my $tablestart = "<TABLE CELLSPACING=0 CELLPADDING=2>
|
||||
<TR ALIGN=LEFT><TH>
|
||||
<A HREF=\"buglist.cgi?$fields&order=bugs.bug_id\">ID</A>";
|
||||
|
||||
|
||||
foreach my $c (@collist) {
|
||||
if (exists $::needquote{$c}) {
|
||||
if ($::needquote{$c}) {
|
||||
$tablestart .= "<TH WIDTH=100% valign=left>";
|
||||
} else {
|
||||
$tablestart .= "<TH valign=left>";
|
||||
}
|
||||
if (defined $::sortkey{$c}) {
|
||||
$tablestart .= "<A HREF=\"buglist.cgi?$fields&order=$::sortkey{$c}$oldorder\">$::title{$c}</A>";
|
||||
} else {
|
||||
$tablestart .= $::title{$c};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$tablestart .= "\n";
|
||||
|
||||
|
||||
my @row;
|
||||
my %seen;
|
||||
my @bugarray;
|
||||
my %prodhash;
|
||||
my %statushash;
|
||||
my $buggroupset = "";
|
||||
|
||||
while (@row = FetchSQLData()) {
|
||||
my $bug_id = shift @row;
|
||||
my $g = shift @row; # Bug's group set.
|
||||
if ($buggroupset eq "") {
|
||||
$buggroupset = $g;
|
||||
} elsif ($buggroupset ne $g) {
|
||||
$buggroupset = "x"; # We only play games with tweaking the
|
||||
# buggroupset if all the bugs have exactly
|
||||
# the same group. If they don't, we leave
|
||||
# it alone.
|
||||
}
|
||||
if (!defined $seen{$bug_id}) {
|
||||
$seen{$bug_id} = 1;
|
||||
$count++;
|
||||
if ($count % 200 == 0) {
|
||||
# Too big tables take too much browser memory...
|
||||
pnl "</TABLE>$tablestart";
|
||||
}
|
||||
push @bugarray, $bug_id;
|
||||
pnl "<TR VALIGN=TOP ALIGN=LEFT><TD>";
|
||||
if ($dotweak) {
|
||||
pnl "<input type=checkbox name=id_$bug_id>";
|
||||
}
|
||||
pnl "<A HREF=\"show_bug.cgi?id=$bug_id\">";
|
||||
pnl "$bug_id</A> ";
|
||||
foreach my $c (@collist) {
|
||||
if (!exists $::needquote{$c}) {
|
||||
next;
|
||||
}
|
||||
my $value = shift @row;
|
||||
my $nowrap = "";
|
||||
|
||||
if ($::needquote{$c}) {
|
||||
$value = html_quote($value);
|
||||
} else {
|
||||
$value = "<nobr>$value</nobr>";
|
||||
}
|
||||
pnl "<td $nowrap>$value";
|
||||
}
|
||||
if ($dotweak) {
|
||||
my $value = shift @row;
|
||||
$prodhash{$value} = 1;
|
||||
$value = shift @row;
|
||||
$statushash{$value} = 1;
|
||||
}
|
||||
pnl "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $buglist = join(":", @bugarray);
|
||||
|
||||
|
||||
if ($serverpush) {
|
||||
print "\n";
|
||||
print "--thisrandomstring\n";
|
||||
}
|
||||
|
||||
|
||||
my $toolong = 0;
|
||||
print "Content-type: text/html\n";
|
||||
if (length($buglist) < 4000) {
|
||||
print "Set-Cookie: BUGLIST=$buglist\n";
|
||||
} else {
|
||||
print "Set-Cookie: BUGLIST=\n";
|
||||
$toolong = 1;
|
||||
}
|
||||
|
||||
print "\n";
|
||||
|
||||
PutHeader("Bug List");
|
||||
|
||||
print "
|
||||
<CENTER>
|
||||
<B>" . time2str("%a %b %e %T %Z %Y", time()) . "</B>";
|
||||
|
||||
if (defined $::FORM{'debug'}) {
|
||||
print "<PRE>$query</PRE>\n";
|
||||
}
|
||||
|
||||
if ($toolong) {
|
||||
print "<h2>This list is too long for bugzilla's little mind; the\n";
|
||||
print "Next/Prev/First/Last buttons won't appear.</h2>\n";
|
||||
}
|
||||
|
||||
# This is stupid. We really really need to move the quip list into the DB!
|
||||
|
||||
my $quip;
|
||||
if (open (COMMENTS, "<data/comments")) {
|
||||
my @cdata;
|
||||
while (<COMMENTS>) {
|
||||
push @cdata, $_;
|
||||
}
|
||||
close COMMENTS;
|
||||
$quip = $cdata[int(rand($#cdata + 1))];
|
||||
} else {
|
||||
$quip = "Bugzilla would like to put a random quip here, but nobody has entered any.";
|
||||
}
|
||||
|
||||
|
||||
print "<HR><I><A HREF=newquip.html>$quip\n";
|
||||
print "</I></A></CENTER>\n";
|
||||
print "<HR SIZE=10>$tablestart\n";
|
||||
print $::bugl;
|
||||
print "</TABLE>\n";
|
||||
|
||||
if ($count == 0) {
|
||||
print "Zarro Boogs found.\n";
|
||||
} elsif ($count == 1) {
|
||||
print "One bug found.\n";
|
||||
} else {
|
||||
print "$count bugs found.\n";
|
||||
}
|
||||
|
||||
if ($dotweak) {
|
||||
GetVersionTable();
|
||||
print "
|
||||
<SCRIPT>
|
||||
numelements = document.changeform.elements.length;
|
||||
function SetCheckboxes(value) {
|
||||
for (var i=0 ; i<numelements ; i++) {
|
||||
item = document.changeform.elements\[i\];
|
||||
item.checked = value;
|
||||
}
|
||||
}
|
||||
document.write(\" <input type=button value=\\\"Uncheck All\\\" onclick=\\\"SetCheckboxes(false);\\\"> <input type=button value=\\\"Check All\\\" onclick=\\\"SetCheckboxes(true);\\\">\");
|
||||
</SCRIPT>";
|
||||
my $resolution_popup = make_options(\@::legal_resolution_no_dup, "FIXED");
|
||||
my @prod_list = keys %prodhash;
|
||||
my @list = @prod_list;
|
||||
my @legal_versions;
|
||||
my @legal_component;
|
||||
if (1 == @prod_list) {
|
||||
@legal_versions = @{$::versions{$prod_list[0]}};
|
||||
@legal_component = @{$::components{$prod_list[0]}};
|
||||
}
|
||||
|
||||
my $version_popup = make_options(\@legal_versions, $::dontchange);
|
||||
my $platform_popup = make_options(\@::legal_platform, $::dontchange);
|
||||
my $priority_popup = make_options(\@::legal_priority, $::dontchange);
|
||||
my $sev_popup = make_options(\@::legal_severity, $::dontchange);
|
||||
my $component_popup = make_options(\@legal_component, $::dontchange);
|
||||
my $product_popup = make_options(\@::legal_product, $::dontchange);
|
||||
|
||||
|
||||
print "
|
||||
<hr>
|
||||
<TABLE>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT><B>Product:</B></TD>
|
||||
<TD><SELECT NAME=product>$product_popup</SELECT></TD>
|
||||
<TD ALIGN=RIGHT><B>Version:</B></TD>
|
||||
<TD><SELECT NAME=version>$version_popup</SELECT></TD>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#rep_platform\">Platform:</A></B></TD>
|
||||
<TD><SELECT NAME=rep_platform>$platform_popup</SELECT></TD>
|
||||
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#priority\">Priority:</A></B></TD>
|
||||
<TD><SELECT NAME=priority>$priority_popup</SELECT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT><B>Component:</B></TD>
|
||||
<TD><SELECT NAME=component>$component_popup</SELECT></TD>
|
||||
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#severity\">Severity:</A></B></TD>
|
||||
<TD><SELECT NAME=bug_severity>$sev_popup</SELECT></TD>
|
||||
</TR>";
|
||||
|
||||
if (Param("usetargetmilestone")) {
|
||||
push(@::legal_target_milestone, " ");
|
||||
my $tfm_popup = make_options(\@::legal_target_milestone,
|
||||
$::dontchange);
|
||||
print "
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT><B>Target milestone:</B></TD>
|
||||
<TD><SELECT NAME=target_milestone>$tfm_popup</SELECT></TD>
|
||||
</TR>";
|
||||
}
|
||||
|
||||
if (Param("useqacontact")) {
|
||||
print "
|
||||
<TR>
|
||||
<TD><B>QA Contact:</B></TD>
|
||||
<TD COLSPAN=3><INPUT NAME=qa_contact SIZE=32 VALUE=\"" .
|
||||
value_quote($::dontchange) . "\"></TD>
|
||||
</TR>";
|
||||
}
|
||||
|
||||
|
||||
print "
|
||||
</TABLE>
|
||||
|
||||
<INPUT NAME=multiupdate value=Y TYPE=hidden>
|
||||
|
||||
<B>Additional Comments:</B>
|
||||
<BR>
|
||||
<TEXTAREA WRAP=HARD NAME=comment ROWS=5 COLS=80></TEXTAREA><BR>";
|
||||
|
||||
if ($::usergroupset ne '0' && $buggroupset =~ /^\d*$/) {
|
||||
SendSQL("select bit, description, (bit & $buggroupset != 0) from groups where bit & $::usergroupset != 0 and isbuggroup != 0 order by bit");
|
||||
while (MoreSQLData()) {
|
||||
my ($bit, $description, $ison) = (FetchSQLData());
|
||||
my $check0 = !$ison ? " SELECTED" : "";
|
||||
my $check1 = $ison ? " SELECTED" : "";
|
||||
print "<select name=bit-$bit><option value=0$check0>\n";
|
||||
print "People not in the \"$description\" group can see these bugs\n";
|
||||
print "<option value=1$check1>\n";
|
||||
print "Only people in the \"$description\" group can see these bugs\n";
|
||||
print "</select><br>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
# knum is which knob number we're generating, in javascript terms.
|
||||
|
||||
my $knum = 0;
|
||||
print "
|
||||
<INPUT TYPE=radio NAME=knob VALUE=none CHECKED>
|
||||
Do nothing else<br>";
|
||||
$knum++;
|
||||
print "
|
||||
<INPUT TYPE=radio NAME=knob VALUE=accept>
|
||||
Accept bugs (change status to <b>ASSIGNED</b>)<br>";
|
||||
$knum++;
|
||||
if (!defined $statushash{'CLOSED'} &&
|
||||
!defined $statushash{'VERIFIED'} &&
|
||||
!defined $statushash{'RESOLVED'}) {
|
||||
print "
|
||||
<INPUT TYPE=radio NAME=knob VALUE=clearresolution>
|
||||
Clear the resolution<br>";
|
||||
$knum++;
|
||||
print "
|
||||
<INPUT TYPE=radio NAME=knob VALUE=resolve>
|
||||
Resolve bugs, changing <A HREF=\"bug_status.html\">resolution</A> to
|
||||
<SELECT NAME=resolution
|
||||
ONCHANGE=\"document.changeform.knob\[$knum\].checked=true\">
|
||||
$resolution_popup</SELECT><br>";
|
||||
$knum++;
|
||||
}
|
||||
if (!defined $statushash{'NEW'} &&
|
||||
!defined $statushash{'ASSIGNED'} &&
|
||||
!defined $statushash{'REOPENED'}) {
|
||||
print "
|
||||
<INPUT TYPE=radio NAME=knob VALUE=reopen> Reopen bugs<br>";
|
||||
$knum++;
|
||||
}
|
||||
my @statuskeys = keys %statushash;
|
||||
if ($#statuskeys == 1) {
|
||||
if (defined $statushash{'RESOLVED'}) {
|
||||
print "
|
||||
<INPUT TYPE=radio NAME=knob VALUE=verify>
|
||||
Mark bugs as <b>VERIFIED</b><br>";
|
||||
$knum++;
|
||||
}
|
||||
if (defined $statushash{'VERIFIED'}) {
|
||||
print "
|
||||
<INPUT TYPE=radio NAME=knob VALUE=close>
|
||||
Mark bugs as <b>CLOSED</b><br>";
|
||||
$knum++;
|
||||
}
|
||||
}
|
||||
print "
|
||||
<INPUT TYPE=radio NAME=knob VALUE=reassign>
|
||||
<A HREF=\"bug_status.html#assigned_to\">Reassign</A> bugs to
|
||||
<INPUT NAME=assigned_to SIZE=32
|
||||
ONCHANGE=\"document.changeform.knob\[$knum\].checked=true\"
|
||||
VALUE=\"$::COOKIE{'Bugzilla_login'}\"><br>";
|
||||
$knum++;
|
||||
print "<INPUT TYPE=radio NAME=knob VALUE=reassignbycomponent>
|
||||
Reassign bugs to owner of selected component<br>";
|
||||
$knum++;
|
||||
|
||||
print "
|
||||
<p>
|
||||
<font size=-1>
|
||||
To make changes to a bunch of bugs at once:
|
||||
<ol>
|
||||
<li> Put check boxes next to the bugs you want to change.
|
||||
<li> Adjust above form elements. (It's <b>always</b> a good idea to add some
|
||||
comment explaining what you're doing.)
|
||||
<li> Click the below \"Commit\" button.
|
||||
</ol></font>
|
||||
<INPUT TYPE=SUBMIT VALUE=Commit>
|
||||
</FORM><hr>\n";
|
||||
}
|
||||
|
||||
|
||||
if ($count > 0) {
|
||||
print "<FORM METHOD=POST ACTION=\"long_list.cgi\">
|
||||
<INPUT TYPE=HIDDEN NAME=buglist VALUE=$buglist>
|
||||
<INPUT TYPE=SUBMIT VALUE=\"Long Format\">
|
||||
<A HREF=\"query.cgi\">Query Page</A>
|
||||
<A HREF=\"enter_bug.cgi\">Enter New Bug</A>
|
||||
<A HREF=\"colchange.cgi?$::buffer\">Change columns</A>
|
||||
</FORM>";
|
||||
if (!$dotweak && $count > 1) {
|
||||
print "<A HREF=\"buglist.cgi?$fields&tweak=1\">Make changes to several of these bugs at once.</A>\n";
|
||||
}
|
||||
}
|
||||
if ($serverpush) {
|
||||
print "\n--thisrandomstring--\n";
|
||||
}
|
||||
88
mozilla/webtools/bugzilla/changepassword.cgi
Executable file
88
mozilla/webtools/bugzilla/changepassword.cgi
Executable file
@@ -0,0 +1,88 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
confirm_login();
|
||||
|
||||
if (! defined $::FORM{'pwd1'}) {
|
||||
print "Content-type: text/html
|
||||
|
||||
<H1>Change your password</H1>
|
||||
<form method=post>
|
||||
<table>
|
||||
<tr>
|
||||
<td align=right>Please enter the new password for <b>$::COOKIE{'Bugzilla_login'}</b>:</td>
|
||||
<td><input type=password name=pwd1></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right>Re-enter your new password:</td>
|
||||
<td><input type=password name=pwd2></td>
|
||||
</table>
|
||||
<input type=submit value=Submit>\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($::FORM{'pwd1'} ne $::FORM{'pwd2'}) {
|
||||
print "Content-type: text/html
|
||||
|
||||
<H1>Try again.</H1>
|
||||
The two passwords you entered did not match. Please click <b>Back</b> and try again.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
my $pwd = $::FORM{'pwd1'};
|
||||
|
||||
|
||||
if ($pwd !~ /^[a-zA-Z0-9-_]*$/ || length($pwd) < 3 || length($pwd) > 15) {
|
||||
print "Content-type: text/html
|
||||
|
||||
<H1>Sorry; we're picky.</H1>
|
||||
Please choose a password that is between 3 and 15 characters long, and that
|
||||
contains only numbers, letters, hyphens, or underlines.
|
||||
<p>
|
||||
Please click <b>Back</b> and try again.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
# Generate a random salt.
|
||||
|
||||
sub x {
|
||||
my $sc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789./";
|
||||
return substr($sc, int (rand () * 100000) % (length ($sc) + 1), 1);
|
||||
}
|
||||
my $salt = x() . x();
|
||||
|
||||
my $encrypted = crypt($pwd, $salt);
|
||||
|
||||
SendSQL("update profiles set password='$pwd',cryptpassword='$encrypted' where login_name=" .
|
||||
SqlQuote($::COOKIE{'Bugzilla_login'}));
|
||||
|
||||
SendSQL("update logincookies set cryptpassword = '$encrypted' where cookie = $::COOKIE{'Bugzilla_logincookie'}");
|
||||
|
||||
print "<H1>OK, done.</H1>
|
||||
Your new password has been set.
|
||||
<p>
|
||||
<a href=query.cgi>Back to query page.</a>\n";
|
||||
109
mozilla/webtools/bugzilla/colchange.cgi
Executable file
109
mozilla/webtools/bugzilla/colchange.cgi
Executable file
@@ -0,0 +1,109 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
print "Content-type: text/html\n";
|
||||
|
||||
# The master list not only says what fields are possible, but what order
|
||||
# they get displayed in.
|
||||
|
||||
my @masterlist = ("opendate", "changeddate", "severity", "priority",
|
||||
"platform", "owner", "reporter", "status", "resolution",
|
||||
"component", "product", "version", "project", "os");
|
||||
|
||||
if (Param("usetargetmilestone")) {
|
||||
push(@masterlist, "target_milestone");
|
||||
}
|
||||
if (Param("useqacontact")) {
|
||||
push(@masterlist, "qa_contact");
|
||||
}
|
||||
if (Param("usestatuswhiteboard")) {
|
||||
push(@masterlist, "status_whiteboard");
|
||||
}
|
||||
|
||||
|
||||
push(@masterlist, ("summary", "summaryfull"));
|
||||
|
||||
|
||||
my @collist;
|
||||
if (defined $::FORM{'rememberedquery'}) {
|
||||
if (defined $::FORM{'resetit'}) {
|
||||
@collist = @::default_column_list;
|
||||
} else {
|
||||
foreach my $i (@masterlist) {
|
||||
if (defined $::FORM{"column_$i"}) {
|
||||
push @collist, $i;
|
||||
}
|
||||
}
|
||||
}
|
||||
my $list = join(" ", @collist);
|
||||
print "Set-Cookie: COLUMNLIST=$list ; path=/ ; expires=Sun, 30-Jun-2029 00:00:00 GMT\n";
|
||||
print "Refresh: 0; URL=buglist.cgi?$::FORM{'rememberedquery'}\n";
|
||||
print "\n";
|
||||
print "<TITLE>What a hack.</TITLE>\n";
|
||||
print "Resubmitting your query with new columns...\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if (defined $::COOKIE{'COLUMNLIST'}) {
|
||||
@collist = split(/ /, $::COOKIE{'COLUMNLIST'});
|
||||
} else {
|
||||
@collist = @::default_column_list;
|
||||
}
|
||||
|
||||
|
||||
my %desc;
|
||||
foreach my $i (@masterlist) {
|
||||
$desc{$i} = $i;
|
||||
}
|
||||
|
||||
$desc{'summary'} = "Summary (first 60 characters)";
|
||||
$desc{'summaryfull'} = "Full Summary";
|
||||
|
||||
|
||||
print "\n";
|
||||
print "Check which columns you wish to appear on the list, and then click\n";
|
||||
print "on submit.\n";
|
||||
print "<p>\n";
|
||||
print "<FORM ACTION=colchange.cgi>\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=rememberedquery VALUE=$::buffer>\n";
|
||||
|
||||
foreach my $i (@masterlist) {
|
||||
my $c;
|
||||
if (lsearch(\@collist, $i) >= 0) {
|
||||
$c = 'CHECKED';
|
||||
} else {
|
||||
$c = '';
|
||||
}
|
||||
print "<INPUT TYPE=checkbox NAME=column_$i $c>$desc{$i}<br>\n";
|
||||
}
|
||||
print "<P>\n";
|
||||
print "<INPUT TYPE=\"submit\" VALUE=\"Submit\">\n";
|
||||
print "</FORM>\n";
|
||||
print "<FORM ACTION=colchange.cgi>\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=rememberedquery VALUE=$::buffer>\n";
|
||||
print "<INPUT TYPE=HIDDEN NAME=resetit VALUE=1>\n";
|
||||
print "<INPUT TYPE=\"submit\" VALUE=\"Reset to Bugzilla default\">\n";
|
||||
print "</FORM>\n";
|
||||
92
mozilla/webtools/bugzilla/collectstats.pl
Executable file
92
mozilla/webtools/bugzilla/collectstats.pl
Executable file
@@ -0,0 +1,92 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>,
|
||||
# Harrison Page <harrison@netscape.com>
|
||||
|
||||
# Run me out of cron at midnight to collect Bugzilla statistics.
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
use vars @::legal_product;
|
||||
|
||||
require "globals.pl";
|
||||
|
||||
ConnectToDatabase();
|
||||
GetVersionTable();
|
||||
|
||||
foreach (@::legal_product) {
|
||||
my $dir = "data/mining";
|
||||
|
||||
&check_data_dir ($dir);
|
||||
&collect_stats ($dir, $_);
|
||||
}
|
||||
|
||||
sub check_data_dir {
|
||||
my $dir = shift;
|
||||
|
||||
if (! -d) {
|
||||
mkdir $dir, 0777;
|
||||
chmod 0777, $dir;
|
||||
}
|
||||
}
|
||||
|
||||
sub collect_stats {
|
||||
my $dir = shift;
|
||||
my $product = shift;
|
||||
my $when = localtime (time);
|
||||
|
||||
|
||||
$product =~ s/\//-/gs;
|
||||
my $file = join '/', $dir, $product;
|
||||
my $exists = -f $file;
|
||||
|
||||
if (open DATA, ">>$file") {
|
||||
push my @row, &today;
|
||||
|
||||
foreach my $status ('NEW', 'ASSIGNED', 'REOPENED') {
|
||||
SendSQL("select count(bug_status) from bugs where bug_status='$status' and product='$product'");
|
||||
push @row, FetchOneColumn();
|
||||
}
|
||||
|
||||
if (! $exists)
|
||||
{
|
||||
print DATA <<FIN;
|
||||
# Bugzilla daily bug stats
|
||||
#
|
||||
# do not edit me! this file is generated.
|
||||
#
|
||||
# fields: date|new|assigned|reopened
|
||||
# product: $product
|
||||
# created: $when
|
||||
FIN
|
||||
}
|
||||
|
||||
print DATA (join '|', @row) . "\n";
|
||||
close DATA;
|
||||
} else {
|
||||
print "$0: $file, $!";
|
||||
}
|
||||
}
|
||||
|
||||
sub today {
|
||||
my ($dom, $mon, $year) = (localtime(time))[3, 4, 5];
|
||||
return sprintf "%04d%02d%02d", 1900 + $year, ++$mon, $dom;
|
||||
}
|
||||
|
||||
79
mozilla/webtools/bugzilla/createaccount.cgi
Executable file
79
mozilla/webtools/bugzilla/createaccount.cgi
Executable file
@@ -0,0 +1,79 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
# David Gardiner <david.gardiner@unisa.edu.au>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
# Shut up misguided -w warnings about "used only once":
|
||||
|
||||
use vars %::FORM;
|
||||
|
||||
ConnectToDatabase();
|
||||
|
||||
# Clear out the login cookies. Make people log in again if they create an
|
||||
# account; otherwise, they'll probably get confused.
|
||||
|
||||
print "Set-Cookie: Bugzilla_login= ; path=/; expires=Sun, 30-Jun-80 00:00:00 GMT
|
||||
Set-Cookie: Bugzilla_logincookie= ; path=/; expires=Sun, 30-Jun-80 00:00:00 GMT
|
||||
Set-Cookie: Bugzilla_password= ; path=/; expires=Sun, 30-Jun-80 00:00:00 GMT
|
||||
Content-type: text/html
|
||||
|
||||
";
|
||||
|
||||
PutHeader("Create a new bugzilla account");
|
||||
|
||||
my $login = $::FORM{'login'};
|
||||
if (defined $login) {
|
||||
CheckEmailSyntax($login);
|
||||
if (DBname_to_id($login) != 0) {
|
||||
print "A bugzilla account for the name <tt>$login</tt> already\n";
|
||||
print "exists. If you have forgotten the password for it, then\n";
|
||||
print "<a href=query.cgi?GoAheadAndLogIn>click here</a> and use\n";
|
||||
print "the <b>E-mail me a password</b> button.\n";
|
||||
exit;
|
||||
}
|
||||
DBNameToIdAndCheck($login, 1);
|
||||
print "A bugzilla account for <tt>$login</tt> has been created. The\n";
|
||||
print "password has been e-mailed to that address. When it is\n";
|
||||
print "received, you may <a href=query.cgi?GoAheadAndLogIn>click\n";
|
||||
print "here</a> and log in. Or, you can just <a href=\"\">go back to\n";
|
||||
print "the top</a>.";
|
||||
exit;
|
||||
}
|
||||
|
||||
print q{
|
||||
To create a bugzilla account, all that you need to do is to enter a
|
||||
legitimate e-mail address. The account will be created, and its
|
||||
password will be mailed to you.
|
||||
|
||||
<FORM method=get>
|
||||
<table>
|
||||
<tr>
|
||||
<td align=right><b>E-mail address:</b></td>
|
||||
<td><input size=35 name=login></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type=submit>
|
||||
};
|
||||
|
||||
112
mozilla/webtools/bugzilla/createattachment.cgi
Executable file
112
mozilla/webtools/bugzilla/createattachment.cgi
Executable file
@@ -0,0 +1,112 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
# David Gardiner <david.gardiner@unisa.edu.au>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
use vars %::COOKIE, %::FILENAME;
|
||||
|
||||
sub Punt {
|
||||
my ($str) = (@_);
|
||||
print "$str<P>Please hit <b>Back</b> and try again.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
my $id = $::FORM{'id'};
|
||||
|
||||
PutHeader("Create an attachment", "Create attachment", "Bug $id");
|
||||
|
||||
|
||||
if (!defined($::FORM{'data'})) {
|
||||
print qq{
|
||||
<form method=post ENCTYPE="multipart/form-data">
|
||||
<input type=hidden name=id value=$id>
|
||||
To attach a file to <a href="show_bug.cgi?id=$id">bug $id</a>, place it in a
|
||||
file on your local machine, and enter the path to that file here:<br>
|
||||
<input type=file name=data size=60>
|
||||
<P>
|
||||
Please also provide a one-line description of this attachment:<BR>
|
||||
<input name=description size=60>
|
||||
<BR>
|
||||
What kind of file is this?
|
||||
<br><input type=radio name=type value=patch>Patch file (text/plain, diffs)
|
||||
<br><input type=radio name=type value="text/plain">Plain text (text/plain)
|
||||
<br><input type=radio name=type value="text/html">HTML source (text/html)
|
||||
<br><input type=radio name=type value="application/octet-stream">Binary file (application/octet-stream)
|
||||
<br><input type=radio name=type value="other">Other (enter mime type: <input name=othertype size=30>)
|
||||
<P>
|
||||
<input type=submit value="Submit">
|
||||
</form>
|
||||
<P>
|
||||
};
|
||||
} else {
|
||||
if ($::FORM{'data'} eq "" || !defined $::FILENAME{'data'}) {
|
||||
Punt("No file was provided, or it was empty.");
|
||||
}
|
||||
my $desc = trim($::FORM{'description'});
|
||||
if ($desc eq "") {
|
||||
Punt("You must provide a description of your attachment.");
|
||||
}
|
||||
my $ispatch = 0;
|
||||
my $mimetype = $::FORM{'type'};
|
||||
if (!defined $mimetype) {
|
||||
Punt("You must select which kind of file you have.");
|
||||
}
|
||||
$mimetype = trim($mimetype);
|
||||
if ($mimetype eq "patch") {
|
||||
$mimetype = "text/plain";
|
||||
$ispatch = 1;
|
||||
}
|
||||
if ($mimetype eq "other") {
|
||||
$mimetype = $::FORM{'othertype'};
|
||||
}
|
||||
if ($mimetype !~ m@^(\w|-)+/(\w|-)+$@) {
|
||||
Punt("You must select a legal mime type. '<tt>$mimetype</tt>' simply will not do.");
|
||||
}
|
||||
SendSQL("insert into attachments (bug_id, filename, description, mimetype, ispatch, thedata) values ($id," .
|
||||
SqlQuote($::FILENAME{'data'}) . ", " . SqlQuote($desc) . ", " .
|
||||
SqlQuote($mimetype) . ", $ispatch, " .
|
||||
SqlQuote($::FORM{'data'}) . ")");
|
||||
SendSQL("select LAST_INSERT_ID()");
|
||||
my $attachid = FetchOneColumn();
|
||||
AppendComment($id, $::COOKIE{"Bugzilla_login"},
|
||||
"Created an attachment (id=$attachid)\n$desc\n");
|
||||
print "Your attachment has been created.";
|
||||
system("./processmail $id < /dev/null > /dev/null 2> /dev/null &");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
print qq{
|
||||
<P>
|
||||
<a href="show_bug.cgi?id=$id">Go back to bug $id</a><br>
|
||||
<a href="query.cgi">Go back to the query page</a><br>
|
||||
};
|
||||
293
mozilla/webtools/bugzilla/defparams.pl
Normal file
293
mozilla/webtools/bugzilla/defparams.pl
Normal file
@@ -0,0 +1,293 @@
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
|
||||
# This file defines all the parameters that we have a GUI to edit within
|
||||
# Bugzilla.
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
|
||||
sub WriteParams {
|
||||
foreach my $i (@::param_list) {
|
||||
if (!defined $::param{$i}) {
|
||||
$::param{$i} = $::param_default{$i};
|
||||
if (!defined $::param{$i}) {
|
||||
die "No default parameter ever specified for $i";
|
||||
}
|
||||
}
|
||||
}
|
||||
mkdir("data", 0777);
|
||||
chmod 0777, "data";
|
||||
my $tmpname = "data/params.$$";
|
||||
open(FID, ">$tmpname") || die "Can't create $tmpname";
|
||||
my $v = $::param{'version'};
|
||||
delete $::param{'version'}; # Don't write the version number out to
|
||||
# the params file.
|
||||
print FID GenerateCode('%::param');
|
||||
$::param{'version'} = $v;
|
||||
print FID "1;\n";
|
||||
close FID;
|
||||
rename $tmpname, "data/params" || die "Can't rename $tmpname to data/params";
|
||||
chmod 0666, "data/params";
|
||||
}
|
||||
|
||||
|
||||
sub DefParam {
|
||||
my ($id, $desc, $type, $default, $checker) = (@_);
|
||||
push @::param_list, $id;
|
||||
$::param_desc{$id} = $desc;
|
||||
$::param_type{$id} = $type;
|
||||
$::param_default{$id} = $default;
|
||||
if (defined $checker) {
|
||||
$::param_checker{$id} = $checker;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub check_numeric {
|
||||
my ($value) = (@_);
|
||||
if ($value !~ /^[0-9]+$/) {
|
||||
return "must be a numeric value";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@::param_list = ();
|
||||
|
||||
|
||||
|
||||
# OK, here are the definitions themselves.
|
||||
#
|
||||
# The type of parameters (the third parameter to DefParam) can be one
|
||||
# of the following:
|
||||
#
|
||||
# t -- A short text entry field (suitable for a single line)
|
||||
# l -- A long text field (suitable for many lines)
|
||||
# b -- A boolean value (either 1 or 0)
|
||||
# i -- An integer.
|
||||
# defenum -- This param defines an enum that defines a column in one of
|
||||
# the database tables. The name of the parameter is of the form
|
||||
# "tablename.columnname".
|
||||
|
||||
DefParam("maintainer",
|
||||
"The email address of the person who maintains this installation of Bugzilla.",
|
||||
"t",
|
||||
'THE MAINTAINER HAS NOT YET BEEN SET');
|
||||
|
||||
DefParam("urlbase",
|
||||
"The URL that is the common initial leading part of all Bugzilla URLs.",
|
||||
"t",
|
||||
"http://cvs-mirror.mozilla.org/webtools/bugzilla/",
|
||||
\&check_urlbase);
|
||||
|
||||
sub check_urlbase {
|
||||
my ($url) = (@_);
|
||||
if ($url !~ m:^http.*/$:) {
|
||||
return "must be a legal URL, that starts with http and ends with a slash.";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
DefParam("usedespot",
|
||||
"If this is on, then we are using the Despot system to control our database of users. Bugzilla won't ever write into the user database, it will let the Despot code maintain that. And Bugzilla will send the user over to Despot URLs if they need to change their password. Also, in that case, Bugzilla will treat the passwords stored in the database as being crypt'd, not plaintext.",
|
||||
"b",
|
||||
0);
|
||||
|
||||
DefParam("despotbaseurl",
|
||||
"The base URL for despot. Used only if <b>usedespot</b> is turned on, above.",
|
||||
"t",
|
||||
"http://cvs-mirror.mozilla.org/webtools/despot/despot.cgi",
|
||||
\&check_despotbaseurl);
|
||||
|
||||
|
||||
sub check_despotbaseurl {
|
||||
my ($url) = (@_);
|
||||
if ($url !~ /^http.*cgi$/) {
|
||||
return "must be a legal URL, that starts with http and ends with .cgi";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
DefParam("headerhtml",
|
||||
"Additional HTML to add to the HEAD area of documents, eg. links to stylesheets.",
|
||||
"l",
|
||||
'');
|
||||
|
||||
|
||||
DefParam("bannerhtml",
|
||||
"The html that gets emitted at the head of every Bugzilla page.
|
||||
Anything of the form %<i>word</i>% gets replaced by the defintion of that
|
||||
word (as defined on this page).",
|
||||
"l",
|
||||
q{<TABLE BGCOLOR="#000000" WIDTH="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0>
|
||||
<TR><TD><A HREF="http://www.mozilla.org/"><IMG
|
||||
SRC="http://www.mozilla.org/images/mozilla-banner.gif" ALT=""
|
||||
BORDER=0 WIDTH=600 HEIGHT=58></A></TD></TR></TABLE>
|
||||
<CENTER><FONT SIZE=-1>Bugzilla version %version%
|
||||
</FONT></CENTER>});
|
||||
|
||||
DefParam("blurbhtml",
|
||||
"A blurb that appears as part of the header of every Bugzilla page. This is a place to put brief warnings, pointers to one or two related pages, etc.",
|
||||
"l",
|
||||
"This is <B>Bugzilla</B>: the Mozilla bug system. For more
|
||||
information about what Bugzilla is and what it can do, see
|
||||
<A HREF=http://www.mozilla.org/>mozilla.org</A>'s
|
||||
<A HREF=http://www.mozilla.org/bugs/><B>bug pages</B></A>.");
|
||||
|
||||
|
||||
|
||||
|
||||
DefParam("changedmail",
|
||||
q{The email that gets sent to people when a bug changes. Within this
|
||||
text, %to% gets replaced by the assigned-to and reported-by people,
|
||||
separated by a comma (with duplication removed, if they're the same
|
||||
person). %cc% gets replaced by the list of people on the CC list,
|
||||
separated by commas. %bugid% gets replaced by the bug number.
|
||||
%diffs% gets replaced by the diff text from the old version to the new
|
||||
version of this bug. %neworchanged% is either "New" or "Changed",
|
||||
depending on whether this mail is reporting a new bug or changes made
|
||||
to an existing one. %summary% gets replaced by the summary of this
|
||||
bug. %<i>anythingelse</i>% gets replaced by the definition of that
|
||||
parameter (as defined on this page).},
|
||||
"l",
|
||||
"From: bugzilla-daemon
|
||||
To: %to%
|
||||
Cc: %cc%
|
||||
Subject: [Bug %bugid%] %neworchanged% - %summary%
|
||||
|
||||
%urlbase%show_bug.cgi?id=%bugid%
|
||||
|
||||
%diffs%");
|
||||
|
||||
|
||||
|
||||
DefParam("whinedays",
|
||||
"The number of days that we'll let a bug sit untouched in a NEW state before our cronjob will whine at the owner.",
|
||||
"t",
|
||||
7,
|
||||
\&check_numeric);
|
||||
|
||||
|
||||
DefParam("whinemail",
|
||||
"The email that gets sent to anyone who has a NEW bug that hasn't been touched for more than <b>whinedays</b>. Within this text, %email% gets replaced by the offender's email address. %<i>anythingelse</i>% gets replaced by the definition of that parameter (as defined on this page).<p> It is a good idea to make sure this message has a valid From: address, so that if the mail bounces, a real person can know that there are bugs assigned to an invalid address.",
|
||||
"l",
|
||||
q{From: %maintainer%
|
||||
To: %email%
|
||||
Subject: Your Bugzilla buglist needs attention.
|
||||
|
||||
[This e-mail has been automatically generated.]
|
||||
|
||||
You have one or more bugs assigned to you in the Bugzilla
|
||||
bugsystem (%urlbase%) that require
|
||||
attention.
|
||||
|
||||
All of these bugs are in the NEW state, and have not been touched
|
||||
in %whinedays% days or more. You need to take a look at them, and
|
||||
decide on an initial action.
|
||||
|
||||
Generally, this means one of three things:
|
||||
|
||||
(1) You decide this bug is really quick to deal with (like, it's INVALID),
|
||||
and so you get rid of it immediately.
|
||||
(2) You decide the bug doesn't belong to you, and you reassign it to someone
|
||||
else. (Hint: if you don't know who to reassign it to, make sure that
|
||||
the Component field seems reasonable, and then use the "Reassign bug to
|
||||
owner of selected component" option.)
|
||||
(3) You decide the bug belongs to you, but you can't solve it this moment.
|
||||
Just use the "Accept bug" command.
|
||||
|
||||
To get a list of all NEW bugs, you can use this URL (bookmark it if you like!):
|
||||
|
||||
%urlbase%buglist.cgi?bug_status=NEW&assigned_to=%email%
|
||||
|
||||
Or, you can use the general query page, at
|
||||
%urlbase%query.cgi.
|
||||
|
||||
Appended below are the individual URLs to get to all of your NEW bugs that
|
||||
haven't been touched for a week or more.
|
||||
|
||||
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");
|
||||
|
||||
|
||||
DefParam("letsubmitterchoosepriority",
|
||||
"If this is on, then people submitting bugs can choose an initial priority for that bug. If off, then all bugs initially have the default priority selected above.",
|
||||
"b",
|
||||
1);
|
||||
|
||||
|
||||
sub check_priority {
|
||||
my ($value) = (@_);
|
||||
GetVersionTable();
|
||||
if (lsearch(\@::legal_priority, $value) < 0) {
|
||||
return "Must be a legal priority value: one of " .
|
||||
join(", ", @::legal_priority);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
DefParam("defaultpriority",
|
||||
"This is the priority that newly entered bugs are set to.",
|
||||
"t",
|
||||
"P2",
|
||||
\&check_priority);
|
||||
|
||||
|
||||
DefParam("usetargetmilestone",
|
||||
"Do you wish to use the Target Milestone field?",
|
||||
"b",
|
||||
0);
|
||||
|
||||
DefParam("nummilestones",
|
||||
"If using Target Milestone, how many milestones do you wish to
|
||||
appear?",
|
||||
"t",
|
||||
10,
|
||||
\&check_numeric);
|
||||
|
||||
DefParam("useqacontact",
|
||||
"Do you wish to use the QA Contact field?",
|
||||
"b",
|
||||
0);
|
||||
|
||||
DefParam("usestatuswhiteboard",
|
||||
"Do you wish to use the Status Whiteboard field?",
|
||||
"b",
|
||||
0);
|
||||
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
||||
96
mozilla/webtools/bugzilla/describecomponents.cgi
Executable file
96
mozilla/webtools/bugzilla/describecomponents.cgi
Executable file
@@ -0,0 +1,96 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
use vars %::FORM;
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
ConnectToDatabase();
|
||||
GetVersionTable();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
my $product = $::FORM{'product'};
|
||||
if (!defined $product || lsearch(\@::legal_product, $product) < 0) {
|
||||
|
||||
PutHeader("Bugzilla component description");
|
||||
print "
|
||||
<FORM>
|
||||
Please specify the product whose components you want described.
|
||||
<P>
|
||||
Product: <SELECT NAME=product>
|
||||
";
|
||||
print make_options(\@::legal_product);
|
||||
print "
|
||||
</SELECT>
|
||||
<P>
|
||||
<INPUT TYPE=\"submit\" VALUE=\"Submit\">
|
||||
</FORM>
|
||||
";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
PutHeader("Bugzilla component description", "Bugzilla component description",
|
||||
$product);
|
||||
|
||||
print "
|
||||
<TABLE>
|
||||
<tr>
|
||||
<th align=left>Component</th>
|
||||
<th align=left>Default owner</th>
|
||||
";
|
||||
|
||||
my $useqacontact = Param("useqacontact");
|
||||
|
||||
my $cols = 2;
|
||||
if ($useqacontact) {
|
||||
print "<th align=left>Default qa contact</th>";
|
||||
$cols++;
|
||||
}
|
||||
|
||||
my $colbut1 = $cols - 1;
|
||||
|
||||
print "</tr>";
|
||||
|
||||
SendSQL("select value, initialowner, initialqacontact, description from components where program = " . SqlQuote($product));
|
||||
|
||||
while (MoreSQLData()) {
|
||||
my @row = FetchSQLData();
|
||||
my ($component, $initialowner, $initialqacontact, $description) = (@row);
|
||||
|
||||
print qq|
|
||||
<tr><td colspan=$cols><hr></td></tr>
|
||||
<tr><td rowspan=2>$component</td>
|
||||
<td><a href="mailto:$initialowner">$initialowner</a></td>
|
||||
|;
|
||||
if ($useqacontact) {
|
||||
print qq|
|
||||
<td><a href="mailto:$initialqacontact">$initialqacontact</a></td>
|
||||
|;
|
||||
}
|
||||
print "</tr><tr><td colspan=$colbut1>$description</td></tr>\n";
|
||||
}
|
||||
|
||||
print "<tr><td colspan=$cols><hr></td></tr></table>\n";
|
||||
99
mozilla/webtools/bugzilla/doaddcomponent.cgi
Executable file
99
mozilla/webtools/bugzilla/doaddcomponent.cgi
Executable file
@@ -0,0 +1,99 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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): Sam Ziegler <sam@ziegler.org>
|
||||
# Terry Weissman <terry@mozilla.org>
|
||||
# Mark Hamby <mhamby@logicon.com>
|
||||
|
||||
# Code derived from doeditcomponents.cgi
|
||||
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
# foreach my $i (sort(keys %::FORM)) {
|
||||
# print value_quote("$i $::FORM{$i}") . "<BR>\n";
|
||||
# }
|
||||
|
||||
if (!UserInGroup("editcomponents")) {
|
||||
print "<H1>Sorry, you aren't a member of the 'editcomponents' group.</H1>\n";
|
||||
print "And so, you aren't allowed to add components.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
PutHeader("Adding new component");
|
||||
|
||||
unlink "data/versioncache";
|
||||
GetVersionTable();
|
||||
|
||||
my $component = trim($::FORM{"component"});
|
||||
my $product = trim($::FORM{"product"});
|
||||
my $description = trim($::FORM{"description"});
|
||||
my $initialowner = trim($::FORM{"initialowner"});
|
||||
my $initialqacontact = trim($::FORM{"initialqacontact"});
|
||||
|
||||
if ($component eq "") {
|
||||
print "You must enter a name for the new component. Please press\n";
|
||||
print "<b>Back</b> and try again.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
# Check to ensure the component doesn't exist already.
|
||||
SendSQL("SELECT value FROM components WHERE " .
|
||||
"program = " . SqlQuote($product) . " and " .
|
||||
"value = " . SqlQuote($component));
|
||||
my @row = FetchSQLData();
|
||||
if (@row) {
|
||||
print "<H1>Component already exists</H1>";
|
||||
print "The component '$component' already exists\n";
|
||||
print "for product '$product'.<P>\n";
|
||||
print "<p><a href=query.cgi>Go back to the query page</a>\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
# Check that the email addresses are legitimate.
|
||||
foreach my $addr ($initialowner, $initialqacontact) {
|
||||
if ($addr ne "") {
|
||||
DBNameToIdAndCheck($addr);
|
||||
}
|
||||
}
|
||||
|
||||
# Add the new component.
|
||||
SendSQL("INSERT INTO components ( " .
|
||||
"value, program, description, initialowner, initialqacontact" .
|
||||
" ) VALUES ( " .
|
||||
SqlQuote($component) . "," .
|
||||
SqlQuote($product) . "," .
|
||||
SqlQuote($description) . "," .
|
||||
SqlQuote($initialowner) . "," .
|
||||
SqlQuote($initialqacontact) . ")" );
|
||||
|
||||
unlink "data/versioncache";
|
||||
|
||||
print "OK, done.<p>\n";
|
||||
print "<a href=addcomponent.cgi>Edit another new component.</a><p>\n";
|
||||
print "<a href=editcomponents.cgi>Edit existing components.</a><p>\n";
|
||||
print "<a href=query.cgi>Go back to the query page.</a>\n";
|
||||
149
mozilla/webtools/bugzilla/doeditcomponents.cgi
Executable file
149
mozilla/webtools/bugzilla/doeditcomponents.cgi
Executable file
@@ -0,0 +1,149 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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): Sam Ziegler <sam@ziegler.org>
|
||||
# Terry Weissman <terry@mozilla.org>
|
||||
|
||||
# Code derived from doeditowners.cgi
|
||||
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
|
||||
# Shut up misguided -w warnings about "used only once":
|
||||
|
||||
use vars @::legal_product;
|
||||
|
||||
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
# foreach my $i (sort(keys %::FORM)) {
|
||||
# print value_quote("$i $::FORM{$i}") . "<BR>\n";
|
||||
# }
|
||||
|
||||
if (!UserInGroup("editcomponents")) {
|
||||
print "<H1>Sorry, you aren't a member of the 'editcomponents' group.</H1>\n";
|
||||
print "And so, you aren't allowed to edit the owners.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
sub Check {
|
||||
my ($code1, $code2) = (@_);
|
||||
if ($code1 ne $code2) {
|
||||
print "<H1>A race error has occurred.</H1>";
|
||||
print "It appears that someone else has been changing the database\n";
|
||||
print "while you've been editing it. I'm afraid you will have to\n";
|
||||
print "start all over. Sorry! <P>\n";
|
||||
print "<p><a href=query.cgi>Go back to the query page</a>\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my @cmds;
|
||||
|
||||
sub DoOne {
|
||||
my ($oldvalue, $field, $where, $checkemail) = (@_);
|
||||
if (!defined $::FORM{$field}) {
|
||||
print "ERROR -- $field not defined!";
|
||||
exit;
|
||||
}
|
||||
if ($oldvalue ne $::FORM{$field}) {
|
||||
my $name = $field;
|
||||
$name =~ s/^.*-//;
|
||||
my $table = "products";
|
||||
if ($field =~ /^P\d+-C\d+-/) {
|
||||
$table = "components";
|
||||
}
|
||||
push @cmds, "update $table set $name=" .
|
||||
SqlQuote($::FORM{$field}) . "where $where";
|
||||
print "Changed $name for $where <P>";
|
||||
if ($checkemail) {
|
||||
DBNameToIdAndCheck($::FORM{$field});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
PutHeader("Saving new component info");
|
||||
|
||||
unlink "data/versioncache";
|
||||
GetVersionTable();
|
||||
|
||||
my $prodcode = "P0";
|
||||
|
||||
foreach my $product (@::legal_product) {
|
||||
SendSQL("select description, milestoneurl, disallownew from products where product='$product'");
|
||||
my @row = FetchSQLData();
|
||||
if (!@row) {
|
||||
next;
|
||||
}
|
||||
my ($description, $milestoneurl, $disallownew) = (@row);
|
||||
$prodcode++;
|
||||
Check($product, $::FORM{"prodcode-$prodcode"});
|
||||
|
||||
my $where = "product=" . SqlQuote($product);
|
||||
DoOne($description, "$prodcode-description", $where);
|
||||
if (Param('usetargetmilestone')) {
|
||||
DoOne($milestoneurl, "$prodcode-milestoneurl", $where);
|
||||
}
|
||||
DoOne($disallownew, "$prodcode-disallownew", $where);
|
||||
|
||||
SendSQL("select value, initialowner, initialqacontact, description from components where program=" . SqlQuote($product) . " order by value");
|
||||
my $c = 0;
|
||||
while (my @row = FetchSQLData()) {
|
||||
my ($component, $initialowner, $initialqacontact, $description) =
|
||||
(@row);
|
||||
$c++;
|
||||
my $compcode = $prodcode . "-" . "C$c";
|
||||
|
||||
Check($component, $::FORM{"compcode-$compcode"});
|
||||
|
||||
my $where = "program=" . SqlQuote($product) . " and value=" .
|
||||
SqlQuote($component);
|
||||
|
||||
DoOne($initialowner, "$compcode-initialowner", $where, 1);
|
||||
if (Param('useqacontact')) {
|
||||
DoOne($initialqacontact, "$compcode-initialqacontact", $where,
|
||||
1);
|
||||
}
|
||||
DoOne($description, "$compcode-description", $where);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
print "Saving changes.<P>\n";
|
||||
|
||||
foreach my $cmd (@cmds) {
|
||||
print "$cmd <BR>";
|
||||
SendSQL($cmd);
|
||||
}
|
||||
|
||||
unlink "data/versioncache";
|
||||
|
||||
print "OK, done.<p>\n";
|
||||
print "<a href=editcomponents.cgi>Edit the components some more.</a><p>\n";
|
||||
print "<a href=query.cgi>Go back to the query page.</a>\n";
|
||||
68
mozilla/webtools/bugzilla/doeditowners.cgi
Executable file
68
mozilla/webtools/bugzilla/doeditowners.cgi
Executable file
@@ -0,0 +1,68 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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): Sam Ziegler <sam@ziegler.org>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
if (!UserInGroup("editcomponents")) {
|
||||
print "<H1>Sorry, you aren't a member of the 'editcomponents' group.</H1>\n";
|
||||
print "And so, you aren't allowed to edit the owners.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
PutHeader("Saving new owners");
|
||||
|
||||
SendSQL("select program, value, initialowner from components order by program, value");
|
||||
|
||||
my @line;
|
||||
|
||||
foreach my $key (keys(%::FORM)) {
|
||||
$::FORM{url_decode($key)} = $::FORM{$key};
|
||||
}
|
||||
|
||||
my @updates;
|
||||
my $curIndex = 0;
|
||||
|
||||
while (@line = FetchSQLData()) {
|
||||
my $curItem = "$line[0]_$line[1]";
|
||||
if (exists $::FORM{$curItem}) {
|
||||
$::FORM{$curItem} =~ s/\r\n/\n/;
|
||||
if ($::FORM{$curItem} ne $line[2]) {
|
||||
print "$line[0] : $line[1] is now owned by $::FORM{$curItem}.<BR>\n";
|
||||
$updates[$curIndex++] = "update components set initialowner = '$::FORM{$curItem}' where program = '$line[0]' and value = '$line[1]'";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach my $update (@updates) {
|
||||
SendSQL($update);
|
||||
}
|
||||
|
||||
print "OK, done.<p>\n";
|
||||
print "<a href=editowners.cgi>Edit the owners some more.</a><p>\n";
|
||||
print "<a href=query.cgi>Go back to the query page.</a>\n";
|
||||
76
mozilla/webtools/bugzilla/doeditparams.cgi
Executable file
76
mozilla/webtools/bugzilla/doeditparams.cgi
Executable file
@@ -0,0 +1,76 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
require "defparams.pl";
|
||||
|
||||
# Shut up misguided -w warnings about "used only once":
|
||||
use vars %::param,
|
||||
%::param_default,
|
||||
@::param_list;
|
||||
|
||||
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
if (!UserInGroup("tweakparams")) {
|
||||
print "<H1>Sorry, you aren't a member of the 'tweakparams' group.</H1>\n";
|
||||
print "And so, you aren't allowed to edit the parameters.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
PutHeader("Saving new parameters");
|
||||
|
||||
foreach my $i (@::param_list) {
|
||||
# print "Processing $i...<BR>\n";
|
||||
if (exists $::FORM{"reset-$i"}) {
|
||||
$::FORM{$i} = $::param_default{$i};
|
||||
}
|
||||
$::FORM{$i} =~ s/\r\n/\n/; # Get rid of windows-style line endings.
|
||||
if ($::FORM{$i} ne Param($i)) {
|
||||
if (defined $::param_checker{$i}) {
|
||||
my $ref = $::param_checker{$i};
|
||||
my $ok = &$ref($::FORM{$i});
|
||||
if ($ok ne "") {
|
||||
print "New value for $i is invalid: $ok<p>\n";
|
||||
print "Please hit <b>Back</b> and try again.\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
print "Changed $i.<br>\n";
|
||||
$::param{$i} = $::FORM{$i}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
WriteParams();
|
||||
|
||||
unlink "data/versioncache";
|
||||
|
||||
print "OK, done.<p>\n";
|
||||
print "<a href=editparams.cgi>Edit the params some more.</a><p>\n";
|
||||
print "<a href=query.cgi>Go back to the query page.</a>\n";
|
||||
|
||||
120
mozilla/webtools/bugzilla/editcomponents.cgi
Executable file
120
mozilla/webtools/bugzilla/editcomponents.cgi
Executable file
@@ -0,0 +1,120 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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): Sam Ziegler <sam@ziegler.org>
|
||||
# Terry Weissman <terry@mozilla.org>
|
||||
|
||||
# Code derived from editparams.cgi, editowners.cgi
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
# Shut up misguided -w warnings about "used only once":
|
||||
|
||||
use vars @::legal_product;
|
||||
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
if (!UserInGroup("editcomponents")) {
|
||||
print "<H1>Sorry, you aren't a member of the 'editcomponents' group.</H1>\n";
|
||||
print "And so, you aren't allowed to edit the owners.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
PutHeader("Edit Components");
|
||||
|
||||
print "This lets you edit the program components of bugzilla.\n";
|
||||
print "<hr>";
|
||||
print "<a href=addcomponent.cgi>Add new component.</a><br>\n";
|
||||
print "<hr>";
|
||||
|
||||
print "<form method=post action=doeditcomponents.cgi>\n";
|
||||
|
||||
my $rowbreak = "<tr><td colspan=2><hr></td></tr>";
|
||||
|
||||
unlink "data/versioncache";
|
||||
GetVersionTable();
|
||||
|
||||
my $prodcode = "P0";
|
||||
|
||||
foreach my $product (@::legal_product) {
|
||||
SendSQL("select description, milestoneurl, disallownew from products where product='$product'");
|
||||
my @row = FetchSQLData();
|
||||
if (!@row) {
|
||||
next;
|
||||
}
|
||||
my ($description, $milestoneurl, $disallownew) = (@row);
|
||||
$prodcode++;
|
||||
print "<input type=hidden name=prodcode-$prodcode value=\"" .
|
||||
value_quote($product) . "\">\n";
|
||||
print "<table><tr><th align=left valign=top>$product</th><td></td></tr>\n";
|
||||
print "<tr><th align=right>Description:</th>\n";
|
||||
print "<td><input size=80 name=$prodcode-description value=\"" .
|
||||
value_quote($description) . "\"></td></tr>\n";
|
||||
if (Param('usetargetmilestone')) {
|
||||
print "<tr><th align=right>MilestoneURL:</th>\n";
|
||||
print "<td><input size=80 name=$prodcode-milestoneurl value=\"" .
|
||||
value_quote($milestoneurl) . "\"></td></tr>\n";
|
||||
}
|
||||
my $check0 = !$disallownew ? " SELECTED" : "";
|
||||
my $check1 = $disallownew ? " SELECTED" : "";
|
||||
print "<tr><td colspan=2><select name=$prodcode-disallownew>\n";
|
||||
print "<option value=0$check0>Open; new bugs may be submitted against this project\n";
|
||||
print "<option value=1$check1>Closed; no new bugs may be submitted against this project\n";
|
||||
print "</select></td></tr>\n";
|
||||
|
||||
print "<tr><td colspan=2>Components:</td></tr></table>\n";
|
||||
print "<table>\n";
|
||||
|
||||
SendSQL("select value, initialowner, initialqacontact, description from components where program=" . SqlQuote($product) . " order by value");
|
||||
my $c = 0;
|
||||
while (my @row = FetchSQLData()) {
|
||||
my ($component, $initialowner, $initialqacontact, $description) =
|
||||
(@row);
|
||||
$c++;
|
||||
my $compcode = $prodcode . "-" . "C$c";
|
||||
print "<input type=hidden name=compcode-$compcode value=\"" .
|
||||
value_quote($component) . "\">\n";
|
||||
print "<tr><th>$component</th><th align=right>Description:</th>\n";
|
||||
print "<td><input size=80 name=$compcode-description value=\"" .
|
||||
value_quote($description) . "\"></td></tr>\n";
|
||||
print "<tr><td></td><th align=right>Initial owner:</th>\n";
|
||||
print "<td><input size=60 name=$compcode-initialowner value=\"" .
|
||||
value_quote($initialowner) . "\"></td></tr>\n";
|
||||
if (Param('useqacontact')) {
|
||||
print "<tr><td></td><th align=right>Initial QA contact:</th>\n";
|
||||
print "<td><input size=60 name=$compcode-initialqacontact value=\"" .
|
||||
value_quote($initialqacontact) . "\"></td></tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
print "</table><hr>\n";
|
||||
|
||||
}
|
||||
|
||||
print "<input type=submit value=\"Submit changes\">\n";
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
print "<p><a href=query.cgi>Skip all this, and go back to the query page</a>\n";
|
||||
69
mozilla/webtools/bugzilla/editowners.cgi
Executable file
69
mozilla/webtools/bugzilla/editowners.cgi
Executable file
@@ -0,0 +1,69 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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): Sam Ziegler <sam@ziegler.org>
|
||||
|
||||
# Code derived from editparams.cgi
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
if (!UserInGroup("editcomponents")) {
|
||||
print "<H1>Sorry, you aren't a member of the 'editcomponents' group.</H1>\n";
|
||||
print "And so, you aren't allowed to edit the owners.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
PutHeader("Edit Component Owners");
|
||||
|
||||
print "This lets you edit the owners of the program components of bugzilla.\n";
|
||||
|
||||
print "<form method=post action=doeditowners.cgi><table>\n";
|
||||
|
||||
my $rowbreak = "<tr><td colspan=2><hr></td></tr>";
|
||||
|
||||
SendSQL("select program, value, initialowner from components order by program, value");
|
||||
|
||||
my @line;
|
||||
my $curProgram = "";
|
||||
|
||||
while (@line = FetchSQLData()) {
|
||||
if ($line[0] ne $curProgram) {
|
||||
print $rowbreak;
|
||||
print "<tr><th align=right valign=top>$line[0]:</th><td></td></tr>\n";
|
||||
$curProgram = $line[0];
|
||||
}
|
||||
print "<tr><td valign = top>$line[1]</td><td><input size=80 ";
|
||||
print "name=\"$line[0]_$line[1]\" value=\"$line[2]\"></td></tr>\n";
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
print "<input type=submit value=\"Submit changes\">\n";
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
print "<p><a href=query.cgi>Skip all this, and go back to the query page</a>\n";
|
||||
105
mozilla/webtools/bugzilla/editparams.cgi
Executable file
105
mozilla/webtools/bugzilla/editparams.cgi
Executable file
@@ -0,0 +1,105 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
require "defparams.pl";
|
||||
|
||||
# Shut up misguided -w warnings about "used only once":
|
||||
use vars @::param_desc,
|
||||
@::param_list;
|
||||
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
if (!UserInGroup("tweakparams")) {
|
||||
print "<H1>Sorry, you aren't a member of the 'tweakparams' group.</H1>\n";
|
||||
print "And so, you aren't allowed to edit the parameters.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
PutHeader("Edit parameters");
|
||||
|
||||
print "This lets you edit the basic operating parameters of bugzilla.\n";
|
||||
print "Be careful!\n";
|
||||
print "<p>\n";
|
||||
print "Any item you check Reset on will get reset to its default value.\n";
|
||||
|
||||
print "<form method=post action=doeditparams.cgi><table>\n";
|
||||
|
||||
my $rowbreak = "<tr><td colspan=2><hr></td></tr>";
|
||||
print $rowbreak;
|
||||
|
||||
foreach my $i (@::param_list) {
|
||||
print "<tr><th align=right valign=top>$i:</th><td>$::param_desc{$i}</td></tr>\n";
|
||||
print "<tr><td valign=top><input type=checkbox name=reset-$i>Reset</td><td>\n";
|
||||
my $value = Param($i);
|
||||
SWITCH: for ($::param_type{$i}) {
|
||||
/^t$/ && do {
|
||||
print "<input size=80 name=$i value=\"" .
|
||||
value_quote($value) . "\">\n";
|
||||
last SWITCH;
|
||||
};
|
||||
/^l$/ && do {
|
||||
print "<textarea wrap=hard name=$i rows=10 cols=80>" .
|
||||
value_quote($value) . "</textarea>\n";
|
||||
last SWITCH;
|
||||
};
|
||||
/^b$/ && do {
|
||||
my $on;
|
||||
my $off;
|
||||
if ($value) {
|
||||
$on = "checked";
|
||||
$off = "";
|
||||
} else {
|
||||
$on = "";
|
||||
$off = "checked";
|
||||
}
|
||||
print "<input type=radio name=$i value=1 $on>On\n";
|
||||
print "<input type=radio name=$i value=0 $off>Off\n";
|
||||
last SWITCH;
|
||||
};
|
||||
# DEFAULT
|
||||
print "<font color=red><blink>Unknown param type $::param_type{$i}!!!</blink></font>\n";
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
print $rowbreak;
|
||||
}
|
||||
|
||||
print "<tr><th align=right valign=top>version:</th><td>
|
||||
What version of Bugzilla this is. This can't be modified here, but
|
||||
<tt>%version%</tt> can be used as a parameter in places that understand
|
||||
such parameters</td></tr>
|
||||
<tr><td></td><td>" . Param('version') . "</td></tr>";
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
print "<input type=reset value=\"Reset form\"><br>\n";
|
||||
print "<input type=submit value=\"Submit changes\">\n";
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
print "<p><a href=query.cgi>Skip all this, and go back to the query page</a>\n";
|
||||
273
mozilla/webtools/bugzilla/enter_bug.cgi
Executable file
273
mozilla/webtools/bugzilla/enter_bug.cgi
Executable file
@@ -0,0 +1,273 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
# Shut up misguided -w warnings about "used only once":
|
||||
use vars @::legal_platform,
|
||||
@::buffer,
|
||||
@::legal_severity,
|
||||
@::legal_opsys,
|
||||
@::legal_priority;
|
||||
|
||||
|
||||
if (!defined $::FORM{'product'}) {
|
||||
GetVersionTable();
|
||||
my @prodlist = keys %::versions;
|
||||
if ($#prodlist != 0) {
|
||||
print "Content-type: text/html\n\n";
|
||||
PutHeader("Enter Bug");
|
||||
|
||||
print "<H2>First, you must pick a product on which to enter\n";
|
||||
print "a bug.</H2>\n";
|
||||
print "<table>";
|
||||
foreach my $p (sort (@prodlist)) {
|
||||
if (defined $::proddesc{$p} && $::proddesc{$p} eq '0') {
|
||||
# Special hack. If we stuffed a "0" into proddesc, that means
|
||||
# that disallownew was set for this bug, and so we don't want
|
||||
# to allow people to specify that product here.
|
||||
next;
|
||||
}
|
||||
print "<tr><th align=right valign=top><a href=\"enter_bug.cgi?product=" . url_quote($p) . "\"&$::buffer>$p</a>:</th>\n";
|
||||
if (defined $::proddesc{$p}) {
|
||||
print "<td valign=top>$::proddesc{$p}</td>\n";
|
||||
}
|
||||
print "</tr>";
|
||||
}
|
||||
print "</table>\n";
|
||||
exit;
|
||||
}
|
||||
$::FORM{'product'} = $prodlist[0];
|
||||
}
|
||||
|
||||
my $product = $::FORM{'product'};
|
||||
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
sub formvalue {
|
||||
my ($name, $default) = (@_);
|
||||
if (exists $::FORM{$name}) {
|
||||
return $::FORM{$name};
|
||||
}
|
||||
if (defined $default) {
|
||||
return $default;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
sub pickplatform {
|
||||
my $value = formvalue("rep_platform");
|
||||
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";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub pickversion {
|
||||
my $version = formvalue('version');
|
||||
if ($version eq "") {
|
||||
if ($ENV{'HTTP_USER_AGENT'} =~ m@Mozilla[ /]([^ ]*)@) {
|
||||
$version = $1;
|
||||
}
|
||||
}
|
||||
|
||||
if (lsearch($::versions{$product}, $version) >= 0) {
|
||||
return $version;
|
||||
} else {
|
||||
if (defined $::COOKIE{"VERSION-$product"}) {
|
||||
if (lsearch($::versions{$product},
|
||||
$::COOKIE{"VERSION-$product"}) >= 0) {
|
||||
return $::COOKIE{"VERSION-$product"};
|
||||
}
|
||||
}
|
||||
}
|
||||
return $::versions{$product}->[0];
|
||||
}
|
||||
|
||||
|
||||
sub pickcomponent {
|
||||
my $result =formvalue('component');
|
||||
if ($result ne "" && lsearch($::components{$product}, $result) < 0) {
|
||||
$result = "";
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
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";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GetVersionTable();
|
||||
|
||||
my $assign_element = GeneratePersonInput('assigned_to', 1,
|
||||
formvalue('assigned_to'));
|
||||
my $cc_element = GeneratePeopleInput('cc', formvalue('cc'));
|
||||
|
||||
|
||||
my $priority = Param('defaultpriority');
|
||||
|
||||
my $priority_popup = make_popup('priority', \@::legal_priority,
|
||||
formvalue('priority', $priority), 0);
|
||||
my $sev_popup = make_popup('bug_severity', \@::legal_severity,
|
||||
formvalue('bug_severity', 'normal'), 0);
|
||||
my $platform_popup = make_popup('rep_platform', \@::legal_platform,
|
||||
pickplatform(), 0);
|
||||
my $opsys_popup = make_popup('op_sys', \@::legal_opsys, pickos(), 0);
|
||||
|
||||
my $component_popup = make_popup('component', $::components{$product},
|
||||
formvalue('component'), 1);
|
||||
|
||||
PutHeader ("Enter Bug");
|
||||
|
||||
print "
|
||||
<FORM NAME=enterForm METHOD=POST ACTION=\"post_bug.cgi\">
|
||||
<INPUT TYPE=HIDDEN NAME=bug_status VALUE=NEW>
|
||||
<INPUT TYPE=HIDDEN NAME=reporter VALUE=$::COOKIE{'Bugzilla_login'}>
|
||||
<INPUT TYPE=HIDDEN NAME=product VALUE=\"" . value_quote($product) . "\">
|
||||
<TABLE CELLSPACING=2 CELLPADDING=0 BORDER=0>
|
||||
<TR>
|
||||
<td ALIGN=right valign=top><B>Product:</B></td>
|
||||
<td valign=top>$product</td>
|
||||
</TR>
|
||||
<TR>
|
||||
<td ALIGN=right valign=top><B>Version:</B></td>
|
||||
<td>" . Version_element(pickversion(), $product) . "</td>
|
||||
<td align=right valign=top><b><a href=\"describecomponents.cgi?product=" .
|
||||
url_quote($product) . "\">Component:</b></td>
|
||||
<td>$component_popup</td>
|
||||
</TR>
|
||||
<tr><td> <td> <td> <td> <td> <td> </tr>
|
||||
<TR>
|
||||
<td align=right><b><B><A HREF=\"bug_status.html#rep_platform\">Platform:</A></B></td>
|
||||
<TD>$platform_popup</TD>
|
||||
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#op_sys\">OS:</A></B></TD>
|
||||
<TD>$opsys_popup</TD>
|
||||
<td align=right valign=top></td>
|
||||
<td rowspan=3></td>
|
||||
<td></td>
|
||||
</TR>
|
||||
<TR>";
|
||||
if (Param('letsubmitterchoosepriority')) {
|
||||
print "
|
||||
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#priority\">Priority</A>:</B></TD>
|
||||
<TD>$priority_popup</TD>";
|
||||
} else {
|
||||
print '<INPUT TYPE=HIDDEN NAME=priority VALUE="' .
|
||||
value_quote($priority) . '">';
|
||||
}
|
||||
print "
|
||||
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#severity\">Severity</A>:</B></TD>
|
||||
<TD>$sev_popup</TD>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</TR>
|
||||
<tr><td> <td> <td> <td> <td> <td> </tr>
|
||||
<tr>
|
||||
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#assigned_to\">Assigned To:
|
||||
</A></B></TD>
|
||||
<TD colspan=5>$assign_element
|
||||
(Leave blank to assign to default owner for component)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<TD ALIGN=RIGHT ><B>Cc:</B></TD>
|
||||
<TD colspan=5>$cc_element</TD>
|
||||
</tr>
|
||||
<tr><td> <td> <td> <td> <td> <td> </tr>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT><B>URL:</B>
|
||||
<TD COLSPAN=5>
|
||||
<INPUT NAME=bug_file_loc SIZE=60 value=\"" .
|
||||
value_quote(formvalue('bug_file_loc')) .
|
||||
"\"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT><B>Summary:</B>
|
||||
<TD COLSPAN=5>
|
||||
<INPUT NAME=short_desc SIZE=60 value=\"" .
|
||||
value_quote(formvalue('short_desc')) .
|
||||
"\"></TD>
|
||||
</TR>
|
||||
<tr><td> <td> <td> <td> <td> <td> </tr>
|
||||
<tr>
|
||||
<td aligh=right valign=top><B>Description:</b>
|
||||
<td colspan=5><TEXTAREA WRAP=HARD NAME=comment ROWS=10 COLS=80>" .
|
||||
value_quote(formvalue('comment')) .
|
||||
"</TEXTAREA><BR></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan=5>
|
||||
<INPUT TYPE=\"submit\" VALUE=\" Commit \">
|
||||
|
||||
<INPUT TYPE=\"reset\" VALUE=\"Reset\">
|
||||
|
||||
<INPUT TYPE=\"submit\" NAME=maketemplate VALUE=\"Remember values as bookmarkable template\">
|
||||
</td>
|
||||
</tr>
|
||||
</TABLE>
|
||||
<INPUT TYPE=hidden name=form_name VALUE=enter_bug>
|
||||
</FORM>
|
||||
|
||||
Some fields initialized from your user-agent, <b>$ENV{'HTTP_USER_AGENT'}</b>.
|
||||
If you think it got it wrong, please tell " . Param('maintainer') . " what it should have been.
|
||||
|
||||
</BODY></HTML>";
|
||||
568
mozilla/webtools/bugzilla/globals.pl
Normal file
568
mozilla/webtools/bugzilla/globals.pl
Normal file
@@ -0,0 +1,568 @@
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
# Contains some global variables and routines used throughout bugzilla.
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
use Mysql;
|
||||
|
||||
use Date::Format; # For time2str().
|
||||
# use Carp; # for confess
|
||||
|
||||
# Contains the version string for the current running Bugzilla.
|
||||
$::param{'version'} = '2.4';
|
||||
|
||||
$::dontchange = "--do_not_change--";
|
||||
$::chooseone = "--Choose_one:--";
|
||||
|
||||
sub ConnectToDatabase {
|
||||
if (!defined $::db) {
|
||||
$::db = Mysql->Connect("localhost", "bugs", "bugs", "")
|
||||
|| die "Can't connect to database server.";
|
||||
}
|
||||
}
|
||||
|
||||
sub SendSQL {
|
||||
my ($str) = (@_);
|
||||
$::currentquery = $::db->query($str)
|
||||
|| die "$str: $::db_errstr";
|
||||
}
|
||||
|
||||
sub MoreSQLData {
|
||||
if (defined @::fetchahead) {
|
||||
return 1;
|
||||
}
|
||||
if (@::fetchahead = $::currentquery->fetchrow()) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub FetchSQLData {
|
||||
if (defined @::fetchahead) {
|
||||
my @result = @::fetchahead;
|
||||
undef @::fetchahead;
|
||||
return @result;
|
||||
}
|
||||
return $::currentquery->fetchrow();
|
||||
}
|
||||
|
||||
|
||||
sub FetchOneColumn {
|
||||
my @row = FetchSQLData();
|
||||
return $row[0];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@::default_column_list = ("severity", "priority", "platform", "owner",
|
||||
"status", "resolution", "summary");
|
||||
|
||||
sub AppendComment {
|
||||
my ($bugid,$who,$comment) = (@_);
|
||||
open(DEBUG, ">/tmp/debug");
|
||||
print DEBUG "A $comment";
|
||||
$comment =~ s/\r\n/\n/g; # Get rid of windows-style line endings.
|
||||
print DEBUG "B $comment";
|
||||
$comment =~ s/\r/\n/g; # Get rid of mac-style line endings.
|
||||
print DEBUG "C $comment";
|
||||
close DEBUG;
|
||||
if ($comment =~ /^\s*$/) { # Nothin' but whitespace.
|
||||
return;
|
||||
}
|
||||
SendSQL("select long_desc from bugs where bug_id = $bugid");
|
||||
|
||||
my $desc = FetchOneColumn();
|
||||
my $now = time2str("%D %H:%M", time());
|
||||
$desc .= "\n\n------- Additional Comments From $who $now -------\n";
|
||||
$desc .= $comment;
|
||||
SendSQL("update bugs set long_desc=" . SqlQuote($desc) .
|
||||
" where bug_id=$bugid");
|
||||
}
|
||||
|
||||
sub lsearch {
|
||||
my ($list,$item) = (@_);
|
||||
my $count = 0;
|
||||
foreach my $i (@$list) {
|
||||
if ($i eq $item) {
|
||||
return $count;
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
sub Product_element {
|
||||
my ($prod,$onchange) = (@_);
|
||||
return make_popup("product", keys %::versions, $prod, 1, $onchange);
|
||||
}
|
||||
|
||||
sub Component_element {
|
||||
my ($comp,$prod,$onchange) = (@_);
|
||||
my $componentlist;
|
||||
if (! defined $::components{$prod}) {
|
||||
$componentlist = [];
|
||||
} else {
|
||||
$componentlist = $::components{$prod};
|
||||
}
|
||||
my $defcomponent;
|
||||
if ($comp ne "" && lsearch($componentlist, $comp) >= 0) {
|
||||
$defcomponent = $comp;
|
||||
} else {
|
||||
$defcomponent = $componentlist->[0];
|
||||
}
|
||||
return make_popup("component", $componentlist, $defcomponent, 1, "");
|
||||
}
|
||||
|
||||
sub Version_element {
|
||||
my ($vers, $prod, $onchange) = (@_);
|
||||
my $versionlist;
|
||||
if (!defined $::versions{$prod}) {
|
||||
$versionlist = [];
|
||||
} else {
|
||||
$versionlist = $::versions{$prod};
|
||||
}
|
||||
my $defversion = $versionlist->[0];
|
||||
if (lsearch($versionlist,$vers) >= 0) {
|
||||
$defversion = $vers;
|
||||
}
|
||||
return make_popup("version", $versionlist, $defversion, 1, $onchange);
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Generate a string which, when later interpreted by the Perl compiler, will
|
||||
# be the same as the given string.
|
||||
|
||||
sub PerlQuote {
|
||||
my ($str) = (@_);
|
||||
return SqlQuote($str);
|
||||
|
||||
# The below was my first attempt, but I think just using SqlQuote makes more
|
||||
# sense...
|
||||
# $result = "'";
|
||||
# $length = length($str);
|
||||
# for (my $i=0 ; $i<$length ; $i++) {
|
||||
# my $c = substr($str, $i, 1);
|
||||
# if ($c eq "'" || $c eq '\\') {
|
||||
# $result .= '\\';
|
||||
# }
|
||||
# $result .= $c;
|
||||
# }
|
||||
# $result .= "'";
|
||||
# return $result;
|
||||
}
|
||||
|
||||
|
||||
# Given the name of a global variable, generate Perl code that, if later
|
||||
# executed, would restore the variable to its current value.
|
||||
|
||||
sub GenerateCode {
|
||||
my ($name) = (@_);
|
||||
my $result = $name . " = ";
|
||||
if ($name =~ /^\$/) {
|
||||
my $value = eval($name);
|
||||
if (ref($value) eq "ARRAY") {
|
||||
$result .= "[" . GenerateArrayCode($value) . "]";
|
||||
} else {
|
||||
$result .= PerlQuote(eval($name));
|
||||
}
|
||||
} elsif ($name =~ /^@/) {
|
||||
my @value = eval($name);
|
||||
$result .= "(" . GenerateArrayCode(\@value) . ")";
|
||||
} elsif ($name =~ '%') {
|
||||
$result = "";
|
||||
foreach my $k (sort { uc($a) cmp uc($b)} eval("keys $name")) {
|
||||
$result .= GenerateCode("\$" . substr($name, 1) .
|
||||
"{'" . $k . "'}");
|
||||
}
|
||||
return $result;
|
||||
} else {
|
||||
die "Can't do $name -- unacceptable variable type.";
|
||||
}
|
||||
$result .= ";\n";
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub GenerateArrayCode {
|
||||
my ($ref) = (@_);
|
||||
my @list;
|
||||
foreach my $i (@$ref) {
|
||||
push @list, PerlQuote($i);
|
||||
}
|
||||
return join(',', @list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub GenerateVersionTable {
|
||||
ConnectToDatabase();
|
||||
SendSQL("select value, program from versions order by value");
|
||||
my @line;
|
||||
my %varray;
|
||||
my %carray;
|
||||
while (@line = FetchSQLData()) {
|
||||
my ($v,$p1) = (@line);
|
||||
if (!defined $::versions{$p1}) {
|
||||
$::versions{$p1} = [];
|
||||
}
|
||||
push @{$::versions{$p1}}, $v;
|
||||
$varray{$v} = 1;
|
||||
}
|
||||
SendSQL("select value, program from components");
|
||||
while (@line = FetchSQLData()) {
|
||||
my ($c,$p) = (@line);
|
||||
if (!defined $::components{$p}) {
|
||||
$::components{$p} = [];
|
||||
}
|
||||
my $ref = $::components{$p};
|
||||
push @$ref, $c;
|
||||
$carray{$c} = 1;
|
||||
}
|
||||
|
||||
my $dotargetmilestone = Param("usetargetmilestone");
|
||||
|
||||
my $mpart = $dotargetmilestone ? ", milestoneurl" : "";
|
||||
SendSQL("select product, description, disallownew$mpart from products");
|
||||
while (@line = FetchSQLData()) {
|
||||
my ($p, $d, $dis, $u) = (@line);
|
||||
$::proddesc{$p} = $d;
|
||||
if ($dis) {
|
||||
# Special hack. Stomp on the description and make it "0" if we're
|
||||
# not supposed to allow new bugs against this product. This is
|
||||
# checked for in enter_bug.cgi.
|
||||
$::proddesc{$p} = "0";
|
||||
}
|
||||
if ($dotargetmilestone) {
|
||||
$::milestoneurl{$p} = $u;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $cols = LearnAboutColumns("bugs");
|
||||
|
||||
@::log_columns = @{$cols->{"-list-"}};
|
||||
foreach my $i ("bug_id", "creation_ts", "delta_ts", "long_desc") {
|
||||
my $w = lsearch(\@::log_columns, $i);
|
||||
if ($w >= 0) {
|
||||
splice(@::log_columns, $w, 1);
|
||||
}
|
||||
}
|
||||
@::log_columns = (sort(@::log_columns));
|
||||
|
||||
@::legal_priority = SplitEnumType($cols->{"priority,type"});
|
||||
@::legal_severity = SplitEnumType($cols->{"bug_severity,type"});
|
||||
@::legal_platform = SplitEnumType($cols->{"rep_platform,type"});
|
||||
@::legal_opsys = SplitEnumType($cols->{"op_sys,type"});
|
||||
@::legal_bug_status = SplitEnumType($cols->{"bug_status,type"});
|
||||
@::legal_resolution = SplitEnumType($cols->{"resolution,type"});
|
||||
@::legal_resolution_no_dup = @::legal_resolution;
|
||||
my $w = lsearch(\@::legal_resolution_no_dup, "DUPLICATE");
|
||||
if ($w >= 0) {
|
||||
splice(@::legal_resolution_no_dup, $w, 1);
|
||||
}
|
||||
|
||||
my @list = sort { uc($a) cmp uc($b)} keys(%::versions);
|
||||
@::legal_product = @list;
|
||||
mkdir("data", 0777);
|
||||
chmod 0777, "data";
|
||||
my $tmpname = "data/versioncache.$$";
|
||||
open(FID, ">$tmpname") || die "Can't create $tmpname";
|
||||
|
||||
print FID GenerateCode('@::log_columns');
|
||||
print FID GenerateCode('%::versions');
|
||||
|
||||
foreach my $i (@list) {
|
||||
if (!defined $::components{$i}) {
|
||||
$::components{$i} = "";
|
||||
}
|
||||
}
|
||||
@::legal_versions = sort {uc($a) cmp uc($b)} keys(%varray);
|
||||
print FID GenerateCode('@::legal_versions');
|
||||
print FID GenerateCode('%::components');
|
||||
@::legal_components = sort {uc($a) cmp uc($b)} keys(%carray);
|
||||
print FID GenerateCode('@::legal_components');
|
||||
foreach my $i('product', 'priority', 'severity', 'platform', 'opsys',
|
||||
'bug_status', 'resolution', 'resolution_no_dup') {
|
||||
print FID GenerateCode('@::legal_' . $i);
|
||||
}
|
||||
print FID GenerateCode('%::proddesc');
|
||||
|
||||
if ($dotargetmilestone) {
|
||||
my $last = Param("nummilestones");
|
||||
my $i;
|
||||
for ($i=1 ; $i<=$last ; $i++) {
|
||||
push(@::legal_target_milestone, "M$i");
|
||||
}
|
||||
print FID GenerateCode('@::legal_target_milestone');
|
||||
print FID GenerateCode('%::milestoneurl');
|
||||
}
|
||||
print FID "1;\n";
|
||||
close FID;
|
||||
rename $tmpname, "data/versioncache" || die "Can't rename $tmpname to versioncache";
|
||||
chmod 0666, "data/versioncache";
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Returns the modification time of a file.
|
||||
|
||||
sub ModTime {
|
||||
my ($filename) = (@_);
|
||||
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
|
||||
$atime,$mtime,$ctime,$blksize,$blocks)
|
||||
= stat($filename);
|
||||
return $mtime;
|
||||
}
|
||||
|
||||
|
||||
|
||||
# This proc must be called before using legal_product or the versions array.
|
||||
|
||||
sub GetVersionTable {
|
||||
my $mtime = ModTime("data/versioncache");
|
||||
if (!defined $mtime || $mtime eq "") {
|
||||
$mtime = 0;
|
||||
}
|
||||
if (time() - $mtime > 3600) {
|
||||
GenerateVersionTable();
|
||||
}
|
||||
require 'data/versioncache';
|
||||
if (!defined %::versions) {
|
||||
GenerateVersionTable();
|
||||
do 'data/versioncache';
|
||||
|
||||
if (!defined %::versions) {
|
||||
die "Can't generate version info; tell terry.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub InsertNewUser {
|
||||
my ($username) = (@_);
|
||||
my $password = "";
|
||||
for (my $i=0 ; $i<8 ; $i++) {
|
||||
$password .= substr("abcdefghijklmnopqrstuvwxyz", int(rand(26)), 1);
|
||||
}
|
||||
SendSQL("select bit, userregexp from groups where userregexp != ''");
|
||||
my $groupset = "0";
|
||||
while (MoreSQLData()) {
|
||||
my @row = FetchSQLData();
|
||||
if ($username =~ m/$row[1]/) {
|
||||
$groupset .= "+ $row[0]"; # Silly hack to let MySQL do the math,
|
||||
# not Perl, since we're dealing with 64
|
||||
# bit ints here, and I don't *think* Perl
|
||||
# does that.
|
||||
}
|
||||
}
|
||||
|
||||
SendSQL("insert into profiles (login_name, password, cryptpassword, groupset) values (@{[SqlQuote($username)]}, '$password', encrypt('$password'), $groupset)");
|
||||
return $password;
|
||||
}
|
||||
|
||||
|
||||
sub DBID_to_name {
|
||||
my ($id) = (@_);
|
||||
if (!defined $::cachedNameArray{$id}) {
|
||||
SendSQL("select login_name from profiles where userid = $id");
|
||||
my $r = FetchOneColumn();
|
||||
if ($r eq "") {
|
||||
$r = "__UNKNOWN__";
|
||||
}
|
||||
$::cachedNameArray{$id} = $r;
|
||||
}
|
||||
return $::cachedNameArray{$id};
|
||||
}
|
||||
|
||||
sub DBname_to_id {
|
||||
my ($name) = (@_);
|
||||
SendSQL("select userid from profiles where login_name = @{[SqlQuote($name)]}");
|
||||
my $r = FetchOneColumn();
|
||||
if (!defined $r || $r eq "") {
|
||||
return 0;
|
||||
}
|
||||
return $r;
|
||||
}
|
||||
|
||||
|
||||
sub DBNameToIdAndCheck {
|
||||
my ($name, $forceok) = (@_);
|
||||
my $result = DBname_to_id($name);
|
||||
if ($result > 0) {
|
||||
return $result;
|
||||
}
|
||||
if ($forceok) {
|
||||
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 "The name <TT>$name</TT> is not a valid username. Please hit\n";
|
||||
print "the <B>Back</B> button and try again.\n";
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
sub GetLongDescription {
|
||||
my ($id) = (@_);
|
||||
SendSQL("select long_desc from bugs where bug_id = $id");
|
||||
return FetchOneColumn();
|
||||
}
|
||||
|
||||
|
||||
sub ShowCcList {
|
||||
my ($num) = (@_);
|
||||
my @ccids;
|
||||
my @row;
|
||||
SendSQL("select who from cc where bug_id = $num");
|
||||
while (@row = FetchSQLData()) {
|
||||
push(@ccids, $row[0]);
|
||||
}
|
||||
my @result = ();
|
||||
foreach my $i (@ccids) {
|
||||
push @result, DBID_to_name($i);
|
||||
}
|
||||
|
||||
return join(',', @result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Fills in a hashtable with info about the columns for the given table in the
|
||||
# database. The hashtable has the following entries:
|
||||
# -list- the list of column names
|
||||
# <name>,type the type for the given name
|
||||
|
||||
sub LearnAboutColumns {
|
||||
my ($table) = (@_);
|
||||
my %a;
|
||||
SendSQL("show columns from $table");
|
||||
my @list = ();
|
||||
my @row;
|
||||
while (@row = FetchSQLData()) {
|
||||
my ($name,$type) = (@row);
|
||||
$a{"$name,type"} = $type;
|
||||
push @list, $name;
|
||||
}
|
||||
$a{"-list-"} = \@list;
|
||||
return \%a;
|
||||
}
|
||||
|
||||
|
||||
|
||||
# If the above returned a enum type, take that type and parse it into the
|
||||
# list of values. Assumes that enums don't ever contain an apostrophe!
|
||||
|
||||
sub SplitEnumType {
|
||||
my ($str) = (@_);
|
||||
my @result = ();
|
||||
if ($str =~ /^enum\((.*)\)$/) {
|
||||
my $guts = $1 . ",";
|
||||
while ($guts =~ /^\'([^\']*)\',(.*)$/) {
|
||||
push @result, $1;
|
||||
$guts = $2;
|
||||
}
|
||||
}
|
||||
return @result;
|
||||
}
|
||||
|
||||
|
||||
# This routine is largely copied from Mysql.pm.
|
||||
|
||||
sub SqlQuote {
|
||||
my ($str) = (@_);
|
||||
# if (!defined $str) {
|
||||
# confess("Undefined passed to SqlQuote");
|
||||
# }
|
||||
$str =~ s/([\\\'])/\\$1/g;
|
||||
$str =~ s/\0/\\0/g;
|
||||
return "'$str'";
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub UserInGroup {
|
||||
my ($groupname) = (@_);
|
||||
if ($::usergroupset eq "0") {
|
||||
return 0;
|
||||
}
|
||||
ConnectToDatabase();
|
||||
SendSQL("select (bit & $::usergroupset) != 0 from groups where name = " . SqlQuote($groupname));
|
||||
my $bit = FetchOneColumn();
|
||||
if ($bit) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
sub Param {
|
||||
my ($value) = (@_);
|
||||
if (defined $::param{$value}) {
|
||||
return $::param{$value};
|
||||
}
|
||||
# Um, maybe we haven't sourced in the params at all yet.
|
||||
if (stat("data/params")) {
|
||||
# Write down and restore the version # here. That way, we get around
|
||||
# anyone who maliciously tries to tweak the version number by editing
|
||||
# the params file. Not to mention that in 2.0, there was a bug that
|
||||
# wrote the version number out to the params file...
|
||||
my $v = $::param{'version'};
|
||||
require "data/params";
|
||||
$::param{'version'} = $v;
|
||||
}
|
||||
if (defined $::param{$value}) {
|
||||
return $::param{$value};
|
||||
}
|
||||
# Well, that didn't help. Maybe it's a new param, and the user
|
||||
# hasn't defined anything for it. Try and load a default value
|
||||
# for it.
|
||||
require "defparams.pl";
|
||||
WriteParams();
|
||||
if (defined $::param{$value}) {
|
||||
return $::param{$value};
|
||||
}
|
||||
# We're pimped.
|
||||
die "Can't find param named $value";
|
||||
}
|
||||
|
||||
|
||||
sub PerformSubsts {
|
||||
my ($str, $substs) = (@_);
|
||||
$str =~ s/%([a-z]*)%/(defined $substs->{$1} ? $substs->{$1} : Param($1))/eg;
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
||||
# Trim whitespace from front and back.
|
||||
|
||||
sub trim {
|
||||
($_) = (@_);
|
||||
s/^\s+//g;
|
||||
s/\s+$//g;
|
||||
return $_;
|
||||
}
|
||||
|
||||
1;
|
||||
55
mozilla/webtools/bugzilla/help.html
Normal file
55
mozilla/webtools/bugzilla/help.html
Normal file
@@ -0,0 +1,55 @@
|
||||
<HTML>
|
||||
<!--
|
||||
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 <terry@mozilla.org>
|
||||
-->
|
||||
|
||||
<TITLE>Clue</TITLE>
|
||||
<H1>A Clue</H1>
|
||||
This form will allow you to call up a subset of the bug list.
|
||||
You should be able to add the URL of the resulting list to
|
||||
your bookmark file in order to preserve queries.
|
||||
<p>
|
||||
The way the query works, if you have nothing checked in a box,
|
||||
then all values for that field are legal, for example if you checked nothing
|
||||
in any of the boxes, you would get the entire bug list.
|
||||
<p>
|
||||
The default value of this form should correspond roughly to a "personal"
|
||||
bug list.
|
||||
<HR>
|
||||
<H2>Running queries not supported by the pretty boxes</H2>
|
||||
There is a hacky way to do some searches that aren't supported by the
|
||||
form. The buglist script will build queries based on the URL, so
|
||||
you can add other criteria.
|
||||
<P>
|
||||
For example, if you wanted to see all bugs reported against the X platform
|
||||
and assigned to jwz, you could ask for all bugs assign to jwz, then
|
||||
edit the URL in the "Location" box, adding the clause "&rep_platform=X-Windows"
|
||||
to the URL.
|
||||
<P>
|
||||
Here is a list of some of the field names you could use for additional
|
||||
unsupported searches ...
|
||||
|
||||
<PRE>
|
||||
version
|
||||
rep_platform
|
||||
op_sys
|
||||
reporter area
|
||||
bug_file_loc
|
||||
short_desc
|
||||
</PRE>
|
||||
36
mozilla/webtools/bugzilla/helpemailquery.html
Normal file
36
mozilla/webtools/bugzilla/helpemailquery.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<html> <head>
|
||||
<title>Help on searching by email address.</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Help on searching by email address.</h1>
|
||||
|
||||
This used to be simpler, but not very powerful. Now it's really
|
||||
powerful and useful, but it may not be obvious how to use it...
|
||||
|
||||
<p>
|
||||
|
||||
To search for bugs associated with an email address:
|
||||
|
||||
<ul>
|
||||
<li> Type a portion of an email address into the text field.
|
||||
<li> Select which fields of the bug you expect that address to be in
|
||||
the bugs you're looking for.
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
|
||||
You can look for up to two different email addresses; if you specify
|
||||
both, then only bugs which match both will show up. This is useful to
|
||||
find bugs that were, for example, created by Ralph and assigned to
|
||||
Fred.
|
||||
|
||||
<p>
|
||||
|
||||
You can also use the drop down menus to specify whether you want to
|
||||
match addresses by doing a substring match, by using regular
|
||||
expressions, or by exactly matching a fully specified email address.
|
||||
|
||||
|
||||
|
||||
</body> </html>
|
||||
80
mozilla/webtools/bugzilla/how_to_mail.html
Normal file
80
mozilla/webtools/bugzilla/how_to_mail.html
Normal file
@@ -0,0 +1,80 @@
|
||||
<HTML>
|
||||
|
||||
<!--
|
||||
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 <terry@mozilla.org>
|
||||
-->
|
||||
|
||||
|
||||
<TITLE>How to Mail to bugzilla</TITLE>
|
||||
|
||||
<H1>THIS DOESN'T WORK RIGHT NOW. Coming someday.</H1>
|
||||
|
||||
Mailing to "bugzilla" will be piped through a script which examines
|
||||
your message, stripping out control lines, and passing the rest of the
|
||||
message in as the description of a new bug. The control lines look like: <P>
|
||||
|
||||
<PRE>
|
||||
@FIELD-LABEL VALUE
|
||||
LABEL Legal Values
|
||||
Priority critical major normal minor trivial
|
||||
Type BUG RFE
|
||||
Product Cheddar
|
||||
Platform PC X-Windows Macintosh All
|
||||
Area CODE JAVA TEST BUILD UI PERF
|
||||
Version version 2.0b1 2.0b2 2.0b2 2.0b4 2.1a0 2.1a1 2.1b0 2.1b1 2.1b2
|
||||
OS Windows 3.1 Windows 95 Windows NT System 7 System 7.5
|
||||
AIX BSDI HP-UX IRIX Linux OSF/1 Solaris SunOS other
|
||||
Summary -anything-
|
||||
URL -anything-
|
||||
Assign someone in eng
|
||||
|
||||
|
||||
and
|
||||
|
||||
@description
|
||||
This tells the bug parse to stop looking for control lines,
|
||||
allowing the bug description to contain lines which start with @
|
||||
</PRE>
|
||||
|
||||
There are default values for all these fields. If you don't specify a
|
||||
Summary, the subject of the mail message is used. <P>
|
||||
|
||||
If you specify an illegal value, the default value is used, the
|
||||
bug is assigned to you, and the answerback message will describe
|
||||
the error. <P>
|
||||
|
||||
After the bug is posted, you will get mail verifying the posting
|
||||
and informing you of the bug number if you wish to fix any
|
||||
mistakes made by the auto-processor. <P>
|
||||
|
||||
EXAMPLE: <P>
|
||||
|
||||
|
||||
<PRE>
|
||||
% Mail bugzilla
|
||||
Subject: WinFE crashes with GPF when I pour beer on my keyboard
|
||||
@priority critical
|
||||
@platform PC
|
||||
@assign troy
|
||||
|
||||
After the beer bash I emptied the rest of the keg onto my keyboard
|
||||
and my sharp build of Navigator got a GPF.
|
||||
.
|
||||
|
||||
</PRE>
|
||||
78
mozilla/webtools/bugzilla/index.html
Normal file
78
mozilla/webtools/bugzilla/index.html
Normal file
@@ -0,0 +1,78 @@
|
||||
<HTML>
|
||||
<!--
|
||||
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 <terry@mozilla.org>
|
||||
-->
|
||||
<HEAD><TITLE>Bugzilla Main Page</TITLE></HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF" TEXT="#000000"
|
||||
LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000">
|
||||
<TABLE BGCOLOR="#000000" WIDTH="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0>
|
||||
<TR><TD><A HREF="http://www.mozilla.org/"><IMG
|
||||
SRC="http://www.mozilla.org/images/mozilla-banner.gif" ALT=""
|
||||
BORDER=0 WIDTH=600 HEIGHT=58></A></TD></TR></TABLE>
|
||||
<TABLE BORDER=0 CELLPADDING=12 CELLSPACING=0 WIDTH="100%">
|
||||
<TR>
|
||||
|
||||
<TD>
|
||||
|
||||
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=2>
|
||||
|
||||
<TR><TD VALIGN=TOP ALIGN=CENTER NOWRAP>
|
||||
|
||||
<FONT SIZE="+3"><B><NOBR>Main Page</NOBR></B></FONT>
|
||||
|
||||
</TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER>
|
||||
|
||||
<B></B>
|
||||
|
||||
</TD></TR>
|
||||
|
||||
</TABLE>
|
||||
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
|
||||
This is <B>Bugzilla</B>: the Mozilla bug system. For more
|
||||
information about what Bugzilla is and what it can do, see
|
||||
<A HREF="http://www.mozilla.org/">mozilla.org</A>'s
|
||||
<A HREF="http://www.mozilla.org/bugs/"><B>bug pages</B></A>.
|
||||
</TD></TR></TABLE>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<img align=right width=329 height=220 src=ant.jpg border=2>
|
||||
|
||||
|
||||
This is where we put in lots of nifty words explaining all about
|
||||
bugzilla.
|
||||
|
||||
<p>
|
||||
|
||||
But it all boils down to a choice of:
|
||||
<br>
|
||||
<a href="query.cgi">Go to the query page to start.</a><br>
|
||||
<a href="enter_bug.cgi">Enter a new bug</a><br>
|
||||
<a href="reports.cgi">Bug reports</a><br>
|
||||
<a href="createaccount.cgi">Open a new Bugzilla account</a><br>
|
||||
<FORM METHOD=GET ACTION=show_bug.cgi><INPUT TYPE=SUBMIT VALUE="Find"> bug
|
||||
# <INPUT NAME=id SIZE=6></FORM></TD>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
106
mozilla/webtools/bugzilla/long_list.cgi
Executable file
106
mozilla/webtools/bugzilla/long_list.cgi
Executable file
@@ -0,0 +1,106 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
# Shut up misguided -w warnings about "used only once":
|
||||
use vars %::FORM;
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
print "<TITLE>Full Text Bug Listing</TITLE>\n";
|
||||
|
||||
ConnectToDatabase();
|
||||
quietly_check_login();
|
||||
|
||||
my $generic_query = "
|
||||
select
|
||||
bugs.bug_id,
|
||||
bugs.product,
|
||||
bugs.version,
|
||||
bugs.rep_platform,
|
||||
bugs.op_sys,
|
||||
bugs.bug_status,
|
||||
bugs.bug_severity,
|
||||
bugs.priority,
|
||||
bugs.resolution,
|
||||
assign.login_name,
|
||||
report.login_name,
|
||||
bugs.component,
|
||||
bugs.bug_file_loc,
|
||||
bugs.short_desc,
|
||||
bugs.target_milestone,
|
||||
bugs.qa_contact,
|
||||
bugs.status_whiteboard
|
||||
from bugs,profiles assign,profiles report
|
||||
where assign.userid = bugs.assigned_to and report.userid = bugs.reporter and
|
||||
bugs.groupset & $::usergroupset = bugs.groupset and";
|
||||
|
||||
foreach my $bug (split(/:/, $::FORM{'buglist'})) {
|
||||
SendSQL("$generic_query bugs.bug_id = $bug");
|
||||
|
||||
my @row;
|
||||
if (@row = FetchSQLData()) {
|
||||
my ($id, $product, $version, $platform, $opsys, $status, $severity,
|
||||
$priority, $resolution, $assigned, $reporter, $component, $url,
|
||||
$shortdesc, $target_milestone, $qa_contact,
|
||||
$status_whiteboard) = (@row);
|
||||
print "<IMG SRC=\"1x1.gif\" WIDTH=1 HEIGHT=80 ALIGN=LEFT>\n";
|
||||
print "<TABLE WIDTH=100%>\n";
|
||||
print "<TD COLSPAN=4><TR><DIV ALIGN=CENTER><B><FONT =\"+3\">" .
|
||||
html_quote($shortdesc) .
|
||||
"</B></FONT></DIV>\n";
|
||||
print "<TR><TD><B>Bug#:</B> <A HREF=\"show_bug.cgi?id=$id\">$id</A>\n";
|
||||
print "<TD><B>Product:</B> $product\n";
|
||||
print "<TD><B>Version:</B> $version\n";
|
||||
print "<TD><B>Platform:</B> $platform\n";
|
||||
print "<TR><TD><B>OS/Version:</B> $opsys\n";
|
||||
print "<TD><B>Status:</B> $status\n";
|
||||
print "<TD><B>Severity:</B> $severity\n";
|
||||
print "<TD><B>Priority:</B> $priority\n";
|
||||
print "<TR><TD><B>Resolution:</B> $resolution</TD>\n";
|
||||
print "<TD><B>Assigned To:</B> $assigned\n";
|
||||
print "<TD><B>Reported By:</B> $reporter\n";
|
||||
if (Param("useqacontact")) {
|
||||
my $name = "";
|
||||
if ($qa_contact > 0) {
|
||||
$name = DBID_to_name($qa_contact);
|
||||
}
|
||||
print "<TD><B>QA Contact:</B> $name\n";
|
||||
}
|
||||
print "<TR><TD><B>Component:</B> $component\n";
|
||||
if (Param("usetargetmilestone")) {
|
||||
print "<TD><B>Target milestone:</B>$target_milestone\n";
|
||||
}
|
||||
print "<TR><TD COLSPAN=6><B>URL:</B> " . html_quote($url) . "\n";
|
||||
print "<TR><TD COLSPAN=6><B>Summary:</B> " . html_quote($shortdesc) . "\n";
|
||||
if (Param("usestatuswhiteboard")) {
|
||||
print "<TR><TD COLSPAN=6><B>Status Whiteboard:" .
|
||||
html_quote($status_whiteboard) . "\n";
|
||||
}
|
||||
print "<TR><TD><B>Description:</B>\n</TABLE>\n";
|
||||
print "<PRE>" . html_quote(GetLongDescription($bug)) . "</PRE>\n";
|
||||
print "<HR>\n";
|
||||
}
|
||||
}
|
||||
47
mozilla/webtools/bugzilla/makeactivitytable.sh
Executable file
47
mozilla/webtools/bugzilla/makeactivitytable.sh
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# 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 <terry@mozilla.org>
|
||||
|
||||
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
|
||||
|
||||
use bugs;
|
||||
|
||||
drop table bugs_activity
|
||||
OK_ALL_DONE
|
||||
mysql << OK_ALL_DONE
|
||||
use bugs;
|
||||
create table bugs_activity (
|
||||
bug_id mediumint not null,
|
||||
who mediumint not null,
|
||||
when datetime not null,
|
||||
field varchar(64) not null,
|
||||
oldvalue tinytext,
|
||||
newvalue tinytext,
|
||||
|
||||
index (bug_id),
|
||||
index (when),
|
||||
index (field)
|
||||
);
|
||||
|
||||
|
||||
|
||||
show columns from bugs_activity;
|
||||
show index from bugs_activity;
|
||||
|
||||
OK_ALL_DONE
|
||||
45
mozilla/webtools/bugzilla/makeattachmenttable.sh
Executable file
45
mozilla/webtools/bugzilla/makeattachmenttable.sh
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# 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 <terry@mozilla.org>
|
||||
|
||||
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
|
||||
|
||||
use bugs;
|
||||
|
||||
drop table attachments;
|
||||
OK_ALL_DONE
|
||||
|
||||
mysql << OK_ALL_DONE
|
||||
use bugs;
|
||||
|
||||
create table attachments (
|
||||
attach_id mediumint not null auto_increment primary key,
|
||||
bug_id mediumint not null,
|
||||
creation_ts timestamp,
|
||||
description mediumtext not null,
|
||||
mimetype mediumtext not null,
|
||||
ispatch tinyint,
|
||||
filename mediumtext not null,
|
||||
thedata longblob not null,
|
||||
|
||||
index(bug_id),
|
||||
index(creation_ts)
|
||||
);
|
||||
|
||||
OK_ALL_DONE
|
||||
75
mozilla/webtools/bugzilla/makebugtable.sh
Executable file
75
mozilla/webtools/bugzilla/makebugtable.sh
Executable file
@@ -0,0 +1,75 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# 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 <terry@mozilla.org>
|
||||
|
||||
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
|
||||
|
||||
use bugs;
|
||||
|
||||
drop table bugs;
|
||||
OK_ALL_DONE
|
||||
|
||||
mysql << OK_ALL_DONE
|
||||
use bugs;
|
||||
create table bugs (
|
||||
bug_id mediumint not null auto_increment primary key,
|
||||
groupset bigint not null,
|
||||
assigned_to mediumint not null, # This is a comment.
|
||||
bug_file_loc text,
|
||||
bug_severity enum("critical", "major", "normal", "minor", "trivial", "enhancement") not null,
|
||||
bug_status enum("NEW", "ASSIGNED", "REOPENED", "RESOLVED", "VERIFIED", "CLOSED") not null,
|
||||
creation_ts datetime,
|
||||
delta_ts timestamp,
|
||||
short_desc mediumtext,
|
||||
long_desc mediumtext,
|
||||
op_sys enum("All", "Windows 3.1", "Windows 95", "Windows 98", "Windows NT", "Mac System 7", "Mac System 7.5", "Mac System 7.6.1", "Mac System 8.0", "Mac System 8.5", "AIX", "BSDI", "HP-UX", "IRIX", "Linux", "FreeBSD", "OSF/1", "Solaris", "SunOS", "OS/2", "other") not null,
|
||||
priority enum("P1", "P2", "P3", "P4", "P5") not null,
|
||||
product varchar(16) not null,
|
||||
rep_platform enum("All", "DEC", "HP", "Macintosh", "PC", "SGI", "Sun", "Other"),
|
||||
reporter mediumint not null,
|
||||
version varchar(16) not null,
|
||||
area enum("BUILD", "CODE", "CONTENT", "DOC", "PERFORMANCE", "TEST", "UI", "i18n", "l10n") not null,
|
||||
component varchar(50) not null,
|
||||
resolution enum("", "FIXED", "INVALID", "WONTFIX", "LATER", "REMIND", "DUPLICATE", "WORKSFORME") not null,
|
||||
target_milestone varchar(20) not null,
|
||||
qa_contact mediumint not null,
|
||||
status_whiteboard mediumtext not null,
|
||||
|
||||
index (assigned_to),
|
||||
index (delta_ts),
|
||||
index (bug_severity),
|
||||
index (bug_status),
|
||||
index (op_sys),
|
||||
index (priority),
|
||||
index (product),
|
||||
index (reporter),
|
||||
index (version),
|
||||
index (area),
|
||||
index (component),
|
||||
index (resolution),
|
||||
index (target_milestone),
|
||||
index (qa_contact)
|
||||
|
||||
);
|
||||
|
||||
show columns from bugs;
|
||||
show index from bugs;
|
||||
|
||||
|
||||
OK_ALL_DONE
|
||||
43
mozilla/webtools/bugzilla/makecctable.sh
Executable file
43
mozilla/webtools/bugzilla/makecctable.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# 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 <terry@mozilla.org>
|
||||
|
||||
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
|
||||
|
||||
use bugs;
|
||||
|
||||
drop table cc
|
||||
OK_ALL_DONE
|
||||
|
||||
mysql << OK_ALL_DONE
|
||||
use bugs;
|
||||
create table cc (
|
||||
bug_id mediumint not null,
|
||||
who mediumint not null,
|
||||
|
||||
index(bug_id),
|
||||
index(who)
|
||||
);
|
||||
|
||||
|
||||
|
||||
show columns from cc;
|
||||
show index from cc;
|
||||
|
||||
OK_ALL_DONE
|
||||
46
mozilla/webtools/bugzilla/makecomponenttable.sh
Executable file
46
mozilla/webtools/bugzilla/makecomponenttable.sh
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# 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 <terry@mozilla.org>
|
||||
|
||||
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
|
||||
|
||||
use bugs;
|
||||
|
||||
drop table components
|
||||
OK_ALL_DONE
|
||||
|
||||
mysql << OK_ALL_DONE
|
||||
use bugs;
|
||||
create table components (
|
||||
value tinytext,
|
||||
program tinytext,
|
||||
initialowner tinytext not null, # Should arguably be a mediumint!
|
||||
initialqacontact tinytext not null, # Should arguably be a mediumint!
|
||||
description mediumtext not null
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
insert into components (value, program, description) values ("TestComponent", "TestProduct", "This is a test component in the test product database. This ought to be blown away and replaced with real stuff in a finished installation of bugzilla.");
|
||||
|
||||
show columns from components;
|
||||
show index from components;
|
||||
|
||||
OK_ALL_DONE
|
||||
69
mozilla/webtools/bugzilla/makegroupstable.sh
Executable file
69
mozilla/webtools/bugzilla/makegroupstable.sh
Executable file
@@ -0,0 +1,69 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# 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 <terry@mozilla.org>
|
||||
|
||||
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
|
||||
|
||||
use bugs;
|
||||
|
||||
drop table groups
|
||||
OK_ALL_DONE
|
||||
|
||||
mysql << OK_ALL_DONE
|
||||
use bugs;
|
||||
create table groups (
|
||||
# This must be a power of two. Groups are identified by a bit; sets of
|
||||
# groups are indicated by or-ing these values together.
|
||||
bit bigint not null,
|
||||
name varchar(255) not null,
|
||||
description text not null,
|
||||
|
||||
# isbuggroup is nonzero if this is a group that controls access to a set
|
||||
# of bugs. In otherword, the groupset field in the bugs table should only
|
||||
# have this group's bit set if isbuggroup is nonzero.
|
||||
isbuggroup tinyint not null,
|
||||
|
||||
# User regexp is which email addresses are initially put into this group.
|
||||
# This is only used when an email account is created; otherwise, profiles
|
||||
# may be individually tweaked to add them in and out of groups.
|
||||
userregexp tinytext not null,
|
||||
|
||||
|
||||
unique(bit),
|
||||
unique(name)
|
||||
|
||||
);
|
||||
|
||||
|
||||
insert into groups (bit, name, description, userregexp) values (pow(2,0), "tweakparams", "Can tweak operating parameters", "");
|
||||
insert into groups (bit, name, description, userregexp) values (pow(2,1), "editgroupmembers", "Can put people in and out of groups that they are members of.", "");
|
||||
insert into groups (bit, name, description, userregexp) values (pow(2,2), "creategroups", "Can create and destroy groups.", "");
|
||||
insert into groups (bit, name, description, userregexp) values (pow(2,3), "editcomponents", "Can create, destroy, and edit components.", "");
|
||||
|
||||
|
||||
|
||||
show columns from groups;
|
||||
show index from groups;
|
||||
|
||||
|
||||
# Check for bad bit values.
|
||||
|
||||
select "*** Bad bit value", bit from groups where bit != pow(2, round(log(bit) / log(2)));
|
||||
|
||||
OK_ALL_DONE
|
||||
40
mozilla/webtools/bugzilla/makelogincookiestable.sh
Executable file
40
mozilla/webtools/bugzilla/makelogincookiestable.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# 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 <terry@mozilla.org>
|
||||
|
||||
mysql bugs > /dev/null 2>/dev/null << OK_ALL_DONE
|
||||
|
||||
drop table logincookies;
|
||||
OK_ALL_DONE
|
||||
|
||||
mysql bugs << OK_ALL_DONE
|
||||
|
||||
create table logincookies (
|
||||
cookie mediumint not null auto_increment primary key,
|
||||
userid mediumint not null,
|
||||
cryptpassword varchar(64),
|
||||
hostname varchar(128),
|
||||
lastused timestamp,
|
||||
index(lastused)
|
||||
);
|
||||
|
||||
show columns from logincookies;
|
||||
show index from logincookies;
|
||||
|
||||
OK_ALL_DONE
|
||||
42
mozilla/webtools/bugzilla/makeproducttable.sh
Executable file
42
mozilla/webtools/bugzilla/makeproducttable.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# 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 <terry@mozilla.org>
|
||||
|
||||
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
|
||||
|
||||
use bugs;
|
||||
|
||||
drop table products;
|
||||
OK_ALL_DONE
|
||||
|
||||
mysql << OK_ALL_DONE
|
||||
use bugs;
|
||||
create table products (
|
||||
product tinytext,
|
||||
description mediumtext,
|
||||
milestoneurl tinytext not null,
|
||||
disallownew tinyint not null
|
||||
);
|
||||
|
||||
|
||||
|
||||
insert into products(product, description) values ("TestProduct", "This is a test product. This ought to be blown away and replaced with real stuff in a finished installation of bugzilla.");
|
||||
|
||||
|
||||
OK_ALL_DONE
|
||||
44
mozilla/webtools/bugzilla/makeprofilestable.sh
Executable file
44
mozilla/webtools/bugzilla/makeprofilestable.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# 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 <terry@mozilla.org>
|
||||
|
||||
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
|
||||
|
||||
use bugs;
|
||||
|
||||
drop table profiles
|
||||
OK_ALL_DONE
|
||||
|
||||
mysql << OK_ALL_DONE
|
||||
use bugs;
|
||||
create table profiles (
|
||||
userid mediumint not null auto_increment primary key,
|
||||
login_name varchar(255) not null,
|
||||
password varchar(16),
|
||||
cryptpassword varchar(64),
|
||||
realname varchar(255),
|
||||
groupset bigint not null,
|
||||
index(login_name)
|
||||
);
|
||||
|
||||
|
||||
show columns from profiles;
|
||||
show index from profiles;
|
||||
|
||||
OK_ALL_DONE
|
||||
43
mozilla/webtools/bugzilla/makeversiontable.sh
Executable file
43
mozilla/webtools/bugzilla/makeversiontable.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# 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 <terry@mozilla.org>
|
||||
|
||||
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
|
||||
|
||||
use bugs;
|
||||
|
||||
drop table versions
|
||||
OK_ALL_DONE
|
||||
|
||||
mysql << OK_ALL_DONE
|
||||
use bugs;
|
||||
create table versions (
|
||||
value tinytext,
|
||||
program tinytext
|
||||
);
|
||||
|
||||
|
||||
insert into versions (value, program) values ("other", "TestProduct");
|
||||
|
||||
select * from versions;
|
||||
|
||||
show columns from versions;
|
||||
show index from versions;
|
||||
|
||||
OK_ALL_DONE
|
||||
41
mozilla/webtools/bugzilla/new_comment.cgi
Executable file
41
mozilla/webtools/bugzilla/new_comment.cgi
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bonsaitools/bin/perl
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
if ($ENV{'REQUEST_METHOD'} eq "GET") { $buffer = $ENV{'QUERY_STRING'}; }
|
||||
else { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); }
|
||||
# Split the name-value pairs
|
||||
@pairs = split(/&/, $buffer);
|
||||
foreach $pair (@pairs)
|
||||
{
|
||||
($name, $value) = split(/=/, $pair);
|
||||
|
||||
$value =~ tr/+/ /;
|
||||
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
|
||||
$FORM{$name} = $value;
|
||||
}
|
||||
open(COMMENTS, ">>data/comments");
|
||||
$c=$FORM{"comment"};
|
||||
print COMMENTS $FORM{"comment"} . "\n";
|
||||
close(COMMENTS);
|
||||
print "Content-type: text/html\n\n";
|
||||
print "<TITLE>The Word Of Confirmation</TITLE>";
|
||||
print "<H1>Done</H1>";
|
||||
print $c;
|
||||
34
mozilla/webtools/bugzilla/newquip.html
Normal file
34
mozilla/webtools/bugzilla/newquip.html
Normal file
@@ -0,0 +1,34 @@
|
||||
<HTML>
|
||||
|
||||
<!--
|
||||
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 <terry@mozilla.org>
|
||||
-->
|
||||
|
||||
<TITLE>I'm So Pretty and Witty And Wise</TITLE>
|
||||
<H2>Add your own clever headline.</h2>
|
||||
The buglist picks a random quip for the headline, and
|
||||
you can extend the quip list. Type in something clever or
|
||||
funny or boring and bonk on the button.
|
||||
<HR>
|
||||
<FORM METHOD=POST ACTION="new_comment.cgi">
|
||||
<INPUT SIZE=80 NAME="comment"><BR>
|
||||
<INPUT TYPE="submit" VALUE="Add This Quip"></FORM>
|
||||
</HR>
|
||||
For the impatient, you can
|
||||
<A HREF="data/comments">view the whole quip list</A>.
|
||||
10
mozilla/webtools/bugzilla/notargetmilestone.html
Normal file
10
mozilla/webtools/bugzilla/notargetmilestone.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<html> <head>
|
||||
<title>No target milestones.</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>No target milestones.</h1>
|
||||
|
||||
No target milestones have been defined for this product. You can set
|
||||
the Target Milestone field to things, but there is not currently any
|
||||
agreed definition of what the milestones are.
|
||||
144
mozilla/webtools/bugzilla/post_bug.cgi
Executable file
144
mozilla/webtools/bugzilla/post_bug.cgi
Executable file
@@ -0,0 +1,144 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
# Shut up misguided -w warnings about "used only once". For some reason,
|
||||
# "use vars" chokes on me when I try it here.
|
||||
|
||||
# use vars qw($::buffer);
|
||||
my $zz = $::buffer;
|
||||
$zz = $zz . $zz;
|
||||
|
||||
confirm_login();
|
||||
|
||||
print "Set-Cookie: PLATFORM=$::FORM{'product'} ; path=/ ; expires=Sun, 30-Jun-2029 00:00:00 GMT\n";
|
||||
print "Set-Cookie: VERSION-$::FORM{'product'}=$::FORM{'version'} ; path=/ ; expires=Sun, 30-Jun-2029 00:00:00 GMT\n";
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
if (defined $::FORM{'maketemplate'}) {
|
||||
print "<TITLE>Bookmarks are your friend.</TITLE>\n";
|
||||
print "<H1>Template constructed.</H1>\n";
|
||||
|
||||
my $url = "enter_bug.cgi?$::buffer";
|
||||
|
||||
print "If you put a bookmark <a href=\"$url\">to this link</a>, it will\n";
|
||||
print "bring up the submit-a-new-bug page with the fields initialized\n";
|
||||
print "as you've requested.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
PutHeader("Posting Bug -- Please wait", "Posting Bug", "One moment please...");
|
||||
|
||||
umask 0;
|
||||
ConnectToDatabase();
|
||||
|
||||
if (!defined $::FORM{'component'} || $::FORM{'component'} eq "") {
|
||||
print "You must choose a component that corresponds to this bug. If\n";
|
||||
print "necessary, just guess. But please hit the <B>Back</B> button\n";
|
||||
print "and choose a component.\n";
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
my $forceAssignedOK = 0;
|
||||
if ($::FORM{'assigned_to'} eq "") {
|
||||
SendSQL("select initialowner from components where program=" .
|
||||
SqlQuote($::FORM{'product'}) .
|
||||
" and value=" . SqlQuote($::FORM{'component'}));
|
||||
$::FORM{'assigned_to'} = FetchOneColumn();
|
||||
$forceAssignedOK = 1;
|
||||
}
|
||||
|
||||
$::FORM{'assigned_to'} = DBNameToIdAndCheck($::FORM{'assigned_to'}, $forceAssignedOK);
|
||||
$::FORM{'reporter'} = DBNameToIdAndCheck($::FORM{'reporter'});
|
||||
|
||||
|
||||
my @bug_fields = ("reporter", "product", "version", "rep_platform",
|
||||
"bug_severity", "priority", "op_sys", "assigned_to",
|
||||
"bug_status", "bug_file_loc", "short_desc", "component");
|
||||
|
||||
if (Param("useqacontact")) {
|
||||
SendSQL("select initialqacontact from components where program=" .
|
||||
SqlQuote($::FORM{'product'}) .
|
||||
" and value=" . SqlQuote($::FORM{'component'}));
|
||||
my $qacontact = FetchOneColumn();
|
||||
if (defined $qacontact && $qacontact ne "") {
|
||||
$::FORM{'qa_contact'} = DBNameToIdAndCheck($qacontact, 1);
|
||||
push(@bug_fields, "qa_contact");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
my $query = "insert into bugs (\n" . join(",\n", @bug_fields) . ",
|
||||
creation_ts, long_desc )
|
||||
values (
|
||||
";
|
||||
|
||||
|
||||
foreach my $field (@bug_fields) {
|
||||
$query .= SqlQuote($::FORM{$field}) . ",\n";
|
||||
}
|
||||
|
||||
my $comment = $::FORM{'comment'};
|
||||
$comment =~ s/\r\n/\n/g; # Get rid of windows-style line endings.
|
||||
$comment =~ s/\r/\n/g; # Get rid of mac-style line endings.
|
||||
$comment = trim($comment);
|
||||
|
||||
$query .= "now(), " . SqlQuote($comment) . " )\n";
|
||||
|
||||
|
||||
my %ccids;
|
||||
|
||||
|
||||
if (defined $::FORM{'cc'}) {
|
||||
foreach my $person (split(/[ ,]/, $::FORM{'cc'})) {
|
||||
if ($person ne "") {
|
||||
$ccids{DBNameToIdAndCheck($person)} = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# print "<PRE>$query</PRE>\n";
|
||||
|
||||
SendSQL($query);
|
||||
|
||||
SendSQL("select LAST_INSERT_ID()");
|
||||
my $id = FetchOneColumn();
|
||||
|
||||
foreach my $person (keys %ccids) {
|
||||
SendSQL("insert into cc (bug_id, who) values ($id, $person)");
|
||||
}
|
||||
|
||||
print "<H2>Changes Submitted</H2>\n";
|
||||
print "<A HREF=\"show_bug.cgi?id=$id\">Show BUG# $id</A>\n";
|
||||
print "<BR><A HREF=\"query.cgi\">Back To Query Page</A>\n";
|
||||
|
||||
system("./processmail $id < /dev/null > /dev/null 2> /dev/null &");
|
||||
exit;
|
||||
346
mozilla/webtools/bugzilla/process_bug.cgi
Executable file
346
mozilla/webtools/bugzilla/process_bug.cgi
Executable file
@@ -0,0 +1,346 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
# Shut up misguided -w warnings about "used only once":
|
||||
|
||||
use vars %::versions,
|
||||
%::components,
|
||||
%::COOKIE;
|
||||
|
||||
confirm_login();
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
GetVersionTable();
|
||||
|
||||
if ($::FORM{'product'} ne $::dontchange) {
|
||||
my $prod = $::FORM{'product'};
|
||||
my $vok = lsearch($::versions{$prod}, $::FORM{'version'}) >= 0;
|
||||
my $cok = lsearch($::components{$prod}, $::FORM{'component'}) >= 0;
|
||||
if (!$vok || !$cok) {
|
||||
print "<H1>Changing product means changing version and component.</H1>\n";
|
||||
print "You have chosen a new product, and now the version and/or\n";
|
||||
print "component fields are not correct. (Or, possibly, the bug did\n";
|
||||
print "not have a valid component or version field in the first place.)\n";
|
||||
print "Anyway, please set the version and component now.<p>\n";
|
||||
print "<form>\n";
|
||||
print "<table>\n";
|
||||
print "<tr>\n";
|
||||
print "<td align=right><b>Product:</b></td>\n";
|
||||
print "<td>$prod</td>\n";
|
||||
print "</tr><tr>\n";
|
||||
print "<td align=right><b>Version:</b></td>\n";
|
||||
print "<td>" . Version_element($::FORM{'version'}, $prod) . "</td>\n";
|
||||
print "</tr><tr>\n";
|
||||
print "<td align=right><b>Component:</b></td>\n";
|
||||
print "<td>" . Component_element($::FORM{'component'}, $prod) . "</td>\n";
|
||||
print "</tr>\n";
|
||||
print "</table>\n";
|
||||
foreach my $i (keys %::FORM) {
|
||||
if ($i ne 'version' && $i ne 'component') {
|
||||
print "<input type=hidden name=$i value=\"" .
|
||||
value_quote($::FORM{$i}) . "\">\n";
|
||||
}
|
||||
}
|
||||
print "<input type=submit value=Commit>\n";
|
||||
print "</form>\n";
|
||||
print "</hr>\n";
|
||||
print "<a href=query.cgi>Cancel all this and go back to the query page.</a>\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my @idlist;
|
||||
if (defined $::FORM{'id'}) {
|
||||
push @idlist, $::FORM{'id'};
|
||||
} else {
|
||||
foreach my $i (keys %::FORM) {
|
||||
if ($i =~ /^id_/) {
|
||||
push @idlist, substr($i, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!defined $::FORM{'who'}) {
|
||||
$::FORM{'who'} = $::COOKIE{'Bugzilla_login'};
|
||||
}
|
||||
|
||||
print "<TITLE>Update Bug " . join(" ", @idlist) . "</TITLE>\n";
|
||||
if (defined $::FORM{'id'}) {
|
||||
navigation_header();
|
||||
}
|
||||
print "<HR>\n";
|
||||
$::query = "update bugs\nset";
|
||||
$::comma = "";
|
||||
umask(0);
|
||||
|
||||
sub DoComma {
|
||||
$::query .= "$::comma\n ";
|
||||
$::comma = ",";
|
||||
}
|
||||
|
||||
sub ChangeStatus {
|
||||
my ($str) = (@_);
|
||||
if ($str ne $::dontchange) {
|
||||
DoComma();
|
||||
$::query .= "bug_status = '$str'";
|
||||
}
|
||||
}
|
||||
|
||||
sub ChangeResolution {
|
||||
my ($str) = (@_);
|
||||
if ($str ne $::dontchange) {
|
||||
DoComma();
|
||||
$::query .= "resolution = '$str'";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $foundbit = 0;
|
||||
foreach my $b (grep(/^bit-\d*$/, keys %::FORM)) {
|
||||
if (!$foundbit) {
|
||||
$foundbit = 1;
|
||||
DoComma();
|
||||
$::query .= "groupset = 0";
|
||||
}
|
||||
if ($::FORM{$b}) {
|
||||
my $v = substr($b, 4);
|
||||
$::query .= "+ $v"; # Carefully written so that the math is
|
||||
# done by MySQL, which can handle 64-bit math,
|
||||
# and not by Perl, which I *think* can not.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach my $field ("rep_platform", "priority", "bug_severity", "url",
|
||||
"summary", "component", "bug_file_loc", "short_desc",
|
||||
"product", "version", "component", "op_sys",
|
||||
"target_milestone", "status_whiteboard") {
|
||||
if (defined $::FORM{$field}) {
|
||||
if ($::FORM{$field} ne $::dontchange) {
|
||||
DoComma();
|
||||
$::query .= "$field = " . SqlQuote(trim($::FORM{$field}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (defined $::FORM{'qa_contact'}) {
|
||||
my $name = trim($::FORM{'qa_contact'});
|
||||
if ($name ne $::dontchange) {
|
||||
my $id = 0;
|
||||
if ($name ne "") {
|
||||
$id = DBNameToIdAndCheck($name);
|
||||
}
|
||||
DoComma();
|
||||
$::query .= "qa_contact = $id";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ConnectToDatabase();
|
||||
|
||||
SWITCH: for ($::FORM{'knob'}) {
|
||||
/^none$/ && do {
|
||||
last SWITCH;
|
||||
};
|
||||
/^accept$/ && do {
|
||||
ChangeStatus('ASSIGNED');
|
||||
last SWITCH;
|
||||
};
|
||||
/^clearresolution$/ && do {
|
||||
ChangeResolution('');
|
||||
last SWITCH;
|
||||
};
|
||||
/^resolve$/ && do {
|
||||
ChangeStatus('RESOLVED');
|
||||
ChangeResolution($::FORM{'resolution'});
|
||||
last SWITCH;
|
||||
};
|
||||
/^reassign$/ && do {
|
||||
ChangeStatus('NEW');
|
||||
DoComma();
|
||||
my $newid = DBNameToIdAndCheck($::FORM{'assigned_to'});
|
||||
$::query .= "assigned_to = $newid";
|
||||
last SWITCH;
|
||||
};
|
||||
/^reassignbycomponent$/ && do {
|
||||
if ($::FORM{'component'} eq $::dontchange) {
|
||||
print "You must specify a component whose owner should get\n";
|
||||
print "assigned these bugs.\n";
|
||||
exit 0
|
||||
}
|
||||
ChangeStatus('NEW');
|
||||
SendSQL("select initialowner from components where program=" .
|
||||
SqlQuote($::FORM{'product'}) . " and value=" .
|
||||
SqlQuote($::FORM{'component'}));
|
||||
my $newname = FetchOneColumn();
|
||||
my $newid = DBNameToIdAndCheck($newname, 1);
|
||||
DoComma();
|
||||
$::query .= "assigned_to = $newid";
|
||||
last SWITCH;
|
||||
};
|
||||
/^reopen$/ && do {
|
||||
ChangeStatus('REOPENED');
|
||||
last SWITCH;
|
||||
};
|
||||
/^verify$/ && do {
|
||||
ChangeStatus('VERIFIED');
|
||||
last SWITCH;
|
||||
};
|
||||
/^close$/ && do {
|
||||
ChangeStatus('CLOSED');
|
||||
last SWITCH;
|
||||
};
|
||||
/^duplicate$/ && do {
|
||||
ChangeStatus('RESOLVED');
|
||||
ChangeResolution('DUPLICATE');
|
||||
my $num = trim($::FORM{'dup_id'});
|
||||
if ($num !~ /^[0-9]*$/) {
|
||||
print "You must specify a bug number of which this bug is a\n";
|
||||
print "duplicate. The bug has not been changed.\n";
|
||||
exit;
|
||||
}
|
||||
if ($::FORM{'dup_id'} == $::FORM{'id'}) {
|
||||
print "Nice try. But it doesn't really make sense to mark a\n";
|
||||
print "bug as a duplicate of itself, does it?\n";
|
||||
exit;
|
||||
}
|
||||
AppendComment($::FORM{'dup_id'}, $::FORM{'who'}, "*** Bug $::FORM{'id'} has been marked as a duplicate of this bug. ***");
|
||||
$::FORM{'comment'} .= "\n\n*** This bug has been marked as a duplicate of $::FORM{'dup_id'} ***";
|
||||
system("./processmail $::FORM{'dup_id'} < /dev/null > /dev/null 2> /dev/null &");
|
||||
last SWITCH;
|
||||
};
|
||||
# default
|
||||
print "Unknown action $::FORM{'knob'}!\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if ($#idlist < 0) {
|
||||
print "You apparently didn't choose any bugs to modify.\n";
|
||||
print "<p>Click <b>Back</b> and try again.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($::comma eq "") {
|
||||
if (!defined $::FORM{'comment'} || $::FORM{'comment'} =~ /^\s*$/) {
|
||||
print "Um, you apparently did not change anything on the selected\n";
|
||||
print "bugs. <p>Click <b>Back</b> and try again.\n";
|
||||
exit
|
||||
}
|
||||
}
|
||||
|
||||
my $basequery = $::query;
|
||||
|
||||
sub SnapShotBug {
|
||||
my ($id) = (@_);
|
||||
SendSQL("select " . join(',', @::log_columns) .
|
||||
" from bugs where bug_id = $id");
|
||||
return FetchSQLData();
|
||||
}
|
||||
|
||||
|
||||
foreach my $id (@idlist) {
|
||||
SendSQL("lock tables bugs write, bugs_activity write, cc write, profiles write");
|
||||
my @oldvalues = SnapShotBug($id);
|
||||
|
||||
my $query = "$basequery\nwhere bug_id = $id";
|
||||
|
||||
# print "<PRE>$query</PRE>\n";
|
||||
|
||||
if ($::comma ne "") {
|
||||
SendSQL($query);
|
||||
}
|
||||
|
||||
if (defined $::FORM{'comment'}) {
|
||||
AppendComment($id, $::FORM{'who'}, $::FORM{'comment'});
|
||||
}
|
||||
|
||||
if (defined $::FORM{'cc'} && ShowCcList($id) ne $::FORM{'cc'}) {
|
||||
my %ccids;
|
||||
foreach my $person (split(/[ ,]/, $::FORM{'cc'})) {
|
||||
if ($person ne "") {
|
||||
my $cid = DBNameToIdAndCheck($person);
|
||||
$ccids{$cid} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
SendSQL("delete from cc where bug_id = $id");
|
||||
foreach my $ccid (keys %ccids) {
|
||||
SendSQL("insert into cc (bug_id, who) values ($id, $ccid)");
|
||||
}
|
||||
}
|
||||
|
||||
my @newvalues = SnapShotBug($id);
|
||||
my $whoid;
|
||||
my $timestamp;
|
||||
foreach my $col (@::log_columns) {
|
||||
my $old = shift @oldvalues;
|
||||
my $new = shift @newvalues;
|
||||
if (!defined $old) {
|
||||
$old = "";
|
||||
}
|
||||
if (!defined $new) {
|
||||
$new = "";
|
||||
}
|
||||
if ($old ne $new) {
|
||||
if (!defined $whoid) {
|
||||
$whoid = DBNameToIdAndCheck($::FORM{'who'});
|
||||
SendSQL("select delta_ts from bugs where bug_id = $id");
|
||||
$timestamp = FetchOneColumn();
|
||||
}
|
||||
if ($col eq 'assigned_to') {
|
||||
$old = DBID_to_name($old);
|
||||
$new = DBID_to_name($new);
|
||||
}
|
||||
$col = SqlQuote($col);
|
||||
$old = SqlQuote($old);
|
||||
$new = SqlQuote($new);
|
||||
my $q = "insert into bugs_activity (bug_id,who,when,field,oldvalue,newvalue) values ($id,$whoid,$timestamp,$col,$old,$new)";
|
||||
# puts "<pre>$q</pre>"
|
||||
SendSQL($q);
|
||||
}
|
||||
}
|
||||
|
||||
print "<TABLE BORDER=1><TD><H1>Changes Submitted</H1>\n";
|
||||
print "<TD><A HREF=\"show_bug.cgi?id=$id\">Back To BUG# $id</A></TABLE>\n";
|
||||
|
||||
SendSQL("unlock tables");
|
||||
|
||||
system("./processmail $id < /dev/null > /dev/null 2> /dev/null &");
|
||||
}
|
||||
|
||||
if (defined $::next_bug) {
|
||||
$::FORM{'id'} = $::next_bug;
|
||||
print "<HR>\n";
|
||||
|
||||
navigation_header();
|
||||
do "bug_form.pl";
|
||||
} else {
|
||||
print "<BR><A HREF=\"query.cgi\">Back To Query Page</A>\n";
|
||||
}
|
||||
295
mozilla/webtools/bugzilla/processmail
Executable file
295
mozilla/webtools/bugzilla/processmail
Executable file
@@ -0,0 +1,295 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
|
||||
# To recreate the shadow database, run "processmail regenerate" .
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "globals.pl";
|
||||
|
||||
$| = 1;
|
||||
|
||||
umask(0);
|
||||
|
||||
$::lockcount = 0;
|
||||
|
||||
sub Lock {
|
||||
if ($::lockcount <= 0) {
|
||||
$::lockcount = 0;
|
||||
if (!open(LOCKFID, ">>data/maillock")) {
|
||||
mkdir "data", 0777;
|
||||
chmod 0777, "data";
|
||||
open(LOCKFID, ">>data/maillock") || die "Can't open lockfile.";
|
||||
}
|
||||
my $val = flock(LOCKFID,2);
|
||||
if (!$val) { # '2' is magic 'exclusive lock' const.
|
||||
print "Lock failed: $val\n";
|
||||
}
|
||||
chmod 0666, "data/maillock";
|
||||
}
|
||||
$::lockcount++;
|
||||
}
|
||||
|
||||
sub Unlock {
|
||||
$::lockcount--;
|
||||
if ($::lockcount <= 0) {
|
||||
flock(LOCKFID,8); # '8' is magic 'unlock' const.
|
||||
close LOCKFID;
|
||||
}
|
||||
}
|
||||
|
||||
sub FileSize {
|
||||
my ($filename) = (@_);
|
||||
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
|
||||
$atime,$mtime,$ctime,$blksize,$blocks)
|
||||
= stat($filename);
|
||||
if (defined $size) {
|
||||
return $size;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub Different {
|
||||
my ($file1, $file2) = (@_);
|
||||
my $size1 = FileSize($file1);
|
||||
my $size2 = FileSize($file2);
|
||||
if ($size1 != $size2) {
|
||||
return 1;
|
||||
}
|
||||
open(FID1, "<$file1") || die "Can't open $file1";
|
||||
open(FID2, "<$file2") || die "Can't open $file2";
|
||||
my $d1;
|
||||
my $d2;
|
||||
if (read(FID1, $d1, $size1) ne $size1) {
|
||||
die "Can't read $size1 bytes from $file1";
|
||||
}
|
||||
if (read(FID2, $d2, $size2) ne $size2) {
|
||||
die "Can't read $size2 bytes from $file2";
|
||||
}
|
||||
close FID1;
|
||||
close FID2;
|
||||
return ($d1 ne $d2);
|
||||
}
|
||||
|
||||
|
||||
sub DescCC {
|
||||
my ($cclist) = (@_);
|
||||
if (scalar(@$cclist) <= 0) {
|
||||
return "";
|
||||
}
|
||||
return "Cc: " . join(", ", @$cclist) . "\n";
|
||||
}
|
||||
|
||||
|
||||
sub GetBugText {
|
||||
my ($id) = (@_);
|
||||
undef %::bug;
|
||||
|
||||
my @collist = ("bug_id", "product", "version", "rep_platform", "op_sys",
|
||||
"bug_status", "resolution", "priority", "bug_severity",
|
||||
"area", "assigned_to", "reporter", "bug_file_loc",
|
||||
"short_desc", "component", "qa_contact", "target_milestone",
|
||||
"status_whiteboard");
|
||||
|
||||
my $query = "select " . join(", ", @collist) .
|
||||
" from bugs where bug_id = $id";
|
||||
|
||||
SendSQL($query);
|
||||
|
||||
my @row;
|
||||
if (!(@row = FetchSQLData())) {
|
||||
return "";
|
||||
}
|
||||
foreach my $field (@collist) {
|
||||
$::bug{$field} = shift @row;
|
||||
if (!defined $::bug{$field}) {
|
||||
$::bug{$field} = "";
|
||||
}
|
||||
}
|
||||
|
||||
$::bug{'assigned_to'} = DBID_to_name($::bug{'assigned_to'});
|
||||
$::bug{'reporter'} = DBID_to_name($::bug{'reporter'});
|
||||
my $qa_contact = "";
|
||||
my $target_milestone = "";
|
||||
my $status_whiteboard = "";
|
||||
if (Param('useqacontact') && $::bug{'qa_contact'} > 0) {
|
||||
$::bug{'qa_contact'} = DBID_to_name($::bug{'qa_contact'});
|
||||
$qa_contact = "QAContact: $::bug{'qa_contact'}\n";
|
||||
} else {
|
||||
$::bug{'qa_contact'} = "";
|
||||
}
|
||||
if (Param('usetargetmilestone') && $::bug{'target_milestone'} ne "") {
|
||||
$target_milestone = "TargetMilestone: $::bug{'target_milestone'}\n";
|
||||
}
|
||||
if (Param('usestatuswhiteboard') && $::bug{'status_whiteboard'} ne "") {
|
||||
$status_whiteboard = "StatusWhiteboard: $::bug{'status_whiteboard'}\n";
|
||||
}
|
||||
|
||||
$::bug{'long_desc'} = GetLongDescription($id);
|
||||
|
||||
my @cclist;
|
||||
@cclist = split(/,/, ShowCcList($id));
|
||||
$::bug{'cclist'} = \@cclist;
|
||||
|
||||
|
||||
return "Bug\#: $id
|
||||
Product: $::bug{'product'}
|
||||
Version: $::bug{'version'}
|
||||
Platform: $::bug{'rep_platform'}
|
||||
OS/Version: $::bug{'op_sys'}
|
||||
Status: $::bug{'bug_status'}
|
||||
Resolution: $::bug{'resolution'}
|
||||
Severity: $::bug{'bug_severity'}
|
||||
Priority: $::bug{'priority'}
|
||||
Component: $::bug{'component'}
|
||||
Area: $::bug{'area'}
|
||||
AssignedTo: $::bug{'assigned_to'}
|
||||
ReportedBy: $::bug{'reporter'}
|
||||
$qa_contact$target_milestone${status_whiteboard}URL: $::bug{'bug_file_loc'}
|
||||
" . DescCC($::bug{'cclist'}) . "Summary: $::bug{'short_desc'}
|
||||
|
||||
$::bug{'long_desc'}
|
||||
";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub fixaddresses {
|
||||
my ($list) = (@_);
|
||||
my @result;
|
||||
my %seen;
|
||||
foreach my $i (@$list) {
|
||||
if ($i ne "" && !defined $::nomail{$i} && !defined $seen{$i}) {
|
||||
push @result, $i;
|
||||
$seen{$i} = 1;
|
||||
}
|
||||
}
|
||||
return join(", ", @result);
|
||||
}
|
||||
|
||||
|
||||
sub Log {
|
||||
my ($str) = (@_);
|
||||
Lock();
|
||||
open(FID, ">>data/maillog") || die "Can't write to data/maillog";
|
||||
print FID time2str("%D %H:%M", time()) . ": $str\n";
|
||||
close FID;
|
||||
Unlock();
|
||||
}
|
||||
|
||||
|
||||
ConnectToDatabase();
|
||||
|
||||
|
||||
Lock();
|
||||
|
||||
# foreach i [split [read_file -nonewline "okmail"] "\n"] {
|
||||
# set okmail($i) 1
|
||||
# }
|
||||
|
||||
|
||||
|
||||
if (open(FID, "<data/nomail")) {
|
||||
while (<FID>) {
|
||||
$::nomail{trim($_)} = 1;
|
||||
}
|
||||
close FID;
|
||||
}
|
||||
|
||||
|
||||
my $regenerate = 0;
|
||||
|
||||
if ($ARGV[0] eq "regenerate") {
|
||||
$regenerate = 1;
|
||||
shift @ARGV;
|
||||
SendSQL("select bug_id from bugs order by bug_id");
|
||||
my @row;
|
||||
while (@row = FetchSQLData()) {
|
||||
push @ARGV, $row[0];
|
||||
}
|
||||
print "$#ARGV bugs to be regenerated.\n";
|
||||
}
|
||||
|
||||
foreach my $i (@ARGV) {
|
||||
my $old = "shadow/$i";
|
||||
my $new = "shadow/$i.tmp.$$";
|
||||
my $diffs = "shadow/$i.diffs.$$";
|
||||
my $verb = "Changed";
|
||||
if (!stat($old)) {
|
||||
mkdir "shadow", 0777;
|
||||
chmod 0777, "shadow";
|
||||
open(OLD, ">$old") || die "Couldn't create null $old";
|
||||
close OLD;
|
||||
$verb = "New";
|
||||
}
|
||||
my $text = GetBugText($i);
|
||||
if ($text eq "") {
|
||||
die "Couldn't find bug $i.";
|
||||
}
|
||||
open(FID, ">$new") || die "Couldn't create $new";
|
||||
print FID $text;
|
||||
close FID;
|
||||
if (Different($old, $new)) {
|
||||
system("diff -c -b $old $new > $diffs");
|
||||
my $tolist = fixaddresses([$::bug{'assigned_to'}, $::bug{'reporter'},
|
||||
$::bug{'qa_contact'}]);
|
||||
my $cclist = fixaddresses($::bug{'cclist'});
|
||||
my $logstr = "Bug $i changed";
|
||||
if ($tolist ne "" || $cclist ne "") {
|
||||
my %substs;
|
||||
|
||||
$substs{"to"} = $tolist;
|
||||
$substs{"cc"} = $cclist;
|
||||
$substs{"bugid"} = $i;
|
||||
$substs{"diffs"} = "";
|
||||
open(DIFFS, "<$diffs") || die "Can't open $diffs";
|
||||
while (<DIFFS>) {
|
||||
$substs{"diffs"} .= $_;
|
||||
}
|
||||
close DIFFS;
|
||||
$substs{"neworchanged"} = $verb;
|
||||
$substs{"summary"} = $::bug{'short_desc'};
|
||||
my $msg = PerformSubsts(Param("changedmail"), \%substs);
|
||||
|
||||
if (!$regenerate) {
|
||||
open(SENDMAIL, "|/usr/lib/sendmail -t") ||
|
||||
die "Can't open sendmail";
|
||||
print SENDMAIL $msg;
|
||||
close SENDMAIL;
|
||||
$logstr = "$logstr; mail sent to $tolist $cclist";
|
||||
}
|
||||
}
|
||||
unlink($diffs);
|
||||
Log($logstr);
|
||||
}
|
||||
rename($new, $old) || die "Can't rename $new to $old";
|
||||
chmod 0666, $old;
|
||||
if ($regenerate) {
|
||||
print "$i ";
|
||||
}
|
||||
}
|
||||
|
||||
exit;
|
||||
559
mozilla/webtools/bugzilla/query.cgi
Executable file
559
mozilla/webtools/bugzilla/query.cgi
Executable file
@@ -0,0 +1,559 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
# David Gardiner <david.gardiner@unisa.edu.au>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
# Shut up misguided -w warnings about "used only once":
|
||||
|
||||
use vars @::legal_resolution,
|
||||
@::legal_product,
|
||||
@::legal_bug_status,
|
||||
@::legal_priority,
|
||||
@::legal_opsys,
|
||||
@::legal_platform,
|
||||
@::legal_components,
|
||||
@::legal_versions,
|
||||
@::legal_severity,
|
||||
@::legal_target_milestone,
|
||||
@::log_columns,
|
||||
%::versions,
|
||||
%::components,
|
||||
%::FORM;
|
||||
|
||||
|
||||
if (defined $::FORM{"GoAheadAndLogIn"}) {
|
||||
# We got here from a login page, probably from relogin.cgi. We better
|
||||
# make sure the password is legit.
|
||||
confirm_login();
|
||||
}
|
||||
|
||||
if (!defined $::COOKIE{"DEFAULTQUERY"}) {
|
||||
$::COOKIE{"DEFAULTQUERY"} = Param("defaultquery");
|
||||
}
|
||||
|
||||
if (!defined $::buffer || $::buffer eq "") {
|
||||
$::buffer = $::COOKIE{"DEFAULTQUERY"};
|
||||
}
|
||||
|
||||
my %default;
|
||||
my %type;
|
||||
|
||||
foreach my $name ("bug_status", "resolution", "assigned_to", "rep_platform",
|
||||
"priority", "bug_severity", "product", "reporter", "op_sys",
|
||||
"component", "version", "chfield", "chfieldfrom",
|
||||
"chfieldto", "chfieldvalue",
|
||||
"email1", "emailtype1", "emailreporter1",
|
||||
"emailassigned_to1", "emailcc1", "emailqa_contact1",
|
||||
"email2", "emailtype2", "emailreporter2",
|
||||
"emailassigned_to2", "emailcc2", "emailqa_contact2") {
|
||||
$default{$name} = "";
|
||||
$type{$name} = 0;
|
||||
}
|
||||
|
||||
|
||||
foreach my $item (split(/\&/, $::buffer)) {
|
||||
my @el = split(/=/, $item);
|
||||
my $name = $el[0];
|
||||
my $value;
|
||||
if ($#el > 0) {
|
||||
$value = url_decode($el[1]);
|
||||
} else {
|
||||
$value = "";
|
||||
}
|
||||
if (defined $default{$name}) {
|
||||
if ($default{$name} ne "") {
|
||||
$default{$name} .= "|$value";
|
||||
$type{$name} = 1;
|
||||
} else {
|
||||
$default{$name} = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($default{'chfieldto'} eq "") {
|
||||
$default{'chfieldto'} = "Now";
|
||||
}
|
||||
|
||||
|
||||
|
||||
my $namelist = "";
|
||||
|
||||
foreach my $i (sort (keys %::COOKIE)) {
|
||||
if ($i =~ /^QUERY_/) {
|
||||
if ($::COOKIE{$i} ne "") {
|
||||
my $name = substr($i, 6);
|
||||
$namelist .= "<OPTION>$name";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "Set-Cookie: BUGLIST=
|
||||
Content-type: text/html\n\n";
|
||||
|
||||
GetVersionTable();
|
||||
|
||||
sub GenerateEmailInput {
|
||||
my ($id) = (@_);
|
||||
my $defstr = value_quote($default{"email$id"});
|
||||
my $deftype = $default{"emailtype$id"};
|
||||
if ($deftype eq "") {
|
||||
$deftype = "substring";
|
||||
}
|
||||
my $assignedto = ($default{"emailassigned_to$id"} eq "1") ? "checked" : "";
|
||||
my $reporter = ($default{"emailreporter$id"} eq "1") ? "checked" : "";
|
||||
my $cc = ($default{"emailcc$id"} eq "1") ? "checked" : "";
|
||||
|
||||
if ($assignedto eq "" && $reporter eq "" && $cc eq "") {
|
||||
if ($id eq "1") {
|
||||
$assignedto = "checked";
|
||||
} else {
|
||||
$reporter = "checked";
|
||||
}
|
||||
}
|
||||
|
||||
my $qapart = "";
|
||||
if (Param("useqacontact")) {
|
||||
my $qacontact =
|
||||
($default{"emailqa_contact$id"} eq "1") ? "checked" : "";
|
||||
$qapart = qq|
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<input type="checkbox" name="emailqa_contact$id" value=1 $qacontact>QA Contact
|
||||
</td>
|
||||
</tr>
|
||||
|;
|
||||
}
|
||||
|
||||
return qq|
|
||||
<table border=1 cellspacing=0 cellpadding=0>
|
||||
<tr><td>
|
||||
<table cellspacing=0 cellpadding=0>
|
||||
<tr>
|
||||
<td rowspan=2 valign=top><a href="helpemailquery.html">Email:</a>
|
||||
<input name="email$id" size="30" value=""> matching as
|
||||
<SELECT NAME=emailtype$id>
|
||||
<OPTION VALUE="regexp">regexp
|
||||
<OPTION VALUE="notregexp">not regexp
|
||||
<OPTION SELECTED VALUE="substring">substring
|
||||
<OPTION VALUE="exact">exact
|
||||
</SELECT>
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" name="emailassigned_to$id" value=1 $assignedto>Assigned To
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="emailreporter$id" value=1 $reporter>Reporter
|
||||
</td>
|
||||
</tr>$qapart
|
||||
<tr>
|
||||
<td align=right>(Will match any of the selected fields)</td>
|
||||
<td>
|
||||
<input type="checkbox" name="emailcc$id" value=1 $cc>CC
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</table>
|
||||
|;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
my $emailinput1 = GenerateEmailInput(1);
|
||||
my $emailinput2 = GenerateEmailInput(2);
|
||||
|
||||
|
||||
# javascript
|
||||
|
||||
my $jscript = << 'ENDSCRIPT';
|
||||
<script language="Javascript1.2">
|
||||
<!--
|
||||
var cpts = new Array();
|
||||
var vers = new Array();
|
||||
// Apparently, IE4 chokes on the below, so do nothing if running that.
|
||||
var agt=navigator.userAgent.toLowerCase();
|
||||
if ((agt.indexOf("msie") == -1)) {
|
||||
ENDSCRIPT
|
||||
|
||||
|
||||
my $p;
|
||||
my $v;
|
||||
my $c;
|
||||
my $i = 0;
|
||||
my $j = 0;
|
||||
|
||||
foreach $c (@::legal_components) {
|
||||
$jscript .= "cpts['$c'] = [];\n";
|
||||
}
|
||||
|
||||
foreach $v (@::legal_versions) {
|
||||
$jscript .= "vers['$v'] = [];\n";
|
||||
}
|
||||
|
||||
|
||||
for $p (@::legal_product) {
|
||||
if ($::components{$p}) {
|
||||
foreach $c (@{$::components{$p}}) {
|
||||
$jscript .= "cpts['$c'].push('$p');\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ($::versions{$p}) {
|
||||
foreach $v (@{$::versions{$p}}) {
|
||||
$jscript .= "vers['$v'].push('$p');\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$jscript .= q{
|
||||
|
||||
\} // end IE4 choke around
|
||||
// Only display versions/components valid for selected product(s)
|
||||
|
||||
function selectProduct(f) {
|
||||
// Apparently, IE4 chokes on the below, so do nothing if running that.
|
||||
var agt=navigator.userAgent.toLowerCase();
|
||||
if ((agt.indexOf("msie") != -1)) return;
|
||||
|
||||
var cnt = 0;
|
||||
var i;
|
||||
var j;
|
||||
for (i=0 ; i<f.product.length ; i++) {
|
||||
if (f.product[i].selected) {
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
var doall = (cnt == f.product.length || cnt == 0);
|
||||
|
||||
var csel = new Array();
|
||||
for (i=0 ; i<f.component.length ; i++) {
|
||||
if (f.component[i].selected) {
|
||||
csel[f.component[i].value] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
f.component.options.length = 0;
|
||||
|
||||
for (c in cpts) {
|
||||
var doit = doall;
|
||||
for (i=0 ; !doit && i<f.product.length ; i++) {
|
||||
if (f.product[i].selected) {
|
||||
var p = f.product[i].value;
|
||||
for (j in cpts[c]) {
|
||||
var p2 = cpts[c][j];
|
||||
if (p2 == p) {
|
||||
doit = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (doit) {
|
||||
var l = f.component.length;
|
||||
f.component[l] = new Option(c, c);
|
||||
if (csel[c] != undefined) {
|
||||
f.component[l].selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var vsel = new Array();
|
||||
for (i=0 ; i<f.version.length ; i++) {
|
||||
if (f.version[i].selected) {
|
||||
vsel[f.version[i].value] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
f.version.options.length = 0;
|
||||
|
||||
for (v in vers) {
|
||||
var doit = doall;
|
||||
for (i=0 ; !doit && i<f.product.length ; i++) {
|
||||
if (f.product[i].selected) {
|
||||
var p = f.product[i].value;
|
||||
for (j in vers[v]) {
|
||||
var p2 = vers[v][j];
|
||||
if (p2 == p) {
|
||||
doit = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (doit) {
|
||||
var l = f.version.length;
|
||||
f.version[l] = new Option(v, v);
|
||||
if (vsel[v] != undefined) {
|
||||
f.version[l].selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
# Muck the "legal product" list so that the default one is always first (and
|
||||
# is therefore visibly selected.
|
||||
|
||||
# Commented out, until we actually have enough products for this to matter.
|
||||
|
||||
# set w [lsearch $legal_product $default{"product"}]
|
||||
# if {$w >= 0} {
|
||||
# set legal_product [concat $default{"product"} [lreplace $legal_product $w $w]]
|
||||
# }
|
||||
|
||||
PutHeader("Bugzilla Query Page", "Query Page");
|
||||
|
||||
push @::legal_resolution, "---"; # Oy, what a hack.
|
||||
push @::legal_target_milestone, "---"; # Oy, what a hack.
|
||||
|
||||
print $jscript;
|
||||
|
||||
print "
|
||||
<FORM NAME=queryForm METHOD=GET ACTION=\"buglist.cgi\">
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th align=left><A HREF=\"bug_status.html\">Status</a>:</th>
|
||||
<th align=left><A HREF=\"bug_status.html\">Resolution</a>:</th>
|
||||
<th align=left><A HREF=\"bug_status.html#rep_platform\">Platform</a>:</th>
|
||||
<th align=left><A HREF=\"bug_status.html#op_sys\">OpSys</a>:</th>
|
||||
<th align=left><A HREF=\"bug_status.html#priority\">Priority</a>:</th>
|
||||
<th align=left><A HREF=\"bug_status.html#severity\">Severity</a>:</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=left valign=top>
|
||||
<SELECT NAME=\"bug_status\" MULTIPLE SIZE=7>
|
||||
@{[make_options(\@::legal_bug_status, $default{'bug_status'}, $type{'bug_status'})]}
|
||||
</SELECT>
|
||||
</td>
|
||||
<td align=left valign=top>
|
||||
<SELECT NAME=\"resolution\" MULTIPLE SIZE=7>
|
||||
@{[make_options(\@::legal_resolution, $default{'resolution'}, $type{'resolution'})]}
|
||||
</SELECT>
|
||||
</td>
|
||||
<td align=left valign=top>
|
||||
<SELECT NAME=\"rep_platform\" MULTIPLE SIZE=7>
|
||||
@{[make_options(\@::legal_platform, $default{'rep_platform'}, $type{'rep_platform'})]}
|
||||
</SELECT>
|
||||
</td>
|
||||
<td align=left valign=top>
|
||||
<SELECT NAME=\"op_sys\" MULTIPLE SIZE=7>
|
||||
@{[make_options(\@::legal_opsys, $default{'op_sys'}, $type{'op_sys'})]}
|
||||
</SELECT>
|
||||
</td>
|
||||
<td align=left valign=top>
|
||||
<SELECT NAME=\"priority\" MULTIPLE SIZE=7>
|
||||
@{[make_options(\@::legal_priority, $default{'priority'}, $type{'priority'})]}
|
||||
</SELECT>
|
||||
</td>
|
||||
<td align=left valign=top>
|
||||
<SELECT NAME=\"bug_severity\" MULTIPLE SIZE=7>
|
||||
@{[make_options(\@::legal_severity, $default{'bug_severity'}, $type{'bug_severity'})]}
|
||||
</SELECT>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
$emailinput1<p>
|
||||
$emailinput2<p>
|
||||
|
||||
|
||||
|
||||
Changed in the <NOBR>last <INPUT NAME=changedin SIZE=2 VALUE=\"$default{'changedin'}\"> days.</NOBR>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td rowspan=2 align=right>Where the field(s)
|
||||
</td><td rowspan=2>
|
||||
<SELECT NAME=\"chfield\" MULTIPLE SIZE=4>
|
||||
@{[make_options(\@::log_columns, $default{'chfield'}, $type{'chfield'})]}
|
||||
</SELECT>
|
||||
</td><td rowspan=2>
|
||||
changed.
|
||||
</td><td>
|
||||
<nobr>dates <INPUT NAME=chfieldfrom SIZE=10 VALUE=\"$default{'chfieldfrom'}\"></nobr>
|
||||
<nobr>to <INPUT NAME=chfieldto SIZE=10 VALUE=\"$default{'chfieldto'}\"></nobr>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>changed to value <nobr><INPUT NAME=chfieldvalue SIZE=10> (optional)</nobr>
|
||||
</td>
|
||||
</table>
|
||||
|
||||
|
||||
<P>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<TH ALIGN=LEFT VALIGN=BOTTOM>Program:</th>
|
||||
<TH ALIGN=LEFT VALIGN=BOTTOM>Version:</th>
|
||||
<TH ALIGN=LEFT VALIGN=BOTTOM><A HREF=describecomponents.cgi>Component:<a></th>
|
||||
";
|
||||
|
||||
if (Param("usetargetmilestone")) {
|
||||
print "<TH ALIGN=LEFT VALIGN=BOTTOM>Target Milestone:</th>";
|
||||
}
|
||||
|
||||
print "
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td align=left valign=top>
|
||||
<SELECT NAME=\"product\" MULTIPLE SIZE=5 onChange=\"selectProduct(this.form);\">
|
||||
@{[make_options(\@::legal_product, $default{'product'}, $type{'product'})]}
|
||||
</SELECT>
|
||||
</td>
|
||||
|
||||
<td align=left valign=top>
|
||||
<SELECT NAME=\"version\" MULTIPLE SIZE=5>
|
||||
@{[make_options(\@::legal_versions, $default{'version'}, $type{'version'})]}
|
||||
</SELECT>
|
||||
</td>
|
||||
|
||||
<td align=left valign=top>
|
||||
<SELECT NAME=\"component\" MULTIPLE SIZE=5>
|
||||
@{[make_options(\@::legal_components, $default{'component'}, $type{'component'})]}
|
||||
</SELECT>
|
||||
</td>";
|
||||
|
||||
if (Param("usetargetmilestone")) {
|
||||
print "
|
||||
<td align=left valign=top>
|
||||
<SELECT NAME=\"target_milestone\" MULTIPLE SIZE=5>
|
||||
@{[make_options(\@::legal_target_milestone, $default{'component'}, $type{'component'})]}
|
||||
</SELECT>
|
||||
</td>";
|
||||
}
|
||||
|
||||
print "
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table border=0>
|
||||
<tr>
|
||||
<td align=right>Summary:</td>
|
||||
<td><input name=short_desc size=30></td>
|
||||
<td><input type=radio name=short_desc_type value=substr checked>Substring</td>
|
||||
<td><input type=radio name=short_desc_type value=regexp>Regexp</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right>Description:</td>
|
||||
<td><input name=long_desc size=30></td>
|
||||
<td><input type=radio name=long_desc_type value=substr checked>Substring</td>
|
||||
<td><input type=radio name=long_desc_type value=regexp>Regexp</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right>URL:</td>
|
||||
<td><input name=bug_file_loc size=30></td>
|
||||
<td><input type=radio name=bug_file_loc_type value=substr checked>Substring</td>
|
||||
<td><input type=radio name=bug_file_loc_type value=regexp>Regexp</td>
|
||||
</tr>";
|
||||
|
||||
if (Param("usestatuswhiteboard")) {
|
||||
print "
|
||||
<tr>
|
||||
<td align=right>Status whiteboard:</td>
|
||||
<td><input name=status_whiteboard size=30></td>
|
||||
<td><input type=radio name=status_whiteboard_type value=substr checked>Substring</td>
|
||||
<td><input type=radio name=status_whiteboard_type value=regexp>Regexp</td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
print "
|
||||
</table>
|
||||
<p>
|
||||
|
||||
|
||||
|
||||
<BR>
|
||||
<INPUT TYPE=radio NAME=cmdtype VALUE=doit CHECKED> Run this query
|
||||
<BR>
|
||||
";
|
||||
|
||||
if ($namelist ne "") {
|
||||
print "
|
||||
<table cellspacing=0 cellpadding=0><tr>
|
||||
<td><INPUT TYPE=radio NAME=cmdtype VALUE=editnamed> Load the remembered query:</td>
|
||||
<td rowspan=3><select name=namedcmd>$namelist</select>
|
||||
</tr><tr>
|
||||
<td><INPUT TYPE=radio NAME=cmdtype VALUE=runnamed> Run the remembered query:</td>
|
||||
</tr><tr>
|
||||
<td><INPUT TYPE=radio NAME=cmdtype VALUE=forgetnamed> Forget the remembered query:</td>
|
||||
</tr></table>"
|
||||
}
|
||||
|
||||
print "
|
||||
<INPUT TYPE=radio NAME=cmdtype VALUE=asdefault> Remember this as the default query
|
||||
<BR>
|
||||
<INPUT TYPE=radio NAME=cmdtype VALUE=asnamed> Remember this query, and name it:
|
||||
<INPUT TYPE=text NAME=newqueryname>
|
||||
<BR>
|
||||
|
||||
<NOBR><B>Sort By:</B>
|
||||
<SELECT NAME=\"order\">
|
||||
<OPTION>Bug Number
|
||||
<OPTION SELECTED>\"Importance\"
|
||||
<OPTION>Assignee
|
||||
</SELECT></NOBR>
|
||||
<INPUT TYPE=\"submit\" VALUE=\"Submit query\">
|
||||
<INPUT TYPE=\"reset\" VALUE=\"Reset back to the default query\">
|
||||
<INPUT TYPE=hidden name=form_name VALUE=query>
|
||||
<BR>Give me a <A HREF=\"help.html\">clue</A> about how to use this form.
|
||||
</CENTER>
|
||||
</FORM>
|
||||
|
||||
";
|
||||
|
||||
|
||||
quietly_check_login();
|
||||
|
||||
if (UserInGroup("tweakparams")) {
|
||||
print "<a href=editparams.cgi>Edit Bugzilla operating parameters</a><br>\n";
|
||||
}
|
||||
if (UserInGroup("editcomponents")) {
|
||||
print "<a href=editcomponents.cgi>Edit Bugzilla components</a><br>\n";
|
||||
}
|
||||
if (defined $::COOKIE{"Bugzilla_login"}) {
|
||||
print "<a href=relogin.cgi>Log in as someone besides <b>$::COOKIE{'Bugzilla_login'}</b></a><br>\n";
|
||||
}
|
||||
print "<a href=changepassword.cgi>Change your password.</a><br>\n";
|
||||
print "<a href=\"enter_bug.cgi\">Create a new bug.</a><br>\n";
|
||||
print "<a href=\"createaccount.cgi\">Open a new Bugzilla account</a><br>\n";
|
||||
print "<a href=\"reports.cgi\">Bug reports</a><br>\n";
|
||||
53
mozilla/webtools/bugzilla/relogin.cgi
Executable file
53
mozilla/webtools/bugzilla/relogin.cgi
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
|
||||
print "Set-Cookie: Bugzilla_login= ; path=/; expires=Sun, 30-Jun-80 00:00:00 GMT
|
||||
Set-Cookie: Bugzilla_logincookie= ; path=/; expires=Sun, 30-Jun-80 00:00:00 GMT
|
||||
Set-Cookie: Bugzilla_password= ; path=/; expires=Sun, 30-Jun-80 00:00:00 GMT
|
||||
Content-type: text/html
|
||||
|
||||
<H1>Your login has been forgotten.</H1>
|
||||
The cookie that was remembering your login is now gone. The next time you
|
||||
do an action that requires a login, you will be prompted for it.
|
||||
<p>
|
||||
<a href=query.cgi>Back to the query page.</a>
|
||||
";
|
||||
|
||||
exit;
|
||||
|
||||
# The below was a different way, that prompted you for a login right then.
|
||||
|
||||
# catch {unset COOKIE(Bugzilla_login)}
|
||||
# catch {unset COOKIE(Bugzilla_password)}
|
||||
# confirm_login
|
||||
|
||||
# puts "Content-type: text/html\n"
|
||||
# puts "<H1>OK, logged in.</H1>"
|
||||
# puts "You are now logged in as <b>$COOKIE(Bugzilla_login)</b>."
|
||||
# puts "<p>"
|
||||
# puts "<a href=query.cgi>Back to the query page.</a>"
|
||||
|
||||
509
mozilla/webtools/bugzilla/reports.cgi
Executable file
509
mozilla/webtools/bugzilla/reports.cgi
Executable file
@@ -0,0 +1,509 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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): Harrison Page <harrison@netscape.com>,
|
||||
# Terry Weissman <terry@mozilla.org>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
use Chart::Lines;
|
||||
|
||||
require "CGI.pl";
|
||||
require "globals.pl";
|
||||
|
||||
use vars @::legal_product;
|
||||
|
||||
my $dir = "data/mining";
|
||||
my $week = 60 * 60 * 24 * 7;
|
||||
my @status = qw (NEW ASSIGNED REOPENED);
|
||||
|
||||
# while this looks odd/redundant, it allows us to name
|
||||
# functions differently than the value passed in
|
||||
|
||||
my %reports =
|
||||
(
|
||||
"most_doomed" => \&most_doomed,
|
||||
"show_chart" => \&show_chart,
|
||||
);
|
||||
|
||||
# patch from Sam Ziegler <sam@ziegler.org>:
|
||||
#
|
||||
# "reports.cgi currently has it's own idea of what
|
||||
# the header should be. This patch sets it to the
|
||||
# system wide header."
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
if (defined $::FORM{'nobanner'})
|
||||
{
|
||||
print <<FIN;
|
||||
<html>
|
||||
<head><title>Bug Reports</title></head>
|
||||
<body bgcolor="#FFFFFF">
|
||||
FIN
|
||||
}
|
||||
else
|
||||
{
|
||||
PutHeader ("Bug Reports") unless (defined $::FORM{'nobanner'});
|
||||
}
|
||||
|
||||
ConnectToDatabase();
|
||||
GetVersionTable();
|
||||
|
||||
$::FORM{'output'} = $::FORM{'output'} || "most_doomed"; # a reasonable default
|
||||
|
||||
if (! defined $::FORM{'product'})
|
||||
{
|
||||
&choose_product;
|
||||
}
|
||||
else
|
||||
{
|
||||
# we want to be careful about what subroutines
|
||||
# can be called from outside. modify %reports
|
||||
# accordingly when a new report type is added
|
||||
|
||||
if (! exists $reports{$::FORM{'output'}})
|
||||
{
|
||||
$::FORM{'output'} = "most_doomed"; # a reasonable default
|
||||
}
|
||||
|
||||
my $f = $reports{$::FORM{'output'}};
|
||||
|
||||
if (! defined $f)
|
||||
{
|
||||
print "start over, your form data was all messed up.<p>\n";
|
||||
foreach (keys %::FORM)
|
||||
{
|
||||
print "<font color=blue>$_</font> : " .
|
||||
($::FORM{$_} ? $::FORM{$_} : "undef") . "<br>\n";
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
&{$f};
|
||||
}
|
||||
|
||||
print <<FIN;
|
||||
<p>
|
||||
</body>
|
||||
</html>
|
||||
FIN
|
||||
|
||||
##################################
|
||||
# user came in with no form data #
|
||||
##################################
|
||||
|
||||
sub choose_product
|
||||
{
|
||||
my $product_popup = make_options (\@::legal_product, $::legal_product[0]);
|
||||
my $charts = (-d $dir) ? "<option value=\"show_chart\">Bug Charts" : "";
|
||||
|
||||
print <<FIN;
|
||||
<center>
|
||||
<h1>Welcome to the Bugzilla Query Kitchen</h1>
|
||||
<form method=get action=reports.cgi>
|
||||
<table border=1 cellpadding=5>
|
||||
<tr>
|
||||
<td align=center><b>Product:</b></td>
|
||||
<td align=center>
|
||||
<select name="product">
|
||||
$product_popup
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center><b>Output:</b></td>
|
||||
<td align=center>
|
||||
<select name="output">
|
||||
<option value="most_doomed">Bug Counts
|
||||
$charts
|
||||
</select>
|
||||
<tr>
|
||||
<td align=center><b>Switches:</b></td>
|
||||
<td align=left>
|
||||
<input type=checkbox name=links value=1> Links to Bugs<br>
|
||||
<input type=checkbox name=nobanner value=1> No Banner<br>
|
||||
<input type=checkbox name=quip value=1> Include Quip<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2 align=center>
|
||||
<input type=submit value=Continue>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<p>
|
||||
FIN
|
||||
}
|
||||
|
||||
sub most_doomed
|
||||
{
|
||||
my $when = localtime (time);
|
||||
|
||||
print <<FIN;
|
||||
<center>
|
||||
<h1>
|
||||
Bug Report for $::FORM{'product'}
|
||||
</h1>
|
||||
$when<p>
|
||||
FIN
|
||||
|
||||
my $query = <<FIN;
|
||||
select
|
||||
bugs.bug_id, bugs.assigned_to, bugs.bug_severity,
|
||||
bugs.bug_status, bugs.product,
|
||||
assign.login_name,
|
||||
report.login_name,
|
||||
unix_timestamp(date_format(bugs.creation_ts, '%Y-%m-%d %h:%m:%s'))
|
||||
|
||||
from bugs,
|
||||
profiles assign,
|
||||
profiles report,
|
||||
versions projector
|
||||
where bugs.assigned_to = assign.userid
|
||||
and bugs.reporter = report.userid
|
||||
and bugs.product='$::FORM{'product'}'
|
||||
and
|
||||
(
|
||||
bugs.bug_status = 'NEW' or
|
||||
bugs.bug_status = 'ASSIGNED' or
|
||||
bugs.bug_status = 'REOPENED'
|
||||
)
|
||||
FIN
|
||||
|
||||
print "<font color=purple><tt>$query</tt></font><p>\n"
|
||||
unless (! exists $::FORM{'showsql'});
|
||||
|
||||
SendSQL ($query);
|
||||
|
||||
my $c = 0;
|
||||
|
||||
my $quip = "Summary";
|
||||
my $bugs_count = 0;
|
||||
my $bugs_new_this_week = 0;
|
||||
my $bugs_reopened = 0;
|
||||
my %bugs_owners;
|
||||
my %bugs_summary;
|
||||
my %bugs_status;
|
||||
my %bugs_totals;
|
||||
my %bugs_lookup;
|
||||
|
||||
#############################
|
||||
# suck contents of database #
|
||||
#############################
|
||||
|
||||
while (my ($bid, $a, $sev, $st, $prod, $who, $rep, $ts) = FetchSQLData())
|
||||
{
|
||||
next if (exists $bugs_lookup{$bid});
|
||||
|
||||
$bugs_lookup{$bid} ++;
|
||||
$bugs_owners{$who} ++;
|
||||
$bugs_new_this_week ++ if (time - $ts <= $week);
|
||||
$bugs_status{$st} ++;
|
||||
$bugs_count ++;
|
||||
|
||||
push @{$bugs_summary{$who}{$st}}, $bid;
|
||||
|
||||
$bugs_totals{$who}{$st} ++;
|
||||
}
|
||||
|
||||
if ($::FORM{'quip'})
|
||||
{
|
||||
if (open (COMMENTS, "<data/comments"))
|
||||
{
|
||||
my @cdata;
|
||||
while (<COMMENTS>)
|
||||
{
|
||||
push @cdata, $_;
|
||||
}
|
||||
close COMMENTS;
|
||||
$quip = "<i>" . $cdata[int(rand($#cdata + 1))] . "</i>";
|
||||
}
|
||||
}
|
||||
|
||||
#########################
|
||||
# start painting report #
|
||||
#########################
|
||||
|
||||
print <<FIN;
|
||||
<h1>$quip</h1>
|
||||
<table border=1 cellpadding=5>
|
||||
<tr>
|
||||
<td align=right><b>New Bugs This Week</b></td>
|
||||
<td align=center>$bugs_new_this_week</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align=right><b>Bugs Marked New</b></td>
|
||||
<td align=center>$bugs_status{'NEW'}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align=right><b>Bugs Marked Assigned</b></td>
|
||||
<td align=center>$bugs_status{'ASSIGNED'}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align=right><b>Bugs Marked Reopened</b></td>
|
||||
<td align=center>$bugs_status{'REOPENED'}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align=right><b>Total Bugs</b></td>
|
||||
<td align=center>$bugs_count</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<p>
|
||||
FIN
|
||||
|
||||
if ($bugs_count == 0)
|
||||
{
|
||||
print "No bugs found!\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
print <<FIN;
|
||||
<h1>Bug Count by Engineer</h1>
|
||||
<table border=3 cellpadding=5>
|
||||
<tr>
|
||||
<td align=center bgcolor="#DDDDDD"><b>Owner</b></td>
|
||||
<td align=center bgcolor="#DDDDDD"><b>New</b></td>
|
||||
<td align=center bgcolor="#DDDDDD"><b>Assigned</b></td>
|
||||
<td align=center bgcolor="#DDDDDD"><b>Reopened</b></td>
|
||||
<td align=center bgcolor="#DDDDDD"><b>Total</b></td>
|
||||
</tr>
|
||||
FIN
|
||||
|
||||
foreach my $who (sort keys %bugs_summary)
|
||||
{
|
||||
my $bugz = 0;
|
||||
print <<FIN;
|
||||
<tr>
|
||||
<td align=left><tt>$who</tt></td>
|
||||
FIN
|
||||
|
||||
foreach my $st (@status)
|
||||
{
|
||||
$bugs_totals{$who}{$st} += 0;
|
||||
print <<FIN;
|
||||
<td align=center>$bugs_totals{$who}{$st}
|
||||
FIN
|
||||
$bugz += $#{$bugs_summary{$who}{$st}} + 1;
|
||||
}
|
||||
|
||||
print <<FIN;
|
||||
<td align=center>$bugz</td>
|
||||
</tr>
|
||||
FIN
|
||||
}
|
||||
|
||||
print <<FIN;
|
||||
</table>
|
||||
<p>
|
||||
FIN
|
||||
|
||||
###############################
|
||||
# individual bugs by engineer #
|
||||
###############################
|
||||
|
||||
print <<FIN;
|
||||
<h1>Individual Bugs by Engineer</h1>
|
||||
<table border=1 cellpadding=5>
|
||||
<tr>
|
||||
<td align=center bgcolor="#DDDDDD"><b>Owner</b></td>
|
||||
<td align=center bgcolor="#DDDDDD"><b>New</b></td>
|
||||
<td align=center bgcolor="#DDDDDD"><b>Assigned</b></td>
|
||||
<td align=center bgcolor="#DDDDDD"><b>Reopened</b></td>
|
||||
</tr>
|
||||
FIN
|
||||
|
||||
foreach my $who (sort keys %bugs_summary)
|
||||
{
|
||||
print <<FIN;
|
||||
<tr>
|
||||
<td align=left><tt>$who</tt></td>
|
||||
FIN
|
||||
|
||||
foreach my $st (@status)
|
||||
{
|
||||
my @l;
|
||||
|
||||
foreach (sort { $a <=> $b } @{$bugs_summary{$who}{$st}})
|
||||
{
|
||||
if ($::FORM{'links'})
|
||||
{
|
||||
push @l, "<a href=\"show_bug.cgi?id=$_\">$_</a>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
push @l, $_;
|
||||
}
|
||||
}
|
||||
|
||||
my $bugz = join ' ', @l;
|
||||
$bugz = " " unless ($bugz);
|
||||
|
||||
print <<FIN
|
||||
<td align=left>$bugz</td>
|
||||
FIN
|
||||
}
|
||||
|
||||
print <<FIN;
|
||||
</tr>
|
||||
FIN
|
||||
}
|
||||
|
||||
print <<FIN;
|
||||
</table>
|
||||
<p>
|
||||
FIN
|
||||
}
|
||||
|
||||
sub is_legal_product
|
||||
{
|
||||
my $product = shift;
|
||||
return grep { $_ eq $product} @::legal_product;
|
||||
}
|
||||
|
||||
sub header
|
||||
{
|
||||
print <<FIN;
|
||||
<TABLE BGCOLOR="#000000" WIDTH="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0>
|
||||
<TR><TD><A HREF="http://www.mozilla.org/"><IMG
|
||||
SRC="http://www.mozilla.org/images/mozilla-banner.gif" ALT=""
|
||||
BORDER=0 WIDTH=600 HEIGHT=58></A></TD></TR></TABLE>
|
||||
FIN
|
||||
}
|
||||
|
||||
sub show_chart
|
||||
{
|
||||
my $when = localtime (time);
|
||||
|
||||
if (! is_legal_product ($::FORM{'product'}))
|
||||
{
|
||||
&die_politely ("Unknown product: $::FORM{'product'}");
|
||||
}
|
||||
|
||||
print <<FIN;
|
||||
<center>
|
||||
FIN
|
||||
|
||||
my @dates;
|
||||
my @open; my @assigned; my @reopened;
|
||||
|
||||
my $prodname = $::FORM{'product'};
|
||||
|
||||
$prodname =~ s/\//-/gs;
|
||||
|
||||
my $file = join '/', $dir, $prodname;
|
||||
my $image = "$file.gif";
|
||||
|
||||
if (! open FILE, $file)
|
||||
{
|
||||
&die_politely ("The tool which gathers bug counts has not been run yet.");
|
||||
}
|
||||
|
||||
while (<FILE>)
|
||||
{
|
||||
chomp;
|
||||
next if ($_ =~ /^#/ or ! $_);
|
||||
my ($date, $open, $assigned, $reopened) = split /\|/, $_;
|
||||
my ($yy, $mm, $dd) = $date =~ /^\d{2}(\d{2})(\d{2})(\d{2})$/;
|
||||
|
||||
push @dates, "$mm/$dd/$yy";
|
||||
push @open, $open;
|
||||
push @assigned, $assigned;
|
||||
push @reopened, $reopened;
|
||||
}
|
||||
|
||||
close FILE;
|
||||
|
||||
if ($#dates < 1)
|
||||
{
|
||||
&die_politely ("We don't have enough data points to make a graph (yet)");
|
||||
}
|
||||
|
||||
my $img = Chart::Lines->new (800, 600);
|
||||
my @labels = qw (New Assigned Reopened);
|
||||
my @when;
|
||||
my $i = 0;
|
||||
my @data;
|
||||
|
||||
push @data, \@dates;
|
||||
push @data, \@open;
|
||||
push @data, \@assigned;
|
||||
push @data, \@reopened;
|
||||
|
||||
my $MAXTICKS = 20; # Try not to show any more x ticks than this.
|
||||
my $skip = 1;
|
||||
if (@dates > $MAXTICKS) {
|
||||
$skip = int((@dates + $MAXTICKS - 1) / $MAXTICKS);
|
||||
}
|
||||
|
||||
my %settings =
|
||||
(
|
||||
"title" => "Bug Charts for $::FORM{'product'}",
|
||||
"x_label" => "Dates",
|
||||
"y_label" => "Bug Count",
|
||||
"legend_labels" => \@labels,
|
||||
"skip_x_ticks" => $skip,
|
||||
);
|
||||
|
||||
$img->set (%settings);
|
||||
|
||||
open IMAGE, ">$image" or die "$image: $!";
|
||||
$img->gif (*IMAGE, \@data);
|
||||
close IMAGE;
|
||||
|
||||
print <<FIN;
|
||||
<img src="$image">
|
||||
<br clear=left>
|
||||
<br>
|
||||
FIN
|
||||
}
|
||||
|
||||
sub die_politely
|
||||
{
|
||||
my $msg = shift;
|
||||
|
||||
print <<FIN;
|
||||
<p>
|
||||
<table border=1 cellpadding=10>
|
||||
<tr>
|
||||
<td align=center>
|
||||
<font color=blue>Sorry, but ...</font>
|
||||
<p>
|
||||
There is no graph available for <b>$::FORM{'product'}</b><p>
|
||||
|
||||
<font size=-1>
|
||||
$msg
|
||||
<p>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
FIN
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
168
mozilla/webtools/bugzilla/sanitycheck.cgi
Executable file
168
mozilla/webtools/bugzilla/sanitycheck.cgi
Executable file
@@ -0,0 +1,168 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
print "Content-type: text/html\n";
|
||||
print "\n";
|
||||
|
||||
ConnectToDatabase();
|
||||
|
||||
|
||||
sub Status {
|
||||
my ($str) = (@_);
|
||||
print "$str <P>\n";
|
||||
}
|
||||
|
||||
sub Alert {
|
||||
my ($str) = (@_);
|
||||
Status("<font color=red>$str</font>");
|
||||
}
|
||||
|
||||
sub BugLink {
|
||||
my ($id) = (@_);
|
||||
return "<a href='show_bug.cgi?id=$id'>$id</a>";
|
||||
}
|
||||
|
||||
|
||||
PutHeader("Bugzilla Sanity Check");
|
||||
|
||||
print "OK, now running sanity checks.<P>\n";
|
||||
|
||||
my @row;
|
||||
my @checklist;
|
||||
|
||||
Status("Checking groups");
|
||||
SendSQL("select bit from groups where bit != pow(2, round(log(bit) / log(2)))");
|
||||
while (my $bit = FetchOneColumn()) {
|
||||
Alert("Illegal bit number found in group table: $bit");
|
||||
}
|
||||
|
||||
SendSQL("select sum(bit) from groups where isbuggroup != 0");
|
||||
my $buggroupset = FetchOneColumn();
|
||||
SendSQL("select bug_id, groupset from bugs where groupset & $buggroupset != groupset");
|
||||
while (@row = FetchSQLData()) {
|
||||
Alert("Bad groupset $row[1] found in bug " . BugLink($row[0]));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Status("Checking version/products");
|
||||
|
||||
SendSQL("select distinct product, version from bugs");
|
||||
while (@row = FetchSQLData()) {
|
||||
my @copy = @row;
|
||||
push(@checklist, \@copy);
|
||||
}
|
||||
|
||||
foreach my $ref (@checklist) {
|
||||
my ($product, $version) = (@$ref);
|
||||
SendSQL("select count(*) from versions where program = '$product' and value = '$version'");
|
||||
if (FetchOneColumn() != 1) {
|
||||
Alert("Bug(s) found with invalid product/version: $product/$version");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Status("Checking components/products");
|
||||
|
||||
@checklist = ();
|
||||
SendSQL("select distinct product, component from bugs");
|
||||
while (@row = FetchSQLData()) {
|
||||
my @copy = @row;
|
||||
push(@checklist, \@copy);
|
||||
}
|
||||
|
||||
foreach my $ref (@checklist) {
|
||||
my ($product, $component) = (@$ref);
|
||||
SendSQL("select count(*) from components where program = '$product' and value = '$component'");
|
||||
if (FetchOneColumn() != 1) {
|
||||
Alert("Bug(s) found with invalid product/component: $product/$component");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Status("Checking profile ids...");
|
||||
|
||||
SendSQL("select userid,login_name from profiles");
|
||||
|
||||
my %profid;
|
||||
|
||||
while (@row = FetchSQLData()) {
|
||||
my ($id, $email) = (@row);
|
||||
if ($email =~ /^[^@, ]*@[^@, ]*\.[^@, ]*$/) {
|
||||
$profid{$id} = 1;
|
||||
} else {
|
||||
Alert "Bad profile id $id <$email>."
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
undef $profid{0};
|
||||
|
||||
|
||||
Status("Checking reporter/assigned_to/qa_contact ids");
|
||||
SendSQL("select bug_id,reporter,assigned_to,qa_contact from bugs");
|
||||
|
||||
my %bugid;
|
||||
|
||||
while (@row = FetchSQLData()) {
|
||||
my($id, $reporter, $assigned_to, $qa_contact) = (@row);
|
||||
$bugid{$id} = 1;
|
||||
if (!defined $profid{$reporter}) {
|
||||
Alert("Bad reporter $reporter in " . BugLink($id));
|
||||
}
|
||||
if (!defined $profid{$assigned_to}) {
|
||||
Alert("Bad assigned_to $assigned_to in" . BugLink($id));
|
||||
}
|
||||
if ($qa_contact != 0 && !defined $profid{$qa_contact}) {
|
||||
Alert("Bad qa_contact $qa_contact in" . BugLink($id));
|
||||
}
|
||||
}
|
||||
|
||||
Status("Checking CC table");
|
||||
|
||||
SendSQL("select bug_id,who from cc");
|
||||
while (@row = FetchSQLData()) {
|
||||
my ($id, $cc) = (@row);
|
||||
if (!defined $profid{$cc}) {
|
||||
Alert("Bad cc $cc in " . BugLink($id));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Status("Checking activity table");
|
||||
|
||||
SendSQL("select bug_id,who from bugs_activity");
|
||||
|
||||
while (@row = FetchSQLData()) {
|
||||
my ($id, $who) = (@row);
|
||||
if (!defined $bugid{$id}) {
|
||||
Alert("Bad bugid " . BugLink($id));
|
||||
}
|
||||
if (!defined $profid{$who}) {
|
||||
Alert("Bad who $who in " . BugLink($id));
|
||||
}
|
||||
}
|
||||
63
mozilla/webtools/bugzilla/show_activity.cgi
Executable file
63
mozilla/webtools/bugzilla/show_activity.cgi
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
print "Content-type: text/html\n\n";
|
||||
|
||||
PutHeader("Changes made to bug $::FORM{'id'}", "Activity log",
|
||||
"Bug $::FORM{'id'}");
|
||||
|
||||
my $query = "
|
||||
select bugs_activity.field, bugs_activity.when,
|
||||
bugs_activity.oldvalue, bugs_activity.newvalue,
|
||||
profiles.login_name
|
||||
from bugs_activity,profiles
|
||||
where bugs_activity.bug_id = $::FORM{'id'}
|
||||
and profiles.userid = bugs_activity.who
|
||||
order by bugs_activity.when";
|
||||
|
||||
ConnectToDatabase();
|
||||
SendSQL($query);
|
||||
|
||||
print "<table border cellpadding=4>\n";
|
||||
print "<tr>\n";
|
||||
print " <th>Who</th><th>What</th><th>Old value</th><th>New value</th><th>When</th>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
my @row;
|
||||
while (@row = FetchSQLData()) {
|
||||
my ($field,$when,$old,$new,$who) = (@row);
|
||||
$old = value_quote($old);
|
||||
$new = value_quote($new);
|
||||
print "<tr>\n";
|
||||
print "<td>$who</td>\n";
|
||||
print "<td>$field</td>\n";
|
||||
print "<td>$old</td>\n";
|
||||
print "<td>$new</td>\n";
|
||||
print "<td>$when</td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</table>\n";
|
||||
print "<hr><a href=show_bug.cgi?id=$::FORM{'id'}>Back to bug $::FORM{'id'}</a>\n";
|
||||
50
mozilla/webtools/bugzilla/show_bug.cgi
Executable file
50
mozilla/webtools/bugzilla/show_bug.cgi
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
print "Content-type: text/html\n";
|
||||
print "\n";
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
if (!defined $::FORM{'id'}) {
|
||||
print "<H2>Search By Bug Number</H2>\n";
|
||||
print "<FORM METHOD=GET ACTION=\"show_bug.cgi\">\n";
|
||||
print "You may find a single bug by entering its bug id here: \n";
|
||||
print "<INPUT NAME=id>\n";
|
||||
print "<INPUT TYPE=\"submit\" VALUE=\"Show Me This Bug\">\n";
|
||||
print "</FORM>\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
ConnectToDatabase();
|
||||
|
||||
GetVersionTable();
|
||||
|
||||
PutHeader("Bugzilla bug $::FORM{'id'}", "Bugzilla Bug", $::FORM{'id'});
|
||||
navigation_header();
|
||||
|
||||
print "<HR>\n";
|
||||
|
||||
$! = 0;
|
||||
do "bug_form.pl" || die "Error doing bug_form.pl: $!";
|
||||
43
mozilla/webtools/bugzilla/showattachment.cgi
Executable file
43
mozilla/webtools/bugzilla/showattachment.cgi
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
# David Gardiner <david.gardiner@unisa.edu.au>
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "CGI.pl";
|
||||
|
||||
ConnectToDatabase();
|
||||
|
||||
my @row;
|
||||
if (defined $::FORM{'attach_id'}) {
|
||||
SendSQL("select mimetype, filename, thedata from attachments where attach_id = $::FORM{'attach_id'}");
|
||||
@row = FetchSQLData();
|
||||
}
|
||||
if (!@row) {
|
||||
print "Content-type: text/html\n\n";
|
||||
PutHeader("Bad ID");
|
||||
print "Please hit back and try again.\n";
|
||||
exit;
|
||||
}
|
||||
print qq{Content-type: $row[0]; name="$row[1]"; \n\n$row[2]};
|
||||
|
||||
|
||||
66
mozilla/webtools/bugzilla/whineatnews.pl
Executable file
66
mozilla/webtools/bugzilla/whineatnews.pl
Executable file
@@ -0,0 +1,66 @@
|
||||
#!/usr/bonsaitools/bin/perl -w
|
||||
# -*- Mode: perl; 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 <terry@mozilla.org>
|
||||
|
||||
|
||||
# This is a script suitable for running once a day from a cron job. It
|
||||
# looks at all the bugs, and sends whiny mail to anyone who has a bug
|
||||
# assigned to them that has status NEW that has not been touched for
|
||||
# more than 7 days.
|
||||
|
||||
use diagnostics;
|
||||
use strict;
|
||||
|
||||
require "globals.pl";
|
||||
|
||||
ConnectToDatabase();
|
||||
|
||||
SendSQL("select bug_id,login_name from bugs,profiles where " .
|
||||
"bug_status = 'NEW' and to_days(now()) - to_days(delta_ts) > " .
|
||||
Param('whinedays') . " and userid=assigned_to order by bug_id");
|
||||
|
||||
my %bugs;
|
||||
my @row;
|
||||
|
||||
while (@row = FetchSQLData()) {
|
||||
my ($id, $email) = (@row);
|
||||
if (!defined $bugs{$email}) {
|
||||
$bugs{$email} = [];
|
||||
}
|
||||
push @{$bugs{$email}}, $id;
|
||||
}
|
||||
|
||||
|
||||
my $template = Param('whinemail');
|
||||
my $urlbase = Param('urlbase');
|
||||
|
||||
foreach my $email (sort (keys %bugs)) {
|
||||
my %substs;
|
||||
$substs{'email'} = $email;
|
||||
my $msg = PerformSubsts($template, \%substs);
|
||||
|
||||
foreach my $i (@{$bugs{$email}}) {
|
||||
$msg .= " ${urlbase}show_bug.cgi?id=$i\n"
|
||||
}
|
||||
open(SENDMAIL, "|/usr/lib/sendmail -t") || die "Can't open sendmail";
|
||||
print SENDMAIL $msg;
|
||||
close SENDMAIL;
|
||||
print "$email " . join(" ", @{$bugs{$email}}) . "\n";
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# 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 Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Contributors:
|
||||
# Daniel Veditz <dveditz@netscape.com>
|
||||
# Douglas Turner <dougt@netscape.com>
|
||||
|
||||
|
||||
DEPTH = ..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = public
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,30 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# 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 Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Contributors:
|
||||
# Daniel Veditz <dveditz@netscape.com>
|
||||
# Douglas Turner <dougt@netscape.com>
|
||||
|
||||
|
||||
DEPTH=..
|
||||
|
||||
DIRS= public res src
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
@@ -1,33 +0,0 @@
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:NC="http://home.netscape.com/NC-rdf#">
|
||||
|
||||
<RDF:Bag ID="NC:SoftwareUpdateRoot">
|
||||
<RDF:li>
|
||||
<RDF:Bag ID="NC:NewSoftwareToday" NC:title="New Software">
|
||||
|
||||
<RDF:li>
|
||||
<RDF:Description ID="AimUpdate344">
|
||||
<NC:type resource="http://home.netscape.com/NC-rdf#SoftwarePackage" />
|
||||
<NC:title>AOL AIM</NC:title>
|
||||
<NC:description>An Instant Message Client</NC:description>
|
||||
<NC:version>3.4.1.12</NC:version>
|
||||
<NC:registryKey>/AOL/AIM/</NC:registryKey>
|
||||
<NC:url>http://home.netscape.com/index.html</NC:url>
|
||||
</RDF:Description>
|
||||
</RDF:li>
|
||||
|
||||
<RDF:li>
|
||||
<RDF:Description ID="PGPPlugin345">
|
||||
<NC:type resource="http://home.netscape.com/NC-rdf#SoftwarePackage" />
|
||||
<NC:title>PGP Plugin For Mozilla</NC:title>
|
||||
<NC:description>A high grade encryption plugin</NC:description>
|
||||
<NC:version>1.1.2.0</NC:version>
|
||||
<NC:registryKey>/PGP/ROCKS/</NC:registryKey>
|
||||
<NC:url>http://home.netscape.com/index.html</NC:url>
|
||||
</RDF:Description>
|
||||
</RDF:li>
|
||||
|
||||
</RDF:Bag>
|
||||
</RDF:li>
|
||||
</RDF:Bag>
|
||||
</RDF:RDF>
|
||||
@@ -1,57 +0,0 @@
|
||||
window {
|
||||
display: block;
|
||||
}
|
||||
|
||||
tree {
|
||||
display: table;
|
||||
background-color: #FFFFFF;
|
||||
border: none;
|
||||
border-spacing: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
treecol {
|
||||
display: table-column;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
treeitem {
|
||||
display: table-row;
|
||||
}
|
||||
|
||||
treehead {
|
||||
display: table-header-group;
|
||||
}
|
||||
|
||||
treebody {
|
||||
display: table-row-group;
|
||||
}
|
||||
|
||||
treecell {
|
||||
display: table-cell;
|
||||
font-family: Verdana, Sans-Serif;
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
treecell[selectedcell] {
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
|
||||
treehead treeitem treecell {
|
||||
background-color: #c0c0c0;
|
||||
border: outset 1px;
|
||||
border-color: white #707070 #707070 white;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#SoftwarePackage"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/SoftwareUpdatePackage.gif");
|
||||
}
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#Folder"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/bookmark-folder-closed.gif");
|
||||
|
||||
treeitem[type="http://home.netscape.com/NC-rdf#Folder"][open="true"] > treecell > titledbutton {
|
||||
list-style-image: url("resource:/res/rdf/bookmark-folder-open.gif");
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
// the rdf service
|
||||
var RDF = Components.classes['component://netscape/rdf/rdf-service'].getService();
|
||||
RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService);
|
||||
|
||||
function getAttr(registry,service,attr_name)
|
||||
{
|
||||
var attr = registry.GetTarget(service,
|
||||
RDF.GetResource('http://home.netscape.com/NC-rdf#' + attr_name),
|
||||
true);
|
||||
if (attr)
|
||||
attr = attr.QueryInterface(Components.interfaces.nsIRDFLiteral);
|
||||
|
||||
if (attr)
|
||||
attr = attr.Value;
|
||||
|
||||
return attr;
|
||||
}
|
||||
|
||||
function Init()
|
||||
{
|
||||
// this is the main rdf file.
|
||||
|
||||
var mainRegistry = RDF.GetDataSource('resource://res/rdf/SoftwareUpdates.rdf');
|
||||
|
||||
var mainContainer = Components.classes['component://netscape/rdf/container'].createInstance();
|
||||
mainContainer = mainContainer.QueryInterface(Components.interfaces.nsIRDFContainer);
|
||||
|
||||
mainContainer.Init(mainRegistry, RDF.GetResource('NC:SoftwareUpdateDataSources'));
|
||||
|
||||
// Now enumerate all of the softwareupdate datasources.
|
||||
var mainEnumerator = mainContainer.GetElements();
|
||||
while (mainEnumerator.HasMoreElements())
|
||||
{
|
||||
var aDistributor = mainEnumerator.GetNext();
|
||||
aDistributor = aDistributor.QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
|
||||
var distributorContainer = Components.classes['component://netscape/rdf/container'].createInstance();
|
||||
distributorContainer = distributorContainer.QueryInterface(Components.interfaces.nsIRDFContainer);
|
||||
|
||||
var distributorRegistry = RDF.GetDataSource(aDistributor.Value);
|
||||
var distributorResource = RDF.GetResource('NC:SoftwareUpdateRoot');
|
||||
|
||||
distributorContainer.Init(distributorRegistry, distributorResource);
|
||||
|
||||
// Now enumerate all of the distributorContainer's packages.
|
||||
|
||||
var distributorEnumerator = distributorContainer.GetElements();
|
||||
|
||||
while (distributorEnumerator.HasMoreElements())
|
||||
{
|
||||
var aPackage = distributorEnumerator.GetNext();
|
||||
aPackage = aPackage.QueryInterface(Components.interfaces.nsIRDFResource);
|
||||
|
||||
// remove any that we do not want.
|
||||
|
||||
if (getAttr(distributorRegistry, aPackage, 'title') == "AOL AIM")
|
||||
{
|
||||
//distributorContainer.RemoveElement(aPackage, true);
|
||||
}
|
||||
}
|
||||
var tree = document.getElementById('tree');
|
||||
|
||||
// Add it to the tree control's composite datasource.
|
||||
tree.database.AddDataSource(distributorRegistry);
|
||||
|
||||
}
|
||||
|
||||
// Install all of the stylesheets in the softwareupdate Registry into the
|
||||
// panel.
|
||||
|
||||
// TODO
|
||||
|
||||
// XXX hack to force the tree to rebuild
|
||||
var treebody = document.getElementById('NC:SoftwareUpdateRoot');
|
||||
treebody.setAttribute('id', 'NC:SoftwareUpdateRoot');
|
||||
}
|
||||
|
||||
|
||||
function OpenURL(event, node)
|
||||
{
|
||||
if (node.getAttribute('type') == "http://home.netscape.com/NC-rdf#SoftwarePackage")
|
||||
{
|
||||
url = node.getAttribute('url');
|
||||
|
||||
/*window.open(url,'bookmarks');*/
|
||||
|
||||
var toolkitCore = XPAppCoresManager.Find("ToolkitCore");
|
||||
if (!toolkitCore)
|
||||
{
|
||||
toolkitCore = new ToolkitCore();
|
||||
if (toolkitCore)
|
||||
{
|
||||
toolkitCore.Init("ToolkitCore");
|
||||
}
|
||||
}
|
||||
|
||||
if (toolkitCore)
|
||||
{
|
||||
toolkitCore.ShowWindow(url,window);
|
||||
}
|
||||
|
||||
dump("OpenURL(" + url + ")\n");
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// To get around "window.onload" not working in viewer.
|
||||
function Boot()
|
||||
{
|
||||
var tree = document.getElementById('tree');
|
||||
if (tree == null) {
|
||||
setTimeout(Boot, 0);
|
||||
}
|
||||
else {
|
||||
Init();
|
||||
}
|
||||
}
|
||||
|
||||
setTimeout('Boot()', 0);
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="resource:/res/rdf/sidebar.css" type="text/css"?>
|
||||
<?xml-stylesheet href="resource:/res/rdf/SoftwareUpdate.css" type="text/css"?>
|
||||
<window
|
||||
xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<html:script src="SoftwareUpdate.js"/>
|
||||
|
||||
<tree id="tree"
|
||||
flex="100%"
|
||||
datasources="rdf:softwareupdates"
|
||||
ondblclick="return OpenURL(event, event.target.parentNode);">
|
||||
|
||||
<treecol rdf:resource="http://home.netscape.com/NC-rdf#title" />
|
||||
<treecol rdf:resource="http://home.netscape.com/NC-rdf#description" />
|
||||
<treecol rdf:resource="http://home.netscape.com/NC-rdf#version" />
|
||||
|
||||
<treehead>
|
||||
<treeitem>
|
||||
<treecell>Title</treecell>
|
||||
<treecell>Description</treecell>
|
||||
<treecell>Version</treecell>
|
||||
</treeitem>
|
||||
</treehead>
|
||||
|
||||
<treebody id="NC:SoftwareUpdateRoot" rdf:containment="http://home.netscape.com/NC-rdf#child" />
|
||||
</tree>
|
||||
</window>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 201 B |
@@ -1,7 +0,0 @@
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:NC="http://home.netscape.com/softwareupdate-schema#">
|
||||
|
||||
<RDF:Bag ID="NC:SoftwareUpdateDataSources">
|
||||
<RDF:li resource="resource:/res/rdf/SoftwareUpdate-Source-1.rdf" />
|
||||
</RDF:Bag>
|
||||
</RDF:RDF>
|
||||
@@ -1,6 +0,0 @@
|
||||
#
|
||||
# This is a list of local files which get copied to the mozilla:dist directory
|
||||
#
|
||||
|
||||
nsISoftwareUpdate.h
|
||||
nsSoftwareUpdateIIDs.h
|
||||
@@ -1,47 +0,0 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# 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 Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Contributors:
|
||||
# Daniel Veditz <dveditz@netscape.com>
|
||||
# Douglas Turner <dougt@netscape.com>
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = xpinstall
|
||||
|
||||
XPIDLSRCS = nsIXPInstallProgress.idl
|
||||
|
||||
EXPORTS = \
|
||||
nsIDOMInstallTriggerGlobal.h \
|
||||
nsIDOMInstallVersion.h \
|
||||
nsSoftwareUpdateIIDs.h \
|
||||
nsISoftwareUpdate.h \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
@@ -1,113 +0,0 @@
|
||||
interface Install
|
||||
{
|
||||
/* IID: { 0x18c2f988, 0xb09f, 0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}} */
|
||||
|
||||
const int BAD_PACKAGE_NAME = -200;
|
||||
const int UNEXPECTED_ERROR = -201;
|
||||
const int ACCESS_DENIED = -202;
|
||||
const int TOO_MANY_CERTIFICATES = -203; /* Installer file must have 1 certificate */
|
||||
const int NO_INSTALLER_CERTIFICATE = -204; /* Installer file must have a certificate */
|
||||
const int NO_CERTIFICATE = -205; /* Extracted file is not signed */
|
||||
const int NO_MATCHING_CERTIFICATE = -206; /* Extracted file does not match installer certificate */
|
||||
const int UNKNOWN_JAR_FILE = -207; /* JAR file has not been opened */
|
||||
const int INVALID_ARGUMENTS = -208; /* Bad arguments to a function */
|
||||
const int ILLEGAL_RELATIVE_PATH = -209; /* Illegal relative path */
|
||||
const int USER_CANCELLED = -210; /* User cancelled */
|
||||
const int INSTALL_NOT_STARTED = -211;
|
||||
const int SILENT_MODE_DENIED = -212;
|
||||
const int NO_SUCH_COMPONENT = -213; /* no such component in the registry. */
|
||||
const int FILE_DOES_NOT_EXIST = -214; /* File cannot be deleted as it does not exist */
|
||||
const int FILE_READ_ONLY = -215; /* File cannot be deleted as it is read only. */
|
||||
const int FILE_IS_DIRECTORY = -216; /* File cannot be deleted as it is a directory */
|
||||
const int NETWORK_FILE_IS_IN_USE = -217; /* File on the network is in-use */
|
||||
const int APPLE_SINGLE_ERR = -218; /* error in AppleSingle unpacking */
|
||||
const int INVALID_PATH_ERR = -219; /* GetFolder() did not like the folderID */
|
||||
const int PATCH_BAD_DIFF = -220; /* error in GDIFF patch */
|
||||
const int PATCH_BAD_CHECKSUM_TARGET = -221; /* source file doesn't checksum */
|
||||
const int PATCH_BAD_CHECKSUM_RESULT = -222; /* final patched file fails checksum */
|
||||
const int UNINSTALL_FAILED = -223; /* error while uninstalling a package */
|
||||
const int GESTALT_UNKNOWN_ERR = -5550;
|
||||
const int GESTALT_INVALID_ARGUMENT = -5551;
|
||||
|
||||
const int SUCCESS = 0;
|
||||
const int REBOOT_NEEDED = 999;
|
||||
|
||||
/* install types */
|
||||
const int LIMITED_INSTALL = 0;
|
||||
const int FULL_INSTALL = 1;
|
||||
const int NO_STATUS_DLG = 2;
|
||||
const int NO_FINALIZE_DLG = 4;
|
||||
|
||||
// these should not be public...
|
||||
/* message IDs*/
|
||||
const int SU_INSTALL_FILE_UNEXPECTED_MSG_ID = 0;
|
||||
const int SU_DETAILS_REPLACE_FILE_MSG_ID = 1;
|
||||
const int SU_DETAILS_INSTALL_FILE_MSG_ID = 2;
|
||||
//////////////////////////
|
||||
|
||||
readonly attribute wstring UserPackageName;
|
||||
readonly attribute wstring RegPackageName;
|
||||
|
||||
void Install();
|
||||
|
||||
void AbortInstall();
|
||||
|
||||
long AddDirectory( in wstring regName,
|
||||
in wstring version,
|
||||
in wstring jarSource,
|
||||
in InstallFolder folder,
|
||||
in wstring subdir,
|
||||
in boolean forceMode );
|
||||
|
||||
|
||||
long AddSubcomponent( in wstring regName,
|
||||
in wstring version,
|
||||
in wstring jarSource,
|
||||
in InstallFolder folder,
|
||||
in wstring targetName,
|
||||
in boolean forceMode );
|
||||
|
||||
long DeleteComponent( in wstring registryName);
|
||||
|
||||
long DeleteFile( in InstallFolder folder,
|
||||
in wstring relativeFileName );
|
||||
|
||||
long DiskSpaceAvailable( in InstallFolder folder );
|
||||
|
||||
long Execute(in wstring jarSource, in wstring args);
|
||||
|
||||
long FinalizeInstall();
|
||||
|
||||
long Gestalt (in wstring selector);
|
||||
|
||||
InstallFolder GetComponentFolder( in wstring regName,
|
||||
in wstring subdirectory);
|
||||
|
||||
InstallFolder GetFolder(in wstring targetFolder,
|
||||
in wstring subdirectory);
|
||||
|
||||
long GetLastError();
|
||||
|
||||
long GetWinProfile(in InstallFolder folder, in wstring file);
|
||||
|
||||
long GetWinRegistry();
|
||||
|
||||
long Patch( in wstring regName,
|
||||
in wstring version,
|
||||
in wstring jarSource,
|
||||
in InstallFolder folder,
|
||||
in wstring targetName );
|
||||
|
||||
void ResetError();
|
||||
|
||||
void SetPackageFolder( in InstallFolder folder );
|
||||
|
||||
long StartInstall( in wstring userPackageName,
|
||||
in wstring packageName,
|
||||
in wstring version,
|
||||
in long flags );
|
||||
|
||||
long Uninstall( in wstring packageName);
|
||||
|
||||
};
|
||||
@@ -1,24 +0,0 @@
|
||||
interface InstallTriggerGlobal
|
||||
{
|
||||
/* IID: { 0x18c2f987, 0xb09f, 0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}} */
|
||||
|
||||
const int MAJOR_DIFF = 4;
|
||||
const int MINOR_DIFF = 3;
|
||||
const int REL_DIFF = 2;
|
||||
const int BLD_DIFF = 1;
|
||||
const int EQUAL = 0;
|
||||
|
||||
boolean UpdateEnabled ();
|
||||
|
||||
long StartSoftwareUpdate(in wstring URL);
|
||||
|
||||
long ConditionalSoftwareUpdate( in wstring URL,
|
||||
in wstring regName,
|
||||
in long diffLevel,
|
||||
in wstring version,
|
||||
in long mode);
|
||||
|
||||
long CompareVersion( in wstring regName, in wstring version );
|
||||
|
||||
};
|
||||
@@ -1,34 +0,0 @@
|
||||
interface InstallVersion
|
||||
{
|
||||
/* IID: { 0x18c2f986, 0xb09f, 0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}} */
|
||||
|
||||
const int EQUAL = 0;
|
||||
const int BLD_DIFF = 1;
|
||||
const int BLD_DIFF_MINUS = -1;
|
||||
const int REL_DIFF = 2;
|
||||
const int REL_DIFF_MINUS = -2;
|
||||
const int MINOR_DIFF = 3;
|
||||
const int MINOR_DIFF_MINUS = -3;
|
||||
const int MAJOR_DIFF = 4;
|
||||
const int MAJOR_DIFF_MINUS = -4;
|
||||
|
||||
attribute int major;
|
||||
attribute int minor;
|
||||
attribute int release;
|
||||
attribute int build;
|
||||
|
||||
void InstallVersion();
|
||||
|
||||
void init(in wstring versionString);
|
||||
/*
|
||||
void init(in int major, in int minor, in int release, in int build);
|
||||
*/
|
||||
wstring toString();
|
||||
|
||||
/* int compareTo(in wstring version);
|
||||
int compareTo(in int major, in int minor, in int release, in int build);
|
||||
*/
|
||||
int compareTo(in InstallVersion versionObject);
|
||||
|
||||
};
|
||||
@@ -1,36 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# 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 Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Contributors:
|
||||
# Daniel Veditz <dveditz@netscape.com>
|
||||
# Douglas Turner <dougt@netscape.com>
|
||||
|
||||
MODULE=xpinstall
|
||||
DEPTH=..\..
|
||||
|
||||
EXPORTS= nsIDOMInstallTriggerGlobal.h \
|
||||
nsIDOMInstallVersion.h \
|
||||
nsSoftwareUpdateIIDs.h \
|
||||
nsISoftwareUpdate.h
|
||||
|
||||
XPIDLSRCS = .\nsIXPInstallProgress.idl
|
||||
|
||||
include <$(DEPTH)\config\config.mak>
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
@@ -1 +0,0 @@
|
||||
#error
|
||||
@@ -1,96 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/* AUTO-GENERATED. DO NOT EDIT!!! */
|
||||
|
||||
#ifndef nsIDOMInstallTriggerGlobal_h__
|
||||
#define nsIDOMInstallTriggerGlobal_h__
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIScriptContext.h"
|
||||
|
||||
|
||||
#define NS_IDOMINSTALLTRIGGERGLOBAL_IID \
|
||||
{ 0x18c2f987, 0xb09f, 0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}}
|
||||
|
||||
class nsIDOMInstallTriggerGlobal : public nsISupports {
|
||||
public:
|
||||
static const nsIID& IID() { static nsIID iid = NS_IDOMINSTALLTRIGGERGLOBAL_IID; return iid; }
|
||||
enum {
|
||||
MAJOR_DIFF = 4,
|
||||
MINOR_DIFF = 3,
|
||||
REL_DIFF = 2,
|
||||
BLD_DIFF = 1,
|
||||
EQUAL = 0
|
||||
};
|
||||
|
||||
NS_IMETHOD UpdateEnabled(PRBool* aReturn)=0;
|
||||
|
||||
NS_IMETHOD StartSoftwareUpdate(const nsString& aURL, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD StartSoftwareUpdate(const nsString& aURL, PRInt32 aFlags, PRInt32* aReturn)=0;
|
||||
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, PRInt32 aDiffLevel, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, PRInt32 aDiffLevel, nsIDOMInstallVersion* aVersion, PRInt32 aMode, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32 aMode, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn)=0;
|
||||
|
||||
NS_IMETHOD CompareVersion(const nsString& aRegName, PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD CompareVersion(const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD CompareVersion(const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn)=0;
|
||||
};
|
||||
|
||||
|
||||
#define NS_DECL_IDOMINSTALLTRIGGERGLOBAL \
|
||||
NS_IMETHOD UpdateEnabled(PRBool* aReturn); \
|
||||
NS_IMETHOD StartSoftwareUpdate(const nsString& aURL, PRInt32 aFlags, PRInt32* aReturn); \
|
||||
NS_IMETHOD StartSoftwareUpdate(const nsString& aURL, PRInt32* aReturn); \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, PRInt32 aDiffLevel, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn); \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, PRInt32 aDiffLevel, nsIDOMInstallVersion* aVersion, PRInt32 aMode, PRInt32* aReturn); \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32 aMode, PRInt32* aReturn); \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn); \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn); \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn); \
|
||||
NS_IMETHOD CompareVersion(const nsString& aRegName, PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn); \
|
||||
NS_IMETHOD CompareVersion(const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn); \
|
||||
NS_IMETHOD CompareVersion(const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn); \
|
||||
|
||||
|
||||
|
||||
#define NS_FORWARD_IDOMINSTALLTRIGGERGLOBAL(_to) \
|
||||
NS_IMETHOD UpdateEnabled(PRBool* aReturn) { return _to##UpdateEnabled(aReturn); } \
|
||||
NS_IMETHOD StartSoftwareUpdate(const nsString& aURL, PRInt32 aFlags, PRInt32* aReturn) { return _to##StartSoftwareUpdate(aURL, aFlags, aReturn); } \
|
||||
NS_IMETHOD StartSoftwareUpdate(const nsString& aURL, PRInt32* aReturn) { return _to##StartSoftwareUpdate(aURL, aReturn); } \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, PRInt32 aDiffLevel, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn) { return _to##ConditionalSoftwareUpdate(aURL, aRegName, aDiffLevel, aVersion, aMode, aReturn); } \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, PRInt32 aDiffLevel, nsIDOMInstallVersion* aVersion, PRInt32 aMode, PRInt32* aReturn) { return _to##ConditionalSoftwareUpdate(aURL, aRegName, aDiffLevel, aVersion, aMode, aReturn); } \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, nsIDOMInstallVersion* aRegName, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn) { return _to##ConditionalSoftwareUpdate(aURL, aDiffLevel, aVersion, aMode, aReturn); } \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, const nsString& aVersion, PRInt32 aMode, PRInt32* aReturn) { return _to##ConditionalSoftwareUpdate(aURL, aDiffLevel, aVersion, aMode, aReturn); } \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn) { return _to##ConditionalSoftwareUpdate(aURL, aDiffLevel, aVersion, aReturn); } \
|
||||
NS_IMETHOD ConditionalSoftwareUpdate(const nsString& aURL, const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn) { return _to##ConditionalSoftwareUpdate(aURL, aDiffLevel, aVersion, aReturn); } \
|
||||
NS_IMETHOD CompareVersion(const nsString& aRegName, PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn) { return _to##CompareVersion(aRegName, aMajor, aMinor, aRelease, aBuild, aReturn); } \
|
||||
NS_IMETHOD CompareVersion(const nsString& aRegName, const nsString& aVersion, PRInt32* aReturn) { return _to##CompareVersion(aRegName, aVersion, aReturn); } \
|
||||
NS_IMETHOD CompareVersion(const nsString& aRegName, nsIDOMInstallVersion* aVersion, PRInt32* aReturn) { return _to##CompareVersion(aRegName, aVersion, aReturn); } \
|
||||
|
||||
|
||||
extern nsresult NS_InitInstallTriggerGlobalClass(nsIScriptContext *aContext, void **aPrototype);
|
||||
|
||||
extern "C" NS_DOM nsresult NS_NewScriptInstallTriggerGlobal(nsIScriptContext *aContext, nsISupports *aSupports, nsISupports *aParent, void **aReturn);
|
||||
|
||||
#endif // nsIDOMInstallTriggerGlobal_h__
|
||||
@@ -1,107 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/* AUTO-GENERATED. DO NOT EDIT!!! */
|
||||
|
||||
#ifndef nsIDOMInstallVersion_h__
|
||||
#define nsIDOMInstallVersion_h__
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIScriptContext.h"
|
||||
|
||||
class nsIDOMInstallVersion;
|
||||
|
||||
#define NS_IDOMINSTALLVERSION_IID \
|
||||
{ 0x18c2f986, 0xb09f, 0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}}
|
||||
|
||||
class nsIDOMInstallVersion : public nsISupports {
|
||||
public:
|
||||
static const nsIID& IID() { static nsIID iid = NS_IDOMINSTALLVERSION_IID; return iid; }
|
||||
enum {
|
||||
EQUAL = 0,
|
||||
BLD_DIFF = 1,
|
||||
BLD_DIFF_MINUS = -1,
|
||||
REL_DIFF = 2,
|
||||
REL_DIFF_MINUS = -2,
|
||||
MINOR_DIFF = 3,
|
||||
MINOR_DIFF_MINUS = -3,
|
||||
MAJOR_DIFF = 4,
|
||||
MAJOR_DIFF_MINUS = -4
|
||||
};
|
||||
|
||||
NS_IMETHOD GetMajor(PRInt32* aMajor)=0;
|
||||
NS_IMETHOD SetMajor(PRInt32 aMajor)=0;
|
||||
|
||||
NS_IMETHOD GetMinor(PRInt32* aMinor)=0;
|
||||
NS_IMETHOD SetMinor(PRInt32 aMinor)=0;
|
||||
|
||||
NS_IMETHOD GetRelease(PRInt32* aRelease)=0;
|
||||
NS_IMETHOD SetRelease(PRInt32 aRelease)=0;
|
||||
|
||||
NS_IMETHOD GetBuild(PRInt32* aBuild)=0;
|
||||
NS_IMETHOD SetBuild(PRInt32 aBuild)=0;
|
||||
|
||||
NS_IMETHOD Init(const nsString& aVersionString)=0;
|
||||
|
||||
NS_IMETHOD ToString(nsString& aReturn)=0;
|
||||
|
||||
NS_IMETHOD CompareTo(nsIDOMInstallVersion* aVersionObject, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD CompareTo(const nsString& aString, PRInt32* aReturn)=0;
|
||||
NS_IMETHOD CompareTo(PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn)=0;
|
||||
};
|
||||
|
||||
|
||||
#define NS_DECL_IDOMINSTALLVERSION \
|
||||
NS_IMETHOD GetMajor(PRInt32* aMajor); \
|
||||
NS_IMETHOD SetMajor(PRInt32 aMajor); \
|
||||
NS_IMETHOD GetMinor(PRInt32* aMinor); \
|
||||
NS_IMETHOD SetMinor(PRInt32 aMinor); \
|
||||
NS_IMETHOD GetRelease(PRInt32* aRelease); \
|
||||
NS_IMETHOD SetRelease(PRInt32 aRelease); \
|
||||
NS_IMETHOD GetBuild(PRInt32* aBuild); \
|
||||
NS_IMETHOD SetBuild(PRInt32 aBuild); \
|
||||
NS_IMETHOD Init(const nsString& aVersionString); \
|
||||
NS_IMETHOD ToString(nsString& aReturn); \
|
||||
NS_IMETHOD CompareTo(nsIDOMInstallVersion* aVersionObject, PRInt32* aReturn); \
|
||||
NS_IMETHOD CompareTo(const nsString& aString, PRInt32* aReturn); \
|
||||
NS_IMETHOD CompareTo(PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn); \
|
||||
|
||||
|
||||
|
||||
#define NS_FORWARD_IDOMINSTALLVERSION(_to) \
|
||||
NS_IMETHOD GetMajor(PRInt32* aMajor) { return _to##GetMajor(aMajor); } \
|
||||
NS_IMETHOD SetMajor(PRInt32 aMajor) { return _to##SetMajor(aMajor); } \
|
||||
NS_IMETHOD GetMinor(PRInt32* aMinor) { return _to##GetMinor(aMinor); } \
|
||||
NS_IMETHOD SetMinor(PRInt32 aMinor) { return _to##SetMinor(aMinor); } \
|
||||
NS_IMETHOD GetRelease(PRInt32* aRelease) { return _to##GetRelease(aRelease); } \
|
||||
NS_IMETHOD SetRelease(PRInt32 aRelease) { return _to##SetRelease(aRelease); } \
|
||||
NS_IMETHOD GetBuild(PRInt32* aBuild) { return _to##GetBuild(aBuild); } \
|
||||
NS_IMETHOD SetBuild(PRInt32 aBuild) { return _to##SetBuild(aBuild); } \
|
||||
NS_IMETHOD Init(const nsString& aVersionString) { return _to##Init(aVersionString); } \
|
||||
NS_IMETHOD ToString(nsString& aReturn) { return _to##ToString(aReturn); } \
|
||||
NS_IMETHOD CompareTo(nsIDOMInstallVersion* aVersionObject, PRInt32* aReturn) { return _to##CompareTo(aVersionObject, aReturn); } \
|
||||
NS_IMETHOD CompareTo(const nsString& aString, PRInt32* aReturn) { return _to##CompareTo(aString, aReturn); } \
|
||||
NS_IMETHOD CompareTo(PRInt32 aMajor, PRInt32 aMinor, PRInt32 aRelease, PRInt32 aBuild, PRInt32* aReturn) { return _to##CompareTo(aMajor, aMinor, aRelease, aBuild, aReturn); } \
|
||||
|
||||
|
||||
extern nsresult NS_InitInstallVersionClass(nsIScriptContext *aContext, void **aPrototype);
|
||||
|
||||
extern "C" NS_DOM nsresult NS_NewScriptInstallVersion(nsIScriptContext *aContext, nsISupports *aSupports, nsISupports *aParent, void **aReturn);
|
||||
|
||||
#endif // nsIDOMInstallVersion_h__
|
||||
@@ -1,85 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef nsISoftwareUpdate_h__
|
||||
#define nsISoftwareUpdate_h__
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsIFactory.h"
|
||||
#include "nsString.h"
|
||||
|
||||
#include "nsIXPInstallProgress.h"
|
||||
|
||||
#define NS_IXPINSTALLCOMPONENT_PROGID NS_IAPPSHELLCOMPONENT_PROGID "/xpinstall"
|
||||
#define NS_IXPINSTALLCOMPONENT_CLASSNAME "Mozilla XPInstall Component"
|
||||
|
||||
|
||||
#define NS_ISOFTWAREUPDATE_IID \
|
||||
{ 0x18c2f992, \
|
||||
0xb09f, \
|
||||
0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}\
|
||||
}
|
||||
|
||||
|
||||
class nsISoftwareUpdate : public nsISupports
|
||||
{
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISOFTWAREUPDATE_IID)
|
||||
|
||||
NS_IMETHOD InstallJar(const nsString& fromURL,
|
||||
const nsString& localFile,
|
||||
long flags) = 0;
|
||||
|
||||
NS_IMETHOD RegisterNotifier(nsIXPInstallProgress *notifier) = 0;
|
||||
|
||||
NS_IMETHOD InstallPending(void) = 0;
|
||||
|
||||
/* FIX: these should be in a private interface */
|
||||
NS_IMETHOD InstallJarCallBack() = 0;
|
||||
NS_IMETHOD GetTopLevelNotifier(nsIXPInstallProgress **notifier) = 0;
|
||||
};
|
||||
|
||||
|
||||
class nsSoftwareUpdateFactory : public nsIFactory
|
||||
{
|
||||
public:
|
||||
|
||||
nsSoftwareUpdateFactory();
|
||||
virtual ~nsSoftwareUpdateFactory();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD CreateInstance(nsISupports *aOuter,
|
||||
REFNSIID aIID,
|
||||
void **aResult);
|
||||
|
||||
NS_IMETHOD LockFactory(PRBool aLock);
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // nsISoftwareUpdate_h__
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[uuid(eea90d40-b059-11d2-915e-c12b696c9333)]
|
||||
interface nsIXPInstallProgress : nsISupports
|
||||
{
|
||||
void BeforeJavascriptEvaluation();
|
||||
void AfterJavascriptEvaluation();
|
||||
void InstallStarted([const] in string UIPackageName);
|
||||
void ItemScheduled([const] in string message );
|
||||
void InstallFinalization([const] in string message, in long itemNum, in long totNum );
|
||||
void InstallAborted();
|
||||
};
|
||||
@@ -1,93 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributors:
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef nsIXPInstallProgressNotifier_h__
|
||||
#define nsIXPInstallProgressNotifier_h__
|
||||
|
||||
|
||||
class nsIXPInstallProgressNotifier
|
||||
{
|
||||
public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Function name : BeforeJavascriptEvaluation
|
||||
// Description : This will be called when prior to the install script being evaluate
|
||||
// Return type : void
|
||||
// Argument : void
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual void BeforeJavascriptEvaluation(void) = 0;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Function name : AfterJavascriptEvaluation
|
||||
// Description : This will be called after the install script has being evaluated
|
||||
// Return type : void
|
||||
// Argument : void
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual void AfterJavascriptEvaluation(void) = 0;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Function name : InstallStarted
|
||||
// Description : This will be called when StartInstall has been called
|
||||
// Return type : void
|
||||
// Argument : char* UIPackageName - User Package Name
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual void InstallStarted(const char* UIPackageName) = 0;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Function name : ItemScheduled
|
||||
// Description : This will be called when items are being scheduled
|
||||
// Return type : Any value returned other than zero, will be treated as an error and the script will be aborted
|
||||
// Argument : The message that should be displayed to the user
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual long ItemScheduled( const char* message ) = 0;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Function name : InstallFinalization
|
||||
// Description : This will be called when the installation is in its Finalize stage
|
||||
// Return type : void
|
||||
// Argument : char* message - The message that should be displayed to the user
|
||||
// Argument : long itemNum - This is the current item number
|
||||
// Argument : long totNum - This is the total number of items
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual void InstallFinalization( const char* message, long itemNum, long totNum ) = 0;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Function name : InstallAborted
|
||||
// Description : This will be called when the install is aborted
|
||||
// Return type : void
|
||||
// Argument : void
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual void InstallAborted(void) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,64 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
#ifndef nsSoftwareUpdateIIDs_h___
|
||||
#define nsSoftwareUpdateIIDs_h___
|
||||
|
||||
#define NS_SoftwareUpdate_CID \
|
||||
{ /* 18c2f989-b09f-11d2-bcde-00805f0e1353 */ \
|
||||
0x18c2f989, \
|
||||
0xb09f, \
|
||||
0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53} \
|
||||
}
|
||||
|
||||
#define NS_SoftwareUpdateInstall_CID \
|
||||
{ /* 18c2f98b-b09f-11d2-bcde-00805f0e1353 */ \
|
||||
0x18c2f98b, \
|
||||
0xb09f, \
|
||||
0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53} \
|
||||
}
|
||||
|
||||
#define NS_SoftwareUpdateInstallTrigger_CID \
|
||||
{ /* 18c2f98d-b09f-11d2-bcde-00805f0e1353 */ \
|
||||
0x18c2f98d, \
|
||||
0xb09f, \
|
||||
0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53} \
|
||||
}
|
||||
|
||||
#define NS_SoftwareUpdateInstallVersion_CID \
|
||||
{ /* 18c2f98f-b09f-11d2-bcde-00805f0e1353 */ \
|
||||
0x18c2f98f, \
|
||||
0xb09f, \
|
||||
0x11d2, \
|
||||
{0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53} \
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* nsSoftwareUpdateIIDs_h___ */
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
progress.xul
|
||||
progress.css
|
||||
progress.html
|
||||
@@ -1,34 +0,0 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH=../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/config.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
EXPORT_RESOURCE_XPINSTALL = \
|
||||
$(srcdir)/progress.xul \
|
||||
$(srcdir)/progress.html \
|
||||
$(srcdir)/progress.css \
|
||||
$(NULL)
|
||||
|
||||
install::
|
||||
$(INSTALL) $(EXPORT_RESOURCE_XPINSTALL) $(DIST)/bin/res/xpinstall
|
||||
@@ -1,31 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH=..\..
|
||||
IGNORE_MANIFEST=1
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(DLL)
|
||||
$(MAKE_INSTALL) progress.xul $(DIST)\bin\res\xpinstall
|
||||
$(MAKE_INSTALL) progress.css $(DIST)\bin\res\xpinstall
|
||||
$(MAKE_INSTALL) progress.html $(DIST)\bin\res\xpinstall
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\res\xpinstall\progress.xul
|
||||
rm -f $(DIST)\res\xpinstall\progress.css
|
||||
rm -f $(DIST)\res\xpinstall\progress.html
|
||||
@@ -1,3 +0,0 @@
|
||||
TD {
|
||||
font: 10pt sans-serif;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
||||
<html>
|
||||
<body bgcolor="#C0C0C0" style="overflow:visible; margin: 0px; color-background: rgb(192,192,192);">
|
||||
<center>
|
||||
<table BORDER COLS=5 WIDTH="99%" style="color-background:rgb(192,192,192);">
|
||||
<tr>
|
||||
<td WIDTH="3%" NOWRAP style="border: 1px inset rgb(192,192,192);"> </td>
|
||||
<td WIDTH="3%" NOWRAP style="border: 1px inset rgb(192,192,192);"> </td>
|
||||
<td WIDTH="3%" NOWRAP style="border: 1px inset rgb(192,192,192);"> </td>
|
||||
<td WIDTH="10%" NOWRAP style="border: 1px inset rgb(192,192,192);"> </td>
|
||||
<td WIDTH="81%" NOWRAP style="border: 1px inset rgb(192,192,192);"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,67 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="../samples/xul.css" type="text/css"?>
|
||||
<?xml-stylesheet href="progress.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window
|
||||
[
|
||||
<!ENTITY downloadWindow.title "XPInstall Progress">
|
||||
<!ENTITY status "Status:">
|
||||
<!ENTITY cancelButtonTitle "Cancel">
|
||||
]
|
||||
>
|
||||
|
||||
<window xmlns:html="http://www.w3.org/TR/REC-html40"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="XPInstall Progress"
|
||||
width="425"
|
||||
height="225">
|
||||
|
||||
<data>
|
||||
<broadcaster id="data.canceled" type="string" value="false"/>
|
||||
</data>
|
||||
|
||||
|
||||
<html:script>
|
||||
|
||||
function cancelInstall()
|
||||
{
|
||||
var cancelData = document.getElementById("data.canceled");
|
||||
cancelData.setAttribute( "value", "true");
|
||||
}
|
||||
|
||||
</html:script>
|
||||
|
||||
<html:center>
|
||||
<html:table style="width:100%;">
|
||||
|
||||
<html:tr>
|
||||
<html:td align="center">
|
||||
<html:input id="dialog.uiPackageName" readonly="" style="background-color:lightgray;width:300px;"/>
|
||||
</html:td>
|
||||
</html:tr>
|
||||
|
||||
<html:tr>
|
||||
<html:td nowrap="" style="border: 1px rgb(192,192,192);" align="center">
|
||||
<html:input id="dialog.currentAction" readonly="" style="background-color:lightgray;width:450px;"/>
|
||||
</html:td>
|
||||
</html:tr>
|
||||
|
||||
|
||||
<html:tr>
|
||||
<html:td align="center" width="15%" nowrap="" style="border: 1px rgb(192,192,192);">
|
||||
<progressmeter id="dialog.progress" mode="undetermined" style="width:300px;height:16px;">
|
||||
</progressmeter>
|
||||
</html:td>
|
||||
</html:tr>
|
||||
|
||||
<html:tr>
|
||||
<html:td align="center" width="3%" nowrap="" style="border: 1px rgb(192,192,192);">
|
||||
<html:button onclick="cancelInstall()" height="12">
|
||||
&cancelButtonTitle;
|
||||
</html:button>
|
||||
</html:td>
|
||||
</html:tr>
|
||||
</html:table>
|
||||
|
||||
</html:center>
|
||||
</window>
|
||||
@@ -1,61 +0,0 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# 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 Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Contributors:
|
||||
# Daniel Veditz <dveditz@netscape.com>
|
||||
# Douglas Turner <dougt@netscape.com>
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
srcdir = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = xpinstall
|
||||
LIBRARY_NAME = xpinstall
|
||||
IS_COMPONENT = 1
|
||||
REQUIRES = dom js netlib raptor xpcom
|
||||
|
||||
CPPSRCS = \
|
||||
nsSoftwareUpdate.cpp \
|
||||
nsInstall.cpp \
|
||||
nsInstallDelete.cpp \
|
||||
nsInstallExecute.cpp \
|
||||
nsInstallFile.cpp \
|
||||
nsInstallFolder.cpp \
|
||||
nsInstallPatch.cpp \
|
||||
nsInstallUninstall.cpp \
|
||||
nsInstallTrigger.cpp \
|
||||
nsInstallResources.cpp \
|
||||
nsJSInstall.cpp \
|
||||
nsJSInstallTriggerGlobal.cpp\
|
||||
nsSoftwareUpdateRun.cpp \
|
||||
nsSoftwareUpdateStream.cpp \
|
||||
nsTopProgressNotifier.cpp \
|
||||
nsLoggingProgressNotifier \
|
||||
ScheduledTasks.cpp \
|
||||
nsInstallFileOpItem.cpp \
|
||||
$(NULL)
|
||||
|
||||
INCLUDES += -I$(srcdir)/../public
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,233 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
|
||||
/*
|
||||
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
|
||||
*
|
||||
|
||||
* 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 Mozilla Communicator client code,
|
||||
|
||||
* released March 31, 1998.
|
||||
|
||||
*
|
||||
|
||||
* 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.
|
||||
|
||||
*
|
||||
|
||||
* Contributors:
|
||||
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef SU_PAS_H
|
||||
|
||||
#define SU_PAS_H
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#include <Errors.h>
|
||||
|
||||
#include <Types.h>
|
||||
|
||||
#include <Files.h>
|
||||
|
||||
#include <Script.h>
|
||||
|
||||
#include <Resources.h>
|
||||
|
||||
|
||||
|
||||
typedef struct PASHeader /* header portion of Patchable AppleSingle */
|
||||
|
||||
{
|
||||
|
||||
UInt32 magicNum; /* internal file type tag = 0x00244200*/
|
||||
|
||||
UInt32 versionNum; /* format version: 1 = 0x00010000 */
|
||||
|
||||
UInt8 filler[16]; /* filler */
|
||||
|
||||
UInt16 numEntries; /* number of entries which follow */
|
||||
|
||||
} PASHeader ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct PASEntry /* one Patchable AppleSingle entry descriptor */
|
||||
|
||||
{
|
||||
|
||||
UInt32 entryID; /* entry type: see list, 0 invalid */
|
||||
|
||||
UInt32 entryOffset; /* offset, in bytes, from beginning */
|
||||
|
||||
/* of file to this entry's data */
|
||||
|
||||
UInt32 entryLength; /* length of data in octets */
|
||||
|
||||
|
||||
|
||||
} PASEntry;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct PASMiscInfo
|
||||
|
||||
{
|
||||
|
||||
short fileHasResFork;
|
||||
|
||||
short fileResAttrs;
|
||||
|
||||
OSType fileType;
|
||||
|
||||
OSType fileCreator;
|
||||
|
||||
UInt32 fileFlags;
|
||||
|
||||
|
||||
|
||||
} PASMiscInfo;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct PASResFork
|
||||
|
||||
{
|
||||
|
||||
short NumberOfTypes;
|
||||
|
||||
|
||||
|
||||
} PASResFork;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct PASResource
|
||||
|
||||
{
|
||||
|
||||
short attr;
|
||||
|
||||
short attrID;
|
||||
|
||||
OSType attrType;
|
||||
|
||||
Str255 attrName;
|
||||
|
||||
unsigned long length;
|
||||
|
||||
|
||||
|
||||
} PASResource;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ALIGN_SUPPORTED
|
||||
|
||||
#pragma options align=reset
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define kCreator 'MOSS'
|
||||
|
||||
#define kType 'PASf'
|
||||
|
||||
#define PAS_BUFFER_SIZE (1024*512)
|
||||
|
||||
|
||||
|
||||
#define PAS_MAGIC_NUM (0x00244200)
|
||||
|
||||
#define PAS_VERSION (0x00010000)
|
||||
|
||||
|
||||
|
||||
enum
|
||||
|
||||
{
|
||||
|
||||
ePas_Data = 1,
|
||||
|
||||
ePas_Misc,
|
||||
|
||||
ePas_Resource
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
extern "C" {
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Prototypes */
|
||||
|
||||
OSErr PAS_EncodeFile(FSSpec *inSpec, FSSpec *outSpec);
|
||||
|
||||
OSErr PAS_DecodeFile(FSSpec *inSpec, FSSpec *outSpec);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif /* SU_PAS_H */
|
||||
@@ -1,380 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
#include "nscore.h"
|
||||
#include "NSReg.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsFileStream.h"
|
||||
#include "nsInstall.h" // for error codes
|
||||
#include "prmem.h"
|
||||
#include "ScheduledTasks.h"
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include <sys/stat.h>
|
||||
#include <windows.h>
|
||||
|
||||
BOOL WIN32_IsMoveFileExBroken()
|
||||
{
|
||||
/* the NT option MOVEFILE_DELAY_UNTIL_REBOOT is broken on
|
||||
* Windows NT 3.51 Service Pack 4 and NT 4.0 before Service Pack 2
|
||||
*/
|
||||
BOOL broken = FALSE;
|
||||
OSVERSIONINFO osinfo;
|
||||
|
||||
// they *all* appear broken--better to have one way that works.
|
||||
return TRUE;
|
||||
|
||||
osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
if (GetVersionEx(&osinfo) && osinfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
|
||||
{
|
||||
if ( osinfo.dwMajorVersion == 3 && osinfo.dwMinorVersion == 51 )
|
||||
{
|
||||
if ( 0 == stricmp(osinfo.szCSDVersion,"Service Pack 4"))
|
||||
{
|
||||
broken = TRUE;
|
||||
}
|
||||
}
|
||||
else if ( osinfo.dwMajorVersion == 4 )
|
||||
{
|
||||
if (osinfo.szCSDVersion[0] == '\0' ||
|
||||
(0 == stricmp(osinfo.szCSDVersion,"Service Pack 1")))
|
||||
{
|
||||
broken = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return broken;
|
||||
}
|
||||
|
||||
|
||||
PRInt32 DoWindowsReplaceExistingFileStuff(const char* currentName, const char* finalName)
|
||||
{
|
||||
PRInt32 err = 0;
|
||||
|
||||
char* final = strdup(finalName);
|
||||
char* current = strdup(currentName);
|
||||
|
||||
/* couldn't delete, probably in use. Schedule for later */
|
||||
DWORD dwVersion, dwWindowsMajorVersion;
|
||||
|
||||
/* Get OS version info */
|
||||
dwVersion = GetVersion();
|
||||
dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
|
||||
|
||||
/* Get build numbers for Windows NT or Win32s */
|
||||
|
||||
if (dwVersion < 0x80000000) // Windows NT
|
||||
{
|
||||
/* On Windows NT */
|
||||
if ( WIN32_IsMoveFileExBroken() )
|
||||
{
|
||||
/* the MOVEFILE_DELAY_UNTIL_REBOOT option doesn't work on
|
||||
* NT 3.51 SP4 or on NT 4.0 until SP2
|
||||
*/
|
||||
struct stat statbuf;
|
||||
PRBool nameFound = PR_FALSE;
|
||||
char tmpname[_MAX_PATH];
|
||||
|
||||
strncpy( tmpname, finalName, _MAX_PATH );
|
||||
int len = strlen(tmpname);
|
||||
while (!nameFound && len < _MAX_PATH )
|
||||
{
|
||||
tmpname[len-1] = '~';
|
||||
tmpname[len] = '\0';
|
||||
if ( stat(tmpname, &statbuf) != 0 )
|
||||
nameFound = TRUE;
|
||||
else
|
||||
len++;
|
||||
}
|
||||
|
||||
if ( nameFound )
|
||||
{
|
||||
if ( MoveFile( finalName, tmpname ) )
|
||||
{
|
||||
if ( MoveFile( currentName, finalName ) )
|
||||
{
|
||||
DeleteFileNowOrSchedule(nsFileSpec(tmpname));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 2nd move failed, put old file back */
|
||||
MoveFile( tmpname, finalName );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* non-executable in use; schedule for later */
|
||||
return -1; // let the start registry stuff do our work!
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( MoveFileEx(currentName, finalName, MOVEFILE_DELAY_UNTIL_REBOOT) )
|
||||
{
|
||||
err = 0;
|
||||
}
|
||||
}
|
||||
else // Windows 95 or Win16
|
||||
{
|
||||
/*
|
||||
* Place an entry in the WININIT.INI file in the Windows directory
|
||||
* to delete finalName and rename currentName to be finalName at reboot
|
||||
*/
|
||||
|
||||
int strlen;
|
||||
char Src[_MAX_PATH]; // 8.3 name
|
||||
char Dest[_MAX_PATH]; // 8.3 name
|
||||
|
||||
strlen = GetShortPathName( (LPCTSTR)currentName, (LPTSTR)Src, (DWORD)sizeof(Src) );
|
||||
if ( strlen > 0 )
|
||||
{
|
||||
free(current);
|
||||
current = strdup(Src);
|
||||
}
|
||||
|
||||
strlen = GetShortPathName( (LPCTSTR) finalName, (LPTSTR) Dest, (DWORD) sizeof(Dest));
|
||||
if ( strlen > 0 )
|
||||
{
|
||||
free(final);
|
||||
final = strdup(Dest);
|
||||
}
|
||||
|
||||
/* NOTE: use OEM filenames! Even though it looks like a Windows
|
||||
* .INI file, WININIT.INI is processed under DOS
|
||||
*/
|
||||
|
||||
AnsiToOem( final, final );
|
||||
AnsiToOem( current, current );
|
||||
|
||||
if ( WritePrivateProfileString( "Rename", final, current, "WININIT.INI" ) )
|
||||
err = 0;
|
||||
}
|
||||
|
||||
free(final);
|
||||
free(current);
|
||||
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
REGERR DeleteFileNowOrSchedule(nsFileSpec& filename)
|
||||
{
|
||||
|
||||
REGERR result = 0;
|
||||
|
||||
filename.Delete(false);
|
||||
|
||||
if (filename.Exists())
|
||||
{
|
||||
RKEY newkey;
|
||||
HREG reg;
|
||||
if ( REGERR_OK == NR_RegOpen("", ®) )
|
||||
{
|
||||
if (REGERR_OK == NR_RegAddKey( reg, ROOTKEY_PRIVATE, REG_DELETE_LIST_KEY, &newkey) )
|
||||
{
|
||||
// FIX should be using nsPersistentFileDescriptor!!!
|
||||
|
||||
result = NR_RegSetEntry( reg, newkey, (char*)(const char*)filename.GetNativePathCString(), REGTYPE_ENTRY_FILE, nsnull, 0);
|
||||
if (result == REGERR_OK)
|
||||
result = nsInstall::REBOOT_NEEDED;
|
||||
}
|
||||
|
||||
NR_RegClose(reg);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
/* tmp file is the bad one that we want to replace with target. */
|
||||
|
||||
REGERR ReplaceFileNowOrSchedule(nsFileSpec& replacementFile, nsFileSpec& doomedFile )
|
||||
{
|
||||
REGERR result = 0;
|
||||
|
||||
if(replacementFile == doomedFile)
|
||||
{
|
||||
/* do not have to do anything */
|
||||
return result;
|
||||
}
|
||||
|
||||
doomedFile.Delete(false);
|
||||
|
||||
if (! doomedFile.Exists() )
|
||||
{
|
||||
// Now that we have move the existing file, we can move the mExtracedFile into place.
|
||||
nsFileSpec parentofFinalFile;
|
||||
|
||||
doomedFile.GetParent(parentofFinalFile);
|
||||
result = replacementFile.Move(parentofFinalFile);
|
||||
if ( NS_SUCCEEDED(result) )
|
||||
{
|
||||
char* leafName = doomedFile.GetLeafName();
|
||||
replacementFile.Rename(leafName);
|
||||
nsCRT::free(leafName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef _WINDOWS
|
||||
if (DoWindowsReplaceExistingFileStuff(replacementFile.GetNativePathCString(), doomedFile.GetNativePathCString()) == 0)
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
RKEY newkey;
|
||||
HREG reg;
|
||||
|
||||
if ( REGERR_OK == NR_RegOpen("", ®) )
|
||||
{
|
||||
result = NR_RegAddKey( reg, ROOTKEY_PRIVATE, REG_REPLACE_LIST_KEY, &newkey);
|
||||
if ( result == REGERR_OK )
|
||||
{
|
||||
char* replacementFileName = (char*)(const char*)replacementFile.GetNativePathCString();
|
||||
result = NR_RegSetEntry( reg, newkey, (char*)(const char*)doomedFile.GetNativePathCString(), REGTYPE_ENTRY_FILE, replacementFileName, strlen(replacementFileName));
|
||||
if (result == REGERR_OK)
|
||||
result = nsInstall::REBOOT_NEEDED;
|
||||
}
|
||||
|
||||
NR_RegClose(reg);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void DeleteScheduledFiles(void);
|
||||
void ReplaceScheduledFiles(void);
|
||||
|
||||
extern "C" void PerformScheduledTasks(void *data)
|
||||
{
|
||||
DeleteScheduledFiles();
|
||||
ReplaceScheduledFiles();
|
||||
}
|
||||
|
||||
|
||||
void DeleteScheduledFiles(void)
|
||||
{
|
||||
HREG reg;
|
||||
|
||||
if (REGERR_OK == NR_RegOpen("", ®))
|
||||
{
|
||||
RKEY key;
|
||||
REGENUM state;
|
||||
|
||||
/* perform scheduled file deletions and replacements (PC only) */
|
||||
if (REGERR_OK == NR_RegGetKey(reg, ROOTKEY_PRIVATE, REG_DELETE_LIST_KEY,&key))
|
||||
{
|
||||
char buf[MAXREGNAMELEN];
|
||||
|
||||
while (REGERR_OK == NR_RegEnumEntries(reg, key, &state, buf, sizeof(buf), NULL ))
|
||||
{
|
||||
nsFileSpec doomedFile(buf);
|
||||
|
||||
doomedFile.Delete(PR_FALSE);
|
||||
|
||||
if (! doomedFile.Exists())
|
||||
{
|
||||
NR_RegDeleteEntry( reg, key, buf );
|
||||
}
|
||||
}
|
||||
|
||||
/* delete list node if empty */
|
||||
if (REGERR_NOMORE == NR_RegEnumEntries( reg, key, &state, buf, sizeof(buf), NULL ))
|
||||
{
|
||||
NR_RegDeleteKey(reg, ROOTKEY_PRIVATE, REG_DELETE_LIST_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
NR_RegClose(reg);
|
||||
}
|
||||
}
|
||||
|
||||
void ReplaceScheduledFiles(void)
|
||||
{
|
||||
HREG reg;
|
||||
|
||||
if (REGERR_OK == NR_RegOpen("", ®))
|
||||
{
|
||||
RKEY key;
|
||||
REGENUM state;
|
||||
|
||||
/* replace files if any listed */
|
||||
if (REGERR_OK == NR_RegGetKey(reg, ROOTKEY_PRIVATE, REG_REPLACE_LIST_KEY, &key))
|
||||
{
|
||||
char tmpfile[MAXREGNAMELEN];
|
||||
char target[MAXREGNAMELEN];
|
||||
|
||||
state = 0;
|
||||
while (REGERR_OK == NR_RegEnumEntries(reg, key, &state, tmpfile, sizeof(tmpfile), NULL ))
|
||||
{
|
||||
|
||||
nsFileSpec replaceFile(tmpfile);
|
||||
|
||||
if (! replaceFile.Exists() )
|
||||
{
|
||||
NR_RegDeleteEntry( reg, key, tmpfile );
|
||||
}
|
||||
else if ( REGERR_OK != NR_RegGetEntryString( reg, key, tmpfile, target, sizeof(target) ) )
|
||||
{
|
||||
/* can't read target filename, corruption? */
|
||||
NR_RegDeleteEntry( reg, key, tmpfile );
|
||||
}
|
||||
else
|
||||
{
|
||||
nsFileSpec targetFile(target);
|
||||
|
||||
targetFile.Delete(PR_FALSE);
|
||||
|
||||
if (!targetFile.Exists())
|
||||
{
|
||||
nsFileSpec parentofTarget;
|
||||
targetFile.GetParent(parentofTarget);
|
||||
|
||||
nsresult result = replaceFile.Move(parentofTarget);
|
||||
if ( NS_SUCCEEDED(result) )
|
||||
{
|
||||
char* leafName = targetFile.GetLeafName();
|
||||
replaceFile.Rename(leafName);
|
||||
nsCRT::free(leafName);
|
||||
|
||||
NR_RegDeleteEntry( reg, key, tmpfile );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* delete list node if empty */
|
||||
if (REGERR_NOMORE == NR_RegEnumEntries(reg, key, &state, tmpfile, sizeof(tmpfile), NULL ))
|
||||
{
|
||||
NR_RegDeleteKey(reg, ROOTKEY_PRIVATE, REG_REPLACE_LIST_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
NR_RegClose(reg);
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __SCHEDULEDTASKS_H__
|
||||
#define __SCHEDULEDTASKS_H__
|
||||
|
||||
|
||||
#include "NSReg.h"
|
||||
#include "nsFileSpec.h"
|
||||
|
||||
|
||||
REGERR DeleteFileNowOrSchedule(nsFileSpec& filename);
|
||||
REGERR ReplaceFileNowOrSchedule(nsFileSpec& tmpfile, nsFileSpec& target );
|
||||
|
||||
|
||||
extern "C" void PerformScheduledTasks(void *data);
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,135 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/*--------------------------------------------------------------
|
||||
* GDIFF.H
|
||||
*
|
||||
* Constants used in processing the GDIFF format
|
||||
*--------------------------------------------------------------*/
|
||||
|
||||
|
||||
#include "prio.h"
|
||||
#include "nsFileSpec.h"
|
||||
|
||||
#define GDIFF_MAGIC "\xD1\xFF\xD1\xFF"
|
||||
#define GDIFF_MAGIC_LEN 4
|
||||
#define GDIFF_VER 5
|
||||
#define GDIFF_EOF "\0"
|
||||
|
||||
#define GDIFF_VER_POS 4
|
||||
#define GDIFF_CS_POS 5
|
||||
#define GDIFF_CSLEN_POS 6
|
||||
|
||||
#define GDIFF_HEADERSIZE 7
|
||||
#define GDIFF_APPDATALEN 4
|
||||
|
||||
#define GDIFF_CS_NONE 0
|
||||
#define GDIFF_CS_MD5 1
|
||||
#define GDIFF_CS_SHA 2
|
||||
#define GDIFF_CS_CRC32 32
|
||||
|
||||
#define CRC32_LEN 4
|
||||
|
||||
/*--------------------------------------
|
||||
* GDIFF opcodes
|
||||
*------------------------------------*/
|
||||
#define ENDDIFF 0
|
||||
#define ADD8MAX 246
|
||||
#define ADD16 247
|
||||
#define ADD32 248
|
||||
#define COPY16BYTE 249
|
||||
#define COPY16SHORT 250
|
||||
#define COPY16LONG 251
|
||||
#define COPY32BYTE 252
|
||||
#define COPY32SHORT 253
|
||||
#define COPY32LONG 254
|
||||
#define COPY64 255
|
||||
|
||||
/* instruction sizes */
|
||||
#define ADD16SIZE 2
|
||||
#define ADD32SIZE 4
|
||||
#define COPY16BYTESIZE 3
|
||||
#define COPY16SHORTSIZE 4
|
||||
#define COPY16LONGSIZE 6
|
||||
#define COPY32BYTESIZE 5
|
||||
#define COPY32SHORTSIZE 6
|
||||
#define COPY32LONGSIZE 8
|
||||
#define COPY64SIZE 12
|
||||
|
||||
|
||||
/*--------------------------------------
|
||||
* error codes
|
||||
*------------------------------------*/
|
||||
#define GDIFF_OK 0
|
||||
#define GDIFF_ERR_UNKNOWN -1
|
||||
#define GDIFF_ERR_ARGS -2
|
||||
#define GDIFF_ERR_ACCESS -3
|
||||
#define GDIFF_ERR_MEM -4
|
||||
#define GDIFF_ERR_HEADER -5
|
||||
#define GDIFF_ERR_BADDIFF -6
|
||||
#define GDIFF_ERR_OPCODE -7
|
||||
#define GDIFF_ERR_OLDFILE -8
|
||||
#define GDIFF_ERR_CHKSUMTYPE -9
|
||||
#define GDIFF_ERR_CHECKSUM -10
|
||||
#define GDIFF_ERR_CHECKSUM_TARGET -11
|
||||
#define GDIFF_ERR_CHECKSUM_RESULT -12
|
||||
|
||||
|
||||
/*--------------------------------------
|
||||
* types
|
||||
*------------------------------------*/
|
||||
#ifndef AIX
|
||||
#ifdef OSF1
|
||||
#include <sys/types.h>
|
||||
#else
|
||||
typedef unsigned char uchar;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef struct _diffdata {
|
||||
PRFileDesc* fSrc;
|
||||
PRFileDesc* fOut;
|
||||
PRFileDesc* fDiff;
|
||||
uint8 checksumType;
|
||||
uint8 checksumLength;
|
||||
uchar* oldChecksum;
|
||||
uchar* newChecksum;
|
||||
PRBool bMacAppleSingle;
|
||||
PRBool bWin32BoundImage;
|
||||
uchar* databuf;
|
||||
uint32 bufsize;
|
||||
} DIFFDATA;
|
||||
|
||||
typedef DIFFDATA* pDIFFDATA;
|
||||
|
||||
|
||||
/*--------------------------------------
|
||||
* miscellaneous
|
||||
*------------------------------------*/
|
||||
|
||||
#define APPFLAG_W32BOUND "autoinstall:Win32PE"
|
||||
#define APPFLAG_APPLESINGLE "autoinstall:AppleSingle"
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# 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 Mozilla Communicator client code,
|
||||
# released March 31, 1998.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Contributors:
|
||||
# Daniel Veditz <dveditz@netscape.com>
|
||||
# Douglas Turner <dougt@netscape.com>
|
||||
|
||||
|
||||
DEPTH=..\..
|
||||
IGNORE_MANIFEST=1
|
||||
|
||||
MAKE_OBJ_TYPE = DLL
|
||||
MODULE=xpinstall
|
||||
|
||||
DLL=.\$(OBJDIR)\$(MODULE).dll
|
||||
|
||||
DEFINES=-D_IMPL_NS_DOM -DWIN32_LEAN_AND_MEAN
|
||||
|
||||
LCFLAGS = \
|
||||
$(LCFLAGS) \
|
||||
$(DEFINES) \
|
||||
$(NULL)
|
||||
|
||||
LINCS= \
|
||||
-I$(PUBLIC)\xpinstall \
|
||||
-I$(PUBLIC)\jar \
|
||||
-I$(PUBLIC)\libreg \
|
||||
-I$(PUBLIC)\netlib \
|
||||
-I$(PUBLIC)\xpcom \
|
||||
-I$(PUBLIC)\pref \
|
||||
-I$(PUBLIC)\rdf \
|
||||
-I$(PUBLIC)\js \
|
||||
-I$(PUBLIC)\dom \
|
||||
-I$(PUBLIC)\raptor \
|
||||
-I$(PUBLIC)\nspr2 \
|
||||
-I$(PUBLIC)\zlib \
|
||||
-I$(PUBLIC)\xpfe\components \
|
||||
$(NULL)
|
||||
|
||||
LLIBS = \
|
||||
$(DIST)\lib\jar50.lib \
|
||||
$(DIST)\lib\libreg32.lib \
|
||||
$(DIST)\lib\netlib.lib \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\js3250.lib \
|
||||
$(DIST)\lib\jsdombase_s.lib \
|
||||
$(DIST)\lib\jsdomevents_s.lib \
|
||||
$(DIST)\lib\zlib.lib \
|
||||
$(DIST)\lib\plc3.lib \
|
||||
$(LIBNSPR) \
|
||||
$(NULL)
|
||||
|
||||
|
||||
OBJS = \
|
||||
.\$(OBJDIR)\nsInstall.obj \
|
||||
.\$(OBJDIR)\nsInstallTrigger.obj \
|
||||
.\$(OBJDIR)\nsInstallVersion.obj \
|
||||
.\$(OBJDIR)\nsInstallFolder.obj \
|
||||
.\$(OBJDIR)\nsJSInstall.obj \
|
||||
.\$(OBJDIR)\nsJSInstallTriggerGlobal.obj \
|
||||
.\$(OBJDIR)\nsJSInstallVersion.obj \
|
||||
.\$(OBJDIR)\nsSoftwareUpdate.obj \
|
||||
.\$(OBJDIR)\nsSoftwareUpdateRun.obj \
|
||||
.\$(OBJDIR)\nsSoftwareUpdateStream.obj \
|
||||
.\$(OBJDIR)\nsInstallFile.obj \
|
||||
.\$(OBJDIR)\nsInstallDelete.obj \
|
||||
.\$(OBJDIR)\nsInstallExecute.obj \
|
||||
.\$(OBJDIR)\nsInstallPatch.obj \
|
||||
.\$(OBJDIR)\nsInstallUninstall.obj \
|
||||
.\$(OBJDIR)\nsInstallResources.obj \
|
||||
.\$(OBJDIR)\nsTopProgressNotifier.obj \
|
||||
.\$(OBJDIR)\nsLoggingProgressNotifier.obj\
|
||||
.\$(OBJDIR)\ScheduledTasks.obj \
|
||||
.\$(OBJDIR)\nsWinReg.obj \
|
||||
.\$(OBJDIR)\nsJSWinReg.obj \
|
||||
.\$(OBJDIR)\nsWinRegItem.obj \
|
||||
.\$(OBJDIR)\nsWinRegValue.obj \
|
||||
.\$(OBJDIR)\nsWinProfile.obj \
|
||||
.\$(OBJDIR)\nsJSWinProfile.obj \
|
||||
.\$(OBJDIR)\nsWinProfileItem.obj \
|
||||
.\$(OBJDIR)\nsInstallProgressDialog.obj \
|
||||
.\$(OBJDIR)\nsInstallFileOpItem.obj \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(DLL)
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(MODULE).lib $(DIST)\lib
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(MODULE).dll $(DIST)\bin\components
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\lib\$(MODULE).lib
|
||||
rm -f $(DIST)\bin\components\$(MODULE).dll
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,265 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __NS_INSTALL_H__
|
||||
#define __NS_INSTALL_H__
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsISupports.h"
|
||||
|
||||
#include "jsapi.h"
|
||||
|
||||
#include "plevent.h"
|
||||
|
||||
#include "nsString.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsVector.h"
|
||||
#include "nsHashtable.h"
|
||||
|
||||
#include "nsSoftwareUpdate.h"
|
||||
|
||||
#include "nsInstallObject.h"
|
||||
#include "nsInstallVersion.h"
|
||||
|
||||
#include "nsIXPInstallProgress.h"
|
||||
|
||||
|
||||
class nsInstallInfo
|
||||
{
|
||||
public:
|
||||
|
||||
nsInstallInfo(const nsString& fromURL, const nsString& localFile, long flags);
|
||||
|
||||
nsInstallInfo(nsVector* fromURL, nsVector* localFiles, long flags);
|
||||
|
||||
virtual ~nsInstallInfo();
|
||||
|
||||
nsString& GetFromURL(PRUint32 index = 0);
|
||||
|
||||
nsString& GetLocalFile(PRUint32 index = 0);
|
||||
|
||||
void GetArguments(nsString& args, PRUint32 index = 0);
|
||||
|
||||
long GetFlags();
|
||||
|
||||
PRBool IsMultipleTrigger();
|
||||
|
||||
static void DeleteVector(nsVector* vector);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
PRBool mMultipleTrigger;
|
||||
nsresult mError;
|
||||
|
||||
long mFlags;
|
||||
nsVector *mFromURLs;
|
||||
nsVector *mLocalFiles;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class nsInstall
|
||||
{
|
||||
friend class nsWinReg;
|
||||
friend class nsWinProfile;
|
||||
|
||||
public:
|
||||
|
||||
enum
|
||||
{
|
||||
BAD_PACKAGE_NAME = -200,
|
||||
UNEXPECTED_ERROR = -201,
|
||||
ACCESS_DENIED = -202,
|
||||
TOO_MANY_CERTIFICATES = -203,
|
||||
NO_INSTALLER_CERTIFICATE = -204,
|
||||
NO_CERTIFICATE = -205,
|
||||
NO_MATCHING_CERTIFICATE = -206,
|
||||
UNKNOWN_JAR_FILE = -207,
|
||||
INVALID_ARGUMENTS = -208,
|
||||
ILLEGAL_RELATIVE_PATH = -209,
|
||||
USER_CANCELLED = -210,
|
||||
INSTALL_NOT_STARTED = -211,
|
||||
SILENT_MODE_DENIED = -212,
|
||||
NO_SUCH_COMPONENT = -213,
|
||||
FILE_DOES_NOT_EXIST = -214,
|
||||
FILE_READ_ONLY = -215,
|
||||
FILE_IS_DIRECTORY = -216,
|
||||
NETWORK_FILE_IS_IN_USE = -217,
|
||||
APPLE_SINGLE_ERR = -218,
|
||||
INVALID_PATH_ERR = -219,
|
||||
PATCH_BAD_DIFF = -220,
|
||||
PATCH_BAD_CHECKSUM_TARGET = -221,
|
||||
PATCH_BAD_CHECKSUM_RESULT = -222,
|
||||
UNINSTALL_FAILED = -223,
|
||||
GESTALT_UNKNOWN_ERR = -5550,
|
||||
GESTALT_INVALID_ARGUMENT = -5551,
|
||||
|
||||
SUCCESS = 0,
|
||||
REBOOT_NEEDED = 999,
|
||||
|
||||
LIMITED_INSTALL = 0,
|
||||
FULL_INSTALL = 1,
|
||||
NO_STATUS_DLG = 2,
|
||||
NO_FINALIZE_DLG = 4,
|
||||
|
||||
INSTALL_FILE_UNEXPECTED_MSG_ID = 0,
|
||||
DETAILS_REPLACE_FILE_MSG_ID = 1,
|
||||
DETAILS_INSTALL_FILE_MSG_ID = 2
|
||||
};
|
||||
|
||||
|
||||
nsInstall();
|
||||
virtual ~nsInstall();
|
||||
|
||||
PRInt32 SetScriptObject(void* aScriptObject);
|
||||
|
||||
PRInt32 SaveWinRegPrototype(void* aScriptObject);
|
||||
PRInt32 SaveWinProfilePrototype(void* aScriptObject);
|
||||
|
||||
JSObject* RetrieveWinRegPrototype(void);
|
||||
JSObject* RetrieveWinProfilePrototype(void);
|
||||
|
||||
PRInt32 GetUserPackageName(nsString& aUserPackageName);
|
||||
PRInt32 GetRegPackageName(nsString& aRegPackageName);
|
||||
|
||||
PRInt32 AbortInstall();
|
||||
|
||||
PRInt32 AddDirectory(const nsString& aRegName, const nsString& aVersion, const nsString& aJarSource, const nsString& aFolder, const nsString& aSubdir, PRBool aForceMode, PRInt32* aReturn);
|
||||
PRInt32 AddDirectory(const nsString& aRegName, const nsString& aVersion, const nsString& aJarSource, const nsString& aFolder, const nsString& aSubdir, PRInt32* aReturn);
|
||||
PRInt32 AddDirectory(const nsString& aRegName, const nsString& aJarSource, const nsString& aFolder, const nsString& aSubdir, PRInt32* aReturn);
|
||||
PRInt32 AddDirectory(const nsString& aJarSource, PRInt32* aReturn);
|
||||
|
||||
PRInt32 AddSubcomponent(const nsString& aRegName, const nsString& aVersion, const nsString& aJarSource, const nsString& aFolder, const nsString& aTargetName, PRBool aForceMode, PRInt32* aReturn);
|
||||
PRInt32 AddSubcomponent(const nsString& aRegName, const nsString& aVersion, const nsString& aJarSource, const nsString& aFolder, const nsString& aTargetName, PRInt32* aReturn);
|
||||
PRInt32 AddSubcomponent(const nsString& aRegName, const nsString& aJarSource, const nsString& aFolder, const nsString& aTargetName, PRInt32* aReturn);
|
||||
PRInt32 AddSubcomponent(const nsString& aJarSource, PRInt32* aReturn);
|
||||
|
||||
PRInt32 DeleteComponent(const nsString& aRegistryName, PRInt32* aReturn);
|
||||
PRInt32 DeleteFile(const nsString& aFolder, const nsString& aRelativeFileName, PRInt32* aReturn);
|
||||
PRInt32 DiskSpaceAvailable(const nsString& aFolder, PRInt32* aReturn);
|
||||
PRInt32 Execute(const nsString& aJarSource, const nsString& aArgs, PRInt32* aReturn);
|
||||
PRInt32 Execute(const nsString& aJarSource, PRInt32* aReturn);
|
||||
PRInt32 FinalizeInstall(PRInt32* aReturn);
|
||||
PRInt32 Gestalt(const nsString& aSelector, PRInt32* aReturn);
|
||||
PRInt32 GetComponentFolder(const nsString& aComponentName, const nsString& aSubdirectory, nsString** aFolder);
|
||||
PRInt32 GetComponentFolder(const nsString& aComponentName, nsString** aFolder);
|
||||
PRInt32 GetFolder(const nsString& aTargetFolder, const nsString& aSubdirectory, nsString** aFolder);
|
||||
PRInt32 GetFolder(const nsString& aTargetFolder, nsString** aFolder);
|
||||
PRInt32 GetLastError(PRInt32* aReturn);
|
||||
PRInt32 GetWinProfile(const nsString& aFolder, const nsString& aFile, JSContext* jscontext, JSClass* WinProfileClass, jsval* aReturn);
|
||||
PRInt32 GetWinRegistry(JSContext* jscontext, JSClass* WinRegClass, jsval* aReturn);
|
||||
PRInt32 Patch(const nsString& aRegName, const nsString& aVersion, const nsString& aJarSource, const nsString& aFolder, const nsString& aTargetName, PRInt32* aReturn);
|
||||
PRInt32 Patch(const nsString& aRegName, const nsString& aJarSource, const nsString& aFolder, const nsString& aTargetName, PRInt32* aReturn);
|
||||
PRInt32 ResetError();
|
||||
PRInt32 SetPackageFolder(const nsString& aFolder);
|
||||
PRInt32 StartInstall(const nsString& aUserPackageName, const nsString& aPackageName, const nsString& aVersion, PRInt32* aReturn);
|
||||
PRInt32 Uninstall(const nsString& aPackageName, PRInt32* aReturn);
|
||||
|
||||
PRInt32 FileOpDirCreate(nsFileSpec& aTarget, PRInt32* aReturn);
|
||||
PRInt32 FileOpDirGetParent(nsFileSpec& aTarget, nsFileSpec* aReturn);
|
||||
PRInt32 FileOpDirRemove(nsFileSpec& aTarget, PRInt32 aFlags, PRInt32* aReturn);
|
||||
PRInt32 FileOpDirRename(nsFileSpec& aSrc, nsFileSpec& aTarget, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileCopy(nsFileSpec& aSrc, nsFileSpec& aTarget, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileDelete(nsFileSpec& aTarget, PRInt32 aFlags, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileExists(nsFileSpec& aTarget, PRBool* aReturn);
|
||||
PRInt32 FileOpFileExecute(nsFileSpec& aTarget, nsString& aParams, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileGetNativeVersion(nsFileSpec& aTarget, nsString* aReturn);
|
||||
PRInt32 FileOpFileGetDiskSpaceAvailable(nsFileSpec& aTarget, PRUint32* aReturn);
|
||||
PRInt32 FileOpFileGetModDate(nsFileSpec& aTarget, nsFileSpec::TimeStamp* aReturn);
|
||||
PRInt32 FileOpFileGetSize(nsFileSpec& aTarget, PRUint32* aReturn);
|
||||
PRInt32 FileOpFileIsDirectory(nsFileSpec& aTarget, PRBool* aReturn);
|
||||
PRInt32 FileOpFileIsFile(nsFileSpec& aTarget, PRBool* aReturn);
|
||||
PRInt32 FileOpFileModDateChanged(nsFileSpec& aTarget, nsFileSpec::TimeStamp& aOldStamp, PRBool* aReturn);
|
||||
PRInt32 FileOpFileMove(nsFileSpec& aSrc, nsFileSpec& aTarget, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileRename(nsFileSpec& aSrc, nsFileSpec& aTarget, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileWinShortcutCreate(nsFileSpec& aTarget, PRInt32 aFlags, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileMacAliasCreate(nsFileSpec& aTarget, PRInt32 aFlags, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileUnixLinkCreate(nsFileSpec& aTarget, PRInt32 aFlags, PRInt32* aReturn);
|
||||
|
||||
PRInt32 ExtractFileFromJar(const nsString& aJarfile, nsFileSpec* aSuggestedName, nsFileSpec** aRealName);
|
||||
void AddPatch(nsHashKey *aKey, nsFileSpec* fileName);
|
||||
void GetPatch(nsHashKey *aKey, nsFileSpec* fileName);
|
||||
|
||||
void GetJarFileLocation(nsString& aFile);
|
||||
void SetJarFileLocation(const nsString& aFile);
|
||||
|
||||
void GetInstallArguments(nsString& args);
|
||||
void SetInstallArguments(const nsString& args);
|
||||
|
||||
|
||||
private:
|
||||
JSObject* mScriptObject;
|
||||
|
||||
JSObject* mWinRegObject;
|
||||
JSObject* mWinProfileObject;
|
||||
|
||||
nsString mJarFileLocation;
|
||||
void* mJarFileData;
|
||||
|
||||
nsString mInstallArguments;
|
||||
|
||||
PRBool mUserCancelled;
|
||||
|
||||
PRBool mUninstallPackage;
|
||||
PRBool mRegisterPackage;
|
||||
|
||||
nsString mRegistryPackageName; /* Name of the package we are installing */
|
||||
nsString mUIName; /* User-readable package name */
|
||||
|
||||
nsInstallVersion* mVersionInfo; /* Component version info */
|
||||
|
||||
nsVector* mInstalledFiles;
|
||||
nsHashtable* mPatchList;
|
||||
|
||||
nsIXPInstallProgress *mNotifier;
|
||||
|
||||
PRInt32 mLastError;
|
||||
|
||||
void ParseFlags(int flags);
|
||||
PRInt32 SanityCheck(void);
|
||||
void GetTime(nsString &aString);
|
||||
|
||||
|
||||
PRInt32 GetQualifiedRegName(const nsString& name, nsString& qualifiedRegName );
|
||||
PRInt32 GetQualifiedPackageName( const nsString& name, nsString& qualifiedName );
|
||||
|
||||
void CurrentUserNode(nsString& userRegNode);
|
||||
PRBool BadRegName(const nsString& regName);
|
||||
PRInt32 SaveError(PRInt32 errcode);
|
||||
|
||||
void CleanUp();
|
||||
|
||||
PRInt32 OpenJARFile(void);
|
||||
void CloseJARFile(void);
|
||||
PRInt32 ExtractDirEntries(const nsString& directory, nsVector *paths);
|
||||
|
||||
PRInt32 ScheduleForInstall(nsInstallObject* ob);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,235 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
|
||||
#include "prmem.h"
|
||||
|
||||
#include "nsFileSpec.h"
|
||||
|
||||
#include "VerReg.h"
|
||||
#include "ScheduledTasks.h"
|
||||
#include "nsInstallDelete.h"
|
||||
#include "nsInstallResources.h"
|
||||
|
||||
#include "nsInstall.h"
|
||||
#include "nsIDOMInstallVersion.h"
|
||||
|
||||
nsInstallDelete::nsInstallDelete( nsInstall* inInstall,
|
||||
const nsString& folderSpec,
|
||||
const nsString& inPartialPath,
|
||||
PRInt32 *error)
|
||||
|
||||
: nsInstallObject(inInstall)
|
||||
{
|
||||
if ((folderSpec == "null") || (inInstall == NULL))
|
||||
{
|
||||
*error = nsInstall::INVALID_ARGUMENTS;
|
||||
return;
|
||||
}
|
||||
|
||||
mDeleteStatus = DELETE_FILE;
|
||||
mFinalFile = nsnull;
|
||||
mRegistryName = "";
|
||||
|
||||
|
||||
mFinalFile = new nsFileSpec(folderSpec);
|
||||
*mFinalFile += inPartialPath;
|
||||
|
||||
*error = ProcessInstallDelete();
|
||||
}
|
||||
|
||||
nsInstallDelete::nsInstallDelete( nsInstall* inInstall,
|
||||
const nsString& inComponentName,
|
||||
PRInt32 *error)
|
||||
|
||||
: nsInstallObject(inInstall)
|
||||
{
|
||||
if (inInstall == NULL)
|
||||
{
|
||||
*error = nsInstall::INVALID_ARGUMENTS;
|
||||
return;
|
||||
}
|
||||
|
||||
mDeleteStatus = DELETE_COMPONENT;
|
||||
mFinalFile = nsnull;
|
||||
mRegistryName = inComponentName;
|
||||
|
||||
*error = ProcessInstallDelete();
|
||||
}
|
||||
|
||||
|
||||
nsInstallDelete::~nsInstallDelete()
|
||||
{
|
||||
if (mFinalFile == nsnull)
|
||||
delete mFinalFile;
|
||||
}
|
||||
|
||||
|
||||
PRInt32 nsInstallDelete::Prepare()
|
||||
{
|
||||
// no set-up necessary
|
||||
return nsInstall::SUCCESS;
|
||||
}
|
||||
|
||||
PRInt32 nsInstallDelete::Complete()
|
||||
{
|
||||
PRInt32 err = nsInstall::SUCCESS;
|
||||
|
||||
if (mInstall == NULL)
|
||||
return nsInstall::INVALID_ARGUMENTS;
|
||||
|
||||
if (mDeleteStatus == DELETE_COMPONENT)
|
||||
{
|
||||
char* temp = mRegistryName.ToNewCString();
|
||||
err = VR_Remove(temp);
|
||||
delete [] temp;
|
||||
}
|
||||
|
||||
if ((mDeleteStatus == DELETE_FILE) || (err == REGERR_OK))
|
||||
{
|
||||
err = NativeComplete();
|
||||
}
|
||||
else
|
||||
{
|
||||
err = nsInstall::UNEXPECTED_ERROR;
|
||||
}
|
||||
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
void nsInstallDelete::Abort()
|
||||
{
|
||||
}
|
||||
|
||||
char* nsInstallDelete::toString()
|
||||
{
|
||||
char* buffer = new char[1024];
|
||||
|
||||
if (mDeleteStatus == DELETE_COMPONENT)
|
||||
{
|
||||
sprintf( buffer, nsInstallResources::GetDeleteComponentString(), nsAutoCString(mRegistryName));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mFinalFile)
|
||||
sprintf( buffer, nsInstallResources::GetDeleteFileString(), mFinalFile->GetCString());
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
PRBool
|
||||
nsInstallDelete::CanUninstall()
|
||||
{
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsInstallDelete::RegisterPackageNode()
|
||||
{
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
||||
PRInt32 nsInstallDelete::ProcessInstallDelete()
|
||||
{
|
||||
PRInt32 err;
|
||||
|
||||
char* tempCString = nsnull;
|
||||
|
||||
if (mDeleteStatus == DELETE_COMPONENT)
|
||||
{
|
||||
/* Check if the component is in the registry */
|
||||
tempCString = mRegistryName.ToNewCString();
|
||||
|
||||
err = VR_InRegistry( tempCString );
|
||||
|
||||
if (err != REGERR_OK)
|
||||
{
|
||||
return err;
|
||||
}
|
||||
else
|
||||
{
|
||||
char* tempRegistryString;
|
||||
|
||||
tempRegistryString = (char*)PR_Calloc(MAXREGPATHLEN, sizeof(char));
|
||||
|
||||
err = VR_GetPath( tempCString , MAXREGPATHLEN, tempRegistryString);
|
||||
|
||||
if (err == REGERR_OK)
|
||||
{
|
||||
if (mFinalFile)
|
||||
delete mFinalFile;
|
||||
|
||||
mFinalFile = new nsFileSpec(tempRegistryString);
|
||||
}
|
||||
|
||||
PR_FREEIF(tempRegistryString);
|
||||
}
|
||||
}
|
||||
|
||||
if(tempCString)
|
||||
delete [] tempCString;
|
||||
|
||||
if (mFinalFile->Exists())
|
||||
{
|
||||
if (mFinalFile->IsFile())
|
||||
{
|
||||
err = nsInstall::SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
err = nsInstall::FILE_IS_DIRECTORY;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
err = nsInstall::FILE_DOES_NOT_EXIST;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PRInt32 nsInstallDelete::NativeComplete()
|
||||
{
|
||||
if (mFinalFile->Exists())
|
||||
{
|
||||
if (mFinalFile->IsFile())
|
||||
{
|
||||
return DeleteFileNowOrSchedule(*mFinalFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
return nsInstall::FILE_IS_DIRECTORY;
|
||||
}
|
||||
}
|
||||
|
||||
return nsInstall::FILE_DOES_NOT_EXIST;
|
||||
}
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef nsInstallDelete_h__
|
||||
#define nsInstallDelete_h__
|
||||
|
||||
#include "prtypes.h"
|
||||
#include "nsString.h"
|
||||
|
||||
#include "nsInstallObject.h"
|
||||
|
||||
#include "nsInstall.h"
|
||||
|
||||
#define DELETE_COMPONENT 1
|
||||
#define DELETE_FILE 2
|
||||
|
||||
class nsInstallDelete : public nsInstallObject
|
||||
{
|
||||
public:
|
||||
|
||||
nsInstallDelete( nsInstall* inInstall,
|
||||
const nsString& folderSpec,
|
||||
const nsString& inPartialPath,
|
||||
PRInt32 *error);
|
||||
|
||||
nsInstallDelete( nsInstall* inInstall,
|
||||
const nsString& ,
|
||||
PRInt32 *error);
|
||||
|
||||
virtual ~nsInstallDelete();
|
||||
|
||||
PRInt32 Prepare();
|
||||
PRInt32 Complete();
|
||||
void Abort();
|
||||
char* toString();
|
||||
|
||||
PRBool CanUninstall();
|
||||
PRBool RegisterPackageNode();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
/* Private Fields */
|
||||
|
||||
nsFileSpec* mFinalFile;
|
||||
|
||||
nsString mRegistryName;
|
||||
PRInt32 mDeleteStatus;
|
||||
|
||||
PRInt32 ProcessInstallDelete();
|
||||
PRInt32 NativeComplete();
|
||||
|
||||
};
|
||||
|
||||
#endif /* nsInstallDelete_h__ */
|
||||
@@ -1,136 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "prmem.h"
|
||||
|
||||
#include "nsFileSpec.h"
|
||||
|
||||
#include "VerReg.h"
|
||||
#include "nsInstallExecute.h"
|
||||
#include "nsInstallResources.h"
|
||||
#include "ScheduledTasks.h"
|
||||
|
||||
#include "nsInstall.h"
|
||||
#include "nsIDOMInstallVersion.h"
|
||||
|
||||
nsInstallExecute:: nsInstallExecute( nsInstall* inInstall,
|
||||
const nsString& inJarLocation,
|
||||
const nsString& inArgs,
|
||||
PRInt32 *error)
|
||||
|
||||
: nsInstallObject(inInstall)
|
||||
{
|
||||
if ((inInstall == nsnull) || (inJarLocation == "null"))
|
||||
{
|
||||
*error = nsInstall::INVALID_ARGUMENTS;
|
||||
return;
|
||||
}
|
||||
|
||||
mJarLocation = inJarLocation;
|
||||
mArgs = inArgs;
|
||||
mExecutableFile = nsnull;
|
||||
|
||||
}
|
||||
|
||||
|
||||
nsInstallExecute::~nsInstallExecute()
|
||||
{
|
||||
if (mExecutableFile)
|
||||
delete mExecutableFile;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PRInt32 nsInstallExecute::Prepare()
|
||||
{
|
||||
if (mInstall == NULL || mJarLocation == "null")
|
||||
return nsInstall::INVALID_ARGUMENTS;
|
||||
|
||||
return mInstall->ExtractFileFromJar(mJarLocation, nsnull, &mExecutableFile);
|
||||
}
|
||||
|
||||
PRInt32 nsInstallExecute::Complete()
|
||||
{
|
||||
if (mExecutableFile == nsnull)
|
||||
return nsInstall::INVALID_ARGUMENTS;
|
||||
|
||||
nsFileSpec app( *mExecutableFile);
|
||||
|
||||
if (!app.Exists())
|
||||
{
|
||||
return nsInstall::INVALID_ARGUMENTS;
|
||||
}
|
||||
|
||||
PRInt32 result = app.Execute( mArgs );
|
||||
|
||||
DeleteFileNowOrSchedule( app );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void nsInstallExecute::Abort()
|
||||
{
|
||||
/* Get the names */
|
||||
if (mExecutableFile == nsnull)
|
||||
return;
|
||||
|
||||
DeleteFileNowOrSchedule(*mExecutableFile);
|
||||
}
|
||||
|
||||
char* nsInstallExecute::toString()
|
||||
{
|
||||
char* buffer = new char[1024];
|
||||
|
||||
// if the FileSpec is NULL, just us the in jar file name.
|
||||
|
||||
if (mExecutableFile == nsnull)
|
||||
{
|
||||
char *tempString = mJarLocation.ToNewCString();
|
||||
sprintf( buffer, nsInstallResources::GetExecuteString(), tempString);
|
||||
delete [] tempString;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf( buffer, nsInstallResources::GetExecuteString(), mExecutableFile->GetCString());
|
||||
}
|
||||
return buffer;
|
||||
|
||||
}
|
||||
|
||||
|
||||
PRBool
|
||||
nsInstallExecute::CanUninstall()
|
||||
{
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsInstallExecute::RegisterPackageNode()
|
||||
{
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef nsInstallExecute_h__
|
||||
#define nsInstallExecute_h__
|
||||
|
||||
#include "prtypes.h"
|
||||
#include "nsString.h"
|
||||
|
||||
#include "nsInstallObject.h"
|
||||
|
||||
#include "nsInstall.h"
|
||||
#include "nsIDOMInstallVersion.h"
|
||||
|
||||
|
||||
class nsInstallExecute : public nsInstallObject
|
||||
{
|
||||
public:
|
||||
|
||||
nsInstallExecute( nsInstall* inInstall,
|
||||
const nsString& inJarLocation,
|
||||
const nsString& inArgs,
|
||||
PRInt32 *error);
|
||||
|
||||
|
||||
virtual ~nsInstallExecute();
|
||||
|
||||
PRInt32 Prepare();
|
||||
PRInt32 Complete();
|
||||
void Abort();
|
||||
char* toString();
|
||||
|
||||
PRBool CanUninstall();
|
||||
PRBool RegisterPackageNode();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
nsString mJarLocation; // Location in the JAR
|
||||
nsString mArgs; // command line arguments
|
||||
|
||||
nsFileSpec *mExecutableFile; // temporary file location
|
||||
|
||||
|
||||
PRInt32 NativeComplete(void);
|
||||
void NativeAbort(void);
|
||||
|
||||
};
|
||||
|
||||
#endif /* nsInstallExecute_h__ */
|
||||
@@ -1,366 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
#include "nsInstallFile.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "VerReg.h"
|
||||
#include "ScheduledTasks.h"
|
||||
#include "nsInstall.h"
|
||||
#include "nsIDOMInstallVersion.h"
|
||||
#include "nsInstallResources.h"
|
||||
|
||||
/* Public Methods */
|
||||
|
||||
/* Constructor
|
||||
inInstall - softUpdate object we belong to
|
||||
inComponentName - full path of the registry component
|
||||
inVInfo - full version info
|
||||
inJarLocation - location inside the JAR file
|
||||
inFinalFileSpec - final location on disk
|
||||
*/
|
||||
|
||||
|
||||
nsInstallFile::nsInstallFile(nsInstall* inInstall,
|
||||
const nsString& inComponentName,
|
||||
const nsString& inVInfo,
|
||||
const nsString& inJarLocation,
|
||||
const nsString& folderSpec,
|
||||
const nsString& inPartialPath,
|
||||
PRBool forceInstall,
|
||||
PRInt32 *error)
|
||||
: nsInstallObject(inInstall)
|
||||
{
|
||||
mVersionRegistryName = nsnull;
|
||||
mJarLocation = nsnull;
|
||||
mExtracedFile = nsnull;
|
||||
mFinalFile = nsnull;
|
||||
mVersionInfo = nsnull;
|
||||
|
||||
mUpgradeFile = PR_FALSE;
|
||||
|
||||
if ((folderSpec == "null") || (inInstall == NULL))
|
||||
{
|
||||
*error = nsInstall::INVALID_ARGUMENTS;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check for existence of the newer version */
|
||||
|
||||
PRBool versionNewer = PR_FALSE; // Is this a newer version
|
||||
char* qualifiedRegNameString = inComponentName.ToNewCString();
|
||||
|
||||
if ( (forceInstall == PR_FALSE ) && (inVInfo != "") && ( VR_ValidateComponent( qualifiedRegNameString ) == 0 ) )
|
||||
{
|
||||
nsInstallVersion *newVersion = new nsInstallVersion();
|
||||
newVersion->Init(inVInfo);
|
||||
|
||||
VERSION versionStruct;
|
||||
|
||||
VR_GetVersion( qualifiedRegNameString, &versionStruct );
|
||||
|
||||
nsInstallVersion* oldVersion = new nsInstallVersion();
|
||||
|
||||
oldVersion->Init(versionStruct.major,
|
||||
versionStruct.minor,
|
||||
versionStruct.release,
|
||||
versionStruct.build);
|
||||
|
||||
PRInt32 areTheyEqual;
|
||||
newVersion->CompareTo(oldVersion, &areTheyEqual);
|
||||
|
||||
delete oldVersion;
|
||||
delete newVersion;
|
||||
|
||||
if (areTheyEqual == nsIDOMInstallVersion::MAJOR_DIFF_MINUS ||
|
||||
areTheyEqual == nsIDOMInstallVersion::MINOR_DIFF_MINUS ||
|
||||
areTheyEqual == nsIDOMInstallVersion::REL_DIFF_MINUS ||
|
||||
areTheyEqual == nsIDOMInstallVersion::BLD_DIFF_MINUS )
|
||||
{
|
||||
// the file to be installed is OLDER than what is on disk. Return error
|
||||
delete qualifiedRegNameString;
|
||||
*error = areTheyEqual;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
delete qualifiedRegNameString;
|
||||
|
||||
|
||||
mFinalFile = new nsFileSpec(folderSpec);
|
||||
*mFinalFile += inPartialPath;
|
||||
|
||||
mReplaceFile = mFinalFile->Exists();
|
||||
|
||||
if (mReplaceFile == PR_FALSE)
|
||||
{
|
||||
nsFileSpec parent;
|
||||
mFinalFile->GetParent(parent);
|
||||
nsFileSpec makeDirs(parent.GetCString(), PR_TRUE);
|
||||
}
|
||||
|
||||
mForceInstall = forceInstall;
|
||||
|
||||
mVersionRegistryName = new nsString(inComponentName);
|
||||
mJarLocation = new nsString(inJarLocation);
|
||||
mVersionInfo = new nsString(inVInfo);
|
||||
|
||||
nsString regPackageName;
|
||||
mInstall->GetRegPackageName(regPackageName);
|
||||
|
||||
// determine Child status
|
||||
if ( regPackageName == "" )
|
||||
{
|
||||
// in the "current communicator package" absolute pathnames (start
|
||||
// with slash) indicate shared files -- all others are children
|
||||
mChildFile = ( mVersionRegistryName->CharAt(0) != '/' );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// there is no "starts with" api in nsString. LAME!
|
||||
nsString startsWith;
|
||||
mVersionRegistryName->Left(startsWith, regPackageName.Length());
|
||||
|
||||
if (startsWith.Equals(regPackageName))
|
||||
{
|
||||
mChildFile = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
mChildFile = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nsInstallFile::~nsInstallFile()
|
||||
{
|
||||
if (mVersionRegistryName)
|
||||
delete mVersionRegistryName;
|
||||
|
||||
if (mJarLocation)
|
||||
delete mJarLocation;
|
||||
|
||||
if (mExtracedFile)
|
||||
delete mExtracedFile;
|
||||
|
||||
if (mFinalFile)
|
||||
delete mFinalFile;
|
||||
|
||||
if (mVersionInfo)
|
||||
delete mVersionInfo;
|
||||
}
|
||||
|
||||
/* Prepare
|
||||
* Extracts file out of the JAR archive
|
||||
*/
|
||||
PRInt32 nsInstallFile::Prepare()
|
||||
{
|
||||
if (mInstall == nsnull || mFinalFile == nsnull || mJarLocation == nsnull )
|
||||
return nsInstall::INVALID_ARGUMENTS;
|
||||
|
||||
return mInstall->ExtractFileFromJar(*mJarLocation, mFinalFile, &mExtracedFile);
|
||||
}
|
||||
|
||||
/* Complete
|
||||
* Completes the install:
|
||||
* - move the downloaded file to the final location
|
||||
* - updates the registry
|
||||
*/
|
||||
PRInt32 nsInstallFile::Complete()
|
||||
{
|
||||
PRInt32 err;
|
||||
|
||||
if (mInstall == nsnull || mVersionRegistryName == nsnull || mFinalFile == nsnull )
|
||||
{
|
||||
return nsInstall::INVALID_ARGUMENTS;
|
||||
}
|
||||
|
||||
err = CompleteFileMove();
|
||||
|
||||
if ( 0 == err || nsInstall::REBOOT_NEEDED == err )
|
||||
{
|
||||
err = RegisterInVersionRegistry();
|
||||
}
|
||||
|
||||
return err;
|
||||
|
||||
}
|
||||
|
||||
void nsInstallFile::Abort()
|
||||
{
|
||||
if (mExtracedFile != nsnull)
|
||||
mExtracedFile->Delete(PR_FALSE);
|
||||
}
|
||||
|
||||
char* nsInstallFile::toString()
|
||||
{
|
||||
char* buffer = new char[1024];
|
||||
|
||||
if (mFinalFile == nsnull)
|
||||
{
|
||||
sprintf( buffer, nsInstallResources::GetInstallFileString(), nsnull);
|
||||
}
|
||||
else if (mReplaceFile)
|
||||
{
|
||||
// we are replacing this file.
|
||||
|
||||
sprintf( buffer, nsInstallResources::GetReplaceFileString(), mFinalFile->GetCString());
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf( buffer, nsInstallResources::GetInstallFileString(), mFinalFile->GetCString());
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
PRInt32 nsInstallFile::CompleteFileMove()
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
if (mExtracedFile == nsnull)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( *mExtracedFile == *mFinalFile )
|
||||
{
|
||||
/* No need to rename, they are the same */
|
||||
result = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = ReplaceFileNowOrSchedule(*mExtracedFile, *mFinalFile );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsInstallFile::RegisterInVersionRegistry()
|
||||
{
|
||||
int refCount;
|
||||
nsString regPackageName;
|
||||
mInstall->GetRegPackageName(regPackageName);
|
||||
|
||||
|
||||
// Register file and log for Uninstall
|
||||
|
||||
if (!mChildFile)
|
||||
{
|
||||
int found;
|
||||
if (regPackageName != "")
|
||||
{
|
||||
found = VR_UninstallFileExistsInList( (char*)(const char*)nsAutoCString(regPackageName) ,
|
||||
(char*)(const char*)nsAutoCString(*mVersionRegistryName));
|
||||
}
|
||||
else
|
||||
{
|
||||
found = VR_UninstallFileExistsInList( "", (char*)(const char*)nsAutoCString(*mVersionRegistryName) );
|
||||
}
|
||||
|
||||
if (found != REGERR_OK)
|
||||
mUpgradeFile = PR_FALSE;
|
||||
else
|
||||
mUpgradeFile = PR_TRUE;
|
||||
}
|
||||
else if (REGERR_OK == VR_InRegistry( (char*)(const char*)nsAutoCString(*mVersionRegistryName)))
|
||||
{
|
||||
mUpgradeFile = PR_TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
mUpgradeFile = PR_FALSE;
|
||||
}
|
||||
|
||||
if ( REGERR_OK != VR_GetRefCount( (char*)(const char*)nsAutoCString(*mVersionRegistryName), &refCount ))
|
||||
{
|
||||
refCount = 0;
|
||||
}
|
||||
|
||||
VR_Install( (char*)(const char*)nsAutoCString(*mVersionRegistryName),
|
||||
(char*)(const char*)mFinalFile->GetNativePathCString(), // DO NOT CHANGE THIS.
|
||||
(char*)(const char*)nsAutoCString(*mVersionInfo),
|
||||
PR_FALSE );
|
||||
|
||||
if (mUpgradeFile)
|
||||
{
|
||||
if (refCount == 0)
|
||||
VR_SetRefCount( (char*)(const char*)nsAutoCString(*mVersionRegistryName), 1 );
|
||||
else
|
||||
VR_SetRefCount( (char*)(const char*)nsAutoCString(*mVersionRegistryName), refCount ); //FIX?? what should the ref count be/
|
||||
}
|
||||
else
|
||||
{
|
||||
if (refCount != 0)
|
||||
{
|
||||
VR_SetRefCount( (char*)(const char*)nsAutoCString(*mVersionRegistryName), refCount + 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mReplaceFile)
|
||||
VR_SetRefCount( (char*)(const char*)nsAutoCString(*mVersionRegistryName), 2 );
|
||||
else
|
||||
VR_SetRefCount( (char*)(const char*)nsAutoCString(*mVersionRegistryName), 1 );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !mChildFile && !mUpgradeFile )
|
||||
{
|
||||
if (regPackageName != "")
|
||||
{
|
||||
VR_UninstallAddFileToList( (char*)(const char*)nsAutoCString(regPackageName),
|
||||
(char*)(const char*)nsAutoCString(*mVersionRegistryName));
|
||||
}
|
||||
else
|
||||
{
|
||||
VR_UninstallAddFileToList( "", (char*)(const char*)nsAutoCString(*mVersionRegistryName) );
|
||||
}
|
||||
}
|
||||
|
||||
return nsInstall::SUCCESS;
|
||||
}
|
||||
|
||||
/* CanUninstall
|
||||
* InstallFile() installs files which can be uninstalled,
|
||||
* hence this function returns true.
|
||||
*/
|
||||
PRBool
|
||||
nsInstallFile::CanUninstall()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* RegisterPackageNode
|
||||
* InstallFile() installs files which need to be registered,
|
||||
* hence this function returns true.
|
||||
*/
|
||||
PRBool
|
||||
nsInstallFile::RegisterPackageNode()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape 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/NPL/
|
||||
*
|
||||
* 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 Mozilla Communicator client code,
|
||||
* released March 31, 1998.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Contributors:
|
||||
* Daniel Veditz <dveditz@netscape.com>
|
||||
* Douglas Turner <dougt@netscape.com>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef nsInstallFile_h__
|
||||
#define nsInstallFile_h__
|
||||
|
||||
#include "prtypes.h"
|
||||
#include "nsString.h"
|
||||
|
||||
#include "nsInstallObject.h"
|
||||
|
||||
#include "nsInstall.h"
|
||||
#include "nsInstallVersion.h"
|
||||
|
||||
class nsInstallFile : public nsInstallObject
|
||||
{
|
||||
public:
|
||||
|
||||
/*************************************************************
|
||||
* Public Methods
|
||||
*
|
||||
* Constructor
|
||||
* inSoftUpdate - softUpdate object we belong to
|
||||
* inComponentName - full path of the registry component
|
||||
* inVInfo - full version info
|
||||
* inJarLocation - location inside the JAR file
|
||||
* inFinalFileSpec - final location on disk
|
||||
*************************************************************/
|
||||
nsInstallFile( nsInstall* inInstall,
|
||||
const nsString& inVRName,
|
||||
const nsString& inVInfo,
|
||||
const nsString& inJarLocation,
|
||||
const nsString& folderSpec,
|
||||
const nsString& inPartialPath,
|
||||
PRBool forceInstall,
|
||||
PRInt32 *error);
|
||||
|
||||
virtual ~nsInstallFile();
|
||||
|
||||
PRInt32 Prepare();
|
||||
PRInt32 Complete();
|
||||
void Abort();
|
||||
char* toString();
|
||||
|
||||
PRBool CanUninstall();
|
||||
PRBool RegisterPackageNode();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
/* Private Fields */
|
||||
nsString* mVersionInfo; /* Version info for this file*/
|
||||
|
||||
nsString* mJarLocation; /* Location in the JAR */
|
||||
nsFileSpec* mExtracedFile; /* temporary file location */
|
||||
nsFileSpec* mFinalFile; /* final file destination */
|
||||
|
||||
nsString* mVersionRegistryName; /* full version path */
|
||||
|
||||
PRBool mForceInstall; /* whether install is forced */
|
||||
PRBool mReplaceFile; /* whether file exists */
|
||||
PRBool mChildFile; /* whether file is a child */
|
||||
PRBool mUpgradeFile; /* whether file is an upgrade */
|
||||
|
||||
|
||||
PRInt32 CompleteFileMove();
|
||||
PRInt32 RegisterInVersionRegistry();
|
||||
};
|
||||
|
||||
#endif /* nsInstallFile_h__ */
|
||||
@@ -1,38 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef nsInstallFileOpEnums_h__
|
||||
#define nsInstallFileOpEnums_h__
|
||||
|
||||
typedef enum nsInstallFileOpEnums {
|
||||
NS_FOP_DIR_CREATE = 0,
|
||||
NS_FOP_DIR_REMOVE = 1,
|
||||
NS_FOP_DIR_RENAME = 2,
|
||||
NS_FOP_FILE_COPY = 3,
|
||||
NS_FOP_FILE_DELETE = 4,
|
||||
NS_FOP_FILE_EXECUTE = 5,
|
||||
NS_FOP_FILE_MOVE = 6,
|
||||
NS_FOP_FILE_RENAME = 7,
|
||||
NS_FOP_WIN_SHORTCUT_CREATE = 8,
|
||||
NS_FOP_MAC_ALIAS_CREATE = 9,
|
||||
NS_FOP_UNIX_LINK_CREATE = 10,
|
||||
NS_FOP_FILE_SET_STAT = 11
|
||||
|
||||
} nsInstallFileOpEnums;
|
||||
|
||||
#endif /* nsInstallFileOpEnums_h__ */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user