Handle hostnames with upper-case letters
[webmin.git] / quota / edit_user_mass.cgi
1 #!/usr/local/bin/perl
2 # Display a form for updating multiple user quotas on a filesystem
3
4 require './quota-lib.pl';
5 &ReadParse();
6 $fs = $in{'dir'};
7 @d = split(/\0/, $in{'d'});
8 foreach $u (@d) {
9         &can_edit_user($u) ||
10                 &error(&text('euser_eallowus', $u));
11         }
12 $access{'ro'} && &error(&text('euser_eallowus', $u));
13 &can_edit_filesys($fs) ||
14         &error($text{'euser_eallowfs'});
15 &ui_print_header(undef, $text{'umass_title'}, "", "edit_user_mass");
16
17 $bsize = &block_size($fs);
18
19 print &text('umass_count', scalar(@d)),"<p>\n";
20 print &ui_form_start("save_user_mass.cgi", "post");
21 foreach $u (@d) {
22         print &ui_hidden("d", $u),"\n";
23         }
24 print &ui_hidden("dir", $fs),"\n";
25 print &ui_table_start($text{'umass_header'}, undef, 2);
26
27 foreach $t ('sblocks', 'hblocks', 'sfiles', 'hfiles') {
28         print &ui_table_row($text{'umass_'.$t},
29                 &ui_radio($t.'_def', 0,
30                  [ [ 0, $text{'umass_leave'} ],
31                    [ 1, $text{'umass_unlimited'} ],
32                    [ 2, $text{'umass_set'}." ".
33                         ($t =~ /blocks$/ ? &quota_inputbox($t, "", $bsize)
34                                          : &ui_textbox($t, "", 10)) ] ]));
35         }
36
37 print &ui_table_end();
38 print &ui_form_end([ [ "ok", $text{'umass_ok'} ] ]);
39
40 &ui_print_footer("list_users.cgi?dir=".&urlize($fs), $text{'euser_ureturn'});
41