use check-sigs instead of list-sigs
[mirror/userdir-ldap-cgi.git] / machines.cgi
index 383f791..92deede 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-# $Id: machines.cgi,v 1.6 2000/08/19 02:34:11 tausq Exp $
+# $Id: machines.cgi,v 1.9 2001/01/08 07:03:23 tausq Exp $
 
 # (c) 1999 Randolph Chung. Licensed under the GPL. <tausq@debian.org>
 
@@ -27,14 +27,18 @@ my (%attrs, @attrorder, %summaryattrs, @summaryorder);
          'bandwidth' => 'Bandwidth',
          'status' => 'Status',
          'notes' => 'Notes',
+         'sshrsahostkey' => 'SSH host key (RSA)',
+         'sshdsahostkey' => 'SSH host key (DSA)',
+         'description' => 'Description',
          'createtimestamp' => 'Entry created',
          'modifytimestamp' => 'Entry modified'
         );
 
 # This defines what fields are displayed, and in what order
-@attrorder = ('hostname', 'admin', 'architecture', 'distribution', 'access',
-              'sponsor', 'sponsor-admin', 'location', 'machine', 'memory',
-             'disk', 'bandwidth', 'status', 'notes', 'createtimestamp', 'modifytimestamp');
+@attrorder = qw(hostname admin architecture distribution access
+                sponsor sponsor-admin location machine memory
+               disk bandwidth status notes sshrsahostkey sshdsahostkey
+               description createtimestamp modifytimestamp);
 
 # ditto for summary
 %summaryattrs = ('hostname' => 'Host name',
@@ -80,6 +84,11 @@ foreach $dn (sort {$entries->{$a}->{host}->[0] cmp $entries->{$b}->{host}->[0]}
     foreach $key (keys(%attrs)) {
       $output{$key} = $data->{$key}->[0];
     }
+  
+    $output{hostname} = undef;
+    foreach my $hostname (@{$data->{hostname}}) {
+      $output{hostname} .= sprintf("%s%s", ($output{hostname} ? ', ' : ''), $hostname);
+    }
 
     # Modified/created time. TODO: maybe add is the name of the creator/modifier
     $output{modifytimestamp} = &Util::FormatTimestamp($output{modifytimestamp});
@@ -116,7 +125,7 @@ foreach $dn (sort {$entries->{$a}->{host}->[0] cmp $entries->{$b}->{host}->[0]}
   
   $summary{$thishost}{hostname} = undef;
   foreach my $hostname (@{$data->{hostname}}) {
-    $summary{$thishost}{hostname} .= sprintf("%s<a href=\"machines.cgi?host=%s\">%s</a>", ($summary{$thishost}{hostname} ? '' : ''), $summary{$thishost}{host}, $hostname);
+    $summary{$thishost}{hostname} .= sprintf("%s<a href=\"machines.cgi?host=%s\">%s</a>", ($summary{$thishost}{hostname} ? '<br>' : ''), $summary{$thishost}{host}, $hostname);
   }
 }
 $ldap->unbind;