-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.php
439 lines (368 loc) · 15.3 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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
<?php
session_start();
$_SESSION['root'] = "/home/maix/"; //this is the start direcory aka scope, going outside this scope requires authentication -- see auth.php
$_SESSION["JSON"] = "/home/temp/JSON/"; //this is the location for the json files / necessary for the search, share and recent features -- see json.php
$_SESSION["search"] = "/home/maix/"; //this is the search scope of the server, session_root recommended
$_SESSION["password"] = "Eleven"; //this is the auth key allowing you to got outside session_root's scope, deleting, moving and renaming files
$server = "maix.ovh"; //this is the server's domain.name it is used in the og meta tags
$name = "Maix.Ovh"; //this is the still the Domain.Name but this can be stylised (capslock/not) it also is used in the og meta tags
$user = "Roy Ossai"; //this is the proprietor of the server, you may use your name here. It is used in the og meta tags
// To finish config please head to js/properties.js and change line 49 to your server name
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Primary Meta Tags -->
<title><?= $name; ?> - The Private web server for <?= $user; ?></title>
<meta name="title" content="<?= $name; ?> - The Private web server for <?= $user; ?>">
<meta name="description" content="Access files made available to you by the author. Share, store files and create folders on their server.">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://<?= $server; ?>/">
<meta property="og:title" content="<?= $name; ?> - The Private web server for <?= $user; ?>">
<meta property="og:description" content="Access files made available to you by the author. Share, store files and create folders on their server.">
<meta property="og:image" content="src/meta.png">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://<?= $server; ?>/">
<meta property="twitter:title" content="<?= $name; ?> - The Private web server for <?= $user; ?>">
<meta property="twitter:description" content="Access files made available to you by the author. Share, store files and create folders on their server.">
<meta property="twitter:image" content="src/meta.png">
<!-- The favicons, fonts and stylsheets -->
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="apple-touch-icon" sizes="57x57" href="favicon/apple-touch-icon-57x57.png" />
<link rel="apple-touch-icon" sizes="72x72" href="favicon/apple-touch-icon-72x72.png" />
<link rel="apple-touch-icon" sizes="76x76" href="favicon/apple-touch-icon-76x76.png" />
<link rel="apple-touch-icon" sizes="114x114" href="favicon/apple-touch-icon-114x114.png" />
<link rel="apple-touch-icon" sizes="120x120" href="favicon/apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon" sizes="144x144" href="favicon/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon" sizes="152x152" href="favicon/apple-touch-icon-152x152.png" />
<link rel="apple-touch-icon" sizes="180x180" href="favicon/apple-touch-icon-180x180.png" />
<link rel="icon" type="image/png" sizes="32x32" href="favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon/favicon-16x16.png">
<link rel="manifest" href="favicon/site.webmanifest">
<link rel="mask-icon" href="favicon/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="favicon/favicon.ico">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="favicon/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link href="https://fonts.googleapis.com/css?family=Barlow+Condensed&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Pacifico&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<!-- The header for the site -->
<header>
<div class="headcont">
<div id="logo">
<label class="link" data-id="home">myDrive</label>
</div>
<div class="search">
<div id="searchForm">
<div id="searchbar">
<input id="searchb" type="text" name="search" placeholder="Search">
</div>
<div id="searchButton">
<input id="SearchBtn" type="image" src="src/loupe.svg" width="25px" alt="SearchBtn">
</div>
</div>
</div>
<div>
<nav>
<ul class="navlist">
<li><label class="leave" data-id="https://www.netflix.com">Netflix</label></li>
<li><label class="leave" data-id="https://www.disneyplus.com/en-gb/">Disney+</label></li>
<li><label class="leave" data-id="https://www.canalplus.com/">myCanal</label></li>
<li><label class="leave" data-id="https://nino.<?= $server; ?>">nino</label></li>
<li><label class="leave" data-id="https://deluge.<?= $server; ?>">Deluge</label></li>
<li><label onclick="validate()" id="auth">Log In</label></li>
</ul>
</nav>
</div>
</div>
</header>
<!-- The sidebar comes next -->
<div id="sidebar">
<div id="create-folder">
<div id="inner-Create" class="newfldr">
<img src="src/add-folder.svg" width="30px">
<label>Create</label>
</div>
</div>
<ul class="sidenav">
<li id="side-upload" class="he">
<img src="src/upload.svg" width="30px">
<label>Upload</label>
</li>
<li class="link" data-id="home" id="side-root">
<img class="image" src="src/folder-2.svg" width="30px">
<label>Home</label>
</li>
<li class="link" data-id="Private" id="side-Private">
<img class="image" src="src/folder-2.svg" width="30px">
<label>Private</label>
</li>
<li class="link" data-id="Downloads" id="side-Downloads">
<img class="image" src="src/folder-2.svg" width="30px">
<label>Torrents</label>
</li>
<li onclick="media()" id="side-media">
<img class="image" src="src/folder-2.svg" width="30px">
<label>Media</label>
</li>
</ul>
<div id="side-divider"></div>
<div id="disk-info">
<img class="image" src="src/server.svg" width="20px">
<span id="storage">Storage Used: </span>
<span id="space-deets"> </span>
</div>
<div id="a-space-groove">
<div id="a-space-filler"></div>
</div>
</div>
<!-- Recently opened files -->
<div id="file-structure">
<div id="folder-head">
<div id="backbtn">
<img class="link" data-id="<?= $_SESSION['root']; ?>" id="backimg" src="src/back2.svg" width="20px">
<span id="recent-labelDiv">Recently opened files</span>
</div>
<label id="foldername" class="link" data-id="#">maix server</label>
</div>
<div id="recently-opened">
</div>
<!-- creating the file manager interface -->
<div id="dropzone">
<ul id="filelist">
</ul>
</div>
</div>
<!-- The context menu div -->
<div id="upload-selector">
<ul id="uSselector-ul">
<li id="use-file">Upload Files</li>
<div class="prop-divider"></div>
<li id="use-folder">Upload folders</li>
</ul>
</div>
<div id="properties">
<ul class="rightbar">
<li class="newfldr">
<label>New Folder</label>
</li>
<div class="prop-divider"></div>
<li class="element" id="sharebtn">
<label>Share</label>
</li>
<li class="element" id="moveprop">
<label>Move</label>
</li>
<div class="prop-divider"></div>
<li class="element" id="renameprop">
<label>Rename</label>
</li>
<li class="element download">
<label>Download</label>
</li>
<div class="prop-divider"></div>
<li class="element" id="infoprop">
<label>Information</label>
</li>
<li class="element" id="deleteprop">
<label>Delete</label>
</li>
</ul>
</div>
<!-- The fucking modals -->
<!-- The modals that don't require a refresh -->
<!-- The Information container -->
<div id="information-div">
<div id="info-head">
<span id="IH-Span">Information</span>
</div>
<div id="Info-body">
<ul id="Info-list">
<div class="prop-divider"></div>
<li>
<label id="inform-name">Name: </label>
<span></span>
</li>
<div class="prop-divider"></div>
<li>
<label id="inform-locate">Location: </label>
<span></span>
</li>
<div class="prop-divider"></div>
<li>
<label id="inform-time">Last Opened: </label>
<span></span>
</li>
<div class="prop-divider"></div>
<li>
<label id="inform-size">Size: </label>
<span></span>
</li>
</ul>
</div>
</div>
<!-- The move container -->
<div id="movecontainer">
<div id="movehead"><img src="src/back.svg" width="20px" onclick="back()"><label>Move to...</label></div>
<div id="movebody">
<ul id="movelist">
</ul>
</div>
<div id="movesub">
<button id="movebutton">Move</button>
</div>
</div>
<!-- The upload progress-->
<div id="uploadProgressContainer">
<div id="upload-head">
<label> Uploading!</label>
</div>
<div id="uploadGroove">
<div id="uploadFiller"></div>
</div>
<div id="uploadSub">
<label>Star Wars.m4v</label>
</div>
</div>
<!-- Info reporting div -->
<div id="info-reporting">
<div id="info-reporting-container">
<div id="info-reporting-img">
<img id="info-reporting-image" src="src/tick.svg" width="40px">
</div>
<div id="info-reporting-div-divider"></div>
<div id="info-reporting-context">
<label id="info-type-label">Prompt</label>
<div id="info-reporting-label-divider"></div>
<label id="info-reporting-message">You have logged in successfully</label>
</div>
</div>
</div>
<!-- The dropzone indicator -->
<div id="dndbox">
<div class="dboxhead">Upload to Server</div>
<div class="dboxbody error-label">
<label>Drag and Drop</label>
<br>
<label>files to Upload</label>
</div>
<div class="dboxsub errorsub">
<label>Test</label>
</div>
</div>
<!-- The lightbox modals -->
<div class="bg-modal" id="uploadblock">
<div class="dbox" id="upload">
<div class="dboxhead">Upload to Server</div>
<div class="dboxbody">
<div class="box" id="uploadcapture">
<input type="file" id="file-4" class="inputfile" data-multiple-caption="{count} files selected" webkitdirectory multiple/>
<label for="file-4"><span>Choose a file</span></label>
</div>
</div>
<div class="dboxsub">
<button id="uplbtn">Upload</button>
</div>
</div>
</div>
<div class="bg-modal" id="deletemodblock">
<div class="dbox" id="deletemod">
<div class="dboxhead">Ready to delete?</div>
<div class="dboxbody error-label" id="removelabel">
<label>Change</label>
</div>
<div id="deletesub">
<ul>
<li id="rmyes">Yes</li>
<li id="rmno">No</li>
</ul>
</div>
</div>
</div>
<div class="bg-modal" id="rendboxblock">
<div class="dbox" id="rendbox">
<div class="dboxhead">Rename!</div>
<div class="dboxbody renameform" id="rename-form">
<input type="text" name="rename" placeholder="Rename" class="renamebar" id="rename-bar">
<input type="image" src="src/edit.svg" width="20px" class="rnmbtn" id="rename-button">
</div>
<div class="dboxsub errorsub">
<label>Test</label>
</div>
</div>
</div>
<div class="bg-modal" id="createboxblock">
<div class="dbox" id="createbox">
<div class="dboxhead">New Folder!</div>
<div class="dboxbody renameform" id="createform">
<input type="text" name="rename" placeholder="Create" class="renamebar" id="create-bar">
<input type="image" src="src/edit.svg" width="20px" class="rnmbtn" id="create-button">
</div>
<div class="dboxsub errorsub">
<label>Test</label>
</div>
</div>
</div>
<div class="bg-modal" id="authdboxblock">
<div class="dbox" id="authdbox">
<div class="dboxhead">Authenticate!</div>
<div class="dboxbody renameform">
<input type="password" autocomplete="current-password" name="key" placeholder="Authenticate" class="renamebar" id="authbar">
<input type="image" src="src/edit.svg" width="20px" class="rnmbtn" id="authbtn">
</div>
<div class="dboxsub errorsub">
<label>Test</label>
</div>
</div>
</div>
<div class="bg-modal" id="videodivblock">
<img class="video-img" src="src/back-arrow.svg" width="40px" id="back-arrow">
<div id="videodiv"></div>
<img class="video-img" style="transform: scaleX(-1);" src="src/back-arrow.svg" width="40px" id="fow-arrow">
</div>
<!-- The modals that do require a refresh -->
<!-- The actionable modals -->
<?php if (isset($_SESSION['share'])) {
$key = array_keys($_SESSION["share"]);
$_SESSION["download"] = $key[0];
$values = array_values($_SESSION["share"]);
$name = basename($key[0]);
$value = $values[0];
?>
<div id="share-modal">
<div class="dbox">
<div class="dboxhead" id="title">Download!</div>
<div id="share-div" class="dboxbody error-label" onclick="download()">
<label><?= $name ?></label>
</div>
<div class="dboxsub errorsub">
<label>Test</label>
</div>
</div>
</div>
<?php } unset($_SESSION['share']); ?>
<footer>
<div id="copyright">
<label>Copyright © 2020 Roy Ossai.</label>
<br>
<div id="copyright-span">
<span>All rights reserved. No document may be reproduced for commercial use without written approval from the author.</span>
</div>
</div>
</footer>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="js/clipboard.min.js"></script>
<script src="js/properties.js"></script>
<script src="js/classes.js"></script>
<script src="js/dropzone.js"></script>
<script src="js/index.js"></script>
<script src="js/modals.js"></script>
<script src="js/beau.js"></script>
</html>