Projet

Général

Profil

« Précédent | Suivant » 

Révision f1a13a7f

Ajouté par Renato Botelho il y a presque 10 ans

Fix whitespaces and indent

Voir les différences:

usr/local/www/widgets/widgets/log.widget.php
1 1
<?php
2 2
/*
3
        $Id$
4
        Copyright 2007 Scott Dale
5
        Part of pfSense widgets (https://www.pfsense.org)
6
        originally based on m0n0wall (http://m0n0.ch/wall)
7

  
8
        Copyright (C) 2004-2005 T. Lechat <dev@lechat.org>, Manuel Kasper <mk@neon1.net>
9
        and Jonathan Watt <jwatt@jwatt.org>.
10
        All rights reserved.
11

  
12
        Redistribution and use in source and binary forms, with or without
13
        modification, are permitted provided that the following conditions are met:
14

  
15
        1. Redistributions of source code must retain the above copyright notice,
16
           this list of conditions and the following disclaimer.
17

  
18
        2. Redistributions in binary form must reproduce the above copyright
19
           notice, this list of conditions and the following disclaimer in the
20
           documentation and/or other materials provided with the distribution.
21

  
22
        THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
23
        INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24
        AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
        AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26
        OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
        SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
        INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
        CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
        ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
        POSSIBILITY OF SUCH DAMAGE.
3
	$Id$
4
	Copyright 2007 Scott Dale
5
	Part of pfSense widgets (https://www.pfsense.org)
6
	originally based on m0n0wall (http://m0n0.ch/wall)
7

  
8
	Copyright (C) 2004-2005 T. Lechat <dev@lechat.org>, Manuel Kasper <mk@neon1.net>
9
	and Jonathan Watt <jwatt@jwatt.org>.
10
	All rights reserved.
11

  
12
	Redistribution and use in source and binary forms, with or without
13
	modification, are permitted provided that the following conditions are met:
14

  
15
	1. Redistributions of source code must retain the above copyright notice,
16
	   this list of conditions and the following disclaimer.
17
	
18
	2. Redistributions in binary form must reproduce the above copyright
19
	   notice, this list of conditions and the following disclaimer in the
20
	   documentation and/or other materials provided with the distribution.
21

  
22
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
23
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
	POSSIBILITY OF SUCH DAMAGE.
32 32
*/
33 33

  
34 34
$nocsrf = true;
......
55 55
	if (isset($config['widgets']['filterlogentriesinterfaces'])) $config['widgets']['filterlogentriesinterfaces'] = trim($config['widgets']['filterlogentriesinterfaces']);
56 56

  
57 57
	write_config("Saved Filter Log Entries via Dashboard");
58
  $filename = $_SERVER['HTTP_REFERER'];
59
  if(headers_sent($file, $line)){
60
    echo '<script type="text/javascript">';
61
    echo '//<![CDATA[';
62
    echo 'window.location.href="'.$filename.'";';
63
    echo '//]]>';
64
    echo '</script>';
65
    echo '<noscript>';
66
    echo '<meta http-equiv="refresh" content="0;url='.$filename.'" />';
67
    echo '</noscript>';  
68
  } 
58
	$filename = $_SERVER['HTTP_REFERER'];
59
	if(headers_sent($file, $line)){
60
		echo '<script type="text/javascript">';
61
		echo '//<![CDATA[';
62
		echo 'window.location.href="'.$filename.'";';
63
		echo '//]]>';
64
		echo '</script>';
65
		echo '<noscript>';
66
		echo '<meta http-equiv="refresh" content="0;url='.$filename.'" />';
67
		echo '</noscript>';
68
	}
69 69
	Header("Location: /");
70 70
}
71 71

  
......
111 111
		'<td class="listMRr ellipsis" title="' + row[1] + '">' + row[1].slice(0,-3) + '<\/td>' +
112 112
		'<td class="listMRr ellipsis" title="' + row[2] + '">' + row[2] + '<\/td>' +
113 113
		'<td class="listMRr ellipsis" title="' + row[3] + '">' + row[3] + '<\/td>' +
114
 		'<td class="listMRr ellipsis" title="' + row[4] + '">' + row[4] + '<\/td>';
114
		'<td class="listMRr ellipsis" title="' + row[4] + '">' + row[4] + '<\/td>';
115 115

  
116 116
	var nentriesacts = "<?php echo $nentriesacts; ?>";
117 117
	var nentriesinterfaces = "<?php echo $nentriesinterfaces; ?>";
......
131 131

  
132 132
<div id="log-settings" class="widgetconfigdiv" style="display:none;">
133 133
	<form action="/widgets/widgets/log.widget.php" method="post" name="iforma">
134
		Number of lines to display: 
134
		Number of lines to display:
135 135
		<select name="filterlogentries" class="formfld unknown" id="filterlogentries">
136 136
		<?php for ($i = 1; $i <= 20; $i++) { ?>
137 137
			<option value="<?php echo $i;?>" <?php if ($nentries == $i) echo "selected=\"selected\"";?>><?php echo $i;?></option>
138 138
		<?php } ?>
139 139
		</select>
140 140

  
141
<?php 
141
<?php
142 142
		$Include_Act = explode(",", str_replace(" ", ",", $nentriesacts));
143 143
		if ($nentriesinterfaces == "All") $nentriesinterfaces = "";
144 144
?>
......
146 146
		<input id="actblock"  name="actblock"  type="checkbox" value="Block"  <?php if (in_arrayi('Block',  $Include_Act)) echo "checked=\"checked\""; ?> /> Block
147 147
		<input id="actreject" name="actreject" type="checkbox" value="Reject" <?php if (in_arrayi('Reject', $Include_Act)) echo "checked=\"checked\""; ?> /> Reject
148 148
		<br/>
149
		Interfaces: 
149
		Interfaces:
150 150
		<input id="filterlogentriesinterfaces" name="filterlogentriesinterfaces" class="formfld unknown" type="text" size="20" value="<?= $nentriesinterfaces ?>" />
151
        &nbsp; &nbsp; &nbsp; 
152

  
151
		&nbsp; &nbsp; &nbsp;
153 152
		<input id="submita" name="submita" type="submit" class="formbtn" value="Save" />
154 153
	</form>
155 154
</div>

Formats disponibles : Unified diff