📄 user_grace_form.cgi
字号:
#!/usr/local/bin/perl# user_grace_form.cgi# Display a form for editing user grace times for some filesystemrequire './quota-lib.pl';&ReadParse();$access{'ugrace'} && &can_edit_filesys($in{'filesys'}) || &error("You cannot edit grace times on this filesystem");&header("Grace Times", "", "user_grace");print "<hr>\n";print "Each filesystem has a grace time for block and file quotas. The\n";print "grace time determines how long a user can remain over the soft limit\n";print "before no more files are allowed to be created. <p>\n";@gr = &get_user_grace($in{'filesys'});print "<form action=user_grace_save.cgi>\n";print "<input type=hidden name=filesys value=\"$in{'filesys'}\">\n";print "<table border width=100%>\n";print "<tr $tb> <td colspan=2><b>User Grace Times for ", "<tt>$in{'filesys'}</tt></b></td></tr>\n";print "<tr $cb> <td width=20%><b>For block quota</b></td> <td>\n";if (&default_grace()) { printf "<input type=radio name=bdef value=1 %s> Default \n", $gr[0] ? "" : "checked"; printf "<input type=radio name=bdef value=0 %s>\n", $gr[0] ? "checked" : ""; }print "<input name=btime size=6 value=\"$gr[0]\">";&select_units("bunits", $gr[1]);print "</td> </tr>\n";print "<tr $cb> <td width=20%><b>For file quota</b></td> <td>\n";if (&default_grace()) { printf "<input type=radio name=fdef value=1 %s> Default \n", $gr[2] ? "" : "checked"; printf "<input type=radio name=fdef value=0 %s>\n", $gr[2] ? "checked" : ""; }print "<input name=ftime size=6 value=\"$gr[2]\">";&select_units("funits", $gr[3]);print "</td> </tr>\n";print "</table><p>\n";print "<input type=submit value=Update></form>\n";print "<hr>\n";&footer("list_users.cgi?$in{'filesys'}", "user list");sub select_units{@uarr = &grace_units();print "<select name=$_[0]>\n";for($i=0; $i<@uarr; $i++) { printf "<option value=$i %s>$uarr[$i]\n", $i == $_[1] ? "selected" : ""; }print "</select>\n";}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -