X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=search.cgi;h=2174d52d5c64571d770a627f8d53d00d9b5a99d5;hb=e8250d78d091445fbd422fed5d3ae9ab2516eada;hp=01a85411976a4a5366ca75d69929e0e115ffbf6a;hpb=75ee0ef50393928e67981a9bef88f09ef3d27572;p=mirror%2Fuserdir-ldap-cgi.git diff --git a/search.cgi b/search.cgi index 01a8541..2174d52 100755 --- a/search.cgi +++ b/search.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: search.cgi,v 1.10 2004/11/18 14:33:32 joey Exp $ +# $Id: search.cgi,v 1.13 2006/06/27 04:37:45 rmurray Exp $ # (c) 1999 Randolph Chung. Licensed under the GPL. # (c) 2004 Martin Schulze. Licensed under the GPL. @@ -33,7 +33,7 @@ $SIG{__DIE__} = \&DieHandler; if (!$dosearch) { # No action yet, send back the search form... - print "Content-type: text/html\n\n"; + print "Content-type: text/html; charset=utf-8\n\n"; open (F, "<$config{websearchhtml}") || &Util::HTMLError($!); while () { s/~id~/$id/g; @@ -72,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)"; @@ -117,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 :) @@ -181,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) {