-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.php
executable file
·63 lines (52 loc) · 1.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
<?php
session_start();
require ('config.php');
require ('libs/funcs.php');
#Authentication
require ('libs/index.authorize.php');
#Process directory/file request
$dir = isset($_REQUEST['d']) ? $_REQUEST['d'] : '';
if ($dir && $config['enable_folder_maxdepth']) {
$dir = split("/", $dir);
foreach ($dir as $k => $v) {
if (($v == "..") || ($v == ".") || ($v == "")) {
unset($dir[$k]);
} else if ($v[0] == "." && ! $auth && ! isset($_GET['download'])) {
authorize();
}
}
$path = $config['storage_path'];
foreach ($dir as $k => $v) {
if (! file_exists($path . "/$v")) {
unset($dir[$k]);
} else {
$path .= "/$v";
}
}
$config['storage_path'] .= ($config['storage_path_relative'] = "/" . join("/", $dir));
if (isset($dir)) {
$dirlevel = sizeof($dir);
} else {
$dirlevel = 0;
}
} else {
unset($dir);
}
#Missing slash?
if ($_GET['download'] && is_dir($config['storage_path'] . '/' . $_GET['download'])) {
header('Location: ' . BASE_URL . $config['storage_path_relative'] . '/' . $_GET['download'] . '/');
exit();
}
#Progress bar
require ('libs/index.progress.php');
#Make dir
require ('libs/index.makedir.php');
#Upload
require ('libs/index.upload.php');
#Delete
require ('libs/index.delete.php');
#Download
require ('libs/index.download.php');
#List
require ('libs/index.list.php');
?>