X-Git-Url: http://git.pippins.net/embedvideo/.git/static/git-logo.png?a=blobdiff_plain;f=bin%2Fparse_ward_data;h=e6d94fb4e1670239ce13538b8df23a1d62597a41;hb=63574045f42044601bfc460bf844ea82387f421f;hp=82a173038d774daa48abb8a312988a2a73c5bd77;hpb=82963f2191eff35b295440782e4309ea3632cf55;p=eq%2F.git diff --git a/bin/parse_ward_data b/bin/parse_ward_data index 82a1730..e6d94fb 100755 --- a/bin/parse_ward_data +++ b/bin/parse_ward_data @@ -2,13 +2,12 @@ use DBI; use Getopt::Std; -################################################### -# GLOBALS -$dbname = "phpgroupware"; -$dbhost = "192.168.0.2"; -$dbport = 3306; -$dbuser = "phpgroupware"; -$dbpass = "phpgroupware"; + +$mydir = `cd \$(dirname $0) 2>/dev/null; pwd`; chomp($mydir); +unshift @INC,("$mydir/../setup"); +if( -f "$mydir/../setup/db_config.local") { require "db_config.local"; } +else { require "db_config"; } + %hometeaching_data = (); %membership_data = (); getopts('vsn:o:b'); @@ -91,7 +90,7 @@ sub print_birthdays ################################################### # Open a connection to the database -$dbh=DBI->connect("dbi:mysql:dbname=$dbname;host=$dbhost port=$dbport",$dbuser,$dbpass,{ +$dbh=DBI->connect("dbi:mysql:dbname=$dbname:host=$dbhost:port=$dbport",$dbuser,$dbpass,{ AutoCommit=>0, PrintError=>0}) or print "Connect Failure:".$DBI::errstr."\n" and exit 2;