diff options
author | Mitch Jackson <mitch@freeside.biz> | 2019-03-03 19:42:10 -0500 |
---|---|---|
committer | Mitch Jackson <mitch@freeside.biz> | 2019-03-03 19:49:20 -0500 |
commit | 01776c9e52c63662403dcb19155ffe3bc8a035ee (patch) | |
tree | 53d6e06b849ae5089f43e3b61998dc9b4d627760 /bin | |
parent | 70e31cdfd01949235897035ad818e9a7b2d0c958 (diff) |
RT# 82942 Replace DBI->connect() with FS::DBI->connect()
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/aradial-sftp_and_import | 5 | ||||
-rwxr-xr-x | bin/b-move-customers | 6 | ||||
-rwxr-xr-x | bin/freeside.import | 8 | ||||
-rwxr-xr-x | bin/import-optigold.pl | 4 | ||||
-rwxr-xr-x | bin/move-customers | 6 | ||||
-rwxr-xr-x | bin/move-unlinked | 6 | ||||
-rwxr-xr-x | bin/postfix_courierimap.import | 6 | ||||
-rwxr-xr-x | bin/sqlradius-nas.import | 4 | ||||
-rwxr-xr-x | bin/sqlradius-norealm.reimport | 6 | ||||
-rwxr-xr-x | bin/sqlradius.import | 6 | ||||
-rwxr-xr-x | bin/sqlradius.reimport | 6 |
11 files changed, 33 insertions, 30 deletions
diff --git a/bin/aradial-sftp_and_import b/bin/aradial-sftp_and_import index 668ec49ba..e7639633a 100755 --- a/bin/aradial-sftp_and_import +++ b/bin/aradial-sftp_and_import @@ -8,6 +8,7 @@ use Date::Parse; use Date::Format; use Text::CSV_XS; use DBI qw( :sql_types ); +use FS::DBI; use Net::SFTP::Foreign; #use FS::UID qw( adminsuidsetup datasrc ); @@ -81,8 +82,8 @@ mkdir $cachedir unless -d $cachedir; my $servername = shift or die &usage; my( $datasrc, $db_user, $db_pass ) = ( shift, shift, shift ); -my $dbh = DBI->connect( $datasrc, $db_user, $db_pass) - or die "can't connect: $DBI::errstr\n"; +my $dbh = FS::DBI->connect( $datasrc, $db_user, $db_pass) + or die "can't connect: $FS::DBI::errstr\n"; my $csv = Text::CSV_XS->new; diff --git a/bin/b-move-customers b/bin/b-move-customers index 026e4cc35..e98ac62b8 100755 --- a/bin/b-move-customers +++ b/bin/b-move-customers @@ -5,7 +5,7 @@ use strict; use vars qw( $sdbh ); -use DBI; +use FS::DBI; use FS::UID qw( adminsuidsetup dbh ); use FS::Schema qw( dbdef ); use FS::Record qw( qsearchs ); @@ -72,8 +72,8 @@ my $void_paynum = 2147483646; #top of int range # source(remote) setup -$sdbh = DBI->connect($source_datasrc, $source_user, $source_pw) - or die $DBI::errstr; +$sdbh = FS::DBI->connect($source_datasrc, $source_user, $source_pw) + or die $FS::DBI::errstr; $sdbh->{ChopBlanks} = 1; diff --git a/bin/freeside.import b/bin/freeside.import index fdfcc083e..8f2b0e8a7 100755 --- a/bin/freeside.import +++ b/bin/freeside.import @@ -1,7 +1,7 @@ #!/usr/bin/perl -w use strict; -use DBI; +use FS::DBI; my $s_datasrc = 'DBI:mysql:host=ns1.enetonline.net;port=3307;user=ivan;dbname=freeside'; my $s_dbuser = 'ivan'; @@ -120,8 +120,10 @@ svc_www type_pkgs ); -my $s_dbh = DBI->connect($s_datasrc, $s_dbuser, $s_dbpass) or die $DBI::errstr; -my $d_dbh = DBI->connect($d_datasrc, $d_dbuser, $d_dbpass) or die $DBI::errstr; +my $s_dbh = FS::DBI->connect($s_datasrc, $s_dbuser, $s_dbpass) + or die $FS::DBI::errstr; +my $d_dbh = FS::DBI->connect($d_datasrc, $d_dbuser, $d_dbpass) + or die $FS::DBI::errstr; foreach my $table ( @tables ) { $d_dbh->do("delete from $table"); diff --git a/bin/import-optigold.pl b/bin/import-optigold.pl index d32a2a129..a251b2322 100755 --- a/bin/import-optigold.pl +++ b/bin/import-optigold.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl -Tw use strict; -use DBI; +use FS::DBI; use HTML::TableParser; use Date::Parse; use Text::CSV_XS; @@ -60,7 +60,7 @@ my @args = ( ); -$s_dbh = DBI->connect($s_dbname, $s_dbuser, $s_dbpass, +$s_dbh = FS::DBI->connect($s_dbname, $s_dbuser, $s_dbpass, { 'AutoCommit' => 0, 'ChopBlanks' => 1, 'ShowErrorStatement' => 1 diff --git a/bin/move-customers b/bin/move-customers index a7ea19781..f6f556131 100755 --- a/bin/move-customers +++ b/bin/move-customers @@ -7,7 +7,7 @@ use strict; use vars qw( $sdbh ); -use DBI; +use FS::DBI; use FS::UID qw( adminsuidsetup dbh ); use FS::Schema qw( dbdef ); use FS::Record qw( qsearchs ); @@ -95,8 +95,8 @@ my $void_paynum = 2147483646; #top of int range # source(remote) setup -$sdbh = DBI->connect($source_datasrc, $source_user, $source_pw) - or die $DBI::errstr; +$sdbh = FS::DBI->connect($source_datasrc, $source_user, $source_pw) + or die $FS::DBI::errstr; $sdbh->{ChopBlanks} = 1; diff --git a/bin/move-unlinked b/bin/move-unlinked index 0d31a49f3..0661266df 100755 --- a/bin/move-unlinked +++ b/bin/move-unlinked @@ -5,7 +5,7 @@ use strict; use vars qw( $sdbh ); -use DBI; +use FS::DBI; use FS::UID qw( adminsuidsetup dbh ); use FS::Schema qw( dbdef ); use DBI; @@ -62,8 +62,8 @@ $FS::svc_Common::noexport_hack = 1; # source(remote) setup -$sdbh = DBI->connect($source_datasrc, $source_user, $source_pw) - or die $DBI::errstr; +$sdbh = FS::DBI->connect($source_datasrc, $source_user, $source_pw) + or die $FS::DBI::errstr; $sdbh->{ChopBlanks} = 1; diff --git a/bin/postfix_courierimap.import b/bin/postfix_courierimap.import index 12c138b49..385249ba5 100755 --- a/bin/postfix_courierimap.import +++ b/bin/postfix_courierimap.import @@ -3,7 +3,7 @@ use strict; use vars qw(%part_svc %domain_part_svc); #use Date::Parse; -use DBI; +use FS::DBI; use Term::Query qw(query); use FS::UID qw(adminsuidsetup); #datasrc use FS::Record qw(qsearch qsearchs); @@ -74,8 +74,8 @@ print "\n\n"; ### -my $dbh = DBI->connect( $datasrc, $db_user, $db_pass ) - or die $DBI::errstr; +my $dbh = FS::DBI->connect( $datasrc, $db_user, $db_pass ) + or die $FS::DBI::errstr; my $sth = $dbh->prepare('SELECT username, password, crypt, name, domain FROM mailbox') or die $dbh->errstr; diff --git a/bin/sqlradius-nas.import b/bin/sqlradius-nas.import index 0583272db..1a34c8a2b 100755 --- a/bin/sqlradius-nas.import +++ b/bin/sqlradius-nas.import @@ -1,7 +1,7 @@ #!/usr/bin/perl -w use strict; -use DBI; +use FS::DBI; use FS::UID qw(adminsuidsetup); #datasrc use FS::Record qw(qsearch qsearchs dbh); use FS::nas; @@ -22,7 +22,7 @@ my $part_export = qsearchs('part_export', { exportnum => $exportnum }) $part_export->isa('FS::part_export::sqlradius') or die "export $exportnum is not an sqlradius export.\n"; -my $raddbh = DBI->connect( +my $raddbh = FS::DBI->connect( $part_export->option('datasrc'), $part_export->option('username'), $part_export->option('password') diff --git a/bin/sqlradius-norealm.reimport b/bin/sqlradius-norealm.reimport index b7d016609..7ac7465f8 100755 --- a/bin/sqlradius-norealm.reimport +++ b/bin/sqlradius-norealm.reimport @@ -3,7 +3,7 @@ use strict; use vars qw(%part_svc); #use Date::Parse; -use DBI; +use FS::DBI; use Term::Query qw(query); use FS::UID qw(adminsuidsetup); #datasrc use FS::Record qw(qsearch qsearchs); @@ -53,8 +53,8 @@ print "\n\n"; ### -my $dbh = DBI->connect( $datasrc, $db_user, $db_pass ) - or die $DBI::errstr; +my $dbh = FS::DBI->connect( $datasrc, $db_user, $db_pass ) + or die $FS::DBI::errstr; my $sth = $dbh->prepare('SELECT DISTINCT UserName FROM radcheck') or die $dbh->errstr; diff --git a/bin/sqlradius.import b/bin/sqlradius.import index e75f65b17..69361e864 100755 --- a/bin/sqlradius.import +++ b/bin/sqlradius.import @@ -3,7 +3,7 @@ use strict; use vars qw(%part_svc %domain_part_svc); #use Date::Parse; -use DBI; +use FS::DBI; use Term::Query qw(query); use FS::UID qw(adminsuidsetup); #datasrc use FS::Record qw(qsearch qsearchs); @@ -74,8 +74,8 @@ print "\n\n"; ### -my $dbh = DBI->connect( $datasrc, $db_user, $db_pass ) - or die $DBI::errstr; +my $dbh = FS::DBI->connect( $datasrc, $db_user, $db_pass ) + or die $FS::DBI::errstr; my $sth = $dbh->prepare('SELECT DISTINCT UserName, Realm FROM radcheck') or die $dbh->errstr; diff --git a/bin/sqlradius.reimport b/bin/sqlradius.reimport index 2218a3f13..2ae78df82 100755 --- a/bin/sqlradius.reimport +++ b/bin/sqlradius.reimport @@ -3,7 +3,7 @@ use strict; use vars qw(%part_svc %domain_part_svc); #use Date::Parse; -use DBI; +use FS::DBI; use Term::Query qw(query); use FS::UID qw(adminsuidsetup); #datasrc use FS::Record qw(qsearch qsearchs); @@ -74,8 +74,8 @@ print "\n\n"; ### -my $dbh = DBI->connect( $datasrc, $db_user, $db_pass ) - or die $DBI::errstr; +my $dbh = FS::DBI->connect( $datasrc, $db_user, $db_pass ) + or die $FS::DBI::errstr; my $sth = $dbh->prepare('SELECT DISTINCT UserName, Realm FROM radcheck') or die $dbh->errstr; |