X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=web%2Fmachines.cgi;h=e0ee813c8766f72c04ea2b5eca066e1295bb1ad3;hb=386666ec7a3ab737dbe45041d7c7e903aad3bc0c;hp=383f791d409e33a8bc6b77241ef9b32433f2d04a;hpb=6d491a2844b3d1c5e11edc6b914b45b87849383e;p=mirror%2Fuserdir-ldap.git diff --git a/web/machines.cgi b/web/machines.cgi index 383f791..e0ee813 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.8 2000/08/20 02:32:46 tausq Exp $ # (c) 1999 Randolph Chung. Licensed under the GPL. @@ -27,6 +27,7 @@ my (%attrs, @attrorder, %summaryattrs, @summaryorder); 'bandwidth' => 'Bandwidth', 'status' => 'Status', 'notes' => 'Notes', + 'description' => 'Description', 'createtimestamp' => 'Entry created', 'modifytimestamp' => 'Entry modified' ); @@ -34,7 +35,8 @@ my (%attrs, @attrorder, %summaryattrs, @summaryorder); # 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'); + 'disk', 'bandwidth', 'status', 'notes', 'description', + 'createtimestamp', 'modifytimestamp'); # ditto for summary %summaryattrs = ('hostname' => 'Host name', @@ -80,6 +82,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 +123,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;