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

ruz at bestpractical.com ruz at bestpractical.com
Wed Dec 5 13:35:45 EST 2007


Author: ruz
Date: Wed Dec  5 13:35:44 2007
New Revision: 9823

Added:
   rt/branches/3.7-RTIR-RELENG/html/Elements/SelectKeyForSigning

Log:
* add SelectKeyForSigning selector

Added: rt/branches/3.7-RTIR-RELENG/html/Elements/SelectKeyForSigning
==============================================================================
--- (empty file)
+++ rt/branches/3.7-RTIR-RELENG/html/Elements/SelectKeyForSigning	Wed Dec  5 13:35:44 2007
@@ -0,0 +1,23 @@
+<select name="<% $Name %>">
+% while ( my ($address, $keys) = splice @res, 0, 2 ) {
+% foreach my $key ( @$keys ) {
+<option value="<% $key->{'Key'} %>"><% $address %></option>
+% } }
+</select>
+<%ARGS>
+$Name => 'SignUsing',
+ at Addresses => ();
+</%ARGS>
+<%INIT>
+return unless RT->Config->Get('GnuPG')->{'Enable'};
+
+my @res;
+
+my %seen;
+foreach my $address ( grep $_ && !$seen{ lc $_ }++, @Addresses ) {
+    $RT::Logger->crit( $address );
+    my %keys = RT::Crypt::GnuPG::GetKeysForSigning( $address );
+    next unless $keys{'info'};
+    push @res, $address, $keys{'info'};
+}
+</%INIT>


More information about the Rt-commit mailing list