[Rt-commit] r8645 - in rt/branches/3.7-EXPERIMENTAL-TUNIS: html/Ticket/Elements

sartak at bestpractical.com sartak at bestpractical.com
Mon Aug 20 13:23:59 EDT 2007


Author: sartak
Date: Mon Aug 20 13:23:58 2007
New Revision: 8645

Modified:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/   (props changed)
   rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/ShowGnuPGStatus
   rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/ShowHistory
   rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/ShowTransaction

Log:
 r37766 at gorgoroth:  sartak | 2007-08-20 13:23:05 -0400
 Add optional warning to UI if an incoming mail is unsigned


Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/ShowGnuPGStatus
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/ShowGnuPGStatus	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/ShowGnuPGStatus	Mon Aug 20 13:23:58 2007
@@ -56,16 +56,21 @@
 </table>
 <%ARGS>
 $Attachment
+$WarnUnsigned => undef
 </%ARGS>
 <%INIT>
 my @runs;
-foreach ( $Attachment->SplitHeaders ) {
-    next unless s/^X-RT-GnuPG-Status:\s*//i;
+my $needs_unsigned_warning = $WarnUnsigned;
 
-    require RT::Crypt::GnuPG;
-    push @runs, [ RT::Crypt::GnuPG::ParseStatus( $_ ) ];
+foreach ( $Attachment->SplitHeaders ) {
+    if ( s/^X-RT-GnuPG-Status:\s*//i ) {
+        require RT::Crypt::GnuPG;
+        push @runs, [ RT::Crypt::GnuPG::ParseStatus( $_ ) ];
+    }
+    $needs_unsigned_warning = 0 if /^X-RT-Incoming-Signature:/;
 }
-return unless @runs;
+
+return unless @runs or $needs_unsigned_warning;
 
 my @messages;
 foreach my $run ( @runs ) {
@@ -89,6 +94,9 @@
         }
     }
 }
+
+push @messages, 'Warning! This is NOT signed!'
+    if $needs_unsigned_warning;
 return unless @messages;
 
 my %seen;

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/ShowHistory
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/ShowHistory	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/ShowHistory	Mon Aug 20 13:23:58 2007
@@ -160,4 +160,5 @@
 $ShowHeaders => undef
 $ShowTitle => 1
 $ShowDisplayModes => 1
+$WarnUnsigned => undef
 </%ARGS>

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/ShowTransaction
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/ShowTransaction	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/ShowTransaction	Mon Aug 20 13:23:58 2007
@@ -65,7 +65,7 @@
   <tr>
     <td colspan="4" class="content">
 % if ( $Attachments->[0] && $Attachments->[0]->id ) {
-    <& ShowGnuPGStatus, Attachment => $Attachments->[0] &>
+    <& ShowGnuPGStatus, Attachment => $Attachments->[0], WarnUnsigned => $WarnUnsigned &>
 % }
 % if ( $Transaction->CustomFieldValues->Count ) {
       <& /Elements/ShowCustomFields, Object => $Transaction &>
@@ -92,6 +92,7 @@
 $AttachmentContent => undef
 $ShowBody => 1
 $LastTransaction => 0
+$WarnUnsigned => undef
 </%ARGS>
 <%ONCE>
 


More information about the Rt-commit mailing list