X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=search.cgi;h=3151399fb1e19ed4afb1d35fc28951b1e4674175;hb=2b3d1497419d64cac46d90e9e386f23e53ac2752;hp=79586f336b8317c165fa4b5328017f8637b337fa;hpb=55661a715987dd6dba3cf4f032a4cb6ad0d2949b;p=mirror%2Fuserdir-ldap-cgi.git diff --git a/search.cgi b/search.cgi index 79586f3..3151399 100755 --- a/search.cgi +++ b/search.cgi @@ -1,7 +1,8 @@ #!/usr/bin/perl -# $Id: search.cgi,v 1.9 2004/11/18 14:32:00 joey Exp $ +# $Id: search.cgi,v 1.12 2004/12/04 18:48:07 joey Exp $ # (c) 1999 Randolph Chung. Licensed under the GPL. +# (c) 2004 Martin Schulze. Licensed under the GPL. use lib '.'; use strict vars; @@ -71,8 +72,8 @@ if (!$dosearch) { } } - # Vacation is a special case - $filter .= "(onvacation=*)" if ($query->param('vacation')); + # Vacation is a special case, support it only when user is authenticated + $filter .= "(onvacation=*)" if ($query->param('vacation') && $authtoken && $id); # AND all the search terms together $filter = "(&$filter)"; @@ -116,7 +117,8 @@ if (!$dosearch) { $data = $entries->{$dn}; # These are local variables.. i have enough global vars as it is... - my ($ufdn, $login, $name, $icquin, $email, $fingerprint, $address, $latlong, $vacation, $created, $modified, $lastseen) = undef; + my ($ufdn, $login, $name, $icquin, $jabberjid, $email, $fingerprint, + $address, $latlong, $vacation, $created, $modified, $lastseen) = undef; $ufdn = $dn; # Net::LDAP does not have a dn2ufn function, but this is close enough :) @@ -180,6 +182,7 @@ if (!$dosearch) { $outsub{searchresults} .= FormatEntry($dataspecref->{uid}, $login); $outsub{searchresults} .= FormatEntry($dataspecref->{ircnick}, $data->{ircnick}->[0]); + $outsub{searchresults} .= FormatEntry($dataspecref->{jabberjid}, $data->{jabberjid}->[0]); $outsub{searchresults} .= FormatEntry($dataspecref->{loginshell}, $data->{loginshell}->[0]); $outsub{searchresults} .= FormatEntry($dataspecref->{fingerprint}, $fingerprint); if ($icquin) {