]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 186130 - collectstats.pl doesn't work if 'requirelogin' set. Patch by gerv; r...
authorgerv%gerv.net <>
Sat, 8 Nov 2003 08:26:41 +0000 (08:26 +0000)
committergerv%gerv.net <>
Sat, 8 Nov 2003 08:26:41 +0000 (08:26 +0000)
duplicates.cgi

index fb54972182503fe867574632e834977639070358..e8d82d2f731b24e9896b17914d987df0a2ae430d 100755 (executable)
@@ -36,6 +36,7 @@ use vars qw($buffer);
 
 use Bugzilla;
 use Bugzilla::Search;
+use Bugzilla::Constants;
 
 my $cgi = Bugzilla->cgi;
 
@@ -57,7 +58,15 @@ use vars qw($template $vars);
 ConnectToDatabase();
 GetVersionTable();
 
-quietly_check_login();
+# collectstats.pl uses duplicates.cgi to generate the RDF duplicates stats.
+# However, this conflicts with requirelogin if it's enabled; so we make
+# logging-in optional if we are running from the command line.
+if ($::ENV{'GATEWAY_INTERFACE'} eq "cmdline") {
+    Bugzilla->login(LOGIN_OPTIONAL);
+}
+else {
+    Bugzilla->login(LOGIN_NORMAL);
+}
 
 Bugzilla->switch_to_shadow_db();