- Timestamp:
- 10/09/14 13:43:07 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r666 r667 4544 4544 ## DNSDB::delRec() 4545 4545 # Delete a record. 4546 # Takes a default/live flag, forward/reverse flag, and the ID of the record to delete. 4546 4547 sub delRec { 4547 4548 $errstr = ''; … … 4564 4565 $logdata{rdns_id} = $oldrec->{rdns_id}; 4565 4566 $logdata{group_id} = $oldrec->{group_id} if $defrec eq 'y'; 4566 $logdata{group_id} = $self->parentID(id => $oldrec->{domain_id}, type => ($revrec eq 'n' ? 'domain' : 'revzone'),4567 revrec => $revrec)4567 $logdata{group_id} = $self->parentID(id => ($revrec eq 'n' ? $oldrec->{domain_id} : $oldrec->{rdns_id}), 4568 type => 'domain', revrec => $revrec) 4568 4569 if $defrec eq 'n'; 4569 4570 $logdata{entry} = "Deleted ".($defrec eq 'y' ? 'default record ' : 'record '). … … 4765 4766 my %args = @_; 4766 4767 4767 # clean up the parent-type. Set it to group if not set; coerce revzone to domain for simpler logic4768 $args{partype} = 'group' if !$args{partype};4769 $args{partype} = 'domain' if $args{partype} eq 'revzone';4770 4771 4768 # clean up defrec and revrec. default to live record, forward zone 4772 4769 $args{defrec} = 'n' if !$args{defrec}; 4773 4770 $args{revrec} = 'n' if !$args{revrec}; 4774 4771 4775 if ($par_type{$args{partype}} eq 'domain') { 4772 # clean up the parent-type. Set it to group if not set 4773 $args{partype} = 'group' if !$args{partype}; 4774 4775 # allow callers to be lazy with type 4776 $args{type} = 'revzone' if $args{type} eq 'domain' && $args{revrec} eq 'y'; 4777 4778 if ($par_type{$args{partype}} eq 'domain' || $par_type{$args{partype}} eq 'revzone') { 4776 4779 # only live records can have a domain/zone parent 4777 4780 return unless ($args{type} eq 'record' && $args{defrec} eq 'n');
Note:
See TracChangeset
for help on using the changeset viewer.