Changeset 468 for trunk/textrecs.cgi
- Timestamp:
- 03/12/13 13:39:49 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/textrecs.cgi
r440 r468 31 31 use lib '.'; ##uselib## 32 32 33 use DNSDB qw(:ALL);33 use DNSDB; 34 34 35 35 # Let's do these templates right... … … 48 48 $webvar{revrec} = 'n' if !$webvar{revrec}; # non-reverse (domain) records 49 49 50 # load some local system defaults (mainly DB connect info) 51 # note this is not *absolutely* fatal, since there's a default dbname/user/pass in DNSDB.pm 52 # we'll catch a bad DB connect string once we get to trying that 53 ##fixme: pass params to loadConfig, and use them there, to allow one codebase to support multiple sites 54 if (!loadConfig()) { 55 warn "Using default configuration; unable to load custom settings: $DNSDB::errstr"; 56 } 50 my $dnsdb = new DNSDB; 57 51 58 52 # Check the session and if we have a zone ID to retrieve. Call a failure sub if not. 59 53 my $sid = ($webvar{sid} ? $webvar{sid} : undef); 60 my $session = new CGI::Session("driver:File", $sid, {Directory => $ config{sessiondir}})54 my $session = new CGI::Session("driver:File", $sid, {Directory => $dnsdb->{sessiondir}}) 61 55 or die CGI::Session->errstr(); 62 56 do_not_pass_go() if !$sid; 63 57 do_not_pass_go() if !$webvar{id}; 64 65 ##fixme: quit throwing the database handle around, and put all the SQL and direct DB fiddling into DNSDB.pm66 # dbname, user, pass, host (optional)67 my ($dbh,$msg) = connectDB($config{dbname}, $config{dbuser}, $config{dbpass}, $config{dbhost});68 # Load config pieces from the database. Ideally all but the DB user/pass/etc should be loaded here.69 initGlobals($dbh);70 58 71 59 my $zone;
Note:
See TracChangeset
for help on using the changeset viewer.