X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=machines.cgi;h=e8670987a80fcd0c357da7aa8481fca8032cab39;hb=f037896f6163f48aeef4f8e03c18c7a2932a7dc7;hp=55fe5bc4c99734df8df8e43948bfedd322ec783f;hpb=3bce39d94939aaf999189e4aaed805858a996153;p=mirror%2Fuserdir-ldap-cgi.git
diff --git a/machines.cgi b/machines.cgi
index 55fe5bc..e867098 100755
--- a/machines.cgi
+++ b/machines.cgi
@@ -35,7 +35,6 @@ my (%attrs, @attrorder, %summaryattrs, @summaryorder, %summarylistitems);
'status' => 'Status',
'notes' => 'Notes',
'sshrsahostkey' => 'SSH host key',
- 'sshrsahostfprint' => 'SSH host fingerprint',
'description' => 'Description',
'purpose' => 'purposes of this server',
# 'createtimestamp' => 'Entry created',
@@ -51,12 +50,13 @@ my (%attrs, @attrorder, %summaryattrs, @summaryorder, %summarylistitems);
# ditto for summary
%summaryattrs = ('hostname' => 'Host name',
'host' => 'just for a link',
+ 'description' => 'Description',
'architecture' => 'Architecture',
'status' => 'Status',
'access' => 'Access',
'sponsor' => 'Sponsor',
'purpose' => 'Purpose');
-@summaryorder = qw{hostname architecture sponsor purpose status access};
+@summaryorder = qw{hostname description architecture sponsor purpose status access};
%summarylistitems = map {$_=>1} qw{purpose sponsor};
# Global settings...
@@ -67,23 +67,6 @@ sub DieHandler {
$ldap->unbind if (defined($ldap));
}
-# human readable fingerprint
-sub sshfingerprint {
- my $key = shift;
-
- return '' if (!$key);
-
- my @field = split(/ /, $key);
- return '' if $field[0] ne 'ssh-dss' and $field[0] ne 'ssh-rsa';
- return '' if !$field[1];
- my $fpr = md5_hex(decode_base64($field[1]));
- my $hrfpr = $field[0] . " " . substr($fpr,0,2,"");
- while (length $fpr > 0) {
- $hrfpr .= ':' . substr($fpr,0,2,"");
- }
- return $hrfpr;
-}
-
sub wiki_link($) {
my ($in) = @_;
# [[hostname|text]] makes a link
@@ -119,13 +102,14 @@ sub item_uplist($) {
return $out;
}
-$SIG{__DIE__} = \&DieHandler;
+#$SIG{__DIE__} = \&DieHandler;
my $query = new CGI;
my $host = lc($query->param('host'));
my $sortby = lc($query->param('sortby')) || "host";
my $sortorder = lc($query->param('sortorder')) || "asc";
+
&Util::HTMLSendHeader;
$ldap = Net::LDAP->new($config{ldaphost}) || &Util::HTMLError($!);
&Util::UpgradeConnection($ldap) unless $config{usessl} eq 'False';
@@ -167,10 +151,6 @@ foreach $dn (sort {$entries->{$a}->{host}->[0] cmp $entries->{$b}->{host}->[0]}
$output{sshrsahostkey} .= $key . "
";
}
- foreach $key (@{$data->{sshrsahostkey}}) {
- $output{sshrsahostfprint} .= sshfingerprint($key) . "
";
- }
-
my $sponsor = item_uplist($data->{sponsor});
$output{sponsor} = $sponsor if defined $sponsor;
my $purpose = item_uplist($data->{purpose});
@@ -203,26 +183,26 @@ if ($output{havehostdata}) {
$hostdetails .= "
$summaryattrs{$key} | "; + $hostdetails .= "$summaryattrs{$key} | "; } else { if ($sortorder ne "dsc") { - $hostdetails .= "$summaryattrs{$key} | "; + $hostdetails .= "$summaryattrs{$key} | "; } else { - $hostdetails .= "$summaryattrs{$key} | "; + $hostdetails .= "$summaryattrs{$key} | "; } } } - $hostdetails .= "
---|