aboutsummaryrefslogtreecommitdiffstats
path: root/cgi/maintainers.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'cgi/maintainers.cgi')
-rwxr-xr-xcgi/maintainers.cgi65
1 files changed, 65 insertions, 0 deletions
diff --git a/cgi/maintainers.cgi b/cgi/maintainers.cgi
new file mode 100755
index 0000000..66665e6
--- /dev/null
+++ b/cgi/maintainers.cgi
@@ -0,0 +1,65 @@
+#!/usr/bin/perl
+# $Id: maintainers.cgi 1179 2006-08-05 08:30:57Z warly $
+
+=head1 NAME
+
+maintainers.cgi - youri CGI interface to maintainers list
+
+=head1 VERSION
+
+Version 1.0
+
+=head1 DESCRIPTION
+
+This script allows to get package maintainers list through CGI interface.
+
+=head1 SYNOPSIS
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2004-2005, YOURI project
+
+This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
+
+=head1 AUTHORS
+
+Guillaume Rousse <guillomovitch@zarb.org>,
+
+=cut
+
+use Youri::Bugzilla;
+use CGI;
+use AppConfig qw/:argcount :expand/;
+use strict;
+use warnings;
+
+my $config = AppConfig->new(
+ {
+ GLOBAL => {
+ DEFAULT => undef,
+ EXPAND => EXPAND_ALL,
+ ARGCOUNT => ARGCOUNT_ONE,
+ }
+ },
+ host => { ARGCOUNT => ARGCOUNT_ONE },
+ base => { ARGCOUNT => ARGCOUNT_ONE },
+ user => { ARGCOUNT => ARGCOUNT_ONE },
+ pass => { ARGCOUNT => ARGCOUNT_ONE },
+);
+
+my $home = (getpwnam($ENV{PROJECT}))[7];
+foreach my $file ("/etc/youri/maintainers.conf", "$home/.youri/maintainers.conf") {
+ $config->file($file) if -f $file && -r $file;
+}
+
+my $bugzilla = Bugzilla->new(
+ $config->host(),
+ $config->base(),
+ $config->user(),
+ $config->pass(),
+);
+
+my $cgi = CGI->new();
+print $cgi->header(-type=>'text/plain');
+
+$bugzilla->browse_packages(sub { print "$_[0]\t$_[2]\n"; });