From b516b075c7e83f3d86a642e71b8cea3c9002482c Mon Sep 17 00:00:00 2001 From: tausq <> Date: Sun, 17 Oct 1999 00:19:07 +0000 Subject: [PATCH] added help function --- ud-fingerserv | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) 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"; +} -- 2.20.1