[Rt-commit] r7576 - in rt/branches/3.7-EXPERIMENTAL: .
ruz at bestpractical.com
ruz at bestpractical.com
Thu Apr 19 17:50:24 EDT 2007
Author: ruz
Date: Thu Apr 19 17:50:23 2007
New Revision: 7576
Added:
rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowGnuPGStatus
Modified:
rt/branches/3.7-EXPERIMENTAL/ (props changed)
Log:
r5003 at cubic-pc: cubic | 2007-04-20 01:46:47 +0400
* GnuPG status component
Added: rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowGnuPGStatus
==============================================================================
--- (empty file)
+++ rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowGnuPGStatus Thu Apr 19 17:50:23 2007
@@ -0,0 +1,50 @@
+<table class="crypt-runs">
+<tr><td align="right" class="labeltop" rowspan="<% scalar @messages %>">GnuPG:</td>
+<td><% shift @messages %></td></tr>
+
+% foreach my $msg( @messages ) {
+<tr><td><% $msg %></td></tr>
+% }
+
+</table>
+<%ARGS>
+$Attachment
+</%ARGS>
+<%INIT>
+my @runs;
+foreach ( $Attachment->SplitHeaders ) {
+ next unless s/^X-RT-GnuPG-Status:\s*//i;
+
+ require RT::Crypt::GnuPG;
+ push @runs, [ RT::Crypt::GnuPG::ParseStatus( $_ ) ];
+}
+return unless @runs;
+
+my @messages;
+foreach my $run ( @runs ) {
+ foreach my $line ( @$run ) {
+ next if $line->{'Operation'} eq 'KeyCheck';
+
+ if ( $line->{'Operation'} eq 'PassphraseCheck' ) {
+ next if $line->{'Status'} eq 'DONE';
+ push @messages, loc( $line->{'Message'} );
+ }
+ elsif ( $line->{'Operation'} eq 'Decrypt' ) {
+ next if $line->{'Keyword'} eq 'ENC_TO';
+ push @messages, loc( $line->{'Message'} );
+ }
+ elsif ( $line->{'Operation'} eq 'Verify' ) {
+ push @messages, loc( $line->{'Message'} );
+ }
+ else {
+ next if $line->{'Status'} eq 'DONE';
+ push @messages, loc( $line->{'Message'} );
+ }
+ }
+}
+return unless @messages;
+
+my %seen;
+ at messages = grep !$seen{$_}++, @messages;
+
+</%INIT>
More information about the Rt-commit
mailing list