mirror of
https://github.com/webmin/webmin.git
synced 2026-02-17 04:02:15 +00:00
Merge pull request #116 from nawawi/master
ui-lib conversion -> itsecur-firewall
This commit is contained in:
@@ -21,62 +21,60 @@ else {
|
||||
$in{'idx'} = $group->{'index'};
|
||||
}
|
||||
}
|
||||
print "<hr>\n";
|
||||
print &ui_hr();
|
||||
|
||||
print "<form action=save_group.cgi>\n";
|
||||
print "<input type=hidden name=new value='$in{'new'}'>\n";
|
||||
print "<input type=hidden name=idx value='$in{'idx'}'>\n";
|
||||
print "<input type=hidden name=from value='$in{'from'}'>\n";
|
||||
print "<table border>\n";
|
||||
print "<tr $tb> <td><b>$text{'group_header'}</b></td> </tr>\n";
|
||||
print "<tr $cb> <td><table>\n";
|
||||
print &ui_form_start("save_group.cgi", "post");
|
||||
print &ui_hidden("new", $in{'new'});
|
||||
print &ui_hidden("idx", $in{'idx'});
|
||||
print &ui_hidden("from", $in{'from'});
|
||||
print &ui_table_start($text{'group_header'}, undef, 2);
|
||||
|
||||
print "<tr> <td><b>$text{'group_name'}</b></td>\n";
|
||||
printf "<td><input name=name size=20 value='%s'></td> </tr>\n",
|
||||
$group->{'name'};
|
||||
print &ui_table_row($text{'group_name'},
|
||||
&ui_textbox("name", $group->{'name'}, 20) );
|
||||
|
||||
print "<tr> <td valign=top><b>$text{'group_members'}</b></td>\n";
|
||||
print "<td><table>\n";
|
||||
my $tx = "";
|
||||
$tx .= &ui_columns_start(undef);
|
||||
$i = 0;
|
||||
foreach $m (( grep { !/\!?\@/ } @{$group->{'members'}} ),
|
||||
$blank, $blank, $blank, $blank, $blank, $blank) {
|
||||
$neg = ($m =~ s/^\!//);
|
||||
print "<input name=member_$i size=40 value='$m'>\n";
|
||||
print "<input type=checkbox name=neg_$i value=! ",
|
||||
$neg ? "checked" : "","> $text{'group_neg'}<br>\n";
|
||||
my @cols;
|
||||
push(@cols, &ui_textbox("member_".$i, $m, 40) );
|
||||
push(@cols, &ui_checkbox("neg_".$i, "!", $text{'group_neg'}, ($neg ? 1 : 0 ) ) );
|
||||
$tx .= &ui_columns_row(\@cols);
|
||||
$i++;
|
||||
}
|
||||
print "</table>\n";
|
||||
print "<input type=checkbox name=resolv value=1> $text{'group_resolv'}\n";
|
||||
print "</td> </tr>\n";
|
||||
$tx .= &ui_columns_row([ &ui_checkbox("resolv", 1, $text{'group_resolv'}) ], ["colspan=2"]);
|
||||
$tx .= ui_columns_end();
|
||||
|
||||
print &ui_table_row($text{'group_members'}, $tx);
|
||||
|
||||
# Show member groups
|
||||
print "<tr> <td valign=top><b>$text{'group_members2'}</b></td>\n";
|
||||
print "<td><table>\n";
|
||||
$i = 0;
|
||||
$tx = &ui_columns_start(undef);
|
||||
foreach $m (( grep { /\!?\@/ } @{$group->{'members'}} ),
|
||||
$blank, $blank, $blank, $blank, $blank, $blank) {
|
||||
$neg = ($m =~ s/^\!//);
|
||||
$m =~ s/^\@//;
|
||||
print "<tr> <td>\n";
|
||||
print &group_input("group_$i", $m, 1);
|
||||
print "</td> </tr>\n";
|
||||
$tx .= &ui_columns_row([&group_input("group_$i", $m, 1)]);
|
||||
$i++;
|
||||
}
|
||||
print "</table></td> </tr>\n";
|
||||
$tx .= ui_columns_end();
|
||||
print &ui_table_row($text{'group_members2'}, $tx);
|
||||
|
||||
print &ui_table_end();
|
||||
|
||||
print "</table></td></tr></table>\n";
|
||||
if ($in{'new'}) {
|
||||
print "<input type=submit value='$text{'create'}'>\n";
|
||||
print &ui_submit($text{'create'});
|
||||
}
|
||||
else {
|
||||
print "<input type=submit value='$text{'save'}'>\n";
|
||||
print "<input type=submit name=delete value='$text{'delete'}'>\n";
|
||||
print &ui_submit($text{'save'});
|
||||
print &ui_submit($text{'delete'}, "delete");
|
||||
}
|
||||
print "</form>\n";
|
||||
print &ui_form_end(undef,undef,1);
|
||||
&can_edit_disable("groups");
|
||||
|
||||
print "<hr>\n";
|
||||
print &ui_hr();
|
||||
$from = $in{'from'} || "groups";
|
||||
&footer("list_${from}.cgi", $text{$from.'_return'});
|
||||
|
||||
|
||||
@@ -50,10 +50,9 @@ if (defined(&theme_icons_table)) {
|
||||
&theme_icons_table(@_);
|
||||
return;
|
||||
}
|
||||
local ($i, $need_tr);
|
||||
local $cols = $_[3] ? $_[3] : 4;
|
||||
local $per = int(100.0 / $cols);
|
||||
print "<table width=100% cellpadding=5>\n";
|
||||
my ($i, $need_tr);
|
||||
my $cols = $_[3] ? $_[3] : 4;
|
||||
my $per = int(100.0 / $cols);
|
||||
print &ui_table_start(undef,"width=100% cellpadding=5",2);
|
||||
for($i=0; $i<@{$_[0]}; $i++) {
|
||||
if ($i%$cols == 0) { print "<tr>\n"; }
|
||||
|
||||
@@ -6,35 +6,31 @@ require './itsecur-lib.pl';
|
||||
&can_use_error("groups");
|
||||
&header($text{'groups_title'}, "",
|
||||
undef, undef, undef, undef, &apply_button());
|
||||
print "<hr>\n";
|
||||
print &ui_hr();
|
||||
|
||||
my @groups = &list_groups();
|
||||
my $edit = &can_edit("groups");
|
||||
|
||||
@groups = &list_groups();
|
||||
$edit = &can_edit("groups");
|
||||
if (@groups) {
|
||||
print "<a href='edit_group.cgi?new=1'>$text{'groups_add'}</a><br>\n"
|
||||
if ($edit);
|
||||
print "<table border>\n";
|
||||
print "<tr $tb> <td><b>$text{'group_name'}</b></td> ",
|
||||
"<td><b>$text{'group_members'}</b></td> </tr>\n";
|
||||
foreach $g (@groups) {
|
||||
print "<tr $cb>\n";
|
||||
print "<td><a href='edit_group.cgi?idx=$g->{'index'}'>",
|
||||
"$g->{'name'}</a></td>\n";
|
||||
@mems = @{$g->{'members'}};
|
||||
print &ui_link("edit_group.cgi?new=1", $text{'groups_add'}) if ($edit);
|
||||
print &ui_columns_start([$text{'group_name'}, $text{'group_members'}]);
|
||||
foreach my $g (@groups) {
|
||||
my @cols_row;
|
||||
my $tx = "";
|
||||
my $link = &ui_link("edit_group.cgi?idx=".$g->{'index'}, $g->{'name'});
|
||||
push(@cols_row, ( $edit ? $link : $g->{'name'} ) );
|
||||
my @mems = @{$g->{'members'}};
|
||||
if (@mems > 5) {
|
||||
@mems = (@mems[0..4], "...");
|
||||
}
|
||||
print "<td>",join(" , ",
|
||||
map { &group_name($_) } @mems),"</td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</table>\n";
|
||||
@mems = (@mems[0..4], "...");
|
||||
}
|
||||
push(@cols_row, join(" , ", map { &group_name($_) } @mems) );
|
||||
print &ui_columns_row(\@cols_row);
|
||||
}
|
||||
print &ui_columns_end();
|
||||
}
|
||||
else {
|
||||
print "<b>$text{'groups_none'}</b><p>\n";
|
||||
}
|
||||
print "<a href='edit_group.cgi?new=1'>$text{'groups_add'}</a><p>\n"
|
||||
if ($edit);
|
||||
|
||||
print "<hr>\n";
|
||||
print &ui_link("edit_group.cgi?new=1", $text{'groups_add'}) if ($edit);
|
||||
print &ui_hr();
|
||||
&footer("", $text{'index_return'});
|
||||
|
||||
Reference in New Issue
Block a user