-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
320 lines (284 loc) · 7.88 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
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="dropzone.css"/>
<!--link rel="stylesheet" type="text/css" href="new.css"/-->
<script src="jquery-3.6.0.js"></script>
<script src="dropzonelate.js" type='text/javascript'></script>
</head>
<body>
<style>
body {
background-image: linear-gradient(to right, #8B8756, #ECE6B1);
background-size: 800px;
}
@font-face {
font-family: "doboto";
src: url("/var/www/html/android/RobLite.ttf") format("ttf");
}
#live-controls {
background-image: linear-gradient(to top left, #F7F538, #F6D400);
border-radius: 40px;
padding: 10px;
width: 330px;
height: 375px;
position: absolute;
top: 15px;
left: 5px;
font-family: Roboto;
font-size: 9px;
text-align: center;
}
.label {
font-family: Roboto;
font-size: 10px;
text-align: center;
color: black;
}
#login {
position: absolute;
top: 0px;
left: 290px;
background-image: radial-gradient(#F7F538, #F6AD00);
border-radius: 120px;
color:black;
font-family: Roboto;
font-weight: bold;
font-size: 6px;
text-align: center;
height: 60px;
width: 60px;
}
#io {
position: relative;
height: 100px;
top: 360px;
background-image: linear-gradient(to top left, #F7F538, #F6D400);
border-radius: 50px;
color:black;
font-family: Roboto;
font-size: 10px;
text-align: center;
resize: none;
padding: 10px 22px;
margin: 4px 2px;
cursor: pointer
}
#free_space {
resize: none;
position: absolute;
top: 250px;
border: dashed, black;
left: 200px;
font-family: roboto;
font-size: 13px;
text-align: center;
background-image: radial-gradient(#A10100, #890000);
border-radius: 90px;
color:black;
height: 90px;
width: 90px;
overflow: hidden;
padding: 15px;
cursor: pointer;
}
#drop { //"quick upload"
position: absolute;
top: 243px;
left: 35px;
font-family: roboto;
font-size: 10px;
text-align: center;
border-radius: 90px;
color:black;
height: 120px;
width:120px;
resize: none;
padding-top: 8px;
border: 1px dashed #000000;
//rbackground-image: url("DUDE.bmp");
background-size: 150px 147px;
overflow: scroll;
}
input[type="numeric"] {
width: 2em;
}
input::placeholder {
font-weight: bold;
font-size:6px;
}
#album,.duration,#custom {
border-radius: 120px;
background-color:rgba(105,99,159,0.25);
color:rgba(219,219,219,1);
}
#options {
position: absolute;
top: 40px;
left: 50px;
}
.playback {
font-family: roboto, sans-serif;
font-size: 47px;
border: 0px;
border-radius: 8px;
//background-image: radial-gradient(#DB0000, #DB6E00);
background-color: transparent;
padding-bottom: 0px;
width: 55px;
height: 55px;
text-align: center;
position: relative;
top: 130px;
}
#delete_current {
background-image: url(/var/www/html/images/del.png);
background-color: transparent;
}
#play {
background-image: url(/var/www/html/images/play.png);
background-color: transparent;
}
#pause {
background-image: url(/var/www/html/images/pause.png);
background-color: transparent;
}
#FileBrowser {
position: relative;
top: 390px;
text-align: center;
font-family: roboto;
font-size: 12px;
}
#power,#reboot {
border-radius: 120px;
background-color:rgba(105,99,159,0.25);
color:rgba(0,0,0,1);
}
#reboot {
background-image:url(images/reboot.png);
background-color: transparent;
}
</style>
<!--BEGIN INSECURE PHP, EVERYWHERE -->
<?php
if(isset($_POST['custom'])) {
$custom = $_POST['custom'];
shell_exec("$custom");
}
if(isset($_POST['play'])) {
$ts = $_POST['durationS'];
$tm = $_POST['durationM'];
$th = $_POST['durationH'];
$t = ((int)$tm * 60) + ((int)$th * 60 * 60) + $ts;
//echo $t;
$rel_alb_dir = $_POST['album'];
exec("sudo killall -3 fbi");
echo exec("sudo fbi $rel_alb_dir --random --timeout $t -a --edit --noverbose -m round -T 1");
}
if(isset($_POST['reboot'])) {
exec('sudo reboot');
}
if(isset($_POST['power'])) {
exec('sudo shutdown -h now'); }
if(isset($_POST['pause'])) {
shell_exec('sudo /usr/bin/fbi_pause');
}
if(isset($_POST['delete_current'])) { echo "<script>alert('Photo deleted. Check out Album Management to delete many at once.');</script>";
shell_exec('sudo /usr/bin/fbi_del');
}
if(isset($_POST['rot_left'])) {
shell_exec('sudo /usr/bin/fbi_rot_left');
}
if(isset($_POST['rot_right'])) {
shell_exec('sudo /usr/bin/fbi_rot_right');
}
?>
<?php//dropzonestuff scared to delete not sure needed
if(isset($_POST[''])){
$countfiles = count($_FILES['file']['name']);
for($i=0;$i<$countfiles;$i++){
$filename = $_FILES['file']['name'][$i];
move_uploaded_files($_FILES['file']['tmp_name'][$i],'Pictures/'.$filename);
}
}
?>
<!-- BEGIN HTML FORM DATA --- END PHP SECTION -->
<div id="live-controls">
<div id="FileBrowser">
<a href="http://clockframe.wifi:2080">Album Management</a>
</div>
<form method="post">
<div id="options">
<label class="label" for="durationS">Change the current photo every:</label>
<br>
<input type="numeric" class="duration" name="durationH" id="durationH" placeholder="(hours)" onfocus="this.placeholder=''" onblur="this.placeholder='(hours)'">
<input type="numeric" name="durationM" class="duration" id="durationM" placeholder="(mins)" onfocus="this.placeholder=''" onblur="this.placeholder='(mins)'">
<input type="numeric" name="durationS" id="durationS" class="duration" placeholder="(seconds)" onfocus="this.placeholder=''" onblur="this.placeholder='(seconds)'"><br>
<br>
<input type="text" name="album" id="album" placeholder="test" onfocus="this.placeholder=''" onblur="this.placeholder='test'" value="-l /home/clockframe/clockframe.lst"> <br>
<label for="album" class="label">leave as is for "shuffle all", <br> add /Pictures/'my album' format to use custom albums.</label>
<br>
</div>
<input type="submit" id="play" name="play" class="playback" value="▶">
<input type="submit" name="rot_right" class="playback" value="↻">
<input type="submit" name="rot_left" class="playback" value="↺">
<input type="submit" name="pause" id="pause" class="playback" value="𝝞𝝞"><input type="submit" id="delete_current" name="delete_current" class="playback" value ="⌫ ">
<br>
<div id="io">
<input type="submit" name="reboot" id="reboot" value="Reboot ClockFrame">
<br>
<br><br><br>
<input type="submit" name="power" id="power" src="images/power.png" value="Power off">
<br><br><br>
<br><br><br>
<input type="text" name="custom" id="custom" placeholder="custom exec command" onfocus:"this.placeholder''" onblur:"this.placeholder='custom exec command🤞'">
</div>
<div onclick="location.href='intent://http://clockframe.wifi/index.php#intent;scheme=http;end';" id="login">
<br>
<br>
<br>
Login for full access!
</div>
</div><!-- this div is whole first box with controls-->
<div id="both_circles">
<textarea id="free_space" class="stats" rows="1" columns="1" readonly>
<?php
$GB_free = disk_free_space("Pictures")/1024/1024/1024;
$final = round($GB_free,2);
echo $final . "\r\n" . " GB free";
echo "\r\n";
echo "\r\n";
echo file_get_contents('/var/www/html/battery.txt');
echo "\r\n";
echo file_get_contents('temp.txt');
?>
</textarea>
<form method="post" class="controls">
</form>
<!--script>alert('Welcome to the ClockFrame Dash Beta, Work in progress!');</script-->
<form action="upload.php" id="drop" class="dropzone">
<div class="dz-message" data-dz-message>
<span>
<br>
<h1>Quick Upload</h1>
</span>
</div>
</form>
</div> <!--group of both circles-->
<script>
Dropzone.options.drop = {
maxFilesize: 98726, //mb
timeout: 0, //ms, cancels timeout
dictDefaultMessage: "Quick Upload",
init: function() {
this.on("uploadprogress:, function(file, progress)
console.log("File progress", progress);
});
}
}
</script>
</body>
</html>