Changeset 234 for trunk/dns.cgi
- Timestamp:
- 02/16/12 16:14:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r227 r234 486 486 $session->clear('resultmsg'); 487 487 } 488 if ($session->param('warnmsg')) { 489 $page->param(warnmsg => $session->param('warnmsg')); 490 $session->clear('warnmsg'); 491 } 488 492 if ($session->param('errmsg')) { 489 493 $page->param(errmsg => $session->param('errmsg')); … … 531 535 unless ($permissions{admin} || $permissions{record_create}); 532 536 533 ##fixme: this should probably go in DNSDB::addRec(), need to ponder what to do about PTR and friends534 # prevent out-of-domain records from getting added by appending the domain, or DOMAIN for default records535 # my $pname = ($webvar{defrec} eq 'y' ? 'DOMAIN' : domainName($dbh,$webvar{parentid}));536 # $webvar{name} =~ s/\.*$/\.$pname/ if $webvar{name} !~ /$pname$/;537 538 537 my @recargs = ($dbh,$webvar{defrec},$webvar{revrec},$webvar{parentid}, 539 $webvar{name}, $webvar{type},$webvar{address},$webvar{ttl});538 $webvar{name},\$webvar{type},$webvar{address},$webvar{ttl}); 540 539 if ($webvar{type} == $reverse_typemap{MX} or $webvar{type} == $reverse_typemap{SRV}) { 541 540 push @recargs, $webvar{distance}; … … 548 547 my ($code,$msg) = addRec(@recargs); 549 548 550 if ($code eq 'OK') { 549 if ($code eq 'OK' || $code eq 'WARN') { 550 my $restr; 551 551 if ($webvar{defrec} eq 'y') { 552 my$restr = "Added default record '$webvar{name} $typemap{$webvar{type}}";552 $restr = "Added default record '$webvar{name} $typemap{$webvar{type}}"; 553 553 $restr .= " [distance $webvar{distance}]" if $typemap{$webvar{type}} eq 'MX'; 554 554 $restr .= " [priority $webvar{distance}] [weight $webvar{weight}] [port $webvar{port}]" … … 556 556 $restr .= " $webvar{address}', TTL $webvar{ttl}"; 557 557 logaction(0, $session->param("username"), $webvar{parentid}, $restr); 558 changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}, resultmsg => $restr);559 558 } else { 560 my$restr = "Added record '$webvar{name} $typemap{$webvar{type}}";559 $restr = "Added record '$webvar{name} $typemap{$webvar{type}}"; 561 560 $restr .= " [distance $webvar{distance}]" if $typemap{$webvar{type}} eq 'MX'; 562 561 $restr .= " [priority $webvar{distance}] [weight $webvar{weight}] [port $webvar{port}]" … … 564 563 $restr .= " $webvar{address}', TTL $webvar{ttl}"; 565 564 logaction($webvar{parentid}, $session->param("username"), parentID($webvar{parentid}, 'dom', 'group'), $restr); 566 changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}, resultmsg => $restr); 567 } 565 } 566 my %pageparams = (page => "reclist", id => $webvar{parentid}, 567 defrec => $webvar{defrec}, revrec => $webvar{revrec}); 568 $pageparams{warnmsg} = $msg."<br><br>\n".$restr if $code eq 'WARN'; 569 $pageparams{resultmsg} = $restr if $code eq 'OK'; 570 changepage(%pageparams); 568 571 } else { 569 572 $page->param(failed => 1); … … 574 577 $page->param(parentid => $webvar{parentid}); 575 578 $page->param(defrec => $webvar{defrec}); 579 $page->param(revrec => $webvar{revrec}); 576 580 $page->param(id => $webvar{id}); 581 $page->param(fwdzone => $webvar{revrec} eq 'n'); 577 582 fill_recdata(); # populate the form... er, mostly. 578 583 $page->param(name => $webvar{name});
Note:
See TracChangeset
for help on using the changeset viewer.