[Rt-commit] r9355 - in rtir/branches/2.3-EXPERIMENTAL: .

sartak at bestpractical.com sartak at bestpractical.com
Fri Oct 19 11:59:21 EDT 2007


Author: sartak
Date: Fri Oct 19 11:59:21 2007
New Revision: 9355

Modified:
   rtir/branches/2.3-EXPERIMENTAL/   (props changed)
   rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Reply.html

Log:
 r43875 at onn:  sartak | 2007-10-19 11:59:14 -0400
 Check each ticket correspond address to make sure it can sign


Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Reply.html
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Reply.html	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Reply.html	Fri Oct 19 11:59:21 2007
@@ -45,8 +45,8 @@
 <input type="hidden" name="All" value="<% $All %>" />
 <input type="hidden" name="Query" value="<% $Query %>" />
 
-% if ($cannot_sign) {
-<& /Elements/GnuPGSignIssues &>
+% if (defined $cannot_sign_to) {
+<& /Elements/GnuPGSignIssues, Address => $cannot_sign_to &>
 % }
 
 <& /Elements/GnuPGKeyIssues, Issues => \@gnupg_keys_issues &>
@@ -159,14 +159,9 @@
 
 my $checks_failure = 0;
 
-my $cannot_sign = 0;
-if ( $SubmitTicket && $ARGS{'Sign'} ) {
-    # XXX: address grokking needs improvement
-    if (!RT::Crypt::GnuPG::DrySign($QueueObj->CorrespondAddress, "x")) {
-        $cannot_sign = 1;
-        $checks_failure = 1;
-    }
-}
+my %sign_addresses;
+my $cannot_sign_to;
+$sign_address{ $IncidentObj->QueueObj->CorrespondAddress } = 1;
 
 my @gnupg_keys_issues;
 if ( $SubmitTicket && $ARGS{'Encrypt'} ) {
@@ -182,6 +177,7 @@
             next;
         }
         $id = $Ticket->id;
+        $sign_address{ $Ticket->QueueObj->CorrespondAddress } = 1;
 
         push @recipients, $m->comp(
             '/Ticket/Elements/PreviewScrips:GetRecipients',
@@ -200,6 +196,16 @@
     $checks_failure = 1 unless $status;
 }
 
+if ( $SubmitTicket && $ARGS{'Sign'} ) {
+    for my $address (keys %sign_address) {
+        if (!RT::Crypt::GnuPG::DrySign($address, "x")) {
+            $cannot_sign_to = $address;
+            $checks_failure = 1;
+            last;
+        }
+    }
+}
+
 if ( $SubmitTicket && !$checks_failure ) {
     foreach my $id( @SelectedReports, @SelectedInvestigations, @SelectedBlocks ) {
         my $Ticket = RT::Ticket->new( $session{'CurrentUser'} );


More information about the Rt-commit mailing list