From: ivan Date: Wed, 19 May 2004 14:22:52 +0000 (+0000) Subject: fixing acct_sql export X-Git-Tag: BEFORE_FINAL_MASONIZE~1082 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=c3986b04e040c54afdf14cb39b3daf5210afa739 fixing acct_sql export --- diff --git a/FS/FS/part_export/acct_sql.pm b/FS/FS/part_export/acct_sql.pm index 0c3b49197..631a44c8a 100644 --- a/FS/FS/part_export/acct_sql.pm +++ b/FS/FS/part_export/acct_sql.pm @@ -56,7 +56,7 @@ my %map = ( }, 'name' => 'finger', - 'maildir' => sub { shift->domain. '/maildirs/'. shift->username. '/' }, + 'maildir' => sub { $_[0]->domain. '/maildirs/'. $_[0]->username. '/' }, 'domain' => sub { shift->domain }, 'svcnum' => 'svcnum', ); @@ -129,6 +129,20 @@ sub acct_sql_insert { #subroutine, not method $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; +} + sub acct_sql_connect { #my($datasrc, $username, $password) = @_; #DBI->connect($datasrc, $username, $password) or die $DBI::errstr;