[freeside-commits] freeside/FS/FS Record.pm, 1.135.2.14, 1.135.2.15 cust_main.pm, 1.271.2.62, 1.271.2.63 Upgrade.pm, 1.1.2.21, 1.1.2.22

Ivan,,, ivan at wavetail.420.am
Wed Apr 8 00:32:52 PDT 2009


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv18750

Modified Files:
      Tag: FREESIDE_1_7_BRANCH
	Record.pm cust_main.pm Upgrade.pm 
Log Message:
eliminate all trace of cvv from history records, RT#5093

Index: Upgrade.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Upgrade.pm,v
retrieving revision 1.1.2.21
retrieving revision 1.1.2.22
diff -u -d -r1.1.2.21 -r1.1.2.22
--- Upgrade.pm	1 Feb 2009 04:13:35 -0000	1.1.2.21
+++ Upgrade.pm	8 Apr 2009 07:32:50 -0000	1.1.2.22
@@ -86,6 +86,9 @@
 
   tie my %hash, 'Tie::IxHash', 
 
+    #cust_main (remove paycvv from history)
+    'cust_main' => [],
+
     #reason type and reasons
     'reason_type'     => [],
     'reason'          => [],

Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.271.2.62
retrieving revision 1.271.2.63
diff -u -d -r1.271.2.62 -r1.271.2.63
--- cust_main.pm	26 Mar 2009 03:53:45 -0000	1.271.2.62
+++ cust_main.pm	8 Apr 2009 07:32:50 -0000	1.271.2.63
@@ -74,6 +74,8 @@
 $ignore_expired_card = 0;
 
 @encrypted_fields = ('payinfo', 'paycvv');
+sub nohistory_fields { ('paycvv'); }
+
 @paytypes = ('', 'Personal checking', 'Personal savings', 'Business checking', 'Business savings');
 
 #ask FS::UID to run this stuff for us later
@@ -6239,6 +6241,15 @@
 
 }
 
+sub _upgrade_data { #class method
+  my ($class, %opts) = @_;
+
+  my $sql = 'UPDATE h_cust_main SET paycvv = NULL';
+  my $sth = dbh->prepare($sql) or die dbh->errstr;
+  $sth->execute or die $sth->errstr;
+
+}
+
 =back
 
 =head1 BUGS

Index: Record.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Record.pm,v
retrieving revision 1.135.2.14
retrieving revision 1.135.2.15
diff -u -d -r1.135.2.14 -r1.135.2.15
--- Record.pm	24 Mar 2009 02:40:04 -0000	1.135.2.14
+++ Record.pm	8 Apr 2009 07:32:50 -0000	1.135.2.15
@@ -1263,16 +1263,18 @@
 
   $time ||= time;
 
+  my %nohistory = map { $_=>1 } $self->nohistory_fields;
+
   my @fields =
-    grep { defined($self->getfield($_)) && $self->getfield($_) ne "" }
+    grep { defined($self->get($_)) && $self->get($_) ne "" && ! $nohistory{$_} }
     real_fields($self->table);
   ;
 
-  # If we're encrypting then don't ever store the payinfo or CVV2 in the history....
-  # You can see if it changed by the paymask...
-  if ($conf->exists('encryption') ) {
-    @fields = grep  $_ ne 'payinfo' && $_ ne 'cvv2', @fields;
+  # If we're encrypting then don't store the payinfo in the history
+  if ( $conf->exists('encryption') ) {
+    @fields = grep { $_ ne 'payinfo' } @fields;
   }
+
   my @values = map { _quote( $self->getfield($_), $self->table, $_) } @fields;
 
   "INSERT INTO h_". $self->table. " ( ".



More information about the freeside-commits mailing list