diff options
author | ivan <ivan> | 2004-05-19 14:22:52 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-05-19 14:22:52 +0000 |
commit | c3986b04e040c54afdf14cb39b3daf5210afa739 (patch) | |
tree | ec647eb5742180c83bb7e36acc8db683a2cbdd0f /FS | |
parent | b970f3999c9a49146ec2f5224a60057723304d1b (diff) |
fixing acct_sql export
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/part_export/acct_sql.pm | 16 |
1 files changed, 15 insertions, 1 deletions
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; |