Changeset 512


Ignore:
Timestamp:
05/14/13 17:00:24 (11 years ago)
Author:
Kris Deugau
Message:

/trunk

Minor code-review cleanup

  • remove a die()-on-SELECT-error in getPermissions() (no other get* sub die()s)
  • Fail to delete a group if there are still reverse zones. This would probably have sucessfully failed anyway, but the error message would be a lot less friendly.
  • add . to the sortby character check in getRecList() since this may include table.column sort specifications
  • remove a duplicate check on logtype in getLogCount()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r510 r512  
    15961596  my $sth = $dbh->prepare($sql);
    15971597
     1598##fixme:  this should be trapped
    15981599  $sth->execute($id) or die "argh: ".$sth->errstr;
    15991600
     
    24832484    my ($domcnt) = $dbh->selectrow_array("SELECT count(*) FROM domains WHERE group_id=?", undef, ($groupid));
    24842485    die "$domcnt domains still in group\n" if $domcnt;
     2486    my ($revcnt) = $dbh->selectrow_array("SELECT count(*) FROM revzones WHERE group_id=?", undef, ($groupid));
     2487    die "$revcnt reverse zones still in group\n" if $revcnt;
    24852488    my ($usercnt) = $dbh->selectrow_array("SELECT count(*) FROM users WHERE group_id=?", undef, ($groupid));
    24862489    die "$usercnt users still in group\n" if $usercnt;
     
    35813584  $defsort = 'val' if $args{revrec} eq 'y';      # default sort by IP on revzone record list
    35823585  $args{sortby} = $defsort if !$args{revrec};
    3583   $args{sortby} = $defsort if $args{sortby} !~ /^[\w_.]+$/;
     3586  $args{sortby} = $defsort if $args{sortby} !~ /^[\w_,.]+$/;
    35843587  $args{offset} = 0 if !$args{offset} || $args{offset} !~ /^(?:all|\d+)$/; 
    35853588  my $perpage = ($args{nrecs} ? $args{nrecs} : $config{perpage});
     
    41024105  $args{logtype} = 'domain' if $args{logtype} eq 'dom';         # hack pthui
    41034106  return if !grep /^$args{logtype}$/, ('group', 'domain', 'revzone', 'user');
    4104 
    4105   $args{logtype} = 'revzone' if $args{logtype} eq 'rdns';       # hack pthui
    41064107
    41074108  my $sql = "SELECT count(*) FROM log ".
Note: See TracChangeset for help on using the changeset viewer.