3 # Display a list of all local filesystems, and allow editing of quotas
4 # on those which have quotas turned on. The actual turning on of quotas must
5 # be done in the mount module first.
7 require './quota-lib.pl';
8 &ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, 0,
9 &help_search_link("quota", "man", "howto"));
11 $err = "as_init();
13 print "<p><b>$err</b><p>\n";
14 &ui_print_footer("/", $text{'index_return'});
18 @list = &list_filesystems();
20 print &ui_columns_start([
24 $text{'index_status'},
25 $access{'enable'} ? ( $text{'index_action'} ) : (),
27 @tds = ( "", "valign=top", "valign=top", "valign=top", "valign=top" );
30 $qc = $qc&1 if ($access{'gmode'} == 3);
32 next if (!&can_edit_filesys($f->[0]));
34 if ($qc == 1) { $msg = $text{'index_quser'}; }
35 elsif ($qc == 2) { $msg = $text{'index_qgroup'}; }
36 elsif ($qc == 3) { $msg = $text{'index_qboth'}; }
39 $chg = $text{'index_mountonly'};
43 $msg .= " $text{'index_active'}";
46 $msg .= " $text{'index_inactive'}";
50 $msg .= " $text{'index_active'}";
51 $chg = $text{'index_disable'};
54 $msg .= " $text{'index_inactive'}";
55 $chg = $text{'index_enable'};
57 if ($qn%2 == 1) { $useractive++; }
58 if ($qn > 1) { $groupactive++; }
66 push(@cols, "<a href=\"list_users.cgi?dir=".
67 &urlize($dir)."&can=",&urlize($qc),"\">$dir</a>");
70 push(@cols, "<a href=\"list_groups.cgi?dir=".
71 &urlize($dir)."&can=",&urlize($qc),"\">$dir</a>");
74 push(@cols, "<a href=\"list_users.cgi?dir=".
75 &urlize($dir)."&can=".&urlize($qc).
76 "\">$dir (users)</a><br>".
77 "<a href=\"list_groups.cgi?dir=".&urlize($dir).
78 "&can=".&urlize($qc)."\">$dir (groups)</a>");
81 push(@cols, &foreign_call("mount", "fstype_name", $f->[2]));
82 push(@cols, &foreign_call("mount", "device_name", $f->[1]));
84 if ($access{'enable'}) {
86 push(@cols, "<a href=\"activate.cgi?dir=$dir&active=$qn&mode=$qc\">$chg</a>");
92 print &ui_columns_row(\@cols, \@tds);
94 print &ui_columns_end();
97 print "<b>$text{'index_nosupport'}</b><p>\n";
98 if (&foreign_available("mount")) {
99 print &text('index_mountmod', "../mount/"),"<p>\n";
103 # Buttons to edit and specific user or group
104 if ($useractive || $groupactive) {
106 print &ui_buttons_start();
109 print &ui_buttons_row("user_filesys.cgi", $text{'index_euser'},
110 $text{'index_euserdesc'}, undef,
111 &ui_user_textbox("user"));
114 print &ui_buttons_row("group_filesys.cgi", $text{'index_egroup'},
115 $text{'index_egroupdesc'}, undef,
116 &ui_group_textbox("group"));
118 if ($useractive || $groupactive) {
119 print &ui_buttons_end();
122 &ui_print_footer("/", $text{'index_return'});