Changeset 389
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r387 r389 3261 3261 my $id = shift; 3262 3262 3263 my $sql = "SELECT record_id,host,type,val,ttl ".($revrec eq 'n' ? ',distance,weight,port' : '').3263 my $sql = "SELECT record_id,host,type,val,ttl,location".($revrec eq 'n' ? ',distance,weight,port' : ''). 3264 3264 (($defrec eq 'y') ? ',group_id FROM ' : ',domain_id,rdns_id FROM '). 3265 3265 _rectable($defrec,$revrec)." WHERE record_id=?"; … … 3402 3402 my $val = shift; 3403 3403 my $ttl = shift; 3404 my $location = shift; 3405 $location = '' if !$location; 3404 3406 3405 3407 # prep for validation … … 3440 3442 3441 3443 # Set up database fields and bind parameters 3442 $fields .= "host,type,val,ttl, "._recparent($defrec,$revrec);3443 push @vallist, ($$host,$$rectype,$$val,$ttl,$ id);3444 $fields .= "host,type,val,ttl,location,"._recparent($defrec,$revrec); 3445 push @vallist, ($$host,$$rectype,$$val,$ttl,$location,$id); 3444 3446 my $vallen = '?'.(',?'x$#vallist); 3445 3447 … … 3468 3470 $logdata{entry} .= " [priority $dist] [weight $weight] [port $port]" 3469 3471 if $typemap{$$rectype} eq 'SRV'; 3470 $logdata{entry} .= "', TTL $ttl ";3472 $logdata{entry} .= "', TTL $ttl, location $location"; 3471 3473 3472 3474 # Allow transactions, and raise an exception on errors so we can catch it later. … … 3518 3520 my $val = shift; 3519 3521 my $ttl = shift; 3522 my $location = shift; # may be empty/null/undef depending on caller 3523 $location = '' if !$location; 3520 3524 3521 3525 # prep for validation … … 3564 3568 # Set up database fields and bind parameters. Note only the optional fields 3565 3569 # (distance, weight, port, secondary parent ID) are added in the validation call above 3566 $fields .= "host,type,val,ttl, "._recparent($defrec,$revrec);3567 push @vallist, ($$host,$$rectype,$$val,$ttl, 3570 $fields .= "host,type,val,ttl,location,"._recparent($defrec,$revrec); 3571 push @vallist, ($$host,$$rectype,$$val,$ttl,$location, 3568 3572 ($defrec eq 'y' ? $oldrec->{group_id} : ($revrec eq 'n' ? $oldrec->{domain_id} : $oldrec->{rdns_id})) ); 3569 3573 … … 3618 3622 $logdata{entry} .= " [priority $oldrec->{distance}] [weight $oldrec->{weight}] [port $oldrec->{port}]" 3619 3623 if $typemap{$oldrec->{type}} eq 'SRV'; 3620 $logdata{entry} .= "', TTL $oldrec->{ttl} \nto\n";3624 $logdata{entry} .= "', TTL $oldrec->{ttl}, location $oldrec->{location}\nto\n"; 3621 3625 # More NS special 3622 3626 if ($revrec eq 'y' && $$rectype == 2) { … … 3627 3631 $logdata{entry} .= " [distance $dist]" if $typemap{$$rectype} eq 'MX'; 3628 3632 $logdata{entry} .= " [priority $dist] [weight $weight] [port $port]" if $typemap{$$rectype} eq 'SRV'; 3629 $logdata{entry} .= "', TTL $ttl ";3633 $logdata{entry} .= "', TTL $ttl, location $location"; 3630 3634 3631 3635 local $dbh->{AutoCommit} = 0; -
trunk/dns.cgi
r388 r389 642 642 unless ($permissions{admin} || $permissions{record_create}); 643 643 644 # location check - if user does not have record_locchg, set $webvar{location} to default location for zone 645 my $parloc = getZoneLocation($dbh, $webvar{revrec}, $webvar{parentid}); 646 $webvar{location} = $parloc unless ($permissions{admin} || $permissions{record_locchg}); 647 644 648 my @recargs = ($dbh,$webvar{defrec},$webvar{revrec},$webvar{parentid}, 645 \$webvar{name},\$webvar{type},\$webvar{address},$webvar{ttl} );649 \$webvar{name},\$webvar{type},\$webvar{address},$webvar{ttl},$webvar{location}); 646 650 if ($webvar{type} == $reverse_typemap{MX} or $webvar{type} == $reverse_typemap{SRV}) { 647 651 push @recargs, $webvar{distance}; … … 701 705 unless ($permissions{admin} || $permissions{record_edit}); 702 706 707 # retain old location if user doesn't have permission to fiddle locations 708 my $oldrec = getRecLine($dbh, $webvar{defrec}, $webvar{revrec}, $webvar{id}); 709 $webvar{location} = $oldrec->{location} unless ($permissions{admin} || $permissions{record_locchg}); 710 703 711 my ($code,$msg) = updateRec($dbh,$webvar{defrec},$webvar{revrec},$webvar{id},$webvar{parentid}, 704 \$webvar{name},\$webvar{type},\$webvar{address},$webvar{ttl}, 712 \$webvar{name},\$webvar{type},\$webvar{address},$webvar{ttl},$webvar{location}, 705 713 $webvar{distance},$webvar{weight},$webvar{port}); 706 714
Note:
See TracChangeset
for help on using the changeset viewer.