Changeset 128 for trunk/dns.cgi
- Timestamp:
- 09/21/11 18:13:16 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r126 r128 130 130 my $sortorder = "ASC"; 131 131 132 #my ($dbh,$msg) = connectDB("dnsdb","dnsdb","secret","newdbhost"); 132 # now load some local system defaults (mainly DB connect info) 133 # note this is not *absolutely* fatal, since there's a default dbname/user/pass in DNSDB.pm 134 # we'll catch a bad DB connect string a little further down. 135 if (!loadConfig()) { 136 warn "Using default configuration; unable to load custom settings: $DNSDB::errstr"; 137 } 138 139 ##fixme: quit throwing the database handle around, and put all the SQL and direct DB fiddling into DNSDB.pm 133 140 # dbname, user, pass, host (optional) 134 my ($dbh,$msg) = connectDB("dnsdb", "dnsdb", "secret", "dnsdbhost"); 135 #my $dbh = DBI->connect("DBI:mysql:database=vegadns","vegadns","secret", 136 # { AutoCommit => 0 }) or die $DBI::errstr; 137 138 ##fixme. PLEASE! <G> 139 print $msg if !$dbh; 140 141 # fiddle hardcoded "defaults" as per system/user (?) prefs 141 my ($dbh,$msg) = connectDB($config{dbname}, $config{dbuser}, $config{dbpass}, $config{dbhost}); 142 143 if (!$dbh) { 144 print "Content-type: text/html\n\n"; 145 print $header->output; 146 my $errpage = HTML::Template->new(filename => "$templatedir/dberr.tmpl"); 147 $errpage->param(errmsg => $msg); 148 print $errpage->output; 149 print $footer->output; 150 exit; 151 } 152 153 # Load config pieces from the database. Ideally all but the DB user/pass/etc should be loaded here. 142 154 initGlobals($dbh); 143 155
Note:
See TracChangeset
for help on using the changeset viewer.