📄 edit_group.cgi
字号:
#!/usr/local/bin/perl# edit_group.cgi# Display a form for editing or creating a grouprequire './user-lib.pl';&ReadParse();$n = $in{'num'};%access = &get_module_acl();if ($n eq "") { $access{'gcreate'}==1 || &error("You cannot create new groups"); &header($text{'gedit_title2'}, "", "create_group"); }else { @glist = &list_groups(); %group = %{$glist[$n]}; &can_edit_group(\%access, \%group) || &error("You cannot edit this group"); &header($text{'gedit_title'}, "", "edit_group"); }print "<hr><form action=\"save_group.cgi\">\n";if ($n ne "") { print "<input type=hidden name=num value=\"$n\">\n"; }print "<table border width=100%>\n";print "<tr $tb> <td><b>$text{'gedit_details'}</b></td> </tr>\n";print "<tr $cb> <td><table width=100%>\n";print "<tr> <td valign=top>",&hlink("<b>$text{'gedit_group'}</b>","ggroup"), "</td>\n";if ($n eq "") { print "<td valign=top><input name=group size=10></td>\n"; }else { print "<td valign=top><font size=+1><i>$group{'group'}", "</i></font></td>\n"; }print "<td valign=top>",&hlink("<b>$text{'gedit_gid'}</b>","ggid"),"</td>\n";if ($n eq "") { # Find the first free GID above the base setgrent(); while(@tmp = getgrent()) { $used{$tmp[2]}++; } endgrent(); $newgid = int($config{'base_gid'} > $access{'lowgid'} ? $config{'base_gid'} : $access{'lowgid'}); while($used{$newgid}) { $newgid++; } print "<td valign=top><input name=gid size=10 value='$newgid'></td>\n"; }else { print "<td valign=top><input name=gid size=10 ", "value=\"$group{'gid'}\"></td>\n"; }print "</tr>\n";print "<tr> <td valign=top>",&hlink("<b>$text{'pass'}</b>","gpasswd"),"</td>\n";printf "<td><input type=radio name=passmode value=0 %s> $text{'none2'}<br>\n", $group{'pass'} eq "" ? "checked" : "";printf "<input type=radio name=passmode value=1 %s> $text{'encrypted'}\n", $group{'pass'} eq "" ? "" : "checked";print "<input name=encpass size=13 value=\"$group{'pass'}\"><br>\n";print "<input type=radio name=passmode value=2 %s> $text{'clear'}\n";print "<input name=pass size=15></td>\n";print "<td valign=top>",&hlink("<b>$text{'gedit_members'}</b>","gmembers"), "</td>\n";print "<td><table><tr><td><textarea wrap=auto name=members rows=5 cols=10>", join("\n", split(/,/ , $group{'members'})),"</textarea></td>\n";print "<td valign=top>",&user_chooser_button("members", 1), "</td></tr></table></td> </tr>\n";print "</table></td></tr></table><p>\n";if ($n ne "") { print "<table border width=100%>\n"; print "<tr $tb> <td><b>$text{'onsave'}</b></td> </tr>\n"; print "<tr $cb> <td><table>\n"; print "<tr> <td>",&hlink($text{'chgid'},"gchgid"),"</td>\n"; print "<td><input type=radio name=chgid value=0 checked> $text{'no'}</td>\n"; print "<td><input type=radio name=chgid value=1> $text{'gedit_homedirs'}</td>\n"; print "<td><input type=radio name=chgid value=2> $text{'gedit_allfiles'}</td> </tr>\n"; print "</table></td> </tr></table><p>\n"; }if ($n ne "") { print "<table width=100%>\n"; print "<tr> <td><input type=submit value=$text{'save'}></td>\n"; print "</form><form action=\"delete_group.cgi\">\n"; print "<input type=hidden name=num value=\"$n\">\n"; print "<td align=right><input type=submit value=$text{'delete'}></td> </tr>\n"; print "</form></table><p>\n"; }else { print "<input type=submit value=$text{'create'}></form><p>\n"; }print "<hr>\n";&footer("", $text{'index_return'});
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -