#!/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. <tausq@debian.org>
'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',
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});
# Format email addresses
$output{admin} = sprintf("<a href=\"mailto:%s\">%s</a>", $output{admin}, $output{admin});
$output{'sponsor-admin'} = sprintf("<a href=\"mailto:%s\">%s</a>", $output{'sponsor-admin'}, $output{'sponsor-admin'});
+
+ $output{sshrsahostkey} = undef;
+ foreach $key (@{$data->{sshrsahostkey}}) {
+ $output{sshrsahostkey} .= $key . "<br>";
+ }
# URL
my ($sponsor, $url) = undef;
$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;