Handle hostnames with upper-case letters
[webmin.git] / samba / save_copy.cgi
1 #!/usr/local/bin/perl
2 # save_copy.cgi
3 # Create a new, empty share that is a copy of an existing one
4
5 require './samba-lib.pl';
6 &ReadParse();
7
8 # check acls
9
10 &error_setup("<blink><font color=red>$text{'eacl_aviol'}</font></blink>");
11 &error("$text{'eacl_np'} $text{'eacl_pcopy'}") unless $access{'copy'};
12  
13 &error_setup($text{'savecopy_fail'});
14 &lock_file($config{'smb_conf'});
15 $in{'name'} || &error($text{'savecopy_ename'});
16 if ($in{"name"} eq "global") {
17         &error($text{'savecopy_global'});
18         }
19 if (&indexof($in{"name"}, &list_shares()) >= 0) {
20         &error(&text('savecopy_exist', $in{name}));
21         }
22 &setval("copy", $in{copy});
23 &create_share($in{name});
24 &unlock_file($config{'smb_conf'});
25 &webmin_log("copy", undef, $in{'name'}, \%in);
26 &redirect("");
27