#!/usr/bin/perl
-# (c) 1999 Debian and Randolph Chung. Licensed under the GPL. <tausq@debian.org>
+# $Id: search.cgi,v 1.4 2000/01/11 04:52:53 tausq Exp $
+# (c) 1999 Randolph Chung. Licensed under the GPL. <tausq@debian.org>
use lib '.';
use strict vars;
$data = $entries->{$dn};
# These are local variables.. i have enough global vars as it is... <sigh>
- my ($ufdn, $login, $name, $email, $fingerprint, $address, $latlong, $vacation, $created, $modified) = undef;
+ my ($ufdn, $login, $name, $email, $fingerprint, $address, $latlong, $vacation, $created, $modified, $lastseen) = undef;
$ufdn = $dn; # Net::LDAP does not have a dn2ufn function, but this is close enough :)
$modified = &Util::FormatTimestamp($data->{modifytimestamp}->[0]);
$created = &Util::FormatTimestamp($data->{createtimestamp}->[0]);
+ # Last seen information (Echelon)
+ $lastseen = &Util::FormatLastSeen($data->{"activity-pgp"}->[0] ||
+ $data->{"activity-from"}->[0]);
+
# Link in the debian login id
$login = $data->{uid}->[0]."\@debian.org";
$login = "<a href=\"mailto:$login\">$login</a>";
$outsub{searchresults} .= FormatEntry($dataspecref->{latlong}, $latlong);
$outsub{searchresults} .= FormatEntry($dataspecref->{phone}, $data->{telephonenumber}->[0] || "- unlisted -");
$outsub{searchresults} .= FormatEntry($dataspecref->{fax}, $data->{fascimiletelephonenumber}->[0] || "- unlisted -");
+ $outsub{searchresults} .= FormatEntry($dataspecref->{lastseen}, $lastseen);
}
$outsub{searchresults} .= FormatEntry($dataspecref->{created}, $created);
$outsub{searchresults} .= FormatEntry($dataspecref->{modified}, $modified);
# If this is ourselves, present a link to do mods
if ($auth && ($id eq $data->{uid}->[0])) { #TODO: extract this string into a url for translation...
- $outsub{searchresults} .= "<a href=\"$proto://$ENV{SERVER_NAME}/$config{webupdateurl}?id=$id&authtoken=$authtoken&editdn=".uri_escape($dn, "\x00-\x40\x7f-\xff")."\">Edit my settings</a>\n";
+ $outsub{searchresults} .= "<a href=\"$proto://$ENV{SERVER_NAME}/$config{webupdateurl}?id=$id&authtoken=$authtoken&editdn=".uri_escape($dn, "\x00-\x40\x7f-\xff")."\">Edit my settings</a>\n";
}
$outsub{searchresults} .= "<br><br><br>\n";
return "<tr><td align=right><b>$key:</b></td><td> $val</td></tr>\n";
}
+
+exit 0;