[Rt-commit] rt branch, 3.999-trunk, updated. eb65bad7d117b06f20e65569cd5c8b1e258f6c93

sartak at bestpractical.com sartak at bestpractical.com
Wed Nov 25 06:34:06 EST 2009


The branch, 3.999-trunk has been updated
       via  eb65bad7d117b06f20e65569cd5c8b1e258f6c93 (commit)
      from  60b14da35d94b431fde8f9791f13e50d881fc528 (commit)

Summary of changes:
 lib/RT/Action/CreateTicket.pm |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit eb65bad7d117b06f20e65569cd5c8b1e258f6c93
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Nov 25 06:33:59 2009 -0500

    basic sign_using validation

diff --git a/lib/RT/Action/CreateTicket.pm b/lib/RT/Action/CreateTicket.pm
index a5985fa..88a1c31 100644
--- a/lib/RT/Action/CreateTicket.pm
+++ b/lib/RT/Action/CreateTicket.pm
@@ -200,6 +200,26 @@ sub setup_gnupg {
         render_as     => 'checkbox',
         default_value => $queue->encrypt,
     ));
+}
+
+sub validate_sign_using {
+    my $self    = shift;
+    my $address = shift;
+
+    return if !$self->argument_value('sign');
+
+    # XXX: how should this fit into RT4?
+    #$address ||= ($self->{'update_type'} && $self->{'update_type'} eq "private")
+    #    ? ( $queue_obj->comment_address || RT->config->get('comment_address') )
+    #    : ( $queue_obj->correspond_address || RT->config->get('correspond_address') );
+
+    unless ( RT::Crypt::GnuPG::dry_sign($address) ) {
+        return $self->validation_error(sign_using => _("The system is unable to sign outgoing email messages. This usually indicates that the passphrase was mis-set, or that GPG Agent is down. Please alert your system administrator immediately. The problem address is: %1", $address));
+    } else {
+        # should this use argument_value('sign_using') or $address?
+        RT::Crypt::GnuPG::use_key_for_signing($self->argument_value('sign_using'))
+            if $self->argument_value('sign_using');
+    }
 
 }
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list