Changeset 155 for trunk/DNSDB.pm


Ignore:
Timestamp:
10/26/11 18:10:09 (13 years ago)
Author:
Kris Deugau
Message:

/trunk

Tweak DNSDB::isParent slightly; treat all groups as being their own parent
Remove stale $offset fiddling in page -> bulkdomain
Add error-reporting TMPL_IF on record data page
Continued scope-checking changes:

  • rearrange group-changing check a little to allow propagating the error message without hardcoding it twice
  • handle the special case of group-change while on the default record list page
  • new sub, check_scope, to do the real checking
  • use new sub checking access to individual records (both record and parent domain/group)
  • check target for bulk domain move, as well as source domains in bulkchange
  • check AXFR target group
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r152 r155  
    14881488  return 1 if $type1 eq 'group' && $id1 == 1;
    14891489
     1490  # groups are always (a) parent of themselves
     1491  return 1 if $type1 eq 'group' && $type2 eq 'group' && $id1 == $id2;
     1492
    14901493# almost the same loop as getParents() above
    14911494  my $id = $id2;
    14921495  my $type = $type2;
    14931496  my $foundparent = 0;
    1494 my $tmp = 0;
     1497
    14951498  while (1) {
    1496 my $sql = "SELECT $par_col{$type} FROM $par_tbl{$type} WHERE $id_col{$type} = ?";
     1499    my $sql = "SELECT $par_col{$type} FROM $par_tbl{$type} WHERE $id_col{$type} = ?";
    14971500    my $result = $dbh->selectrow_hashref($sql,
    14981501        undef, ($id) ) or warn $dbh->errstr." $sql";
     
    15051508    $id = $result->{$par_col{$type}};
    15061509    $type = $par_type{$type};
    1507 last if $tmp++ > 10;
    15081510  }
    15091511
Note: See TracChangeset for help on using the changeset viewer.