[freeside-commits] freeside/FS/FS svc_cert.pm,1.1.2.3,1.1.2.4
Ivan,,,
ivan at wavetail.420.am
Sun Nov 7 15:47:07 PST 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv1249/FS/FS
Modified Files:
Tag: FREESIDE_2_1_BRANCH
svc_cert.pm
Log Message:
certificates ala communigate, RT#7515
Index: svc_cert.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_cert.pm,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -w -d -r1.1.2.3 -r1.1.2.4
--- svc_cert.pm 7 Nov 2010 05:30:29 -0000 1.1.2.3
+++ svc_cert.pm 7 Nov 2010 23:47:04 -0000 1.1.2.4
@@ -2,6 +2,7 @@
use strict;
use base qw( FS::svc_Common );
+use Tie::IxHash;
#use FS::Record qw( qsearch qsearchs );
use FS::cust_svc;
@@ -251,14 +252,18 @@
return ($ok =~ /key ok/);
}
-my %subj = (
+tie my %subj, 'Tie::IxHash',
'CN' => 'common_name',
'O' => 'organization',
'OU' => 'organization_unit',
'L' => 'city',
'ST' => 'state',
'C' => 'country',
-);
+;
+
+sub subj_col {
+ \%subj;
+}
sub subj {
my $self = shift;
@@ -343,11 +348,25 @@
my %hash = ();
while (<OUT>) {
- warn $_;
/^\s*(\w+)=\s*(.*)\s*$/ or next;
$hash{$1} = $2;
}
+ for my $f (qw( subject issuer )) {
+
+ $hash{$f} = { map { if ( /^\s*(\w+)=\s*(.*)\s*$/ ) {
+ ($1=>$2);
+ } else {
+ (''=>'');
+ }
+ }
+ split('/', $hash{$f})
+ };
+
+ }
+
+ $hash{'selfsigned'} = 1 if $hash{'subject'}->{'O'} eq $hash{'issuer'}->{'O'};
+
%hash;
}
More information about the freeside-commits
mailing list