|
1 <?php |
|
2 /* DO NOT CHANGE ANYTHING HERE */ |
|
3 if ( ! defined( 'ABSPATH' ) ) |
|
4 die(); |
|
5 |
|
6 require_once('../wp-config.php'); |
|
7 $title = 'FileManager'; |
|
8 define("VERSION", "1.4.0"); |
|
9 include(WP_CONTENT_DIR . "/plugins/wp-filemanager/conf/config.inc.php"); |
|
10 include(WP_CONTENT_DIR . "/plugins/wp-filemanager/incl/functions.inc.php"); |
|
11 include(WP_CONTENT_DIR . "/plugins/wp-filemanager/lang/$language.inc.php"); |
|
12 include(WP_CONTENT_DIR . "/plugins/wp-filemanager/incl/header.inc.php"); |
|
13 include(WP_CONTENT_DIR . "/plugins/wp-filemanager/incl/html.header.inc.php"); |
|
14 /* register directory/filename */ |
|
15 |
|
16 if (isset($_GET['directory_name'])) |
|
17 { |
|
18 $directory_name = basename(stripslashes($_GET['directory_name']))."/"; |
|
19 } |
|
20 if (isset($_GET['filename'])) |
|
21 { |
|
22 $filename = basename(stripslashes($_GET['filename'])); |
|
23 } |
|
24 if (isset($_POST['directory_name'])) |
|
25 { |
|
26 $directory_name = basename(stripslashes($_POST['directory_name']))."/"; |
|
27 } |
|
28 if (isset($_POST['filename'])) |
|
29 { |
|
30 $filename = basename(stripslashes($_POST['filename'])); |
|
31 } |
|
32 if (isset($_POST['new_directory_name'])) |
|
33 { |
|
34 $new_directory_name = basename(stripslashes($_POST['new_directory_name']))."/"; |
|
35 } |
|
36 if (isset($_POST['new_filename'])) |
|
37 { |
|
38 $new_filename = basename(stripslashes($_POST['new_filename'])); |
|
39 } |
|
40 /* validate path */ |
|
41 if (isset($_GET['path'])) |
|
42 $wp_fileman_path = wp_fileman_validate_path($_GET['path']); |
|
43 else if (isset($_POST['path'])) |
|
44 $wp_fileman_path = wp_fileman_validate_path($_POST['path']); |
|
45 |
|
46 |
|
47 if (!isset($wp_fileman_path) || $wp_fileman_path == "./" || $wp_fileman_path == ".\\" || $wp_fileman_path == "/" || $wp_fileman_path == "\\") |
|
48 $wp_fileman_path = false; |
|
49 |
|
50 if (isset($_SESSION['session_username']) && $_SESSION['session_username'] == $username && isset($_SESSION['session_password']) && $_SESSION['session_password'] == md5($password) || !$phpfm_auth) |
|
51 { |
|
52 if (!(@opendir($home_directory.$wp_fileman_path)) || (substr($home_directory, -1) != "/")) |
|
53 { |
|
54 print "<table class='output' width=400 cellpadding=0 cellspacing=0>"; |
|
55 print "<tr><td align='center'>"; |
|
56 |
|
57 if (!(@opendir($home_directory))) |
|
58 print "<font color='#CC0000'>$StrInvalidHomeFolder</font>"; |
|
59 else if (!(@opendir($home_directory.$wp_fileman_path))) |
|
60 print "<font color='#CC0000'>$StrInvalidPath</font>"; |
|
61 if (substr($home_directory, -1) != "/") |
|
62 print " <font color='#CC0000'>$StrMissingTrailingSlash</font>"; |
|
63 |
|
64 print "</td></tr>"; |
|
65 print "</table><br />"; |
|
66 } |
|
67 if (isset($_GET['action']) && is_file(WP_CONTENT_DIR . "/plugins/wp-filemanager/incl/".$_GET['action'].".inc.php") && wp_fileman_is_valid_name($_GET['action'])) |
|
68 { |
|
69 include(WP_CONTENT_DIR . "/plugins/wp-filemanager/incl/".basename($_GET['action']).".inc.php"); |
|
70 } |
|
71 else if (isset($_GET['output']) && is_file(WP_CONTENT_DIR . "/plugins/wp-filemanager/incl/".$_GET['output'].".inc.php") && wp_fileman_is_valid_name($_GET['output'])) |
|
72 { |
|
73 print "<table class='output' width=400 cellpadding=0 cellspacing=0>"; |
|
74 print "<tr><td align='center'>"; |
|
75 include(WP_CONTENT_DIR . "/plugins/wp-filemanager/incl/".basename($_GET['output']).".inc.php"); |
|
76 print "</td></tr>"; |
|
77 print "</table><br />"; |
|
78 include(WP_CONTENT_DIR . "/plugins/wp-filemanager/incl/filebrowser.inc.php"); |
|
79 } |
|
80 else |
|
81 { |
|
82 include(WP_CONTENT_DIR . "/plugins/wp-filemanager/incl/filebrowser.inc.php"); |
|
83 } |
|
84 } |
|
85 else |
|
86 { |
|
87 include(WP_CONTENT_DIR . "/plugins/wp-filemanager/incl/login.inc.php"); |
|
88 } |
|
89 //include(WP_CONTENT_DIR . "/plugins/wp-filemanager/incl/footer.inc.php"); |
|
90 ?> |