diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-11-13 15:23:18 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-11-13 15:23:18 -0200 |
commit | 99b7f4b222642514183510f98bd6870646cc6760 (patch) | |
tree | f7ae9c4874a62b4f39d2deef78b32c19e23efdbd | |
parent | 98d11ee7aa7d1e80dd75502b2a577f472ae66e1d (diff) | |
parent | b95a96ecb4c88b73d33a8ee38963303e40b6f398 (diff) | |
download | pfsense-99b7f4b222642514183510f98bd6870646cc6760.zip pfsense-99b7f4b222642514183510f98bd6870646cc6760.tar.gz |
Merge pull request #1335 from brunostein/remove_multiple_groups
-rw-r--r-- | usr/local/www/system_groupmanager.php | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/usr/local/www/system_groupmanager.php b/usr/local/www/system_groupmanager.php index e6230aa..5b91179 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); @@ -188,6 +206,7 @@ include("head.inc"); <body link="#000000" vlink="#000000" alink="#000000" onload="<?= $jsevents["body"]["onload"] ?>"> <?php include("fbegin.inc"); ?> +<script type="text/javascript" src="/javascript/row_toggle.js"></script> <script type="text/javascript"> //<![CDATA[ @@ -458,6 +477,7 @@ function presubmit() { <table class="sortable" width="100%" border="0" cellpadding="0" cellspacing="0" summary=""> <thead> <tr> + <th width="5%" class="list"> </th> <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> @@ -466,16 +486,17 @@ function presubmit() { </thead> <tfoot> <tr> - <td class="list" colspan="3"></td> + <td class="list" colspan="4"></td> <td class="list"> <input type="image" name="addcert" width="17" height="17" border="0" 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> - <td colspan="3"> + <td colspan="4"> <p> <?=gettext("Additional webConfigurator groups can be added here. Group permissions can be assigned which are inherited by users who are members of the group. @@ -499,8 +520,13 @@ function presubmit() { ?> <tr ondblclick="document.getElementById('act').value='<?php echo "edit";?>'; document.getElementById('groupid').value='<?=$i;?>'; - document.iform2.submit();"> - <td class="listlr"> + document.iform2.submit();" id="fr<?=$i?>"> + <td class="list" id="frd<?=$i?>"> + <?php if($group['scope'] != "system") : ?> + <input type="checkbox" id="frc<?=$i?>" onclick="fr_bgcolor(<?=$i?>)" name="delete_check[]" value="<?=$i?>" /> + <?php endif; ?> + </td> + <td class="listlr" id="frd<?=$i?>" onclick="fr_toggle(<?=$i?>)"> <table border="0" cellpadding="0" cellspacing="0" summary=""> <tr> <td align="left" valign="middle"> @@ -512,10 +538,10 @@ function presubmit() { </tr> </table> </td> - <td class="listr"> + <td class="listr" id="frd<?=$i?>" onclick="fr_toggle(<?=$i?>)"> <?=htmlspecialchars($group['description']);?> </td> - <td class="listbg"> + <td class="listbg" onclick="fr_toggle(<?=$i?>)"> <?=$groupcount;?> </td> <td valign="middle" class="list nowrap"> |