Changeset 468 for trunk/textrecs.cgi


Ignore:
Timestamp:
03/12/13 13:39:49 (11 years ago)
Author:
Kris Deugau
Message:

/trunk

Object conversion of DNSDB.pm, 4 of <mumble>. See #11.

  • Convert initialization of bundled callers to object calls
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/textrecs.cgi

    r440 r468  
    3131use lib '.';    ##uselib##
    3232
    33 use DNSDB qw(:ALL);
     33use DNSDB;
    3434
    3535# Let's do these templates right...
     
    4848$webvar{revrec} = 'n' if !$webvar{revrec};      # non-reverse (domain) records
    4949
    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 }
     50my $dnsdb = new DNSDB;
    5751
    5852# Check the session and if we have a zone ID to retrieve.  Call a failure sub if not.
    5953my $sid = ($webvar{sid} ? $webvar{sid} : undef);
    60 my $session = new CGI::Session("driver:File", $sid, {Directory => $config{sessiondir}})
     54my $session = new CGI::Session("driver:File", $sid, {Directory => $dnsdb->{sessiondir}})
    6155        or die CGI::Session->errstr();
    6256do_not_pass_go() if !$sid;
    6357do_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.pm
    66 # 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);
    7058
    7159my $zone;
Note: See TracChangeset for help on using the changeset viewer.