[bugzilla-newer] Commit changes made on the server



commit c0005538f8a930af2038dd62498145b972f61b3e
Author: Olav Vitters <olav bkor dhs org>
Date:   Tue May 19 22:04:20 2009 +0200

    Commit changes made on the server
---
 reports/product-activity-utils.pl |   22 +++++++++++-----------
 rfc.cgi                           |   14 ++++++--------
 robots.txt                        |    9 +++++++++
 utils/mass-reassign-bugs.pl       |    2 +-
 utils/year-end-stats.pl           |    8 +++++---
 5 files changed, 32 insertions(+), 23 deletions(-)

diff --git a/reports/product-activity-utils.pl b/reports/product-activity-utils.pl
index d6893cc..972696e 100644
--- a/reports/product-activity-utils.pl
+++ b/reports/product-activity-utils.pl
@@ -38,8 +38,8 @@ sub get_total_patch_count {
         my $quoted_product = $dbh->quote($product);
         $query .= "   AND products.name = $quoted_product\n";
     }
-    $query .= "GROUP BY product_id
-               ORDER BY N";
+    $query .= " GROUP BY product_id
+                ORDER BY N";
 
     my $patch_count = $dbh->selectall_arrayref($query);
     return $patch_count;
@@ -70,8 +70,8 @@ sub get_unreviewed_patch_count {
       my $quoted_product = $dbh->quote($product);
       $query .= "   AND products.name = $quoted_product\n";
     }
-    $query .= "GROUP BY product_id
-               ORDER BY N";
+    $query .= " GROUP BY product_id
+                ORDER BY N";
 
     my $unreviewed_count = $dbh->selectall_arrayref($query);
     return $unreviewed_count;
@@ -111,17 +111,17 @@ sub get_total_bug_count {
     $query =    "SELECT products.name, COUNT(bug_id) as N
                    FROM bugs
               LEFT JOIN products ON bugs.product_id = products.id
-                  WHERE attachments.creation_ts >= NOW() - " .
+                  WHERE bugs.creation_ts >= NOW() - " .
                             $dbh->sql_interval($max_days, 'DAY') . "
-                    AND attachments.creation_ts <= NOW() - " .
+                    AND bugs.creation_ts <= NOW() - " .
                             $dbh->sql_interval($min_days, 'DAY');
 
     if ($product) {
       my $quoted_product = $dbh->quote($product);
       $query .= "   AND products.name = $quoted_product\n";
     }
-    $query .= "GROUP BY product_id
-               ORDER BY N";
+    $query .= " GROUP BY product_id
+                ORDER BY N";
 
     my $bug_count = $dbh->selectall_arrayref($query);
     return $bug_count;
@@ -207,10 +207,10 @@ sub get_responsiveness_ratings {
         # as I found out the hard way before seeing that it was on the
         # Perl::DBI man page.
         my $query =   "SELECT bugs.bug_id
-                       FROM bugs, products
+                       FROM bugs
+                 INNER JOIN products on bugs.product_id = products.id
                  INNER JOIN longdescs ON longdescs.bug_id = bugs.bug_id
-                      WHERE bugs.product_id = products.id
-                        AND products.name = " . $dbh->quote($product) . "
+                      WHERE products.name = " . $dbh->quote($product) . "
                         AND bug_severity != 'enhancement'\n";
         if ($has_devs) {
             $query .= " AND reporter NOT IN ($devs_in_string)\n";
diff --git a/rfc.cgi b/rfc.cgi
index 48ae4c1..cf93af1 100755
--- a/rfc.cgi
+++ b/rfc.cgi
@@ -23,27 +23,25 @@ my $date = scalar localtime(time);
 #
 # Open existing .htaccess file in r/w append mode, lock it, rewind to start, read current contents
 # into array.
-open(HTACCESS,"+>>$htapath") || die $!;
-flock(HTACCESS,2);
+###open(HTACCESS,"+>>$htapath") || die $!;
+###flock(HTACCESS,2);
 #seek(HTACCESS,0,0);
 # contents = <HTACCESS>;
 # Empty existing .htaccess file, then write new IP ban line and previous contents to it
 #truncate(HTACCESS,0);
-print HTACCESS ("\n# blocked by rfc.cgi - $date - $usragnt\ndeny from $remaddr\n");
+###print HTACCESS ("\n# blocked by rfc.cgi - $date - $usragnt\ndeny from $remaddr\n");
 #print HTACCESS (@contents);
 # close the .htaccess file, releasing lock - allow other instances of this script to proceed.
-close(HTACCESS);
+###close(HTACCESS);
 
 # Write html output to server response
 print <<_EOF_;
 Content-type: text/html
 
-<html><head><title>You have now been banned</title></head>
+<html><head><title>Invalid URL</title></head>
 
 <body text=\"#000000\" bgcolor="#FFFFFF">
-<p>The link you followed is often used by spiders. Please mail bugmaster AT
-gnome DOT org and we will unban you. Please specify the link you followed as
-well.</p>
+<p>The link you followed is often used by spiders and spam harvesters. Please email bugmaster\ gnome org the URL you followed and we'll tell you how to avoid this warning.</p>
 <p>Apologies for the inconvience<br>
 The GNOME bugmasters</p></body>
 </html>
diff --git a/robots.txt b/robots.txt
index 0f823cb..966b534 100644
--- a/robots.txt
+++ b/robots.txt
@@ -1,3 +1,12 @@
 User-agent: *
 Allow: /index.cgi
 Disallow: /
+
+# Any robot like behaviour against this site is not allowed
+# This includes Wget, etc
+# 
+# If you do want to do this, please contact bugmaster gnome org
+# with your contact details so we can start legal action
+# against you
+
+
diff --git a/utils/mass-reassign-bugs.pl b/utils/mass-reassign-bugs.pl
index eaecaf6..dfb9ae5 100755
--- a/utils/mass-reassign-bugs.pl
+++ b/utils/mass-reassign-bugs.pl
@@ -14,7 +14,7 @@
 #        -n <new-value> -c <changer>
 #
 # Example:
-#   ./mass-reassign-bugs.pl -p gedit -f assignee \
+#   ./mass-reassign-bugs.pl -p gedit -f assigned_to
 #        -o paolo gnome org -n gedit-maint gnome bugs \
 #        -c newren gmail com
 #
diff --git a/utils/year-end-stats.pl b/utils/year-end-stats.pl
index df6eb9a..c3cc7cd 100755
--- a/utils/year-end-stats.pl
+++ b/utils/year-end-stats.pl
@@ -74,12 +74,12 @@ my $totalbugs = &get_total_bugs_on_bugzilla($keyword, $version);
 print "done.\n";
 
 print "Getting number of bugs opened...";
-my ($bugs_opened, $opened_buglist) = &bugs_opened(undef, $days, $keyword, 
+my ($bugs_opened, $opened_buglist) = &bugs_opened($days, $keyword, 
                                                   $version);
 print "done.\n";
 
 print "Getting number of bugs closed...";
-my ($bugs_closed, $closed_buglist) = &bugs_closed(undef, $days, $keyword,
+my ($bugs_closed, $closed_buglist) = &bugs_closed($days, $keyword,
                                                   $version);
 print "done.\n";
 
@@ -230,8 +230,10 @@ printf STATFILE
   "Product               Total Opened Closed Change\n",
   $year-1;
 
+my($prod_id, $opened_list, $closed_list);
+
 foreach my $row (@$productlist) {
-    ($name, $total, $opened, $closed, $change) = @$row[0,1,2,4,6];
+    ($prod_id, $name, $total, $opened, $opened_list, $closed, $closed_list, $change) = @$row;
     printf STATFILE "%-21s %5d %6s %6s %6d\n",
       $name, $total, '+' . $opened, '-' . $closed, $change;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]