Changeset 473 for trunk/dns.cgi


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

/trunk

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

  • update domainName(), revName(), userFullName(), groupName() and parentID(), and callers
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r470 r473  
    392392
    393393    $page->param(del_getconf => 1);
    394     $page->param(domain => domainName($dbh,$webvar{id}));
     394    $page->param(domain => $dnsdb->domainName($webvar{id}));
    395395
    396396  } elsif ($webvar{del} eq 'ok') {
    397     my $pargroup = parentID($dbh, (id => $webvar{id}, type => 'domain', revrec => $webvar{revrec}));
     397    my $pargroup = $dnsdb->parentID(id => $webvar{id}, type => 'domain', revrec => $webvar{revrec});
    398398    my ($code,$msg) = delZone($dbh, $webvar{id}, $webvar{revrec});
    399399    if ($code eq 'OK') {
     
    492492
    493493    $page->param(del_getconf => 1);
    494     $page->param(revzone => revName($dbh,$webvar{id}));
     494    $page->param(revzone => $dnsdb->revName($webvar{id}));
    495495
    496496  } elsif ($webvar{del} eq 'ok') {
    497     my $pargroup = parentID($dbh, (id => $webvar{id}, type => 'revzone', revrec => $webvar{revrec}));
    498     my $zone = revName($dbh, $webvar{id});
     497    my $pargroup = $dnsdb->parentID(id => $webvar{id}, type => 'revzone', revrec => $webvar{revrec});
     498    my $zone = $dnsdb->revName($webvar{id});
    499499    my ($code,$msg) = delZone($dbh, $webvar{id}, 'y');
    500500    if ($code eq 'OK') {
     
    569569# fill the page-count and first-previous-next-last-all details
    570570    fill_pgcount($count,"records",
    571         ($webvar{defrec} eq 'y' ? "group ".groupName($dbh,$webvar{id}) :
    572                 ($webvar{revrec} eq 'y' ? revName($dbh,$webvar{id}) : domainName($dbh,$webvar{id}))
     571        ($webvar{defrec} eq 'y' ? "group ".$dnsdb->groupName($webvar{id}) :
     572                ($webvar{revrec} eq 'y' ? $dnsdb->revName($webvar{id}) : $dnsdb->domainName($webvar{id}))
    573573        ));
    574574    fill_fpnla($count);  # should put some params on this sub...
     
    724724
    725725  if ($webvar{defrec} eq 'y') {
    726     $page->param(dohere => "default records in group ".groupName($dbh,$webvar{parentid}));
     726    $page->param(dohere => "default records in group ".$dnsdb->groupName($webvar{parentid}));
    727727  } else {
    728     $page->param(dohere => domainName($dbh,$webvar{parentid})) if $webvar{revrec} eq 'n';
    729     $page->param(dohere => revName($dbh,$webvar{parentid})) if $webvar{revrec} eq 'y';
     728    $page->param(dohere => $dnsdb->domainName($webvar{parentid})) if $webvar{revrec} eq 'n';
     729    $page->param(dohere => $dnsdb->revName($webvar{parentid})) if $webvar{revrec} eq 'y';
    730730  }
    731731
     
    929929    changepage(page => "grpman");
    930930  }
    931   $page->param(delgroupname => groupName($dbh, $webvar{id}));
     931  $page->param(delgroupname => $dnsdb->groupName($webvar{id}));
    932932
    933933} elsif ($webvar{page} eq 'edgroup') {
     
    968968        changepage(page => "grpman", warnmsg =>
    969969                "You can only grant permissions you hold.  Default permissions in group ".
    970                 groupName($dbh, $webvar{gid})." updated with reduced access");
     970                $dnsdb->groupName($webvar{gid})." updated with reduced access");
    971971      } else {
    972972        changepage(page => "grpman", resultmsg => $msg);
     
    978978  }
    979979  $page->param(gid => $webvar{gid});
    980   $page->param(grpmeddle => groupName($dbh, $webvar{gid}));
     980  $page->param(grpmeddle => $dnsdb->groupName($webvar{gid}));
    981981  my %grpperms;
    982982  getPermissions($dbh, 'group', $webvar{gid}, \%grpperms);
     
    996996
    997997  $page->param(curpage => $webvar{page});
    998   fill_pgcount($count,'domains',groupName($dbh,$curgroup));
     998  fill_pgcount($count, 'domains', $dnsdb->groupName($curgroup));
    999999  fill_fpnla($count);
    10001000  $page->param(perpage => $perpage);
     
    10261026    changepage(page => "domlist", errmsg => "You are not permitted to bulk-move domains")
    10271027        unless ($permissions{admin} || ($permissions{domain_edit} && $permissions{domain_create} && $permissions{domain_delete}));
    1028     my $newgname = groupName($dbh,$webvar{destgroup});
     1028    my $newgname = $dnsdb->groupName($webvar{destgroup});
    10291029    $page->param(action => "Move to group $newgname");
    10301030  } elsif ($webvar{bulkaction} eq 'deactivate' || $webvar{bulkaction} eq 'activate') {
     
    10561056      next;
    10571057    }
    1058     $row{domain} = domainName($dbh,$webvar{$_});
     1058    $row{domain} = $dnsdb->domainName($webvar{$_});
    10591059
    10601060    # Do the $webvar{bulkaction}
     
    13171317  if (!defined($webvar{del})) {
    13181318    $page->param(del_getconf => 1);
    1319     $page->param(user => userFullName($dbh,$webvar{id}));
     1319    $page->param(user => $dnsdb->userFullName($webvar{id}));
    13201320  } elsif ($webvar{del} eq 'ok') {
    13211321    my ($code,$msg) = delUser($dbh, $webvar{id});
     
    16271627      goto DONELOG;
    16281628    }
    1629     $page->param(logfor => 'user '.userFullName($dbh,$id));
     1629    $page->param(logfor => 'user '.$dnsdb->userFullName($id));
    16301630  } elsif ($webvar{ltype} && $webvar{ltype} eq 'dom') {
    16311631    $id = $webvar{id};
     
    16341634      goto DONELOG;
    16351635    }
    1636     $page->param(logfor => 'domain '.domainName($dbh,$id));
     1636    $page->param(logfor => 'domain '.$dnsdb->domainName($id));
    16371637  } elsif ($webvar{ltype} && $webvar{ltype} eq 'rdns') {
    16381638    $id = $webvar{id};
     
    16411641      goto DONELOG;
    16421642    }
    1643     $page->param(logfor => 'reverse zone '.revName($dbh,$id));
     1643    $page->param(logfor => 'reverse zone '.$dnsdb->revName($id));
    16441644  } else {
    16451645    # Default to listing curgroup log
    1646     $page->param(logfor => 'group '.groupName($dbh,$id));
     1646    $page->param(logfor => 'group '.$dnsdb->groupName($id));
    16471647    # note that scope limitations are applied via the change-group check;
    16481648    # group log is always for the "current" group
     
    16991699
    17001700  $page->param(group => $curgroup);
    1701   $page->param(groupname => groupName($dbh,$curgroup));
    1702   $page->param(logingrp => groupName($dbh,$logingroup));
     1701  $page->param(groupname => $dnsdb->groupName($curgroup));
     1702  $page->param(logingrp => $dnsdb->groupName($logingroup));
    17031703  $page->param(logingrp_num => $logingroup);
    17041704
     
    17711771  foreach (@childlist) {
    17721772    my %row;
    1773     $row{grpname} = groupName($dbh,$_);
     1773    $row{grpname} = $dnsdb->groupName($_);
    17741774    $row{grpnum} = $_;
    17751775    $row{whereami} = $uri_self;
     
    18471847#  $page->param(group   => $DNSDB::group);
    18481848  $page->param(isgrp => 1) if $defrec eq 'y';
    1849   $page->param(parent => ($defrec eq 'y' ? groupName($dbh, $id) :
    1850         ($revrec eq 'n' ? domainName($dbh, $id) : revName($dbh, $id)) ) );
     1849  $page->param(parent => ($defrec eq 'y' ? $dnsdb->groupName($id) :
     1850        ($revrec eq 'n' ? $dnsdb->domainName($id) : $dnsdb->revName($id)) ) );
    18511851
    18521852# defaults
     
    19261926# prefill <domain> or DOMAIN in "Host" space for new records
    19271927  if ($webvar{revrec} eq 'n') {
    1928     my $domroot = ($webvar{defrec} eq 'y' ? 'DOMAIN' : domainName($dbh,$webvar{parentid}));
     1928    my $domroot = ($webvar{defrec} eq 'y' ? 'DOMAIN' : $dnsdb->domainName($webvar{parentid}));
    19291929    $page->param(name   => ($webvar{name} ? $webvar{name} : $domroot));
    19301930    $page->param(address        => $webvar{address});
     
    19361936    my $domroot = ($webvar{defrec} eq 'y' ? 'ADMINDOMAIN' : ".$config{domain}");
    19371937    $page->param(name   => ($webvar{name} ? $webvar{name} : $domroot));
    1938     my $zname = ($webvar{defrec} eq 'y' ? 'ZONE' : revName($dbh,$webvar{parentid}));
     1938    my $zname = ($webvar{defrec} eq 'y' ? 'ZONE' : $dnsdb->revName($webvar{parentid}));
    19391939    $zname =~ s|\d*/\d+$||;
    19401940    $page->param(address        => ($webvar{address} ? $webvar{address} : $zname));
     
    20392039
    20402040# fill page count and first-previous-next-last-all bits
    2041   fill_pgcount($count,($webvar{revrec} eq 'n' ? 'domains' : 'revzones'),groupName($dbh,$curgroup));
     2041  fill_pgcount($count,($webvar{revrec} eq 'n' ? 'domains' : 'revzones'),$dnsdb->groupName($curgroup));
    20422042  fill_fpnla($count);
    20432043
     
    21512151      $row{groupval} = $_;
    21522152      $row{groupactive} = ($_ == $cur);
    2153       $row{groupname} = $indent.groupName($dbh, $_);
     2153      $row{groupname} = $indent.$dnsdb->groupName($_);
    21542154      push @{$grplist}, \%row;
    21552155      getgroupdrop($_, $cur, $grplist, $indent.'&nbsp;&nbsp;&nbsp;&nbsp;');
     
    21592159  my @grouplist;
    21602160  push @grouplist, { groupval => $logingroup, groupactive => $logingroup == $curgroup,
    2161         groupname => groupName($dbh, $logingroup) };
     2161        groupname => $dnsdb->groupName($logingroup) };
    21622162  getgroupdrop($logingroup, $curgroup, \@grouplist);
    21632163
Note: See TracChangeset for help on using the changeset viewer.