From ac6a300ac8cfea79b50beb0da295ab4cef080973 Mon Sep 17 00:00:00 2001 From: "bryce-mozilla%nextbus.com" <> Date: Mon, 26 Jul 1999 02:45:55 +0000 Subject: [PATCH] Not really having time to really finish this, I'll put it up for others to work with. This is a login-centric view of the database. It is very slow for systems ith large numbers of logins. --- showowners.cgi | 145 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100755 showowners.cgi diff --git a/showowners.cgi b/showowners.cgi new file mode 100755 index 0000000000..dee819bee5 --- /dev/null +++ b/showowners.cgi @@ -0,0 +1,145 @@ +#!/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): Bryce Nesbitt +# +# This program lists all BugZilla users, and lists what modules they +# either own or are default QA for. It is very slow on large databases. + +use diagnostics; +use strict; + +require "CGI.pl"; +require "globals.pl"; + +# Fetch, one row at a time, the product and module. +# Build the contents of the table cell listing each unique +# product just once, with all the modules. +sub FetchAndFormat { + my $result = ""; + my $temp = ""; + my @row = ""; + + while (@row = FetchSQLData()) { + if( $temp ne $row[0] ) { + $result .= " " . $row[0] . ": "; + } else { + $result .= ", "; + } + $temp = $row[0]; + $result .= "" . $row[1] . ""; + } + return( $result ); +} + + +# Start the resulting web page +print "Content-type: text/html\n\n"; +print " +BugZilla module owners list\n"; + +ConnectToDatabase(); +GetVersionTable(); + +# Collect all BugZilla user names +SendSQL("select login_name,userid from profiles order by login_name"); +my @list; +my @row; +while (@row = FetchSQLData()) { + push @list, $row[0]; +} + +print "

The following is a list of BugZilla users who are the default owner +for at least one module. BugZilla will only assign or Cc: a bug to the exact +name stored in the database. Click on a name to see bugs assigned to that person:

\n"; +print "\n"; +print "\n"; +print "\n"; + +# If a user is a initialowner or initialqacontact, list their modules +my $person; +my $nospamperson; +my $firstcell; +my $secondcell; +my @nocell; +foreach $person (@list) { + + my $qperson = SqlQuote($person); + + SendSQL("select program,value from components\ + where initialowner = $qperson order by program,value;"); + $firstcell = FetchAndFormat(); + + SendSQL("select program,value from components\ + where initialqacontact = $qperson order by program,value;"); + $secondcell = FetchAndFormat(); + + $_ = $person; # Anti-spam + s/@/ @/; # Mangle + $nospamperson = $_; # Email + + if( $firstcell || $secondcell ) { + print ""; + + print "\n"; + + print "\n"; + + print "\n"; + + print "\n"; + } else { + push @nocell, $person; + } +} + +print ""; +print ""; +print "\n"; + +print "
Login nameDefault owner forDefault QA for
\n"; + print "${nospamperson}\n"; + print ""; + print $firstcell; + print ""; + print $secondcell; + print "
"; +print "Other valid logins: "; +foreach $person (@nocell) { + $_ = $person; # Anti-spam + s/@/ @/; # Mangle + $nospamperson = $_; # Email + + print "${nospamperson}\n"; + print ", "; +} +print "
\n"; + +# Enhancement ideas +# o Use just one table cell for each person. The table gets unbalanced for installs +# where just a few QA people handle lots of modules +# o Optimize for large systems. Terry notes: +# The problem is that you go query the components table 10,000 times, +# twice for each of the 5,000 logins that we have. Yow! +# +# It would be better to generate your initial list of logins by selecting +# for distinct initialqacontact and initialowner values from the +# components database. Then when you generate the list of "other +# logins", you can query for the whole list of logins and subtract out +# things that were in the components database. -- 2.47.2