Handle hostnames with upper-case letters
[webmin.git] / quota / activate.cgi
1 #!/usr/local/bin/perl
2 # activate.cgi
3 # Turn quotas on or off for some filesystem
4
5 require './quota-lib.pl';
6 &ReadParse();
7 &can_edit_filesys($in{'dir'}) && $access{'enable'} ||
8         &error($text{'activate_eallow'});
9
10 if ($in{'active'} == 0) {
11         # Turn on quotas
12         $whatfailed = $text{'activate_eon'};
13         if ($error = &quotaon($in{'dir'}, $in{'mode'})) {
14                 &error($error);
15                 }
16         &webmin_log("activate", undef, $in{'dir'}, \%in);
17         }
18 else {
19         # Turn off quotas
20         $whatfailed = $text{'activate_eoff'};
21         if ($error = &quotaoff($in{'dir'}, $in{'mode'})) {
22                 &error($error);
23                 }
24         &webmin_log("deactivate", undef, $in{'dir'}, \%in);
25         }
26 &redirect("");
27