From: tausq <> Date: Sun, 17 Oct 1999 00:19:07 +0000 (+0000) Subject: added help function X-Git-Tag: debian_userdir-ldap_0-3-7~203 X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=b516b075c7e83f3d86a642e71b8cea3c9002482c;hp=f4a89029dd309f07a6a2661e8f79328e15a32ebf;p=mirror%2Fuserdir-ldap.git added help function --- diff --git a/ud-fingerserv b/ud-fingerserv index c581b3d..ec52955 100755 --- a/ud-fingerserv +++ b/ud-fingerserv @@ -1,9 +1,10 @@ #!/usr/bin/perl -# $Id: ud-fingerserv,v 1.8 1999/10/17 02:01:28 tausq Exp $ +# $Id: ud-fingerserv,v 1.9 1999/10/17 02:19:07 tausq Exp $ # (c) 1999 Randolph Chung. Licensed under the GPL. -use lib '/var/www/userdir-ldap/'; +#use lib '/var/www/userdir-ldap/'; +use lib '/home/randolph/projects/userdir-ldap/web'; use strict vars; #use Apache::Registry; use IO::Handle; @@ -102,6 +103,11 @@ sub ProcessQuery { $query =~ s/[^\/,0-9a-z]//gi; # be paranoid about input my ($uid, $fields) = split(/\//, $query, 2); + if ($uid =~ /^help$/i) { + &sendhelp($client); + return; + } + &log("Looking up $uid at $config{basedn}, uid=$uid"); $mesg = $ldap->search(base => $config{basedn}, filter => "uid=$uid"); @@ -158,3 +164,20 @@ sub log { my $time = localtime; print STDERR "$time $msg\n"; } + +sub sendhelp { + my $client = shift; + + print $client "userdir-ldap finger daemon\n"; + print $client "--------------------------\n"; + print $client "finger [/]\@db.debian.org\n"; + print $client " where uid is the user id of the user\n"; + print $client " the optional attributes parameter specifies what to return\n"; + print $client " if nothing is specified, all attributes are returned.\n"; + print $client " The following attributes are current supported:\n"; + foreach (@summarykeys) { + print $client " $_ : $attrs{$_}\n"; + } + print $client " Multiple attributes can be separated by commas, like this:\n"; + print $client " finger tux/email,key\@db.debian.org\n"; +}