X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=web%2Fmachines.cgi;h=938e330693cecea5fef60b5208424db7bb4c82eb;hb=a551cec7583c6d3ca2f320b6abea2dfb9d262bb8;hp=383f791d409e33a8bc6b77241ef9b32433f2d04a;hpb=6d491a2844b3d1c5e11edc6b914b45b87849383e;p=mirror%2Fuserdir-ldap.git diff --git a/web/machines.cgi b/web/machines.cgi index 383f791..938e330 100755 --- a/web/machines.cgi +++ b/web/machines.cgi @@ -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.10 2001/12/03 05:02:13 rmurray Exp $ # (c) 1999 Randolph Chung. Licensed under the GPL. @@ -27,14 +27,17 @@ my (%attrs, @attrorder, %summaryattrs, @summaryorder); 'bandwidth' => 'Bandwidth', 'status' => 'Status', 'notes' => 'Notes', + 'sshrsahostkey' => 'SSH host key', + '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 + description createtimestamp modifytimestamp); # ditto for summary %summaryattrs = ('hostname' => 'Host name', @@ -80,6 +83,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}); @@ -88,6 +96,11 @@ foreach $dn (sort {$entries->{$a}->{host}->[0] cmp $entries->{$b}->{host}->[0]} # Format email addresses $output{admin} = sprintf("%s", $output{admin}, $output{admin}); $output{'sponsor-admin'} = sprintf("%s", $output{'sponsor-admin'}, $output{'sponsor-admin'}); + + $output{sshrsahostkey} = undef; + foreach $key (@{$data->{sshrsahostkey}}) { + $output{sshrsahostkey} .= $key . "
"; + } # URL my ($sponsor, $url) = undef; @@ -116,7 +129,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%s", ($summary{$thishost}{hostname} ? ', ' : ''), $summary{$thishost}{host}, $hostname); + $summary{$thishost}{hostname} .= sprintf("%s%s", ($summary{$thishost}{hostname} ? '
' : ''), $summary{$thishost}{host}, $hostname); } } $ldap->unbind;