-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
67 lines (56 loc) · 1.26 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
$configfile='/usr/web/nets/internal/portlists/ThisSite.pm';
$cols=80;
$rows=30;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<meta Http-Equiv="Cache-Control" Content="no-cache">
<meta Http-Equiv="Pragma" Content="no-cache">
<meta Http-Equiv="Cache-Control:" max-age="0">
<meta Http-Equiv="Expires" Content="-100">
<title>Configure Switchmap</title>
<link href="/nets/internal/SwitchMap.css" rel="stylesheet">
</head>
<body>
<?php
if (!isset($_REQUEST['content'])) {
?>
<h1>Edit config file</h1>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<textarea name="content" cols=<?php echo $cols; ?> rows=<?php echo $rows; ?>>
<?php
include $configfile;
?>
</textarea>
<p>
<input type=submit value="Save">
</form>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method=get>
<input type=submit value="Discard Changes">
</form>
</p>
<form action="/switchmap" method=get>
<input type=submit value="Cancel">
</form>
</p>
</form>
<?php
# End editing page
}
else {
# Begin uploading page
$fh=fopen($configfile, 'w');
$confdata=stripslashes($_REQUEST['content']);
fwrite($fh, $confdata);
fclose($fh);
?>
<p>
Config file changed.
</p>
<?php
}
?>
</body>
</html>