X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap-cgi.git;a=blobdiff_plain;f=machines.cgi;h=41ebe250f3d28058edb7c5a2bbd7a8fb62434ce2;hp=55fe5bc4c99734df8df8e43948bfedd322ec783f;hb=036702ecd044b501dce1b05dfbf19a17921120da;hpb=3bce39d94939aaf999189e4aaed805858a996153 diff --git a/machines.cgi b/machines.cgi index 55fe5bc..41ebe25 100755 --- a/machines.cgi +++ b/machines.cgi @@ -51,12 +51,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... @@ -74,7 +75,8 @@ sub sshfingerprint { return '' if (!$key); my @field = split(/ /, $key); - return '' if $field[0] ne 'ssh-dss' and $field[0] ne 'ssh-rsa'; + my %keytypes = map {$_=>1} (qw{ssh-dss ssh-rsa ecdsa-sha2-nistp256 ssh-ed25519}); + return '' unless $keytypes{$field[0]}; return '' if !$field[1]; my $fpr = md5_hex(decode_base64($field[1])); my $hrfpr = $field[0] . " " . substr($fpr,0,2,""); @@ -119,13 +121,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'; @@ -203,26 +206,26 @@ if ($output{havehostdata}) { $hostdetails .= "\n"; } else { # display summary info $hostdetails = "

Summary

\n"; - $hostdetails .= "\n"; + $hostdetails .= "
\n\n"; foreach $key (@summaryorder) { if ($sortby ne $key) { - $hostdetails .= ""; + $hostdetails .= ""; } else { if ($sortorder ne "dsc") { - $hostdetails .= ""; + $hostdetails .= ""; } else { - $hostdetails .= ""; + $hostdetails .= ""; } } } - $hostdetails .= "\n"; + $hostdetails .= "\n\n\n"; my @sorted; if ($sortorder eq "asc") { @@ -238,7 +241,7 @@ if ($output{havehostdata}) { } $hostdetails .= "\n"; } - $hostdetails .= "
$summaryattrs{$key}$summaryattrs{$key}$summaryattrs{$key}$summaryattrs{$key}$summaryattrs{$key}$summaryattrs{$key}
\n"; + $hostdetails .= "\n\n"; } # Finally, we can write the output... yuck...