Changeset 477 for trunk/dns.cgi


Ignore:
Timestamp:
03/13/13 17:10:34 (11 years ago)
Author:
Kris Deugau
Message:

/trunk

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

  • convert addDomain(), delZone(), addRDNS(), getZoneCount(), getZoneList() getZoneLocation(), zoneStatus(), and getZonesByCIDR() and callers
  • fix a couple of missed utility calls in dns-rpc.cgi as well
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r476 r477  
    315315    }
    316316    if ($flag && ($permissions{admin} || $permissions{domain_edit})) {
    317       my $stat = zoneStatus($dbh,$webvar{id},'n',$webvar{zonestatus});
     317      my $stat = $dnsdb->zoneStatus($webvar{id}, 'n', $webvar{zonestatus});
    318318      $page->param(resultmsg => $DNSDB::resultstr);
    319319    } else {
     
    362362  $webvar{makeactive} = 0 if !defined($webvar{makeactive});
    363363
    364   my ($code,$msg) = addDomain($dbh,$webvar{domain},$webvar{group},($webvar{makeactive} eq 'on' ? 1 : 0));
     364  my ($code,$msg) = $dnsdb->addDomain($webvar{domain}, $webvar{group}, ($webvar{makeactive} eq 'on' ? 1 : 0));
    365365
    366366  if ($code eq 'OK') {
     
    396396  } elsif ($webvar{del} eq 'ok') {
    397397    my $pargroup = $dnsdb->parentID(id => $webvar{id}, type => 'domain', revrec => $webvar{revrec});
    398     my ($code,$msg) = delZone($dbh, $webvar{id}, $webvar{revrec});
     398    my ($code,$msg) = $dnsdb->delZone($webvar{id}, $webvar{revrec});
    399399    if ($code eq 'OK') {
    400400      changepage(page => "domlist", resultmsg => $msg);
     
    419419    }
    420420    if ($flag && ($permissions{admin} || $permissions{domain_edit})) {
    421       my $stat = zoneStatus($dbh,$webvar{id},'y',$webvar{zonestatus});
     421      my $stat = $dnsdb->zoneStatus($webvar{id}, 'y', $webvar{zonestatus});
    422422      $page->param(resultmsg => $DNSDB::resultstr);
    423423    } else {
     
    464464  }
    465465
    466   my ($code,$msg) = addRDNS($dbh, $webvar{revzone}, $webvar{revpatt}, $webvar{group},
     466  my ($code,$msg) = $dnsdb->addRDNS($webvar{revzone}, $webvar{revpatt}, $webvar{group},
    467467        ($webvar{makeactive} eq 'on' ? 1 : 0), $webvar{location});
    468468
     
    497497    my $pargroup = $dnsdb->parentID(id => $webvar{id}, type => 'revzone', revrec => $webvar{revrec});
    498498    my $zone = $dnsdb->revName($webvar{id});
    499     my ($code,$msg) = delZone($dbh, $webvar{id}, 'y');
     499    my ($code,$msg) = $dnsdb->delZone($webvar{id}, 'y');
    500500    if ($code eq 'OK') {
    501501      changepage(page => "revzones", resultmsg => $msg);
     
    625625
    626626    if ($webvar{defrec} eq 'n') {
    627       my $defloc = getZoneLocation($dbh, $webvar{revrec}, $webvar{parentid});
     627      my $defloc = $dnsdb->getZoneLocation($webvar{revrec}, $webvar{parentid});
    628628      fill_loclist($curgroup, $defloc);
    629629    }
     
    635635
    636636    # location check - if user does not have record_locchg, set $webvar{location} to default location for zone
    637     my $parloc = getZoneLocation($dbh, $webvar{revrec}, $webvar{parentid});
     637    my $parloc = $dnsdb->getZoneLocation($webvar{revrec}, $webvar{parentid});
    638638    $webvar{location} = $parloc unless ($permissions{admin} || $permissions{record_locchg});
    639639
     
    993993  fill_grouplist("grouplist");
    994994
    995   my $count = getZoneCount($dbh, (revrec => 'n', curgroup => $curgroup) );
     995  my $count = $dnsdb->getZoneCount(revrec => 'n', curgroup => $curgroup);
    996996
    997997  $page->param(curpage => $webvar{page});
     
    10001000  $page->param(perpage => $perpage);
    10011001
    1002   my $domlist = getZoneList($dbh, (revrec => 'n', curgroup => $curgroup) );
     1002  my $domlist = $dnsdb->getZoneList(revrec => 'n', curgroup => $curgroup);
    10031003  my $rownum = 0;
    10041004  foreach my $dom (@{$domlist}) {
     
    10631063        if $webvar{bulkaction} eq 'move';
    10641064    if ($webvar{bulkaction} eq 'deactivate' || $webvar{bulkaction} eq 'activate') {
    1065       my $stat = zoneStatus($dbh,$webvar{$_},'n',($webvar{bulkaction} eq 'activate' ? 'domon' : 'domoff'));
     1065      my $stat = $dnsdb->zoneStatus($webvar{$_}, 'n', ($webvar{bulkaction} eq 'activate' ? 'domon' : 'domoff'));
    10661066      $code = (defined($stat) ? 'OK' : 'FAIL');
    10671067      $msg = (defined($stat) ? $DNSDB::resultstr : $DNSDB::errstr);
    10681068    }
    1069     ($code, $msg) = delZone($dbh, $webvar{$_}, 'n')
     1069    ($code, $msg) = $dnsdb->delZone($webvar{$_}, 'n')
    10701070        if $webvar{bulkaction} eq 'delete';
    10711071
     
    20352035  my $childlist = join(',',@childgroups);
    20362036
    2037   my $count = getZoneCount($dbh, (childlist => $childlist, curgroup => $curgroup, revrec => $webvar{revrec},
    2038         filter => ($filter ? $filter : undef), startwith => ($startwith ? $startwith : undef) ) );
     2037  my $count = $dnsdb->getZoneCount(childlist => $childlist, curgroup => $curgroup, revrec => $webvar{revrec},
     2038        filter => ($filter ? $filter : undef), startwith => ($startwith ? $startwith : undef) );
    20392039
    20402040# fill page count and first-previous-next-last-all bits
     
    20672067  $page->param(group => $curgroup);
    20682068
    2069   my $zonelist = getZoneList($dbh, (childlist => $childlist, curgroup => $curgroup,
    2070         revrec => $webvar{revrec},
     2069  my $zonelist = $dnsdb->getZoneList(childlist => $childlist, curgroup => $curgroup, revrec => $webvar{revrec},
    20712070        filter => ($filter ? $filter : undef), startwith => ($startwith ? $startwith : undef),
    20722071        offset => $webvar{offset}, sortby => $sortby, sortorder => $sortorder
    2073         ) );
     2072        );
    20742073# probably don't need this, keeping for reference for now
    20752074#  foreach (@$zonelist) {
Note: See TracChangeset for help on using the changeset viewer.