From cfd88fbc838ab0ab08c166ede807e866716fb11f Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Fri, 6 Sep 2013 11:12:08 -0300 Subject: [PATCH] Fix indent and whitespaces --- usr/local/www/services_captiveportal_mac.php | 112 ++++++++------ .../www/services_captiveportal_mac_edit.php | 137 +++++++++--------- 2 files changed, 137 insertions(+), 112 deletions(-) diff --git a/usr/local/www/services_captiveportal_mac.php b/usr/local/www/services_captiveportal_mac.php index 1cc625b15c..4803f7e7b1 100755 --- a/usr/local/www/services_captiveportal_mac.php +++ b/usr/local/www/services_captiveportal_mac.php @@ -2,20 +2,20 @@ /* services_captiveportal_mac.php part of m0n0wall (http://m0n0.ch/wall) - + Copyright (C) 2004 Dinesh Nair 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 @@ -46,15 +46,15 @@ require("captiveportal.inc"); $cpzone = $_GET['zone']; if (isset($_POST['zone'])) - $cpzone = $_POST['zone']; + $cpzone = $_POST['zone']; if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) { - header("Location: services_captiveportal_zones.php"); - exit; + header("Location: services_captiveportal_zones.php"); + exit; } if (!is_array($config['captiveportal'])) - $config['captiveportal'] = array(); + $config['captiveportal'] = array(); $a_cp =& $config['captiveportal']; $pgtitle = array(gettext("Services"),gettext("Captive portal"), $a_cp[$cpzone]['zone']); @@ -89,7 +89,7 @@ if ($_POST) { if ($_POST['username']) { $mac = captiveportal_passthrumac_findbyname($_POST['username']); if (!empty($mac)) - $_POST['delmac'] = $mac['mac']; + $_POST['delmac'] = $mac['mac']; else echo gettext("No entry exists for this username:") . " " . $_POST['username'] . "\n"; } @@ -156,7 +156,7 @@ include("head.inc"); You must apply the changes in order for them to take effect."));?>
- - - - -
+
-
- + - - - + - - - - - - - - - - - - - - - -
+ + + + + + + + + + + + + + + + + + + + + +
+ + +   + + + " width="17" height="17" border="0"> + +   + ')"> + " width="17" height="17" border="0"> + +
  + + " width="17" height="17" border="0"> + +
+ +
+ +
+
 
+
- - -   - " width="17" height="17" border="0"> -  ')">" width="17" height="17" border="0">
  " width="17" height="17" border="0">
-
-
-
 
-
+ diff --git a/usr/local/www/services_captiveportal_mac_edit.php b/usr/local/www/services_captiveportal_mac_edit.php index bb3650035f..a27c6834b5 100755 --- a/usr/local/www/services_captiveportal_mac_edit.php +++ b/usr/local/www/services_captiveportal_mac_edit.php @@ -1,21 +1,21 @@ - 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 @@ -43,9 +43,9 @@ function passthrumacscmp($a, $b) { } function passthrumacs_sort() { - global $config, $cpzone; + global $config, $cpzone; - usort($config['captiveportal'][$cpzone]['passthrumac'],"passthrumacscmp"); + usort($config['captiveportal'][$cpzone]['passthrumac'],"passthrumacscmp"); } require("guiconfig.inc"); @@ -59,15 +59,15 @@ $shortcut_section = "captiveportal"; $cpzone = $_GET['zone']; if (isset($_POST['zone'])) - $cpzone = $_POST['zone']; + $cpzone = $_POST['zone']; if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) { - header("Location: services_captiveportal_zones.php"); - exit; + header("Location: services_captiveportal_zones.php"); + exit; } if (!is_array($config['captiveportal'])) - $config['captiveportal'] = array(); + $config['captiveportal'] = array(); $a_cp =& $config['captiveportal']; $id = $_GET['id']; @@ -94,11 +94,11 @@ if ($_POST) { /* input validation */ $reqdfields = explode(" ", "mac"); $reqdfieldsn = array(gettext("MAC address")); - + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); - + $_POST['mac'] = str_replace("-", ":", $_POST['mac']); - + if (($_POST['mac'] && !is_macaddr($_POST['mac']))) { $input_errors[] = sprintf("%s. [%s]", gettext("A valid MAC address must be specified"), $_POST['mac']); } @@ -110,11 +110,11 @@ if ($_POST) { foreach ($a_passthrumacs as $macent) { if (isset($id) && ($a_passthrumacs[$id]) && ($a_passthrumacs[$id] === $macent)) continue; - + if ($macent['mac'] == $_POST['mac']){ $input_errors[] = sprintf("[%s] %s.", $_POST['mac'], gettext("already allowed")); break; - } + } } if (!$input_errors) { @@ -126,7 +126,7 @@ if ($_POST) { $mac['bw_down'] = $_POST['bw_down']; if ($_POST['username']) $mac['username'] = $_POST['username']; - + $mac['descr'] = $_POST['descr']; if (isset($id) && $a_passthrumacs[$id]) { @@ -137,7 +137,7 @@ if ($_POST) { $a_passthrumacs[] = $mac; } passthrumacs_sort(); - + write_config(); if (isset($config['captiveportal'][$cpzone]['enable'])) { @@ -154,7 +154,7 @@ if ($_POST) { $rules = "delete {$ruleno}\n"; $rules .= "delete " . ++$ruleno . "\n"; } - + $rules .= captiveportal_passthrumac_configure_entry($mac); $uniqid = uniqid("{$cpzone}_macedit"); file_put_contents("{$g['tmp_path']}/{$uniqid}_tmp", $rules); @@ -171,57 +171,62 @@ include("head.inc"); -
- + +
- - + + - - - + + + - - - + + + - - - + + + - - - - - - - -
- - - -
-
+ + + +
+
- -
.
+ +
+ . +
- -
+ +
+ +
- -
  - "> - - - - - - - -
+ + + +
+ + + + +   + + "> + + + + + + + + + +