From 4c291f4c3ce13c31e9612edaa367a2eb003cb544 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 5 Aug 2014 08:35:56 -0300 Subject: [PATCH] Fix indent and whitespaces --- usr/local/www/system_groupmanager.php | 216 +++++++------ usr/local/www/system_usermanager.php | 437 +++++++++++++------------- 2 files changed, 339 insertions(+), 314 deletions(-) diff --git a/usr/local/www/system_groupmanager.php b/usr/local/www/system_groupmanager.php index cd6cf9b9b3..1b1fb47151 100644 --- a/usr/local/www/system_groupmanager.php +++ b/usr/local/www/system_groupmanager.php @@ -1,27 +1,27 @@ -. - All rights reserved. + All rights reserved. Copyright (C) 2003-2005 Manuel Kasper . 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() { - + - - + + -
- +
- - +
- + - + - - + - - - - + @@ -335,20 +337,21 @@ function presubmit() {


@@ -357,10 +360,10 @@ function presubmit() { - - - - + - + - +
@@ -278,23 +279,23 @@ function presubmit() {
+ />
+
@@ -304,20 +305,21 @@ function presubmit() {


@@ -370,11 +373,11 @@ function presubmit() {
@@ -388,11 +391,11 @@ function presubmit() {
@@ -406,10 +409,12 @@ function presubmit() {
  + " /> @@ -419,9 +424,9 @@ function presubmit() {
- - - + @@ -432,7 +437,7 @@ function presubmit() { - + - +
" width="17" height="17" border="0" alt="add" /> @@ -442,7 +447,7 @@ function presubmit() {

- @@ -451,18 +456,17 @@ function presubmit() {

@@ -487,23 +491,27 @@ function presubmit() { " width="17" height="17" border="0" alt="edit" />   - +')"> " width="17" height="17" border="0" alt="delete" /> - + - +
- - - - + +
diff --git a/usr/local/www/system_usermanager.php b/usr/local/www/system_usermanager.php index ddb8320369..5cf91ce15b 100644 --- a/usr/local/www/system_usermanager.php +++ b/usr/local/www/system_usermanager.php @@ -1,38 +1,38 @@ . - All rights reserved. + Copyright (C) 2005 Paul Taylor . + All rights reserved. - Copyright (C) 2003-2005 Manuel Kasper . - All rights reserved. + Copyright (C) 2003-2005 Manuel Kasper . + All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + 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. + 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. + 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 - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. + 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 + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. */ /* pfSense_BUILDER_BINARIES: @@ -252,8 +252,8 @@ if ($_POST) { if (!empty($_POST['name'])) { $ca = lookup_ca($_POST['caref']); - if (!$ca) - $input_errors[] = gettext("Invalid internal Certificate Authority") . "\n"; + if (!$ca) + $input_errors[] = gettext("Invalid internal Certificate Authority") . "\n"; } /* if this is an AJAX caller then handle via JSON */ @@ -297,19 +297,19 @@ if ($_POST) { if (!empty($_POST['name'])) { $cert = array(); $cert['refid'] = uniqid(); - $userent['cert'] = array(); + $userent['cert'] = array(); $cert['descr'] = $_POST['name']; - $subject = cert_get_subject_array($ca['crt']); + $subject = cert_get_subject_array($ca['crt']); - $dn = array( - 'countryName' => $subject[0]['v'], - 'stateOrProvinceName' => $subject[1]['v'], - 'localityName' => $subject[2]['v'], - 'organizationName' => $subject[3]['v'], - 'emailAddress' => $subject[4]['v'], - 'commonName' => $userent['name']); + $dn = array( + 'countryName' => $subject[0]['v'], + 'stateOrProvinceName' => $subject[1]['v'], + 'localityName' => $subject[2]['v'], + 'organizationName' => $subject[3]['v'], + 'emailAddress' => $subject[4]['v'], + 'commonName' => $userent['name']); cert_create($cert, $_POST['caref'], $_POST['keylen'], (int)$_POST['lifetime'], $dn); @@ -431,13 +431,13 @@ function usercertClicked(obj) { } function sshkeyClicked(obj) { - if (obj.checked) { - document.getElementById("sshkeychck").style.display="none"; - document.getElementById("sshkey").style.display=""; - } else { - document.getElementById("sshkey").style.display="none"; - document.getElementById("sshkeychck").style.display=""; - } + if (obj.checked) { + document.getElementById("sshkeychck").style.display="none"; + document.getElementById("sshkey").style.display=""; + } else { + document.getElementById("sshkey").style.display="none"; + document.getElementById("sshkeychck").style.display=""; + } } //]]> @@ -450,36 +450,36 @@ function sshkeyClicked(obj) {
- +?>
- - - +
- - - - + + - + + @@ -561,24 +562,25 @@ function sshkeyClicked(obj) {


@@ -587,9 +589,9 @@ function sshkeyClicked(obj) { - - - + - + - + - + - + - - 0): ?> - + 0): + $i = 0; + foreach( $config['ca'] as $ca) { + if (!$ca['prv']) + continue; + $i++; + } +?> - - 0): ?> - + 0): +?> - - - - - +> - - - + + + >
- + +
+ -
@@ -528,22 +528,23 @@ function sshkeyClicked(obj) {


@@ -600,39 +602,42 @@ function sshkeyClicked(obj) {
- + - + ')"> delete - +
@@ -653,21 +658,24 @@ function sshkeyClicked(obj) {
- + (Revoked) - + @@ -684,11 +692,11 @@ function sshkeyClicked(obj) {
@@ -701,90 +709,95 @@ function sshkeyClicked(obj) {
+
- -
+ +
@@ -817,9 +830,9 @@ function sshkeyClicked(obj) {
- - - + @@ -854,21 +867,21 @@ function sshkeyClicked(obj) { - +
- +
- + <?=gettext(" title="" border="0" height="16" width="16" /> @@ -880,30 +893,34 @@ function sshkeyClicked(obj) {   - +   " alt="" width="17" height="17" border="0" /> - +   ')"> " alt="" width="17" height="17" border="0" /> - +
- - - +