[Rt-commit] r10090 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Mon Dec 24 18:50:08 EST 2007


Author: ruz
Date: Mon Dec 24 18:50:07 2007
New Revision: 10090

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/html/Elements/GnuPG/SelectKeyForSigning
   rt/branches/3.7-EXPERIMENTAL/html/Elements/GnuPG/SignEncryptWidget

Log:
 r9893 at cubic-pc (orig r9892):  ruz | 2007-12-11 19:20:57 +0300
 * get rid of Queue argument as it can br unknown


Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/GnuPG/SelectKeyForSigning
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/GnuPG/SelectKeyForSigning	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/GnuPG/SelectKeyForSigning	Mon Dec 24 18:50:07 2007
@@ -1,22 +1,19 @@
 <select name="<% $Name %>">
-% while ( my ($address, $keys) = splice @res, 0, 2 ) {
-% foreach my $key ( @$keys ) {
-<option value="<% $key->{'Key'} %>"><% $address %></option>
-% } }
+<option value=""><% loc("Queue's key") %></option>
+% foreach my $key ( @keys ) {
+<option value="<% $key->{'Key'} %>"><% $key->{'Key'} %></option>
+% }
 </select>
 <%ARGS>
 $Name => 'SignUsing',
- at Addresses => ();
+$User => undef,
 </%ARGS>
 <%INIT>
 return unless RT->Config->Get('GnuPG')->{'Enable'};
 
-my @res;
-
-my %seen;
-foreach my $address ( grep $_ && !$seen{ lc $_ }++, @Addresses ) {
-    my %keys = RT::Crypt::GnuPG::GetKeysForSigning( $address );
-    next unless $keys{'info'};
-    push @res, $address, $keys{'info'};
+my @keys;
+if ( my $address = $User->EmailAddress ) {
+    my %res = RT::Crypt::GnuPG::GetKeysForSigning( $address );
+    push @keys, @{ $res{'info'} } if $res{'info'};
 }
 </%INIT>

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/GnuPG/SignEncryptWidget
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/GnuPG/SignEncryptWidget	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/GnuPG/SignEncryptWidget	Mon Dec 24 18:50:07 2007
@@ -1,26 +1,16 @@
 <table>
 <td><% loc('Sign')%></td>
 <td><& /Widgets/Form/Boolean:InputOnly, Name => 'Sign', CurrentValue => $self->{'Sign'} &>
-using <& SelectKeyForSigning, Addresses => \@signers &>
+using <& SelectKeyForSigning, User => $session{'CurrentUser'}->UserObj &>
 </td>
 <td><% loc('Encrypt')%></td>
 <td><& /Widgets/Form/Boolean:InputOnly, Name => 'Encrypt', CurrentValue => $self->{'Encrypt'} &></td>
 </table>
 <%ARGS>
 $self => undef,
-$TicketObj => undef,
-$QueueObj => undef,
 </%ARGS>
 <%INIT>
 return unless $self;
-
-$QueueObj ||= $TicketObj->QueueObj if $TicketObj;
-
-my @signers;
-push @signers, ($self->{'UpdateType'}||'') eq "private"
-    ? ( $QueueObj->CommentAddress || RT->Config->Get('CommentAddress') )
-    : ( $QueueObj->CorrespondAddress || RT->Config->Get('CorrespondAddress') );
-push @signers, $session{'CurrentUser'}->EmailAddress;
 </%INIT>
 
 <%METHOD new>


More information about the Rt-commit mailing list