summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorbruno <bruno.stein@bluepex.com>2014-11-11 08:26:04 -0200
committerbruno <bruno.stein@bluepex.com>2014-11-11 08:26:04 -0200
commitc0c5b8cc8a6505c5d0a9f29914a107b3da04af36 (patch)
treedf622a3fcc69524e3f353273caabd0df42833960 /usr/local/www
parent0b7dbebe406f559432f928c8208b6c5cef607e22 (diff)
downloadpfsense-c0c5b8cc8a6505c5d0a9f29914a107b3da04af36.zip
pfsense-c0c5b8cc8a6505c5d0a9f29914a107b3da04af36.tar.gz
add input checkbox to remove multiple groups
Diffstat (limited to 'usr/local/www')
-rw-r--r--usr/local/www/system_groupmanager.php29
1 files changed, 28 insertions, 1 deletions
diff --git a/usr/local/www/system_groupmanager.php b/usr/local/www/system_groupmanager.php
index 04381b3..7e8fc47 100644
--- a/usr/local/www/system_groupmanager.php
+++ b/usr/local/www/system_groupmanager.php
@@ -115,6 +115,24 @@ if ($act == "edit") {
}
}
+if(isset($_POST['dellall_x'])) {
+
+ $del_groups = $_POST['delete_check'];
+
+ if(!empty($del_groups)) {
+ foreach($del_groups as $groupid) {
+ if(isset($a_group[$groupid]) && $a_group[$groupid]['scope'] != "system") {
+ conf_mount_rw();
+ local_group_del($a_group[$groupid]);
+ conf_mount_ro();
+ unset($a_group[$groupid]);
+ }
+ }
+ $savemsg = gettext("Selected groups removed successfully!");
+ write_config($savemsg);
+ }
+}
+
if (isset($_POST['save'])) {
unset($input_errors);
@@ -191,6 +209,13 @@ include("head.inc");
<script type="text/javascript">
//<![CDATA[
+function checkall_checkbox(checked) {
+ var cbs = document.getElementsByName('delete_check[]');
+ if (cbs != null)
+ for (var i = 0; i < cbs.length; i++)
+ cbs[i].checked = checked;
+}
+
function setall_selected(id) {
selbox = document.getElementById(id);
count = selbox.options.length;
@@ -451,7 +476,7 @@ function presubmit() {
<th width="25%" class="listhdrr"><?=gettext("Group name");?></th>
<th width="25%" class="listhdrr"><?=gettext("Description");?></th>
<th width="30%" class="listhdrr"><?=gettext("Member Count");?></th>
- <th width="10%" class="list"></th>
+ <th width="10%" class="list"><input type="checkbox" onClick="checkall_checkbox(this.checked)"> <?=gettext("check all")?></th>
</tr>
</thead>
<tfoot>
@@ -462,6 +487,7 @@ function presubmit() {
src="/themes/<?=$g['theme'];?>/images/icons/icon_plus.gif"
onclick="document.getElementById('act').value='<?php echo "new";?>';"
title="<?=gettext("add group");?>" />
+ <input type="image" src="/themes/<?= $g['theme'];?>/images/icons/icon_x.gif" name="dellall" title="<?=gettext('Delete selected groups')?>" onClick="return confirm('<?=gettext("Do you really want to delete selected groups?");?>')" />
</td>
</tr>
<tr>
@@ -525,6 +551,7 @@ function presubmit() {
document.getElementById('act').value='<?php echo "delgroup";?>';
return confirm('<?=gettext("Do you really want to delete this group?");?>');"
title="<?=gettext("delete group");?>" />
+ <input type='checkbox' id='check_<?=$i?>' name='delete_check[]' value='<?=$i?>' />
<?php
endif;
?>
OpenPOWER on IntegriCloud