-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
93 lines (76 loc) · 2.81 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
<?php
define("VERSION", "0.2.3");
include("./conf/config.inc.php");
include("./incl/functions.inc.php");
include("./lang/$language.inc.php");
include("./incl/header.inc.php");
include("./incl/html.header.inc.php");
/* register directory/filename */
if (isset($_GET['directory_name']))
{
$directory_name = basename(stripslashes($_GET['directory_name']))."/";
}
if (isset($_GET['filename']))
{
$filename = basename(stripslashes($_GET['filename']));
}
if (isset($_POST['directory_name']))
{
$directory_name = basename(stripslashes($_POST['directory_name']))."/";
}
if (isset($_POST['filename']))
{
$filename = basename(stripslashes($_POST['filename']));
}
if (isset($_POST['new_directory_name']))
{
$new_directory_name = basename(stripslashes($_POST['new_directory_name']))."/";
}
if (isset($_POST['new_filename']))
{
$new_filename = basename(stripslashes($_POST['new_filename']));
}
/* validate path */
if (isset($_GET['path']))
$path = validate_path($_GET['path']);
else if (isset($_POST['path']))
$path = validate_path($_POST['path']);
if (!isset($path) || $path == "./" || $path == ".\\" || $path == "/" || $path == "\\")
$path = false;
if (isset($_SESSION['session_username']) && $_SESSION['session_username'] == $username && isset($_SESSION['session_password']) && $_SESSION['session_password'] == md5($password) || !$phpfm_auth)
{
if (!(@opendir($home_directory.$path)) || (substr($home_directory, -1) != "/"))
{
print "<table class='output' width=400 cellpadding=0 cellspacing=0>";
print "<tr><td align='center'>";
if (!(@opendir($home_directory)))
print "<font color='#CC0000'>$StrInvalidHomeFolder</font>";
else if (!(@opendir($home_directory.$path)))
print "<font color='#CC0000'>$StrInvalidPath</font>";
if (substr($home_directory, -1) != "/")
print " <font color='#CC0000'>$StrMissingTrailingSlash</font>";
print "</td></tr>";
print "</table><br />";
}
if (isset($_GET['action']) && is_file("incl/".$_GET['action'].".inc.php") && is_valid_name($_GET['action']))
include("./incl/".basename($_GET['action']).".inc.php");
else if (isset($_GET['output']) && is_file("incl/".$_GET['output'].".inc.php") && is_valid_name($_GET['output']))
{
print "<table class='output' width=400 cellpadding=0 cellspacing=0>";
print "<tr><td align='center'>";
include("./incl/".basename($_GET['output']).".inc.php");
print "</td></tr>";
print "</table><br />";
include("./incl/filebrowser.inc.php");
}
else
{
include("./incl/filebrowser.inc.php");
}
}
else
{
include("./incl/login.inc.php");
}
include("./incl/footer.inc.php");
?>