Changeset 272 for trunk/dns.cgi
- Timestamp:
- 03/09/12 18:03:29 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r270 r272 688 688 $page->param(port => $recdata->{port}); 689 689 $page->param(ttl => $recdata->{ttl}); 690 $page->param(typelist => getTypelist($dbh, $webvar{revrec}, $ webvar{type}));690 $page->param(typelist => getTypelist($dbh, $webvar{revrec}, $recdata->{type})); 691 691 692 692 } elsif ($webvar{recact} eq 'update') { … … 695 695 unless ($permissions{admin} || $permissions{record_edit}); 696 696 697 # prevent out-of-domain records from getting added by appending the domain, or DOMAIN for default records698 my $pname = ($webvar{defrec} eq 'y' ? 'DOMAIN' : domainName($dbh,$webvar{parentid}));699 $webvar{name} =~ s/\.*$/\.$pname/ if $webvar{name} !~ /$pname$/;697 # # prevent out-of-domain records from getting added by appending the domain, or DOMAIN for default records 698 # my $pname = ($webvar{defrec} eq 'y' ? 'DOMAIN' : domainName($dbh,$webvar{parentid})); 699 # $webvar{name} =~ s/\.*$/\.$pname/ if $webvar{name} !~ /$pname$/; 700 700 701 701 # get current/previous record info so we can log "updated 'foo A 1.2.3.4' to 'foo A 2.3.4.5'" 702 702 my $oldrec = getRecLine($dbh, $webvar{defrec}, $webvar{revrec}, $webvar{id}); 703 703 704 my ($code,$msg) = updateRec($dbh,$webvar{defrec},$webvar{ id},705 $webvar{name},$webvar{type},$webvar{address},$webvar{ttl},704 my ($code,$msg) = updateRec($dbh,$webvar{defrec},$webvar{revrec},$webvar{id},$webvar{parentid}, 705 \$webvar{name},\$webvar{type},\$webvar{address},$webvar{ttl}, 706 706 $webvar{distance},$webvar{weight},$webvar{port}); 707 707 708 if ($code eq 'OK' ) {709 ##fixme: retrieve old record info for full logging of change 708 if ($code eq 'OK' || $code eq 'WARN') { 709 my $restr; 710 710 if ($webvar{defrec} eq 'y') { 711 my$restr = "Updated default record from '$oldrec->{host} $typemap{$oldrec->{type}} $oldrec->{val}', TTL $oldrec->{ttl}\n".711 $restr = "Updated default record from '$oldrec->{host} $typemap{$oldrec->{type}} $oldrec->{val}', TTL $oldrec->{ttl}\n". 712 712 "to '$webvar{name} $typemap{$webvar{type}} $webvar{address}', TTL $webvar{ttl}"; 713 713 logaction(0, $session->param("username"), $webvar{parentid}, $restr); 714 changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}, resultmsg => $restr);715 714 } else { 716 my$restr = "Updated record from '$oldrec->{host} $typemap{$oldrec->{type}} $oldrec->{val}', TTL $oldrec->{ttl}\n".715 $restr = "Updated record from '$oldrec->{host} $typemap{$oldrec->{type}} $oldrec->{val}', TTL $oldrec->{ttl}\n". 717 716 "to '$webvar{name} $typemap{$webvar{type}} $webvar{address}', TTL $webvar{ttl}"; 718 717 logaction($webvar{parentid}, $session->param("username"), … … 720 719 revrec => $webvar{revrec}, partype => 'group')), 721 720 $restr); 722 changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}, resultmsg => $restr); 723 } 721 } 722 changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}, 723 revrec => $webvar{revrec}, resultmsg => $restr, warnmsg => ($code ne 'OK' ? $msg : '')); 724 724 } else { 725 725 $page->param(failed => 1); … … 1808 1808 # than set them locally everywhere. 1809 1809 foreach my $sessme ('resultmsg','warnmsg','errmsg') { 1810 if ($params{$sessme}) { 1810 if (my $tmp = $params{$sessme}) { 1811 $tmp =~ s|\n|<br />\n|g; 1811 1812 $session->param($sessme, $params{$sessme}); 1812 1813 delete $params{$sessme};
Note:
See TracChangeset
for help on using the changeset viewer.