X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FAdmin%2FElements%2FShowKeyInfo;h=6f055f937392971be37a10bdebdcfd8f823bb18f;hp=2ec319a63ba108c19bce2cd898c94437daa33df5;hb=7322f2afedcc2f427e997d1535a503613a83f088;hpb=85e677b86fc37c54e6de2b06340351a28f5a5916 diff --git a/rt/share/html/Admin/Elements/ShowKeyInfo b/rt/share/html/Admin/Elements/ShowKeyInfo index 2ec319a63..6f055f937 100644 --- a/rt/share/html/Admin/Elements/ShowKeyInfo +++ b/rt/share/html/Admin/Elements/ShowKeyInfo @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -45,18 +45,29 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<&| /Widgets/TitleBox, title => $title &> -% if ( $res{'exit_code'} || !keys %{ $res{'info'} } ) { -<% loc('No keys for this address') %> +<&| /Widgets/TitleBox, title => $title &> +% while ( my $protocol = shift @protocols ) { +% my %res = RT::Crypt->GetKeyInfo( +% Protocol => $protocol, +% Key => $EmailAddress, +% Type => $Type, +% ); +% if ( $res{'exit_code'} ) { + +% } elsif ( !keys %{ $res{'info'} } ) { + % } else { -
<% loc("Couldn't get [_1] keys information", $protocol) %>
<% loc('No [_1] keys for this address', $protocol) %>
-% unless ( $Type eq 'private' ) { + + +% if ( $Type ne 'private' && $res{'info'}{'Trust'} ) { % } + +% $_->CurrentUser( $session{CurrentUser} ) for grep {$_} (@{$res{'info'}}{qw|Created Expire|}); @@ -64,31 +75,38 @@ % foreach my $uinfo( @{ $res{'info'}{'User'} } ) { +% if ($uinfo->{'Created'} or $uinfo->{'Expire'}) { +% $_->CurrentUser( $session{CurrentUser} ) for grep {$_} ($uinfo->{'Created'}, $uinfo->{'Expire'}); - +<% $uinfo->{'Expire'}? $uinfo->{'Expire'}->AsString( Time => 0 ): loc('never') %>) +% } else { + + +% } % } -
<% loc("[_1] key '[_2]'", $protocol, $res{'info'}{'Formatted'} ) %>
<% loc('Trust') %>: <% loc( $res{'info'}{'Trust'} ) %>
<% loc('Fingerprint') %>: <% $res{'info'}{'Fingerprint'} %>
<% loc('Created') %>: <% $res{'info'}{'Created'}? $res{'info'}{'Created'}->AsString( Time => 0 ): loc('never') %>
<% $res{'info'}{'Expire'}? $res{'info'}{'Expire'}->AsString( Time => 0 ): loc('never') %>
<% loc('User (created - expire)') %>:<% $uinfo->{'String'} %>\ +<% $uinfo->{'String'} %> \ (<% $uinfo->{'Created'}? $uinfo->{'Created'}->AsString( Time => 0 ): loc('never') %> - \ -<% $uinfo->{'Expire'}? $uinfo->{'Expire'}->AsString( Time => 0 ): loc('never') %>) -
<% loc('User') %>:<% $uinfo->{'String'} %>
% } - + +% if ( @protocols ) { +  +% } + +% } + <%ARGS> $EmailAddress $Type => 'public' <%INIT> -return if ($m->cache_self( key => join("||",$EmailAddress,$Type, $$), expires_in => '2 minutes')); -require RT::Crypt::GnuPG; -my %res = RT::Crypt::GnuPG::GetKeyInfo( $EmailAddress, $Type ); +my @protocols = RT::Crypt->EnabledProtocols; my $title; unless ( $Type eq 'private' ) { - $title = loc('GnuPG public key(s) for [_1]', $EmailAddress); + $title = loc('Public key(s) for [_1]', $EmailAddress); } else { - $title = loc('GnuPG private key(s) for [_1]', $EmailAddress); + $title = loc('Private key(s) for [_1]', $EmailAddress); } -