[Rt-commit] r10097 - in rt/branches/3.7-EXPERIMENTAL: . lib/RT/Crypt
ruz at bestpractical.com
ruz at bestpractical.com
Mon Dec 24 18:51:11 EST 2007
Author: ruz
Date: Mon Dec 24 18:51:11 2007
New Revision: 10097
Modified:
rt/branches/3.7-EXPERIMENTAL/ (props changed)
rt/branches/3.7-EXPERIMENTAL/html/Admin/Users/GnuPG.html
rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm
Log:
r9917 at cubic-pc (orig r9916): ruz | 2007-12-12 20:28:30 +0300
* returning all keys if passed id is empty was bad idea as there are
several places where it's unexpected
Modified: rt/branches/3.7-EXPERIMENTAL/html/Admin/Users/GnuPG.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Admin/Users/GnuPG.html (original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Admin/Users/GnuPG.html Mon Dec 24 18:51:11 2007
@@ -21,7 +21,7 @@
Name => 'PrivateKey',
Description => loc('Private Key'),
Values => [ map $_->{'Key'}, @{ $keys_meta{'info'} } ],
- CurrentValue => $private_key,
+ CurrentValue => $UserObj->PrivateKey,
DefaultLabel => loc('No private key'),
&>
@@ -47,7 +47,7 @@
$id = $ARGS{'id'} = $UserObj->id;
my $email = $UserObj->EmailAddress;
-my %keys_meta = RT::Crypt::GnuPG::GetKeysForSigning( $email );
+my %keys_meta = RT::Crypt::GnuPG::GetKeysForSigning( $email, 'force' );
$ARGS{'PrivateKey'} = $m->comp('/Widgets/Form/Select:Process',
Name => 'PrivateKey',
@@ -60,8 +60,6 @@
push @results, $msg;
}
-my $private_key = $UserObj->PrivateKey;
-
my $title = loc("User's GnuPG keys");
</%INIT>
Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm (original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm Mon Dec 24 18:51:11 2007
@@ -1623,7 +1623,7 @@
sub GetKeysForEncryption {
my $key_id = shift;
- my %res = GetKeysInfo( $key_id, 'public' );
+ my %res = GetKeysInfo( $key_id, 'public', @_ );
return %res if $res{'exit_code'};
return %res unless $res{'info'};
@@ -1644,7 +1644,7 @@
sub GetKeysForSigning {
my $key_id = shift;
- my %res = GetKeysInfo( $key_id, 'public' );
+ my %res = GetKeysInfo( $key_id, 'public', @_ );
return %res if $res{'exit_code'};
return %res unless $res{'info'};
@@ -1729,11 +1729,11 @@
}
sub GetPublicKeyInfo {
- return GetKeyInfo(shift, 'public');
+ return GetKeyInfo( shift, 'public', @_ );
}
sub GetPrivateKeyInfo {
- return GetKeyInfo(shift, 'private');
+ return GetKeyInfo( shift, 'private', @_ );
}
sub GetKeyInfo {
@@ -1745,6 +1745,11 @@
sub GetKeysInfo {
my $email = shift;
my $type = shift || 'public';
+ my $force = shift;
+
+ unless ( $email ) {
+ return (exit_code => 0) unless $force;
+ }
my $gnupg = new GnuPG::Interface;
my %opt = RT->Config->Get('GnuPGOptions');
More information about the Rt-commit
mailing list