X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FAdmin%2FElements%2FShowKeyInfo;h=035125957ba1c79b484cd188c99b1ed829c87a41;hb=026dc7ad72ba972f230b6709e31fa64397d75ad4;hp=0a7ef0f02c97f771d7c615d45b4cef67990cfe7f;hpb=919e930aa9279b3c5cd12b593889cd6de79d67bf;p=freeside.git
diff --git a/rt/share/html/Admin/Elements/ShowKeyInfo b/rt/share/html/Admin/Elements/ShowKeyInfo
index 0a7ef0f02..035125957 100644
--- a/rt/share/html/Admin/Elements/ShowKeyInfo
+++ b/rt/share/html/Admin/Elements/ShowKeyInfo
@@ -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'} ) {
+<% loc("Couldn't get [_1] keys information", $protocol) %> |
+% } elsif ( !keys %{ $res{'info'} } ) {
+<% loc('No [_1] keys for this address', $protocol) %> |
% } else {
-
-% unless ( $Type eq 'private' ) {
+<% loc("[_1] key '[_2]'", $protocol, $res{'info'}{'Formatted'} ) %> |
+
+% if ( $Type ne 'private' && $res{'info'}{'Trust'} ) {
<% loc('Trust') %>: | <% loc( $res{'info'}{'Trust'} ) %> |
% }
<% loc('Fingerprint') %>: |
<% $res{'info'}{'Fingerprint'} %> |
+
+% $_->CurrentUser( $session{CurrentUser} ) for grep {$_} (@{$res{'info'}}{qw|Created Expire|});
<% loc('Created') %>: |
<% $res{'info'}{'Created'}? $res{'info'}{'Created'}->AsString( Time => 0 ): loc('never') %> |
@@ -64,30 +75,38 @@
<% $res{'info'}{'Expire'}? $res{'info'}{'Expire'}->AsString( Time => 0 ): loc('never') %> |
% foreach my $uinfo( @{ $res{'info'}{'User'} } ) {
+% if ($uinfo->{'Created'} or $uinfo->{'Expire'}) {
+% $_->CurrentUser( $session{CurrentUser} ) for grep {$_} ($uinfo->{'Created'}, $uinfo->{'Expire'});
<% 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') %>)
- |
+<% $uinfo->{'Expire'}? $uinfo->{'Expire'}->AsString( Time => 0 ): loc('never') %>)
+% } else {
+<% loc('User') %>: |
+<% $uinfo->{'String'} %> |
+% }
% }
-
% }
-&>
+
+% if ( @protocols ) {
+ |
+% }
+
+% }
+
&>
<%ARGS>
$EmailAddress
$Type => 'public'
%ARGS>
<%INIT>
-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);
}
-
%INIT>