Handle hostnames with upper-case letters
[webmin.git] / dnsadmin / save_text.cgi
1 #!/usr/local/bin/perl
2 # save_text.cgi
3 # Save a manually edit zone file
4
5 require './dns-lib.pl';
6 &ReadParseMime();
7 %access = &get_module_acl();
8 $zconf = &get_config()->[$in{'index'}];
9 &can_edit_zone(\%access, $zconf->{'values'}->[0]) ||
10         &error("You are not allowed to edit this zone");
11 $file = &absolute_path($zconf->{'values'}->[1]);
12
13 $in{'text'} =~ s/\r//g;
14 &lock_file($file);
15 open(FILE, ">$file");
16 print FILE $in{'text'};
17 close(FILE);
18 &unlock_file($file);
19 &webmin_log("text", undef, $zconf->{'values'}->[0], { 'file' => $file } );
20 &redirect("edit_master.cgi?index=$in{'index'}");
21