From d61309a07ce3fd295cb4f9903b4c62245facfdd4 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 17 Dec 2015 16:38:25 +0545 Subject: Code style system_* --- src/usr/local/www/system_groupmanager.php | 48 ++++++++++++++++--------------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'src/usr/local/www/system_groupmanager.php') diff --git a/src/usr/local/www/system_groupmanager.php b/src/usr/local/www/system_groupmanager.php index b3e0444..a934ad3 100644 --- a/src/usr/local/www/system_groupmanager.php +++ b/src/usr/local/www/system_groupmanager.php @@ -245,7 +245,7 @@ function build_priv_table() { $privhtml .= '' . htmlspecialchars($priv['descr']) . ''; $privhtml .= ''; $privhtml .= ''; - + } $privhtml .= ''; @@ -261,10 +261,12 @@ function build_priv_table() { include("head.inc"); -if ($input_errors) +if ($input_errors) { print_input_errors($input_errors); -if ($savemsg) +} +if ($savemsg) { print_info_box($savemsg); +} $tab_array = array(); $tab_array[] = array(gettext("Users"), false, "system_usermanager.php"); @@ -273,8 +275,7 @@ $tab_array[] = array(gettext("Settings"), false, "system_usermanager_settings.ph $tab_array[] = array(gettext("Servers"), false, "system_authservers.php"); display_top_tabs($tab_array); -if (!($_GET['act'] == "new" || $_GET['act'] == "edit")) -{ +if (!($_GET['act'] == "new" || $_GET['act'] == "edit")) { ?>
@@ -288,11 +289,12 @@ if (!($_GET['act'] == "new" || $_GET['act'] == "edit")) $group): - if ($group["name"] == "all") + foreach ($a_group as $i => $group): + if ($group["name"] == "all") { $groupcount = count($config['system']['user']); - else + } else { $groupcount = count($group['member']); + } ?> @@ -356,8 +358,7 @@ if (isset($id) && $a_group[$id]){ $section = new Form_Section('Group properties'); -if ($_GET['act'] != "new") -{ +if ($_GET['act'] != "new") { $section->addInput(new Form_StaticText( 'Defined by', strtoupper($pconfig['gtype']) @@ -371,8 +372,9 @@ $section->addInput($input = new Form_Input( $pconfig['name'] )); -if ($pconfig['gtype'] == "system") +if ($pconfig['gtype'] == "system") { $input->setReadonly(); +} $section->addInput(new Form_Input( 'description', @@ -382,8 +384,8 @@ $section->addInput(new Form_Input( ))->setHelp('Group description, for your own information only'); $form->add($section); -if ($pconfig['gid'] != 1998) // all users group -{ +if ($pconfig['gid'] != 1998) { // all users group + // ==== Group membership ================================================== $group = new Form_Group('Group membership'); @@ -393,10 +395,11 @@ if ($pconfig['gid'] != 1998) // all users group $usersGroups = array(); foreach ($config['system']['user'] as $user) { - if (is_array($pconfig['members']) && in_array($user['uid'], $pconfig['members'])) + if (is_array($pconfig['members']) && in_array($user['uid'], $pconfig['members'])) { $usersGroups[ $user['uid'] ] = $user['name']; // Add it to the user's list - else + } else { $systemGroups[ $user['uid'] ] = $user['name']; // Add it to the 'not a member of' list + } } $group->add(new Form_Select( @@ -434,8 +437,7 @@ if ($pconfig['gid'] != 1998) // all users group } -if ($_GET['act'] != "new") -{ +if ($_GET['act'] != "new") { $section = new Form_Section('Assigned Privileges'); $section->addInput(new Form_StaticText( @@ -451,7 +453,7 @@ print $form; ?>
@@ -306,7 +308,7 @@ if (!($_GET['act'] == "new" || $_GET['act'] == "edit")) " href="?act=edit&groupid="> - + " href="?act=delgroup&groupid=&groupname=">