Commit 4727e6c0 authored by terry%netscape.com's avatar terry%netscape.com

Everything has been ported to now run under Perl.

parent d8a4482d
This diff is collapsed. Click to expand it.
......@@ -10,6 +10,26 @@ query the CVS tree. For example,
will tell you what has been changed in the last week.
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".
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.
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
......
......@@ -24,10 +24,12 @@ this document!)
First, you need some other things:
1) MySQL database server.
2) Tcl 7.6
3) TclX 7.6
4) mysqltcl program (hmm.. This was tricky.. Read on)
5) Some kind of HTTP server so you could use CGI scripts
2) Perl5.004 or greater, including MySQL support and the Date::Format
package from CPAN.
3) Some kind of HTTP server so you could use CGI scripts
Earlier versions of Bugzilla required TCL. THIS IS NO LONGER TRUE.
All dependencies on TCL have been removed.
1.1 Getting and setting up MySQL database
......@@ -43,43 +45,8 @@ writable by all users on your machine and change access level
later. This would save you a lot of time trying to guess whether it's
permissions or a mistake in the script that make things fail.
1.2-3 Getting and building Tcl & TclX 7.6
Tcl homepage is at http://www.scriptics.com. You may get sources
for UNIX from ftp://ftp.scriptics.com/pub/tcl/tcl7_6/tcl7.6p2.tar.gz.
TclX is an extension for Tcl that adds a lot of useful functions that
are heavily used in the Bugzilla tool.
TclX page is http://www.neosoft.com/tclx. Download sources from
ftp://ftp.neosoft.com/pub/tcl/TclX/tclX7.6.0.tar.gz. Watch out for the
case of the letters in URL. These guys are going to bring some fun
into your life by spelling their program name in various ways.
Now you've probably got both Tcl and TclX 7.6. You may try to use
version 8.X but I'm not sure about results. Unfortunately I'm not an
expert in "Tcl&Co.".
Build and install Tcl first. Then build and install TclX. This
should go without serious problems
1.4 mysqltcl - the tricky part
Grab msqltcl 1.50 (yes, "msqltcl" without 'y'. That's not a typo) from
MySQL site's contributed software area (http://www.tcx.se/Contrib/) or
from mSQL site (www.hughes.com.au). I've used version 1.50 and it
works for me, though you may try more recent version at your own
risk. You're risking anyway.
Then grab mysqltcl.c-patch from MySQL's contrib area and apply this
patch to msqltcl.c file from msqltcl-1.50 distribution.
Try to make msqltcl binary which is in fact mYsqltcl already. Very
likely that you will not be able to compile it without modifications.
You can use the patch in APPENDIX 1 to see what changes I had to make
to compile mysqltcl. Your mileage may vary.
1.5 HTTP server
1.2 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
......@@ -120,8 +87,8 @@ like to customize some things.
Create yourself an account. (Try to enter a new bug, and it will
prompt you for your login. Give it your email address, and have it
mail you your password.) Go visit the query page; that ought to force
the creation of the "params" file in your installation dir. Edit the
params file, and change the line that says "set param(maintainer)" to
the creation of the "data/params" file in your installation dir. Edit the
data/params file, and change the line that sets "$::param{'maintainer'}" to
have your email address as the maintainer. Go visit the query page
again; there should now be a link at the bottom that invites you to
edit the parameters. (If you have cookies turned off, you'll have to
......@@ -134,131 +101,8 @@ Tweak the parameters to taste. Be careful.
It's a good idea to set up a daily cronjob that does
cd <your-installation-dir> ; ./whineatnews.tcl
cd <your-installation-dir> ; ./whineatnews.pl
This causes email that gets sent to anyone who has a NEW bug that
hasn't been touched for several days. For more info, see the
whinedays and whinemail parameters.
*******************************************************
APPENDIXES
*******************************************************
APPENDIX 1. Patch to build mysqltcl.
--------------------------------------
diff -u -r msqltcl-1.50/Makefile mysqltcl-1.50/Makefile
--- msqltcl-1.50/Makefile Tue Jun 6 07:25:39 1995
+++ mysqltcl-1.50/Makefile Tue Jun 23 18:20:07 1998
@@ -38,11 +38,11 @@
#
#----- Tcl/Tk libraries & such
# Path for Tcl include files.
-TCLINCL = -I/usr/local/include
+TCLINCL = -I../include
# Path for Tk include files, if different from the above.
TKINCL =
# Libraries required to link plain Tcl.
-TCLLIBS = -L/usr/local/lib -ltcl -lm
+TCLLIBS = -L../lib -ltclx7.6.0 -ltcl7.6 -lm -lnsl -lsocket
# Libraries required to link plain Tk.
TKLIBS = -L/usr/local/lib -ltk -ltcl -lX11 -lm
@@ -66,11 +66,11 @@
#
#----- Tcl/Tk libraries & such
# Path for Tcl include files.
-NEWTCLINCL = -I/usr/local/new/include
+NEWTCLINCL = -I../include
# Path for Tk include files, if different from the above.
NEWTKINCL =
# Libraries required to link plain Tcl.
-NEWTCLLIBS = -L/usr/local/new/lib -ltcl -lm
+NEWTCLLIBS = -L../lib -ltclx7.6.0 -ltcl7.6 -lm -lnsl -lsocket
# Libraries required to link plain Tk.
NEWTKLIBS = -L/usr/local/new/lib -ltk -ltcl -lX11 -lm
@@ -82,7 +82,7 @@
# Path for TclX/TkX include files, if different from plain Tcl.
NEWTCLXINCL =
# Extra libraries required to link TclX.
-NEWTCLXLIBS = -L/usr/local/new/lib -ltclx
+NEWTCLXLIBS = -L../mysql/lib -ltclx
# Extra libraries required to link TkX.
NEWTKXLIBS = -L/usr/local/new/lib -ltkx -ltclx
# TclX/TkX 'AppInit' files (base names).
@@ -94,16 +94,16 @@
#
#----- mSQL libraries & such
# Path for mSQL include files.
-MSQLINCL = -I/usr/local2/src/Minerva/include
+MSQLINCL = -I../mysql/include
# Libraries required to link an mSQL application.
-MSQLLIB = -L/usr/local2/src/Minerva/lib -lmsql
+MSQLLIB = -L../mysql/lib -lmysqlclient
#===== END OF CONFIGURATION DEFINITIONS =====
INCL = -I. ${MSQLINCL} ${TCLINCL} ${TKINCL}
CFLAGS = ${OPTIM} -c
LDFLAGS = ${OPTIM}
-PROGS = msqltcl msqlwish
+PROGS = msqltcl # msqlwish
TCLLINK = ${MSQLLIB} ${TCLLIBS}
TKLINK = ${MSQLLIB} ${TKLIBS}
diff -u -r msqltcl-1.50/new-tclAppInit.c mysqltcl-1.50/new-tclAppInit.c
--- msqltcl-1.50/new-tclAppInit.c Tue Jun 6 07:25:38 1995
+++ mysqltcl-1.50/new-tclAppInit.c Tue Jun 23 18:28:14 1998
@@ -14,7 +14,7 @@
static char sccsid[] = "@(#) tclAppInit.c 1.11 94/12/17 16:14:03";
#endif /* not lint */
-#include "tcl.h"
+#include "tclExtend.h"
/*
* The following variable is a special hack that is needed in order for
@@ -48,7 +48,7 @@
int argc; /* Number of command-line arguments. */
char **argv; /* Values of command-line arguments. */
{
- Tcl_Main(argc, argv);
+ TclX_Main(argc, argv, Tcl_AppInit);
return 0; /* Needed only to prevent compiler warning. */
}
@@ -79,6 +79,10 @@
return TCL_ERROR;
}
+ if (Tclx_Init(interp) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
/*
* Call the init procedures for included packages. Each call should
* look like this:
@@ -90,7 +94,7 @@
* where "Mod" is the name of the module.
*/
- if (Msqltcl_Init(interp) == TCL_ERROR) {
+ if (Mysqltcl_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
@@ -106,6 +110,6 @@
* then no user-specific startup file will be run under any conditions.
*/
- tcl_RcFileName = "~/.tclshrc";
+/* tcl_RcFileName = "~/.tclshrc"; */
return TCL_OK;
}
# -*- 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 $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,
date_format(creation_ts,'Y-m-d')
from bugs
where bug_id = $::FORM{'id'}";
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", "creation_ts") {
$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>$bug{'bug_id'}</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>$bug{'op_sys'}</TD>
<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>Component:</B></TD>
<TD><SELECT NAME=component>$component_popup</SELECT></TD>
</TR><TR>
<TD ALIGN=RIGHT><B><A HREF=\"bug_status.html#assigned_to\">Assigned&nbsp;To:
</A></B></TD>
<TD>$bug{'assigned_to'}</TD>
</TR><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>
</TABLE>
<br>
<B>Additional Comments:</B>
<BR>
<TEXTAREA WRAP=HARD NAME=comment ROWS=5 COLS=80></TEXTAREA><BR>
<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%>&nbsp;</td>
<td align=right>Opened:&nbsp;$bug{'creation_ts'}</td></tr></table>
<HR>
<PRE>
" . html_quote($bug{'long_desc'}) . "
</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";
#! /usr/bonsaitools/bin/mysqltcl
# -*- Mode: tcl; indent-tabs-mode: nil -*-
#!/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
......@@ -18,61 +18,74 @@
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
source "CGI.tcl"
confirm_login
#! /usr/bonsaitools/bin/mysqltcl
# -*- Mode: tcl; indent-tabs-mode: nil -*-
require "CGI.pl";
if {![info exists FORM(pwd1)]} {
puts "Content-type: text/html
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 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>"
exit
<input type=submit value=Submit>\n";
exit;
}
if {![cequal $FORM(pwd1) $FORM(pwd2)]} {
puts "Content-type: text/html
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."
exit
The two passwords you entered did not match. Please click <b>Back</b> and try again.\n";
exit;
}
set pwd $FORM(pwd1)
my $pwd = $::FORM{'pwd1'};
if {![regexp {^[a-zA-Z0-9-_]*$} $pwd] || [clength $pwd] < 3 || [clength $pwd] > 15} {
puts "Content-type: text/html
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."
exit
Please click <b>Back</b> and try again.\n";
exit;
}
puts "Content-type: text/html\n"
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 "select encrypt('$pwd')"
set encrypted [lindex [FetchSQLData] 0]
SendSQL("update profiles set password='$pwd',cryptpassword='$encrypted' where login_name=" .
SqlQuote($::COOKIE{'Bugzilla_login'}));
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)"
SendSQL("update logincookies set cryptpassword = '$encrypted' where cookie = $::COOKIE{'Bugzilla_logincookie'}");
puts "<H1>OK, done.</H1>
print "<H1>OK, done.</H1>
Your new password has been set.
<p>
<a href=query.cgi>Back to query page.</a>"
<a href=query.cgi>Back to query page.</a>\n";
#! /usr/bonsaitools/bin/mysqltcl
# -*- Mode: tcl; indent-tabs-mode: nil -*-
#!/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
......@@ -19,70 +19,79 @@
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
source "CGI.tcl"
use diagnostics;
use strict;
puts "Content-type: text/html"
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.
set masterlist {opendate changeddate severity priority platform owner reporter status
resolution component product version project os summary summaryfull }
my @masterlist = ("opendate", "changeddate", "severity", "priority",
"platform", "owner", "reporter", "status", "resolution",
"component", "product", "version", "project", "os",
"summary", "summaryfull");
if {[info exists FORM(rememberedquery)]} {
if {[info exists FORM(resetit)]} {
set collist $default_column_list
my @collist;
if (defined $::FORM{'rememberedquery'}) {
if (defined $::FORM{'resetit'}) {
@collist = @::default_column_list;
} else {
set collist {}
foreach i $masterlist {
if {[info exists FORM(column_$i)]} {
lappend collist $i
foreach my $i (@masterlist) {
if (defined $::FORM{"column_$i"}) {
push @collist, $i;
}
}
}
puts "Set-Cookie: COLUMNLIST=$collist ; path=/ ; expires=Sun, 30-Jun-99 00:00:00 GMT"
puts "Refresh: 0; URL=buglist.cgi?$FORM(rememberedquery)"
puts ""
puts "<TITLE>What a hack.</TITLE>"
puts "Resubmitting your query with new columns..."
exit
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 {[info exists COOKIE(COLUMNLIST)]} {
set collist $COOKIE(COLUMNLIST)
if (defined $::COOKIE{'COLUMNLIST'}) {
@collist = split(/ /, $::COOKIE{'COLUMNLIST'});
} else {
set collist $default_column_list
@collist = @::default_column_list;
}
foreach i $masterlist {
set desc($i) $i
my %desc;
foreach my $i (@masterlist) {
$desc{$i} = $i;
}
set desc(summary) "Summary (first 60 characters)"
set desc(summaryfull) "Full Summary"
$desc{'summary'} = "Summary (first 60 characters)";
$desc{'summaryfull'} = "Full Summary";
puts ""
puts "Check which columns you wish to appear on the list, and then click on"
puts "submit."
puts "<p>"
puts "<FORM ACTION=colchange.cgi>"
puts "<INPUT TYPE=HIDDEN NAME=rememberedquery VALUE=$buffer>"
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 i $masterlist {
if {[lsearch $collist $i] >= 0} {
set c CHECKED
foreach my $i (@masterlist) {
my $c;
if (lsearch(\@collist, $i) >= 0) {
$c = 'CHECKED';
} else {
set c ""
$c = '';
}
puts "<INPUT TYPE=checkbox NAME=column_$i $c>$desc($i)<br>"
print "<INPUT TYPE=checkbox NAME=column_$i $c>$desc{$i}<br>\n";
}
puts "<P>"
puts "<INPUT TYPE=\"submit\" VALUE=\"Submit\">"
puts "</FORM>"
puts "<FORM ACTION=colchange.cgi>"
puts "<INPUT TYPE=HIDDEN NAME=rememberedquery VALUE=$buffer>"
puts "<INPUT TYPE=HIDDEN NAME=resetit VALUE=1>"
puts "<INPUT TYPE=\"submit\" VALUE=\"Reset to Bugzilla default\">"
puts "</FORM>"
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";
# -*- 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};
}
}
mkdir("data", 0777);
chmod 0777, "data";
my $tmpname = "data/params.$$";
open(FID, ">$tmpname") || die "Can't create $tmpname";
print FID GenerateCode('%::param');
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)
# 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".
# This very first one is silly. At some point, "superuserness" should be an
# attribute of the person's profile entry, and not a single name like this.
#
# When first installing bugzilla, you need to either change this line to be
# you, or (better) edit the initial "params" file and change the entry for
# param(maintainer).
DefParam("maintainer",
"The email address of the person who maintains this installation of Bugzilla.",
"t",
'terry@mozilla.org');
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("bannerhtml",
"The html that gets emitted at the head of every Bugzilla 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>});
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");
1;
......@@ -71,6 +71,10 @@ set param_list {}
#
# 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)
# 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".
# This very first one is silly. At some point, "superuserness" should be an
# attribute of the person's profile entry, and not a single name like this.
......@@ -90,6 +94,22 @@ proc check_urlbase {url} {
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
proc check_despotbaseurl {url} {
if {![regexp {^http.*cgi$} $url]} {
return "must be a legal URL, that starts with http and ends with .cgi"
}
return ""
}
DefParam bannerhtml {The html that gets emitted at the head of every Bugzilla page.} l {<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=""
......@@ -148,3 +168,4 @@ 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 bugs.bug_status {The different statuses that a bug
#! /usr/bonsaitools/bin/mysqltcl
# -*- Mode: tcl; indent-tabs-mode: nil -*-
#!/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
......@@ -19,44 +19,57 @@
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
source "CGI.tcl"
source "defparams.tcl"
use diagnostics;
use strict;
confirm_login
require "CGI.pl";
require "defparams.pl";
puts "Content-type: text/html\n"
# Shut up misguided -w warnings about "used only once":
use vars %::param,
%::param_default,
@::param_list,
%::COOKIE;
if {![cequal [Param "maintainer"] $COOKIE(Bugzilla_login)]} {
puts "<H1>Sorry, you aren't the maintainer of this system.</H1>"
puts "And so, you aren't allowed to edit the parameters of it."
exit
confirm_login();
print "Content-type: text/html\n\n";
if (Param("maintainer") ne $::COOKIE{'Bugzilla_login'}) {
print "<H1>Sorry, you aren't the maintainer of this system.</H1>\n";
print "And so, you aren't allowed to edit the parameters of it.\n";
exit;
}
PutHeader "Saving new parameters" "Saving new parameters"
PutHeader("Saving new parameters");
foreach i $param_list {
if {[info exists FORM(reset-$i)]} {
set FORM($i) $param_default($i)
foreach my $i (@::param_list) {
# print "Processing $i...<BR>\n";
if (exists $::FORM{"reset-$i"}) {
$::FORM{$i} = $::param_default{$i};
}
if {![cequal $FORM($i) [Param $i]]} {
if {![cequal $param_checker($i) ""]} {
set ok [$param_checker($i) $FORM($i)]
if {![cequal $ok ""]} {
puts "New value for $i is invalid: $ok<p>"
puts "Please hit <b>Back</b> and try again."
exit
$::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;
}
}
puts "Changed $i.<br>"
set param($i) $FORM($i)
print "Changed $i.<br>\n";
$::param{$i} = $::FORM{$i}
}
}
WriteParams
WriteParams();
puts "OK, done.<p>"
puts "<a href=editparams.cgi>Edit the params some more.</a><p>"
puts "<a href=query.cgi>Go back to the query page.</a>"
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";
#! /usr/bonsaitools/bin/mysqltcl
# -*- Mode: tcl; indent-tabs-mode: nil -*-
#!/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
......@@ -20,66 +20,81 @@
# Contributor(s): Terry Weissman <terry@mozilla.org>
source "CGI.tcl"
source "defparams.tcl"
use diagnostics;
use strict;
confirm_login
require "CGI.pl";
require "defparams.pl";
puts "Content-type: text/html\n"
# Shut up misguided -w warnings about "used only once":
use vars @::param_desc,
@::param_list,
%::COOKIE;
if {![cequal [Param "maintainer"] $COOKIE(Bugzilla_login)]} {
puts "<H1>Sorry, you aren't the maintainer of this system.</H1>"
puts "And so, you aren't allowed to edit the parameters of it."
exit
confirm_login();
print "Content-type: text/html\n\n";
if (Param("maintainer") ne $::COOKIE{Bugzilla_login}) {
print "<H1>Sorry, you aren't the maintainer of this system.</H1>\n";
print "And so, you aren't allowed to edit the parameters of it.\n";
exit;
}
PutHeader "Edit parameters" "Edit parameters"
puts "This lets you edit the basic operating parameters of bugzilla. Be careful!"
puts "<p>"
puts "Any item you check Reset on will get reset to its default value."
puts "<form method=post action=doeditparams.cgi><table>"
set rowbreak "<tr><td colspan=2><hr></td></tr>"
puts $rowbreak
foreach i $param_list {
puts "<tr><th align=right valign=top>$i:</th><td>$param_desc($i)</td></tr>"
puts "<tr><td valign=top><input type=checkbox name=reset-$i>Reset</td><td>"
set value [Param $i]
switch $param_type($i) {
t {
puts "<input size=80 name=$i value=\"[value_quote $value]\">"
}
l {
puts "<textarea wrap=hard name=$i rows=10 cols=80>[value_quote $value]</textarea>"
}
b {
if {$value} {
set on "checked"
set off ""
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 {
set on ""
set off "checked"
$on = "";
$off = "checked";
}
puts "<input type=radio name=$i value=1 $on>On "
puts "<input type=radio name=$i value=0 $off>Off"
}
default {
puts "<font color=red><blink>Unknown param type $param_type($i)!!!</blink></font>"
}
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";
}
puts "</td></tr>"
puts $rowbreak
print "</td></tr>\n";
print $rowbreak;
}
puts "</table>"
print "</table>\n";
puts "<input type=reset value=\"Reset form\"><br>"
puts "<input type=submit value=\"Submit changes\">"
print "<input type=reset value=\"Reset form\"><br>\n";
print "<input type=submit value=\"Submit changes\">\n";
puts "</form>"
print "</form>\n";
puts "<p><a href=query.cgi>Skip all this, and go back to the query page</a>"
print "<p><a href=query.cgi>Skip all this, and go back to the query page</a>\n";
This diff is collapsed. Click to expand it.
......@@ -110,7 +110,6 @@ proc SortIgnoringCase {a b} {
proc make_popup { name src default listtype {onchange {}}} {
set last ""
set popup "<SELECT NAME=$name"
if {$listtype > 0} {
append popup " SIZE=5"
......
#! /usr/bonsaitools/bin/mysqltcl
# -*- Mode: tcl; indent-tabs-mode: nil -*-
#!/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
......@@ -20,11 +20,18 @@
# Contributor(s): Terry Weissman <terry@mozilla.org>
source "CGI.tcl"
puts "Content-type: text/html\n"
puts "<TITLE>Full Text Bug Listing</TITLE>"
use diagnostics;
use strict;
set generic_query {
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";
my $generic_query = "
select
bugs.bug_id,
bugs.product,
......@@ -42,34 +49,39 @@ select
bugs.short_desc
from bugs,profiles assign,profiles report
where assign.userid = bugs.assigned_to and report.userid = bugs.reporter and
}
";
ConnectToDatabase
ConnectToDatabase();
foreach bug [split $FORM(buglist) :] {
SendSQL "$generic_query bugs.bug_id = $bug\n"
foreach my $bug (split(/:/, $::FORM{'buglist'})) {
SendSQL("$generic_query bugs.bug_id = $bug");
if { [ MoreSQLData ] } {
set result [ FetchSQLData ]
puts "<IMG SRC=\"1x1.gif\" WIDTH=1 HEIGHT=80 ALIGN=LEFT>"
puts "<TABLE WIDTH=100%>"
puts "<TD COLSPAN=4><TR><DIV ALIGN=CENTER><B><FONT =\"+3\">[html_quote [lindex $result 15]]</B></FONT></DIV>"
puts "<TR><TD><B>Bug#:</B> <A HREF=\"show_bug.cgi?id=[lindex $result 0]\">[lindex $result 0]</A>"
puts "<TD><B>Product:</B> [lindex $result 1]"
puts "<TD><B>Version:</B> [lindex $result 2]"
puts "<TD><B>Platform:</B> [lindex $result 3]"
puts "<TR><TD><B>OS/Version:</B> [lindex $result 4]"
puts "<TD><B>Status:</B> [lindex $result 5]"
puts "<TD><B>Severity:</B> [lindex $result 6]"
puts "<TD><B>Priority:</B> [lindex $result 7]"
puts "<TR><TD><B>Resolution:</B> [lindex $result 8]</TD>"
puts "<TD><B>Assigned To:</B> [lindex $result 9]"
puts "<TD><B>Reported By:</B> [lindex $result 10]"
puts "<TR><TD><B>Component:</B> [lindex $result 11]"
puts "<TR><TD COLSPAN=6><B>URL:</B> [html_quote [lindex $result 12]]"
puts "<TR><TD COLSPAN=6><B>Summary&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</B> [html_quote [lindex $result 13]]"
puts "<TR><TD><B>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</B>\n</TABLE>"
puts "<PRE>[html_quote [GetLongDescription $bug]]</PRE>"
puts "<HR>"
}
my @row;
if (@row = FetchSQLData()) {
my ($id, $product, $version, $platform, $opsys, $status, $severity,
$priority, $resolution, $assigned, $reporter, $component, $url,
$shortdesc) = (@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";
print "<TR><TD><B>Component:</B> $component\n";
print "<TR><TD COLSPAN=6><B>URL:</B> " . html_quote($url) . "\n";
print "<TR><TD COLSPAN=6><B>Summary&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</B> " . html_quote($shortdesc) . "\n";
print "<TR><TD><B>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</B>\n</TABLE>\n";
print "<PRE>" . html_quote(GetLongDescription($bug)) . "</PRE>\n";
print "<HR>\n";
}
}
......@@ -31,7 +31,7 @@ foreach $pair (@pairs)
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
open(COMMENTS, ">>comments");
open(COMMENTS, ">>data/comments");
$c=$FORM{"comment"};
print COMMENTS $FORM{"comment"} . "\n";
close(COMMENTS);
......
......@@ -31,4 +31,4 @@ funny or boring and bonk on the button.
<INPUT TYPE="submit" VALUE="Add This Quip"></FORM>
</HR>
For the impatient, you can
<A HREF="comments">view the whole quip list</A>.
<A HREF="data/comments">view the whole quip list</A>.
#! /usr/bonsaitools/bin/mysqltcl
# -*- Mode: tcl; indent-tabs-mode: nil -*-
#!/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
......@@ -20,118 +20,104 @@
# Contributor(s): Terry Weissman <terry@mozilla.org>
source "CGI.tcl"
confirm_login
use diagnostics;
use strict;
puts "Set-Cookie: PLATFORM=$FORM(product) ; path=/ ; expires=Sun, 30-Jun-99 00:00:00 GMT"
puts "Set-Cookie: VERSION-$FORM(product)=$FORM(version) ; path=/ ; expires=Sun, 30-Jun-99 00:00:00 GMT"
puts "Content-type: text/html\n"
require "CGI.pl";
if {[info exists FORM(maketemplate)]} {
puts "<TITLE>Bookmarks are your friend.</TITLE>"
puts "<H1>Template constructed.</H1>"
set url "enter_bug.cgi?$buffer"
# Shut up misguided -w warnings about "used only once". For some reason,
# "use vars" chokes on me when I try it here.
puts "If you put a bookmark <a href=\"$url\">to this link</a>, it will"
puts "bring up the submit-a-new-bug page with the fields initialized"
puts "as you've requested."
exit
}
# use vars qw($::buffer);
my $zz = $::buffer;
$zz = $zz . $zz;
PutHeader "Posting Bug -- Please wait" "Posting Bug" "One moment please..."
confirm_login();
flush stdout
umask 0
ConnectToDatabase
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 {![info exists FORM(component)] || [cequal $FORM(component) ""]} {
puts "You must choose a component that corresponds to this bug. If"
puts "necessary, just guess. But please hit the <B>Back</B> button and"
puts "choose a component."
exit 0
}
if (defined $::FORM{'maketemplate'}) {
print "<TITLE>Bookmarks are your friend.</TITLE>\n";
print "<H1>Template constructed.</H1>\n";
my $url = "enter_bug.cgi?$::buffer";
set forceAssignedOK 0
if {[cequal "" $FORM(assigned_to)]} {
SendSQL "select initialowner from components
where program='[SqlQuote $FORM(product)]'
and value='[SqlQuote $FORM(component)]'"
set FORM(assigned_to) [lindex [FetchSQLData] 0]
set forceAssignedOK 1
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;
}
set FORM(assigned_to) [DBNameToIdAndCheck $FORM(assigned_to) $forceAssignedOK]
set FORM(reporter) [DBNameToIdAndCheck $FORM(reporter)]
PutHeader("Posting Bug -- Please wait", "Posting Bug", "One moment please...");
umask 0;
ConnectToDatabase();
set bug_fields { reporter product version rep_platform bug_severity \
priority op_sys assigned_to bug_status bug_file_loc \
short_desc component }
set query "insert into bugs (\n"
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
}
foreach field $bug_fields {
append query "$field,\n"
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;
}
append query "creation_ts, long_desc )\nvalues (\n"
$::FORM{'assigned_to'} = DBNameToIdAndCheck($::FORM{'assigned_to'}, $forceAssignedOK);
$::FORM{'reporter'} = DBNameToIdAndCheck($::FORM{'reporter'});
foreach field $bug_fields {
if {$field == "qa_assigned_to"} {
my @bug_fields = ("reporter", "product", "version", "rep_platform",
"bug_severity", "priority", "op_sys", "assigned_to",
"bug_status", "bug_file_loc", "short_desc", "component");
my $query = "insert into bugs (\n" . join(",\n", @bug_fields) . ",
creation_ts, long_desc )
values (
";
set valin [DBname_to_id $FORM($field)]
if {$valin == "__UNKNOWN__"} {
append query "null,\n"
} else {
append query "$valin,\n"
}
} else {
regsub -all "'" [FormData $field] "''" value
append query "'$value',\n"
}
foreach my $field (@bug_fields) {
$query .= SqlQuote($::FORM{$field}) . ",\n";
}
append query "now(), "
append query "'[SqlQuote [FormData comment]]' )\n"
$query .= "now(), " . SqlQuote($::FORM{'comment'}) . " )\n";
set ccids(zz) 1
unset ccids(zz)
my %ccids;
if {[info exists FORM(cc)]} {
foreach person [split $FORM(cc) " ,"] {
if {![cequal $person ""]} {
set ccids([DBNameToIdAndCheck $person]) 1
if (defined $::FORM{'cc'}) {
foreach my $person (split(/[ ,]/, $::FORM{'cc'})) {
if ($person ne "") {
$ccids{DBNameToIdAndCheck($person)} = 1;
}
}
}
# puts "<PRE>$query</PRE>"
# print "<PRE>$query</PRE>\n";
SendSQL $query
while {[MoreSQLData]} { set ret [FetchSQLData] }
SendSQL($query);
SendSQL "select LAST_INSERT_ID()"
set id [FetchSQLData]
SendSQL("select LAST_INSERT_ID()");
my $id = FetchOneColumn();
foreach person [array names ccids] {
SendSQL "insert into cc (bug_id, who) values ($id, $person)"
while { [ MoreSQLData ] } { FetchSQLData }
foreach my $person (keys %ccids) {
SendSQL("insert into cc (bug_id, who) values ($id, $person)");
}
# Now make sure changes are written before we run processmail...
Disconnect
puts "<H2>Changes Submitted</H2>"
puts "<A HREF=\"show_bug.cgi?id=$id\">Show BUG# $id</A>"
puts "<BR><A HREF=\"query.cgi\">Back To Query Page</A>"
flush stdout
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";
exec ./processmail $id < /dev/null > /dev/null 2> /dev/null &
exit
system("./processmail $id < /dev/null > /dev/null 2> /dev/null &");
exit;
#! /usr/bonsaitools/bin/mysqltcl
# -*- Mode: tcl; indent-tabs-mode: nil -*-
#!/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
......@@ -19,66 +19,90 @@
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
source "CGI.tcl"
# Contains some global routines used throughout the CGI scripts of Bugzilla.
if {[catch {
use diagnostics;
use strict;
require "CGI.pl";
# Shut up misguided -w warnings about "used only once":
if {[info exists FORM(GoAheadAndLogIn)]} {
use vars @::legal_resolution,
@::legal_product,
@::legal_bug_status,
@::legal_priority,
@::legal_resolution,
@::legal_platform,
@::legal_components,
@::legal_versions,
@::legal_severity,
%::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
confirm_login();
}
if {![info exists COOKIE(DEFAULTQUERY)]} {
set COOKIE(DEFAULTQUERY) [Param defaultquery]
if (!defined $::COOKIE{"DEFAULTQUERY"}) {
$::COOKIE{"DEFAULTQUERY"} = Param("defaultquery");
}
if {![info exists buffer] || $buffer == ""} {
set buffer $COOKIE(DEFAULTQUERY)
if (!defined $::buffer || $::buffer eq "") {
$::buffer = $::COOKIE{"DEFAULTQUERY"};
}
foreach name {bug_status resolution assigned_to rep_platform priority \
bug_severity product reporter op_sys component \
version} {
set default($name) ""
set type($name) 0
my %default;
my %type;
foreach my $name ("bug_status", "resolution", "assigned_to", "rep_platform",
"priority", "bug_severity", "product", "reporter", "op_sys",
"component", "version") {
$default{$name} = "";
$type{$name} = 0;
}
foreach item [split $buffer "&"] {
set el [ split $item = ]
set value [url_decode [lindex $el 1]]
set name [lindex $el 0]
if {[info exists default($name)]} {
if {$default($name) != ""} {
append default($name) "|$value"
set type($name) 1
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 {
set default($name) $value
$default{$name} = $value;
}
}
}
my $namelist = "";
foreach i [lsort [array names COOKIE]] {
switch -glob $i {
QUERY_* {
if {$COOKIE($i) != ""} {
set name [crange $i 6 end]
append namelist "<OPTION>$name"
}
foreach my $i (sort (keys %::COOKIE)) {
if ($i =~ /^QUERY_/) {
if ($::COOKIE{$i} ne "") {
my $name = substr($i, 6);
$namelist .= "<OPTION>$name";
}
}
}
puts "Set-Cookie: BUGLIST=
Content-type: text/html\n"
GetVersionTable
set who [GeneratePeopleInput assigned_to $default(assigned_to)]
set reporter [GeneratePeopleInput reporter $default(reporter)]
set qa_assigned_to_who [GeneratePeopleInput qa_assigned_to ""]
print "Set-Cookie: BUGLIST=
Content-type: text/html\n\n";
GetVersionTable();
my $who = GeneratePeopleInput("assigned_to", $default{"assigned_to"});
my $reporter = GeneratePeopleInput("reporter", $default{"reporter"});
# Muck the "legal product" list so that the default one is always first (and
......@@ -86,14 +110,16 @@ set qa_assigned_to_who [GeneratePeopleInput qa_assigned_to ""]
# Commented out, until we actually have enough products for this to matter.
# set w [lsearch $legal_product $default(product)]
# set w [lsearch $legal_product $default{"product"}]
# if {$w >= 0} {
# set legal_product [concat $default(product) [lreplace $legal_product $w $w]]
# set legal_product [concat $default{"product"} [lreplace $legal_product $w $w]]
# }
PutHeader "Bugzilla Query Page" "Query Page"
PutHeader("Bugzilla Query Page", "Query Page");
push @::legal_resolution, "---"; # Oy, what a hack.
puts "
print "
<FORM NAME=queryForm METHOD=GET ACTION=\"buglist.cgi\">
<table>
......@@ -107,27 +133,27 @@ puts "
<tr>
<td align=left valign=top>
<SELECT NAME=\"bug_status\" MULTIPLE SIZE=7>
[make_options $legal_bug_status $default(bug_status) $type(bug_status)]
@{[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 [concat $legal_resolution [list "---"]] $default(resolution) $type(resolution)]
@{[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)]
@{[make_options(\@::legal_platform, $default{'rep_platform'}, $type{'rep_platform'})]}
</SELECT>
</td>
<td align=left valign=top>
<SELECT NAME=\"priority\" MULTIPLE SIZE=7>
[make_options $legal_priority $default(priority) $type(priority) ]
@{[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)]
@{[make_options(\@::legal_severity, $default{'bug_severity'}, $type{'bug_severity'})]}
</SELECT>
</tr>
</table>
......@@ -154,19 +180,19 @@ puts "
<td align=left valign=top>
<SELECT NAME=\"product\" MULTIPLE SIZE=5>
[make_options $legal_product $default(product) $type(product)]
@{[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)]
@{[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)]
@{[make_options(\@::legal_components, $default{'component'}, $type{'component'})]}
</SELECT>
</td>
......@@ -193,10 +219,11 @@ puts "
<BR>
<INPUT TYPE=radio NAME=cmdtype VALUE=doit CHECKED> Run this query
<BR>"
<BR>
";
if {[info exists namelist]} {
puts "
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>
......@@ -207,7 +234,7 @@ if {[info exists namelist]} {
</tr></table>"
}
puts "
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:
......@@ -227,19 +254,18 @@ puts "
</CENTER>
</FORM>
"
";
if {[info exists COOKIE(Bugzilla_login)]} {
if {[cequal $COOKIE(Bugzilla_login) [Param maintainer]]} {
puts "<a href=editparams.cgi>Edit Bugzilla operating parameters</a><br>"
if (defined $::COOKIE{"Bugzilla_login"}) {
if ($::COOKIE{"Bugzilla_login"} eq Param("maintainer")) {
print "<a href=editparams.cgi>Edit Bugzilla operating parameters</a><br>\n";
}
puts "<a href=relogin.cgi>Log in as someone besides <b>$COOKIE(Bugzilla_login)</b></a><br>"
print "<a href=relogin.cgi>Log in as someone besides <b>$::COOKIE{'Bugzilla_login'}</b></a><br>\n";
}
puts "<a href=changepassword.cgi>Change your password.</a><br>"
puts "<a href=\"enter_bug.cgi\">Create a new bug.</a><br>"
print "<a href=changepassword.cgi>Change your password.</a><br>\n";
print "<a href=\"enter_bug.cgi\">Create a new bug.</a><br>\n";
}]} {
puts "\n\nQuery Page Error\n$errorInfo"
# exec /usr/lib/sendmail -t << "To: terry\n\n$errorInfo\n"
}
#! /usr/bonsaitools/bin/mysqltcl
# -*- Mode: tcl; indent-tabs-mode: nil -*-
#!/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
......@@ -19,13 +19,13 @@
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
source CGI.tcl
use diagnostics;
use strict;
require "CGI.pl";
puts "Set-Cookie: Bugzilla_login= ; path=/; expires=Sun, 30-Jun-80 00:00:00 GMT
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
......@@ -35,19 +35,19 @@ 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
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
# 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>"
# 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>"
#! /usr/bonsaitools/bin/mysqltcl
# -*- Mode: tcl; indent-tabs-mode: nil -*-
#!/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
......@@ -19,94 +19,95 @@
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
source "CGI.tcl"
puts "Content-type: text/html"
puts ""
use diagnostics;
use strict;
ConnectToDatabase
require "CGI.pl";
print "Content-type: text/html\n";
print "\n";
proc Status {str} {
puts "$str <P>"
flush stdout
ConnectToDatabase();
sub Status {
my ($str) = (@_);
print "$str <P>\n";
}
proc Alert {str} {
Status "<font color=red>$str</font>"
sub Alert {
my ($str) = (@_);
Status("<font color=red>$str</font>");
}
proc BugLink {id} {
return "<a href='show_bug.cgi?id=$id'>$id</a>"
sub BugLink {
my ($id) = (@_);
return "<a href='show_bug.cgi?id=$id'>$id</a>";
}
PutHeader "Bugzilla Sanity Check" "Bugzilla Sanity Check"
PutHeader("Bugzilla Sanity Check");
print "OK, now running sanity checks.<P>\n";
Status("Checking profile ids...");
puts "OK, now running sanity checks.<P>"
SendSQL("select userid,login_name from profiles");
Status "Checking profile ids..."
my @row;
SendSQL "select userid,login_name from profiles"
my %profid;
while {[MoreSQLData]} {
lassign [FetchSQLData] id email
if {[regexp {^[^@, ]*@[^@, ]*\.[^@, ]*$} $email]} {
set profid($id) 1
while (@row = FetchSQLData()) {
my ($id, $email) = (@row);
if ($email =~ /^[^@, ]*@[^@, ]*\.[^@, ]*$/) {
$profid{$id} = 1;
} else {
if {$id != ""} {
Alert "Bad profile id $id &lt;$email&gt;."
}
Alert "Bad profile id $id &lt;$email&gt;."
}
}
catch {[unset profid(0)]}
undef $profid{0};
Status "Checking reporter/assigned_to ids"
SendSQL "select bug_id,reporter,assigned_to from bugs"
Status("Checking reporter/assigned_to ids");
SendSQL("select bug_id,reporter,assigned_to from bugs");
while {[MoreSQLData]} {
lassign [FetchSQLData] id reporter assigned_to
if {$id == ""} {
continue
}
set bugid($id) 1
if {![info exists profid($reporter)]} {
Alert "Bad reporter $reporter in [BugLink $id]"
my %bugid;
while (@row = FetchSQLData()) {
my($id, $reporter, $assigned_to) = (@row);
$bugid{$id} = 1;
if (!defined $profid{$reporter}) {
Alert("Bad reporter $reporter in " . BugLink($id));
}
if {![info exists profid($assigned_to)]} {
Alert "Bad assigned_to $assigned_to in [BugLink $id]"
if (!defined $profid{$assigned_to}) {
Alert("Bad assigned_to $assigned_to in" . BugLink($id));
}
}
Status "Checking CC table"
Status("Checking CC table");
SendSQL "select bug_id,who from cc";
while {[MoreSQLData]} {
lassign [FetchSQLData] id cc
if {$cc == ""} {
continue
}
if {![info exists profid($cc)]} {
Alert "Bad cc $cc in [BugLink $id]"
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"
Status("Checking activity table");
SendSQL "select bug_id,who from bugs_activity"
SendSQL("select bug_id,who from bugs_activity");
while {[MoreSQLData]} {
lassign [FetchSQLData] id who
if {$who == ""} {
continue
}
if {![info exists bugid($id)]} {
Alert "Bad bugid [BugLink $id]"
while (@row = FetchSQLData()) {
my ($id, $who) = (@row);
if (!defined $bugid{$id}) {
Alert("Bad bugid " . BugLink($id));
}
if {![info exists profid($who)]} {
Alert "Bad who $who in [BugLink $id]"
if (!defined $profid{$who}) {
Alert("Bad who $who in " . BugLink($id));
}
}
#! /usr/bonsaitools/bin/mysqltcl
# -*- Mode: tcl; indent-tabs-mode: nil -*-
#!/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
......@@ -19,40 +19,45 @@
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
source "CGI.tcl"
puts "Content-type: text/html\n"
use diagnostics;
use strict;
puts "<HTML>
<H1>Changes made to bug $FORM(id)</H1>
"
set query "
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)
where bugs_activity.bug_id = $::FORM{'id'}
and profiles.userid = bugs_activity.who
order by bugs_activity.when"
ConnectToDatabase
SendSQL $query
puts "<table border cellpadding=4>"
puts "<tr>"
puts " <th>Who</th><th>What</th><th>Old value</th><th>New value</th><th>When</th>"
puts "</tr>"
while { [MoreSQLData] } {
set value [FetchSQLData]
lassign $value field when old new who
puts "<tr>"
puts "<td>$who</td>"
puts "<td>$field</td>"
puts "<td>[value_quote $old]</td>"
puts "<td>[value_quote $new]</td>"
puts "<td>$when</td>"
puts "</tr>"
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";
}
puts "</table>"
puts "<hr><a href=show_bug.cgi?id=$FORM(id)>Back to bug $FORM(id)</a>"
print "</table>\n";
print "<hr><a href=show_bug.cgi?id=$::FORM{'id'}>Back to bug $::FORM{'id'}</a>\n";
#! /usr/bonsaitools/bin/mysqltcl
# -*- Mode: tcl; indent-tabs-mode: nil -*-
#!/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
......@@ -19,26 +19,31 @@
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
source "CGI.tcl"
puts "Content-type: text/html"
puts ""
use diagnostics;
use strict;
print "Content-type: text/html\n";
print "\n";
if {[lookup FORM id] == ""} {
puts "<H2>Search By Bug Number</H2>"
puts "<FORM METHOD=GET ACTION=\"show_bug.cgi\">"
puts "You may find a single bug by entering its bug id here: "
puts "<INPUT NAME=id>"
puts "<INPUT TYPE=\"submit\" VALUE=\"Show Me This Bug\">"
puts "</FORM>"
exit 0
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
ConnectToDatabase();
GetVersionTable();
PutHeader("Bugzilla bug $::FORM{'id'}", "Bugzilla Bug", $::FORM{'id'});
navigation_header();
PutHeader "Bugzilla bug $FORM(id)" "Bugzilla Bug" $FORM(id)
navigation_header
print "<HR>\n";
puts "<HR>"
source "bug_form.tcl"
do "bug_form.pl";
#!/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";
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment