Adds echelon support
authortausq <>
Tue, 11 Jan 2000 03:52:53 +0000 (03:52 +0000)
committertausq <>
Tue, 11 Jan 2000 03:52:53 +0000 (03:52 +0000)
web/Util.pm
web/search.cgi
web/searchresults.html
web/searchresults.wml

index 1127c63..b1b85f3 100644 (file)
@@ -203,6 +203,18 @@ sub FormatTimestamp {
   return sprintf("%04d/%02d/%02d %02d:%02d:%02d UTC", $1,$2,$3,$4,$5,$6);
 }
 
+sub FormatLastSeen {
+# Format:
+# [Tue, 11 Jan 2000 02:37:18] "Joey Hess <joeyh@debian.org>" "<debian-boot@lists.debian.org> archive/latest/7130" "<20000110181924.H19910@kitenet.net>"
+# [Mon, 10 Jan 2000 21:48:19] "9E1E 1052 F8BB A351  0606 5527 50BB 2974 2D59 A7D2" "<debian-devel-changes@lists.debian.org> archive/latest/58632" "<20000110200506.13257.qmail@master.debian.org>"
+  my $lastseen = shift;
+  return "<b>No activity detected</b>" if (!$lastseen);
+
+  my ($date,$user,$list,$msgid) = ($lastseen =~ /^\[(.+?)\]\s+"(.+?)"\s+"<(.+?)>.+?"\s+"<(.+?)>"/);
+  return "<b>$list</b><br>Message ID: $msgid";
+}
+
 sub LookupCountry {
   my $in = shift;
   my ($abbrev, $country);
index 5bd31ec..3afb03a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: search.cgi,v 1.3 1999/12/11 07:03:45 tausq Exp $
+# $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 '.';
@@ -116,7 +116,7 @@ if (!$dosearch) {
     $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 :)
     
@@ -153,6 +153,10 @@ if (!$dosearch) {
     $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>";
@@ -183,6 +187,7 @@ if (!$dosearch) {
       $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);
index b910d64..caa7903 100644 (file)
@@ -8,8 +8,8 @@
 <META NAME="Keywords" CONTENT="debian, GNU, linux, unix, open source, free, DFSG ">
 <META NAME="Language" CONTENT="English">
 <meta name="Author"    content="Debian Webmaster, webmaster@debian.org">
-<meta name="Generator" content="WML 1.6.8 (12-01-1999)">
-<meta name="Modified"  content="24-09-1999 19:15:43">
+<meta name="Generator" content="WML 1.7.2 (28-06-1999)">
+<meta name="Modified"  content="10-01-2000 21:51:34">
 </HEAD>
 <BODY text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#800080" alink="#FF0000">
 <TABLE border="0" cellpadding="3" cellspacing="0" width="100%">
@@ -55,6 +55,7 @@
 (Lat/Long, latlong)
 (Phone, phone)
 (FAX, fax)
+(Last seen, lastseen)
 searchresults?>
 </div>
 <br><br>
@@ -67,7 +68,7 @@ searchresults?>
 <P>Back to the <A href="http://www.debian.org/">Debian Project homepage</A>.
 <HR>
 <SMALL>You can contact us at <A href="mailto:admin@db.debian.org">admin@db.debian.org</A>.</SMALL><P>
-<SMALL>Last Modified: Sat, Sep 25 01:15:43 UTC 1999<BR>
+<SMALL>Last Modified: Tue, Jan 11 04:51:34 UTC 2000<BR>
 Copyright &copy; 1997-1999 <A href="http://www.spi-inc.org/">SPI</A>; See <A href="http://www.debian.org/license">license terms</A>
        
         </SMALL>
index 63e58dc..2a1bff4 100644 (file)
@@ -24,6 +24,7 @@
 (Lat/Long, latlong)
 (Phone, phone)
 (FAX, fax)
+(Last seen, lastseen)
 searchresults?>
 
 </center>