| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/libexec/webmin/dnsadmin/ |
Upload File : |
#!/usr/bin/perl
# change_soa.cgi
# Saves changes to the SOA record from edit_primary.cgi
require './dns-lib.pl';
$whatfailed = "Failed to save domain";
&ReadParse();
$d = $in{domain};
# Get the domain being edited
&get_primary($d);
for($i=0; $i<@name; $i++) {
if ($type[$i] eq "SOA") { $soa = $i; last; }
}
# Check user inputs
$in{serv} =~ /^[A-Za-z0-9\-\_\.]+$/ ||
&error("$in{serv} is not a valid server hostname");
$in{serv} = &make_full($in{serv}, "$d.");
$in{mail} =~ /^[A-Za-z0-9\-\_\.]+\@[A-Za-z0-9\-\_\.]+$/ ||
&error("$in{mail} doesn't look like a valid email address");
$in{mail} =~ s/\@/\./g; $in{mail} .= ".";
$in{refresh} =~ /^[0-9]+$/ ||
&error("$in{refresh} is not a valid refresh period");
$in{retry} =~ /^[0-9]+$/ ||
&error("$in{retry} is not a valid retry period");
$in{expire} =~ /^[0-9]+$/ ||
&error("$in{expire} is not a valid expire time");
$in{min} =~ /^[0-9]+$/ ||
&error("$in{min} is not a valid minumum TTL");
# Save and bounce back
$data[$soa] = "$in{serv} $in{mail} $in{serial} $in{refresh} $in{retry} $in{expire} $in{min}";
&save_primary($d);
&redirect("edit_primary.cgi?$d");