diff --git a/usr/local/www/system_groupmanager.php b/usr/local/www/system_groupmanager.php
index 7132a45005..9cb7513b5a 100644
--- a/usr/local/www/system_groupmanager.php
+++ b/usr/local/www/system_groupmanager.php
@@ -60,10 +60,10 @@ $a_group = &$config['system']['group'];
unset($id);
if (isset($_POST['groupid']) && is_numericint($_POST['groupid']))
$id = $_POST['groupid'];
+elseif (isset($_GET['groupid']) && is_numericint($_GET['groupid']))
+ $id = $_GET['groupid'];
-$act = (isset($_POST['act']) ? $_POST['act'] : '');
-
-if ($act == "delgroup") {
+if ($_POST['act'] == "delgroup") {
if (!isset($id) || !isset($_POST['groupname']) || !isset($a_group[$id]) || ($_POST['groupname'] != $a_group[$id]['name'])) {
pfSenseHeader("system_groupmanager.php");
@@ -80,31 +80,23 @@ if ($act == "delgroup") {
gettext("successfully deleted")."
";
}
-if ($act == "delpriv") {
+if ($_GET['act'] == "edit") {
+ // This used to be a separate act=delpriv
+ if (isset($a_group[$id]) && !empty($_POST['delpriv'])) {
+ foreach ($_POST['delpriv'] as $i)
+ unset($a_group[$id]['priv'][ $i ]);
- if (!isset($id) || !isset($a_group[$id])) {
- pfSenseHeader("system_groupmanager.php");
- exit;
- }
-
- $privdeleted = $priv_list[$a_group[$id]['priv'][$_POST['privid']]]['name'];
- unset($a_group[$id]['priv'][$_POST['privid']]);
-
- if (is_array($a_group[$id]['member'])) {
- foreach ($a_group[$id]['member'] as $uid) {
- $user = getUserEntryByUID($uid);
- if ($user)
- local_user_set($user);
+ if (is_array($a_group[$id]['member'])) {
+ foreach ($a_group[$id]['member'] as $uid) {
+ $user = getUserEntryByUID($uid);
+ if ($user)
+ local_user_set($user);
+ }
}
+
+ write_config();
}
- write_config();
- $act = "edit";
- $savemsg = gettext("Privilege")." {$privdeleted} ".
- gettext("successfully deleted")."
";
-}
-
-if ($act == "edit") {
if (isset($id) && isset($a_group[$id])) {
$pconfig['name'] = $a_group[$id]['name'];
$pconfig['gid'] = $a_group[$id]['gid'];
@@ -115,26 +107,7 @@ 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);
$pconfig = $_POST;
@@ -202,384 +175,164 @@ if (isset($_POST['save'])) {
include("head.inc");
+if ($input_errors)
+ print_input_errors($input_errors);
+if ($savemsg)
+ print_info_box($savemsg);
+
+$tab_array = array();
+$tab_array[] = array(gettext("Users"), false, "system_usermanager.php");
+$tab_array[] = array(gettext("Groups"), true, "system_groupmanager.php");
+$tab_array[] = array(gettext("Settings"), false, "system_usermanager_settings.php");
+$tab_array[] = array(gettext("Servers"), false, "system_authservers.php");
+display_top_tabs($tab_array);
+
+if (!($_GET['act'] == "new" || $_GET['act'] == "edit"))
+{
?>
+
| =gettext("Group name")?> | +=gettext("Description")?> | +=gettext("Member Count")?> | ++ |
|---|---|---|---|
| + =htmlspecialchars($group['name'])?> + | ++ =htmlspecialchars($group['description'])?> + | ++ =$groupcount?> + | ++ edit + + delete + + | +
| - - | -
|
-
-
-
-
-
-
-
-
- |
-