Project

General

Profile

Download (3.88 KB) Statistics
| Branch: | Tag: | Revision:
1 f63d5b66 Helder Pereira
<?php
2
/* $Id$ */
3
/*
4
	Exec+ v1.02-000 - Copyright 2001-2003, All rights reserved
5
	Created by Andr? Ribeiro and H?lder Pereira
6
7
    Redistribution and use in source and binary forms, with or without
8
    modification, are permitted provided that the following conditions are met:
9
10
    1. Redistributions of source code must retain the above copyright notice,
11
       this list of conditions and the following disclaimer.
12
13
    2. Redistributions in binary form must reproduce the above copyright
14
       notice, this list of conditions and the following disclaimer in the
15
       documentation and/or other materials provided with the distribution.
16
17
    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
18
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
19
    AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
20
    AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
21
    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26
    POSSIBILITY OF SUCH DAMAGE.
27
*/
28
29 13d193c2 Scott Ullrich
/*	
30
		pfSense_MODULE:	shaper
31
*/
32
33 f63d5b66 Helder Pereira
##|+PRIV
34
##|*IDENT=page-diagnostics-patters
35
##|*NAME=Diagnostics: Patterns page
36
##|*DESCR=Allow access to the 'Diagnostics: Patterns' page.
37
##|*MATCH=patterns.php*
38
##|-PRIV
39
40
require("guiconfig.inc");
41
42
//Move the upload file to /usr/local/share/protocols (is_uploaded_file must use tmp_name as argument)
43 f8ec8de4 Renato Botelho
if (($_POST['submit'] == gettext("Upload")) && is_uploaded_file($_FILES['ulfile']['tmp_name'])) {
44 f63d5b66 Helder Pereira
	if(fileExtension($_FILES['ulfile']['name'])) {
45
		move_uploaded_file($_FILES['ulfile']['tmp_name'], "/usr/local/share/protocols/" . $_FILES['ulfile']['name']);
46 f8ec8de4 Renato Botelho
		$ulmsg = gettext("Uploaded file to") . " /usr/local/share/protocols/" . htmlentities($_FILES['ulfile']['name']);
47 f63d5b66 Helder Pereira
	}
48
	else
49 f8ec8de4 Renato Botelho
		$ulmsg = gettext("Warning: You must upload a file with .pat extension.");
50 f63d5b66 Helder Pereira
}
51
52
//Check if file has correct extension (.pat)
53
function fileExtension($nameFile) {
54
	$format = substr($nameFile, -4);	
55
	return ($format == ".pat");	
56
}
57
58 f8ec8de4 Renato Botelho
$pgtitle = array(gettext("Diagnostics"), gettext("Add layer7 pattern"));
59 f63d5b66 Helder Pereira
include("head.inc");
60
?>
61
62
<style>
63
<!--
64
65
input {
66
   font-family: courier new, courier;
67
   font-weight: normal;
68
   font-size: 9pt;
69
}
70
71
pre {
72
   border: 2px solid #435370;
73
   background: #F0F0F0;
74
   padding: 1em;
75
   font-family: courier new, courier;
76
   white-space: pre;
77
   line-height: 10pt;
78
   font-size: 10pt;
79
}
80
81
.label {
82
   font-family: tahoma, verdana, arial, helvetica;
83
   font-size: 11px;
84
   font-weight: bold;
85
}
86
87
.button {
88
   font-family: tahoma, verdana, arial, helvetica;
89
   font-weight: bold;
90
   font-size: 11px;
91
}
92
93
-->
94
</style>
95
</head>
96
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
97
<?php include("fbegin.inc"); ?>
98 f8ec8de4 Renato Botelho
<p><strong><?=gettext("You can upload new layer7 patterns to your system!");?></strong></p>
99 f63d5b66 Helder Pereira
<?php if ($ulmsg) echo "<p class=\"red\"><strong>" . $ulmsg . "</strong></p>\n"; ?>
100
<div id="niftyOutter">
101
<form action="diag_patterns.php" method="POST" enctype="multipart/form-data" name="frmPattern">
102
  <table>
103
	
104
  <tr>
105 f8ec8de4 Renato Botelho
    <td colspan="2" valign="top" class="vnsepcell"><?=gettext("Upload");?></td>
106 f63d5b66 Helder Pereira
  </tr>    
107
    <tr>
108 519d52bb Carlos Eduardo Ramos
      <td align="right"><?=gettext("File to upload:");?></td>
109 f63d5b66 Helder Pereira
      <td valign="top" class="label">
110
	<input name="ulfile" type="file" class="formfld file" id="ulfile">
111
	</td></tr>
112
    <tr>
113
      <td valign="top">&nbsp;&nbsp;&nbsp;</td>
114
      <td valign="top" class="label">	
115 f8ec8de4 Renato Botelho
	<input name="submit" type="submit"  class="button" id="upload" value="<?=gettext("Upload");?>"></td>
116 f63d5b66 Helder Pereira
    </tr>
117
	<tr>
118
	  <td colspan="2" valign="top" height="16"></td>
119
	</tr>
120
	    
121
  </table>
122
</div>
123
<?php include("fend.inc"); ?>
124
</form>
125
</body>
126
</html>