Update from samosa: Declare the local directory as library (in order to
[mirror/userdir-ldap-cgi.git] / fetchkey.cgi
1 #!/usr/bin/perl -wT
2
3 # $Id: fetchkey.cgi,v 1.3 2004/11/18 14:22:04 joey Exp $
4 # (c) 1999 Randolph Chung. Licensed under the GPL. <tausq@debian.org>
5
6 use lib '.';
7 use strict;
8 use CGI;
9 use Util;
10
11 # Global settings...
12 my %config = &Util::ReadConfigFile;
13 for my $key (keys %config) {
14     $key =~ /(.*)/;
15     $config{$key} = $1;
16 }
17
18 my $query = new CGI;
19 print "Content-type: text/plain\n\n";
20
21 my $fp = $query->param('fingerprint');
22
23 if ($fp) {
24   my $key = &Util::FetchKey($fp, 0);
25   if ($key) {
26     print $key;
27   } else {
28     print "Sorry, no key found matching fingerprint $fp\n";
29   }
30 } else {
31   print "No fingerprint given\n";
32 }
33
34 exit 0;
35