[Rt-commit] r9920 - rt/branches/3.7-RTIR-RELENG/html/Elements/GnuPG

ruz at bestpractical.com ruz at bestpractical.com
Wed Dec 12 14:42:49 EST 2007


Author: ruz
Date: Wed Dec 12 14:42:47 2007
New Revision: 9920

Modified:
   rt/branches/3.7-RTIR-RELENG/html/Elements/GnuPG/SelectKeyForSigning

Log:
* implement PrivateKey in the UI

Modified: rt/branches/3.7-RTIR-RELENG/html/Elements/GnuPG/SelectKeyForSigning
==============================================================================
--- rt/branches/3.7-RTIR-RELENG/html/Elements/GnuPG/SelectKeyForSigning	(original)
+++ rt/branches/3.7-RTIR-RELENG/html/Elements/GnuPG/SelectKeyForSigning	Wed Dec 12 14:42:47 2007
@@ -1,9 +1,11 @@
+% if ( $user_key ) {
 <select name="<% $Name %>">
 <option value=""><% loc("Queue's key") %></option>
-% foreach my $key ( @keys ) {
-<option value="<% $key->{'Key'} %>"><% $key->{'Key'} %></option>
-% }
+<option value="<% $user_key %>"><% $user_key %></option>
 </select>
+% } else {
+<% loc("Queue's key") %>
+% }
 <%ARGS>
 $Name => 'SignUsing',
 $User => undef,
@@ -11,9 +13,5 @@
 <%INIT>
 return unless RT->Config->Get('GnuPG')->{'Enable'};
 
-my @keys;
-if ( my $address = $User->EmailAddress ) {
-    my %res = RT::Crypt::GnuPG::GetKeysForSigning( $address );
-    push @keys, @{ $res{'info'} } if $res{'info'};
-}
+my $user_key = $User->PrivateKey;
 </%INIT>


More information about the Rt-commit mailing list