Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r208 r209 1368 1368 } 1369 1369 1370 return ('FAIL', "TTL must be numeric") unless $ttl =~ /^\d+$/; 1371 1370 1372 my $fields = ($defrec eq 'y' ? 'group_id' : 'domain_id').",host,type,val,ttl"; 1371 1373 my $vallen = "?,?,?,?,?"; … … 1375 1377 if ($rectype == $reverse_typemap{MX} or $rectype == $reverse_typemap{SRV}) { 1376 1378 $dist = shift; 1377 return ('FAIL',"Need distance for $typemap{$rectype} record") if !defined($dist); 1379 return ('FAIL',"Distance is required for $typemap{$rectype} records") unless defined($dist); 1380 $dist =~ s/\s*//g; 1381 return ('FAIL',"Distance is required, and must be numeric") unless $dist =~ /^\d+$/; 1378 1382 $fields .= ",distance"; 1379 1383 $vallen .= ",?"; … … 1386 1390 # it just says (paraphrased) "... is prepended with _ to prevent DNS collisions" 1387 1391 return ('FAIL',"SRV records must begin with _service._protocol [$host]") 1388 if $host !~ /^_[A-Za-z]+\._[A-Za-z]+\.[a-zA-Z0-9-]+/;1392 unless $host =~ /^_[A-Za-z]+\._[A-Za-z]+\.[a-zA-Z0-9-]+/; 1389 1393 $weight = shift; 1390 1394 $port = shift; 1391 return ('FAIL',"Need weight and port for SRV record") if !defined($weight) or !defined($port); 1395 return ('FAIL',"Port and weight are required for SRV records") unless defined($weight) && defined($port); 1396 $weight =~ s/\s*//g; 1397 $port =~ s/\s*//g; 1398 return ('FAIL',"Port and weight are required, and must be numeric") 1399 unless $weight =~ /^\d+$/ && $port =~ /^\d+$/; 1392 1400 $fields .= ",weight,port"; 1393 1401 $vallen .= ",?,?"; -
trunk/dns.cgi
r207 r209 535 535 } else { 536 536 my $restr = "Added record '$webvar{name} $typemap{$webvar{type}}"; 537 $restr .= " [distance $webvar{dist }]" if $typemap{$webvar{type}} eq 'MX';538 $restr .= " [priority $webvar{dist }] [weight $webvar{weight}] [port $webvar{port}]"537 $restr .= " [distance $webvar{distance}]" if $typemap{$webvar{type}} eq 'MX'; 538 $restr .= " [priority $webvar{distance}] [weight $webvar{weight}] [port $webvar{port}]" 539 539 if $typemap{$webvar{type}} eq 'SRV'; 540 540 $restr .= " $webvar{address}', TTL $webvar{ttl}"; … … 552 552 $page->param(id => $webvar{id}); 553 553 fill_recdata(); # populate the form... er, mostly. 554 $page->param(name => $webvar{name}); 554 555 if ($config{log_failures}) { 555 556 if ($webvar{defrec} eq 'y') {
Note:
See TracChangeset
for help on using the changeset viewer.