This repository has been archived by the owner on Oct 29, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
settings.php
executable file
·188 lines (149 loc) · 5.2 KB
/
settings.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?php
session_start();
require("include/functions.php");
$config_file = 'config.php';
if (file_exists($config_file)) {
require("config.php");
}
else {
header("Location: error.php?e=config");
die();
}
require("include/apply_config.php");
$Token=filter_var($_GET["Token"], FILTER_SANITIZE_STRING);
$username = $_COOKIE["username"];
$UserID = query_one("SELECT UserID FROM Users WHERE UserName='$username'", $connection);
$valid_token = query_one("SELECT COUNT(*) FROM Tokens WHERE TokenID='$Token' AND UserID='$UserID'", $connection);
if ($valid_token==1) {
$soundfile_name = query_one("SELECT soundfile_name FROM Tokens WHERE TokenID='$Token' LIMIT 1", $connection);
}
echo "<!DOCTYPE html>
<html>
<head>
<title>$app_custom_name - Settings Page</title>";
require("include/get_css3.php");
require("include/get_jqueryui.php");
if ($use_googleanalytics){
echo $googleanalytics_code;
}
#Execute custom code for head, if set
if (is_file("$absolute_dir/customhead.php")) {
include("customhead.php");
}
?>
</head>
<body>
<!--Blueprint container-->
<div class="container">
<?php
require("include/topbar.php");
if ($soundfile_name!="") {
//If its not empty, then there is a file open
#require("include/pumilio_buttons_partial.php");
#echo "<h5 class=\"highlight2 ui-corner-all\">$soundfile_name</h5>";
}
echo "<div class=\"row\">
<div class=\"col-md-8\">";
echo "<div class=\"panel panel-primary\">
<div class=\"panel-heading\">
<h3 class=\"panel-title\">$soundfile_name</h3>
</div>
<div class=\"panel-body\">";
echo "<form method=\"GET\" action=\"pumilio.php\">
<input type=\"hidden\" name=\"Token\" value=\"$Token\">
<button type=\"submit\" title=\"Return to file\" class=\"btn btn-sm btn-primary\">Return to file</button>
</form>\n";
echo "<h3>Your settings</h3>
<form name=\"frequencies\" action=\"set_cookies.php\" method=\"post\" class=\"form-inline\">
<input type=\"hidden\" name=\"cookie_to_set\" value=\"freq_range\">
Frequency range when opening files:
<select name=\"min_freq\" class=\"form-control\">
<option selected>10</option>
<option>100</option>
<option>500</option>
<option>1000</option>
<option>2000</option>
<option>3000</option>
<option>4000</option>
<option>5000</option>
<option>8000</option>
<option>10000</option>
<option>12000</option>
</select> Hz
to
<select name=\"max_freq\" class=\"form-control\">
<option>300</option>
<option>500</option>
<option>1000</option>
<option>2000</option>
<option>3000</option>
<option>4000</option>
<option>5000</option>
<option>8000</option>
<option selected>10000</option>
<option>12000</option>
<option>14000</option>
<option>16000</option>
<option>22050</option>
<option>24000</option>
</select> Hz
<input type=\"hidden\" name=\"Token\" value=\"$Token\">
<button type=\"submit\" title=\"Update settings\" class=\"btn btn-sm btn-primary\">Update</button>
";
if (isset($_COOKIE["frequency_min"])) {
$frequency_min=$_COOKIE["frequency_min"];
$frequency_max=$_COOKIE["frequency_max"];
echo " | (current: $frequency_min - $frequency_max Hz)";
}
echo "
</form>
<form name=\"fft\" action=\"set_cookies.php\" method=\"post\" class=\"form-inline\">
<input type=\"hidden\" name=\"cookie_to_set\" value=\"fft\">
FFT size:
<select name=\"fft\" class=\"form-control\">
<option>256</option>
<option>512</option>
<option>1024</option>
<option selected>2048</option>
<option>4096</option>
</select>
<input type=\"hidden\" name=\"Token\" value=\"$Token\">
<button type=\"submit\" title=\"Update settings\" class=\"btn btn-sm btn-primary\">Update</button>";
if (isset($_COOKIE["fft"])) {
$fft=$_COOKIE["fft"];
echo " | (current: $fft)";
}
echo "
</form>
<form name=\"palette\" action=\"set_cookies.php\" method=\"post\" class=\"form-inline\">
<input type=\"hidden\" name=\"cookie_to_set\" value=\"palette\">
Color palette to use in spectrograms:
<select name=\"palette\" class=\"form-control\">
<option value=\"2\">white background</option>
<option value=\"1\">black background</option>
</select>
<input type=\"hidden\" name=\"Token\" value=\"$Token\">
<button type=\"submit\" title=\"Update settings\" class=\"btn btn-sm btn-primary\">Update</button>";
if (isset($_COOKIE["palette"])) {
$palette=$_COOKIE["palette"];
if ($palette==1)
echo " | (current: black background)";
if ($palette==2)
echo " | (current: white background)";
}
echo "
</form>
<br>
<form name=\"clear\" action=\"set_cookies.php\" method=\"post\" class=\"form-inline\">
<input type=\"hidden\" name=\"cookie_to_set\" value=\"clear\">
<input type=\"hidden\" name=\"Token\" value=\"$Token\">
<button type=\"submit\" title=\"Return settings to their defaults\" class=\"btn btn-sm btn-primary\">Return settings to their defaults</button>
</form>
</div></div>
<div class=\"col-md-4\"> </div></div>";
require("include/bottom.php");
?>
</body>
</html>