projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MySQL is case sensitive about table names! huh
[freeside.git]
/
FS
/
FS
/
part_export
/
radiator.pm
diff --git
a/FS/FS/part_export/radiator.pm
b/FS/FS/part_export/radiator.pm
index
8f4a929
..
95f0a0b
100644
(file)
--- a/
FS/FS/part_export/radiator.pm
+++ b/
FS/FS/part_export/radiator.pm
@@
-1,6
+1,6
@@
package FS::part_export::radiator;
package FS::part_export::radiator;
-use vars qw(@ISA %info);
+use vars qw(@ISA %info
$radusers
);
use Tie::IxHash;
use FS::part_export::sqlradius;
use Tie::IxHash;
use FS::part_export::sqlradius;
@@
-21,6
+21,8
@@
END
@ISA = qw(FS::part_export::sqlradius); #for regular sqlradius accounting
@ISA = qw(FS::part_export::sqlradius); #for regular sqlradius accounting
+$radusers = 'RADUSERS'; #MySQL is case sensitive about table names! huh
+
#sub export_username {
# my($self, $svc_acct) = (shift, shift);
# $svc_acct->email;
#sub export_username {
# my($self, $svc_acct) = (shift, shift);
# $svc_acct->email;
@@
-99,7
+101,7
@@
sub radiator_insert { #subroutine, not method
my %hash = @_;
my $sth = $dbh->prepare(
my %hash = @_;
my $sth = $dbh->prepare(
-
'INSERT INTO radusers ( '
. join(', ', keys %hash ). ' ) '.
+
"INSERT INTO $radusers ( "
. join(', ', keys %hash ). ' ) '.
'VALUES ( '. join(', ', map '?', keys %hash ). ' ) '
) or die $dbh->errstr;
$sth->execute( values %hash )
'VALUES ( '. join(', ', map '?', keys %hash ). ' ) '
) or die $dbh->errstr;
$sth->execute( values %hash )
@@
-114,7
+116,7
@@
sub radiator_replace { #subroutine, not method
my ( $old_username, %hash ) = @_;
my $sth = $dbh->prepare(
my ( $old_username, %hash ) = @_;
my $sth = $dbh->prepare(
-
'UPDATE radusers SET '
. join(', ', map " $_ = ?", keys %hash ).
+
"UPDATE $radusers SET "
. join(', ', map " $_ = ?", keys %hash ).
' WHERE username = ?'
) or die $dbh->errstr;
$sth->execute( values(%hash), $old_username )
' WHERE username = ?'
) or die $dbh->errstr;
$sth->execute( values(%hash), $old_username )
@@
-128,7
+130,7
@@
sub radiator_delete { #subroutine, not method
my ( $username ) = @_;
my $sth = $dbh->prepare(
my ( $username ) = @_;
my $sth = $dbh->prepare(
- 'DELETE FROM radusers WHERE username = ?'
+ "DELETE FROM $radusers WHERE username = ?"
) or die $dbh->errstr;
$sth->execute( $username )
or die $sth->errstr;
) or die $dbh->errstr;
$sth->execute( $username )
or die $sth->errstr;