Changeset 614
- Timestamp:
- 04/22/14 18:01:10 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r613 r614 3763 3763 $sql .= "WHERE "._recparent($args{defrec},$args{revrec})." = ?"; 3764 3764 $sql .= " AND NOT r.type=$reverse_typemap{SOA}"; 3765 # if ($self->{showrev_arpa} eq 'zone' || $self->{showrev_arpa} eq 'all') { 3766 # Just In Case the UI is using formal .arpa notation, and someone enters something reversed, 3767 # we want to match both the formal and natural zone name 3768 $sql .= " AND (r.host ~* ? OR r.val ~* ? OR r.host ~* ? OR r.val ~* ?)" if $args{filter}; 3769 my $tmp = join('.',reverse(split(/\./,$args{filter}))); 3770 push @bindvars, ($tmp, $tmp) if $args{filter}; 3771 # } else { 3772 # $sql .= " AND (r.host ~* ? OR r.val ~* ?)" if $args{filter}; 3773 # } 3765 if ($args{filter}) { 3766 $sql .= " AND (r.host ~* ? OR r.val ~* ? OR r.host ~* ? OR r.val ~* ?)"; 3767 my $tmp = join('.',reverse(split(/\./,$args{filter}))); 3768 push @bindvars, ($tmp, $tmp); 3769 } 3774 3770 $sql .= " ORDER BY $newsort $args{sortorder}"; 3775 3771 # ensure consistent ordering by sorting on record_id too … … 3818 3814 " WHERE "._recparent($defrec,$revrec)."=? ". 3819 3815 "AND NOT type=$reverse_typemap{SOA}"; 3820 # if ($self->{showrev_arpa} eq 'zone' || $self->{showrev_arpa} eq 'all') { 3821 # Just In Case the UI is using formal .arpa notation, and someone enters something reversed, 3822 # we want to match both the formal and natural zone name 3823 $sql .= " AND (host ~* ? OR val ~* ? OR host ~* ? OR val ~* ?)" if $filter; 3824 my $tmp = join('.',reverse(split(/\./,$filter))); 3825 push @bindvars, ($tmp, $tmp) if $filter; 3826 # } else { 3827 # $sql .= " AND (host ~* ? OR val ~* ?)" if $filter; 3828 # } 3816 if ($args{filter}) { 3817 $sql .= " AND (r.host ~* ? OR r.val ~* ? OR r.host ~* ? OR r.val ~* ?)"; 3818 my $tmp = join('.',reverse(split(/\./,$args{filter}))); 3819 push @bindvars, ($tmp, $tmp); 3820 } 3821 $sql .= " AND (host ~* ? OR val ~* ? OR host ~* ? OR val ~* ?)" if $filter; 3822 my $tmp = join('.',reverse(split(/\./,$filter))); 3823 push @bindvars, ($tmp, $tmp) if $filter; 3829 3824 3830 3825 my ($count) = $dbh->selectrow_array($sql, undef, (@bindvars) );
Note:
See TracChangeset
for help on using the changeset viewer.