freeside/FS/FS/part_export acct_sql.pm,1.1,1.2

ivan ivan at pouncequick.420.am
Wed May 19 07:22:57 PDT 2004


Update of /home/cvs/cvsroot/freeside/FS/FS/part_export
In directory pouncequick:/tmp/cvs-serv31551/FS/part_export

Modified Files:
	acct_sql.pm 
Log Message:
fixing acct_sql export

Index: acct_sql.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_export/acct_sql.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- acct_sql.pm	19 May 2004 13:41:25 -0000	1.1
+++ acct_sql.pm	19 May 2004 14:22:52 -0000	1.2
@@ -56,7 +56,7 @@
 
                 },
   'name'     => 'finger',
-  'maildir'  => sub { shift->domain. '/maildirs/'. shift->username. '/' },
+  'maildir'  => sub { $_[0]->domain. '/maildirs/'. $_[0]->username. '/' },
   'domain'   => sub { shift->domain },
   'svcnum'   => 'svcnum',
 );
@@ -125,6 +125,20 @@
 
   $sth->execute( map $record{$_}, keys %record )
     or die "can't insert into $table table: ". $sth->errstr;
+
+  $dbh->disconnect;
+}
+
+sub acct_sql_delete { #subroutine, not method
+  my $dbh = acct_sql_connect(shift, shift, shift);
+  my( $table, %record ) = @_;
+
+  my $sth = $dbh->prepare(
+    "DELETE FROM  $table WHERE ". join(' AND ', map "$_ = ? ", keys %record )
+  ) or die $dbh->errstr;
+
+  $sth->execute( map $record{$_}, keys %record )
+    or die "can't delete from $table table: ". $sth->errstr;
 
   $dbh->disconnect;
 }




More information about the freeside-commits mailing list