diff options
author | Renato Botelho <renato@netgate.com> | 2015-10-12 12:29:26 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-10-12 12:29:26 -0300 |
commit | d7e5efa46134e738ae62e5c387c1e92fd803124d (patch) | |
tree | a34b0d88ae7f1b8d22f97731a39bc433fbbf85eb | |
parent | 8d070c072ec2b662f6a235cc3779fb62835dd647 (diff) | |
parent | d5161e8e059a064f8955a0676d763ad1be84ce5c (diff) | |
download | pfsense-d7e5efa46134e738ae62e5c387c1e92fd803124d.zip pfsense-d7e5efa46134e738ae62e5c387c1e92fd803124d.tar.gz |
Merge pull request #1958 from phil-davis/patch-11
-rw-r--r-- | usr/local/www/system_groupmanager.php | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/usr/local/www/system_groupmanager.php b/usr/local/www/system_groupmanager.php index 7132a45..8a80476 100644 --- a/usr/local/www/system_groupmanager.php +++ b/usr/local/www/system_groupmanager.php @@ -70,14 +70,22 @@ if ($act == "delgroup") { exit; } - conf_mount_rw(); - local_group_del($a_group[$id]); - conf_mount_ro(); - $groupdeleted = $a_group[$id]['name']; - unset($a_group[$id]); - write_config(); - $savemsg = gettext("Group")." {$groupdeleted} ". - gettext("successfully deleted")."<br />"; + $saved_groupname = $a_group[$id]['name']; + + if ($a_group[$id]['scope'] != "system") { + conf_mount_rw(); + local_group_del($a_group[$id]); + conf_mount_ro(); + unset($a_group[$id]); + write_config(); + $savemsg = gettext("Group")." {$saved_groupname} ". + gettext("successfully deleted")."<br />"; + } else { + unset($id); + unset($deletion_errors); + $deletion_errors[] = gettext("Group") . " {$saved_groupname} " . + gettext("is a system group. Deletion is not allowed."); + } } if ($act == "delpriv") { @@ -277,6 +285,8 @@ function presubmit() { <?php if ($input_errors) print_input_errors($input_errors); + if ($deletion_errors) + print_input_errors($deletion_errors); if ($savemsg) print_info_box($savemsg); ?> |