summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system_groupmanager.php
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-08-05 08:35:56 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-08-05 08:35:56 -0300
commit4c291f4c3ce13c31e9612edaa367a2eb003cb544 (patch)
treed7b2e6241e559143350f6c2a2dc5dcb95cd59d59 /usr/local/www/system_groupmanager.php
parent4c4c59b94d3054266e34601b48a7d495c8bf9e38 (diff)
downloadpfsense-4c291f4c3ce13c31e9612edaa367a2eb003cb544.zip
pfsense-4c291f4c3ce13c31e9612edaa367a2eb003cb544.tar.gz
Fix indent and whitespaces
Diffstat (limited to 'usr/local/www/system_groupmanager.php')
-rw-r--r--usr/local/www/system_groupmanager.php216
1 files changed, 112 insertions, 104 deletions
diff --git a/usr/local/www/system_groupmanager.php b/usr/local/www/system_groupmanager.php
index cd6cf9b..1b1fb47 100644
--- a/usr/local/www/system_groupmanager.php
+++ b/usr/local/www/system_groupmanager.php
@@ -1,27 +1,27 @@
-<?php
+<?php
/*
- $Id: system_groupmanager.php
+ $Id: system_groupmanager.php
part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2008 Shrew Soft Inc.
- All rights reserved.
+ All rights reserved.
Copyright (C) 2005 Paul Taylor <paultaylor@winn-dixie.com>.
- All rights reserved.
+ All rights reserved.
Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-
+
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
-
+
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
@@ -117,15 +117,15 @@ if ($_POST) {
/* input validation */
$reqdfields = explode(" ", "groupname");
$reqdfieldsn = array(gettext("Group Name"));
-
+
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
-
+
if (preg_match("/[^a-zA-Z0-9\.\-_ ]/", $_POST['groupname']))
$input_errors[] = gettext("The group name contains invalid characters.");
-
+
if (strlen($_POST['groupname']) > 16)
$input_errors[] = gettext("The group name is longer than 16 characters.");
-
+
if (!$input_errors && !(isset($id) && $a_group[$id])) {
/* make sure there are no dupes */
foreach ($a_group as $group) {
@@ -135,12 +135,12 @@ if ($_POST) {
}
}
}
-
+
if (!$input_errors) {
$group = array();
if (isset($id) && $a_group[$id])
$group = $a_group[$id];
-
+
$group['name'] = $_POST['groupname'];
$group['description'] = $_POST['description'];
@@ -170,7 +170,7 @@ if ($_POST) {
}
write_config();
-
+
header("Location: system_groupmanager.php");
exit;
}
@@ -248,29 +248,30 @@ function presubmit() {
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="group manager">
<tr>
<td>
- <?php
- $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);
- ?>
+<?php
+ $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);
+?>
</td>
- </tr>
+ </tr>
<tr>
<td id="mainarea">
<div class="tabcont">
- <?php if($_GET['act']=="new" || $_GET['act']=="edit"): ?>
-
+<?php
+ if($_GET['act']=="new" || $_GET['act']=="edit"):
+?>
<form action="system_groupmanager.php" method="post" name="iform" id="iform" onsubmit="presubmit()">
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
- <?php
- $ro = "";
- if ($pconfig['gtype'] == "system")
- $ro = "readonly=\"readonly\"";
- ?>
+<?php
+ $ro = "";
+ if ($pconfig['gtype'] == "system")
+ $ro = "readonly=\"readonly\"";
+?>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Defined by");?></td>
<td width="78%" class="vtable">
@@ -278,23 +279,23 @@ function presubmit() {
<input name="gtype" type="hidden" value="<?=htmlspecialchars($pconfig['gtype'])?>"/>
</td>
</tr>
- <tr>
+ <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Group name");?></td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="groupname" type="text" class="formfld group" id="groupname" size="20" maxlength="16" value="<?=htmlspecialchars($pconfig['name']);?>" <?=$ro;?> />
</td>
</tr>
- <tr>
+ <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
- <td width="78%" class="vtable">
+ <td width="78%" class="vtable">
<input name="description" type="text" class="formfld unknown" id="description" size="20" value="<?=htmlspecialchars($pconfig['description']);?>" />
<br />
<?=gettext("Group description, for your own information only");?>
</td>
</tr>
-
- <?php if ($pconfig['gid'] != 1998): // all users group ?>
-
+<?php
+ if ($pconfig['gid'] != 1998): // all users group
+?>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Group Memberships");?></td>
<td width="78%" class="vtable" align="center">
@@ -304,20 +305,21 @@ function presubmit() {
<strong><?=gettext("Not Members");?></strong><br />
<br />
<select size="10" style="width: 75%" name="notmembers[]" class="formselect" id="notmembers" onchange="clear_selected('members')" multiple="multiple">
- <?php
- $rowIndex = 0;
- foreach ($config['system']['user'] as $user):
- if (is_array($pconfig['members']) && in_array($user['uid'],$pconfig['members']))
- continue;
- $rowIndex++;
- ?>
+<?php
+ $rowIndex = 0;
+ foreach ($config['system']['user'] as $user):
+ if (is_array($pconfig['members']) && in_array($user['uid'],$pconfig['members']))
+ continue;
+ $rowIndex++;
+?>
<option value="<?=$user['uid'];?>" <?=$selected;?>>
<?=htmlspecialchars($user['name']);?>
</option>
- <?php endforeach;
- if ($rowIndex == 0)
- echo "<option></option>";
- ?>
+<?php
+ endforeach;
+ if ($rowIndex == 0)
+ echo "<option></option>";
+?>
</select>
<br />
</td>
@@ -335,20 +337,21 @@ function presubmit() {
<strong><?=gettext("Members");?></strong><br />
<br />
<select size="10" style="width: 75%" name="members[]" class="formselect" id="members" onchange="clear_selected('notmembers')" multiple="multiple">
- <?php
- $rowIndex = 0;
- foreach ($config['system']['user'] as $user):
- if (!(is_array($pconfig['members']) && in_array($user['uid'],$pconfig['members'])))
- continue;
- $rowIndex++;
- ?>
+<?php
+ $rowIndex = 0;
+ foreach ($config['system']['user'] as $user):
+ if (!(is_array($pconfig['members']) && in_array($user['uid'],$pconfig['members'])))
+ continue;
+ $rowIndex++;
+?>
<option value="<?=$user['uid'];?>">
<?=htmlspecialchars($user['name']);?>
</option>
- <?php endforeach;
- if ($rowIndex == 0)
- echo "<option></option>";
- ?>
+<?php
+ endforeach;
+ if ($rowIndex == 0)
+ echo "<option></option>";
+?>
</select>
<br />
</td>
@@ -357,10 +360,10 @@ function presubmit() {
<?=gettext("Hold down CTRL (pc)/COMMAND (mac) key to select multiple items");?>
</td>
</tr>
-
- <?php endif; ?>
- <?php if($_GET['act'] != "new"): ?>
-
+<?php
+ endif;
+ if($_GET['act'] != "new"):
+?>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Assigned Privileges");?></td>
<td width="78%" class="vtable">
@@ -370,11 +373,11 @@ function presubmit() {
<td width="60%" class="listhdrr"><?=gettext("Description");?></td>
<td class="list"></td>
</tr>
- <?php
- if(is_array($pconfig['priv'])):
- $i = 0;
- foreach ($pconfig['priv'] as $priv):
- ?>
+<?php
+ if(is_array($pconfig['priv'])):
+ $i = 0;
+ foreach ($pconfig['priv'] as $priv):
+?>
<tr>
<td class="listr">
<?=htmlspecialchars($priv_list[$priv]['name']);?>
@@ -388,11 +391,11 @@ function presubmit() {
</a>
</td>
</tr>
- <?php
- $i++;
- endforeach;
- endif;
- ?>
+<?php
+ $i++;
+ endforeach;
+ endif;
+?>
<tr>
<td class="list" colspan="2"></td>
<td class="list">
@@ -406,10 +409,12 @@ function presubmit() {
</table>
</td>
</tr>
- <?php endif; ?>
- <tr>
+<?php
+ endif;
+?>
+ <tr>
<td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
+ <td width="78%">
<input name="save" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
<?php if (isset($id) && $a_group[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
@@ -419,9 +424,9 @@ function presubmit() {
</tr>
</table>
</form>
-
- <?php else: ?>
-
+<?php
+ else:
+?>
<table class="sortable" width="100%" border="0" cellpadding="0" cellspacing="0" summary="">
<thead>
<tr>
@@ -432,7 +437,7 @@ function presubmit() {
</tr>
</thead>
<tfoot>
- <tr>
+ <tr>
<td class="list" colspan="3"></td>
<td class="list">
<a href="system_groupmanager.php?act=new"><img src="./themes/<?=$g['theme'];?>/images/icons/icon_plus.gif" title="<?=gettext("add group");?>" width="17" height="17" border="0" alt="add" />
@@ -442,7 +447,7 @@ function presubmit() {
<tr>
<td colspan="3">
<p>
- <?=gettext("Additional webConfigurator groups can be added here.
+ <?=gettext("Additional webConfigurator groups can be added here.
Group permissions can be assigned which are inherited by users who are members of the group.
An icon that appears grey indicates that it is a system defined object.
Some system object properties can be modified but they cannot be deleted.");?>
@@ -451,18 +456,17 @@ function presubmit() {
</tr>
</tfoot>
<tbody>
- <?php
- $i = 0;
- foreach($a_group as $group):
-
- if($group['scope'] == "system")
- $grpimg = "/themes/{$g['theme']}/images/icons/icon_system-group-grey.png";
- else
- $grpimg = "/themes/{$g['theme']}/images/icons/icon_system-group.png";
- $groupcount = count($group['member']);
- if ($group["name"] == "all")
- $groupcount = count($config['system']['user']);
- ?>
+<?php
+ $i = 0;
+ foreach($a_group as $group):
+ if($group['scope'] == "system")
+ $grpimg = "/themes/{$g['theme']}/images/icons/icon_system-group-grey.png";
+ else
+ $grpimg = "/themes/{$g['theme']}/images/icons/icon_system-group.png";
+ $groupcount = count($group['member']);
+ if ($group["name"] == "all")
+ $groupcount = count($config['system']['user']);
+?>
<tr ondblclick="document.location='system_groupmanager.php?act=edit&amp;id=<?=$i;?>'">
<td class="listlr">
<table border="0" cellpadding="0" cellspacing="0" summary="">
@@ -487,23 +491,27 @@ function presubmit() {
<img src="./themes/<?=$g['theme'];?>/images/icons/icon_e.gif" title="<?=gettext("edit group");?>" width="17" height="17" border="0" alt="edit" />
</a>
&nbsp;
- <?php if($group['scope'] != "system"): ?>
+<?php
+ if($group['scope'] != "system"):
+?>
<a href="system_groupmanager.php?act=delgroup&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this group?"); ?>')">
<img src="/themes/<?=$g['theme'];?>/images/icons/icon_x.gif" title="<?=gettext("delete group"); ?>" width="17" height="17" border="0" alt="delete" />
</a>
- <?php endif; ?>
+<?php
+ endif;
+?>
</td>
</tr>
- <?php
- $i++;
- endforeach;
- ?>
+<?php
+ $i++;
+ endforeach;
+?>
</tbody>
</table>
-
- <?php endif; ?>
-
- </div>
+<?php
+ endif;
+?>
+ </div>
</td>
</tr>
</table>
OpenPOWER on IntegriCloud