0
|
1 |
<?php |
|
2 |
if ( ! defined( 'ABSPATH' ) ) |
|
3 |
die(); |
|
4 |
$wp_root = dirname(dirname(dirname(dirname(dirname(__FILE__))))); |
|
5 |
if(file_exists($wp_root . '/wp-load.php')) { |
|
6 |
require_once($wp_root . "/wp-load.php"); |
|
7 |
} else if(file_exists($wp_root . '/wp-config.php')) { |
|
8 |
require_once($wp_root . "/wp-config.php"); |
|
9 |
}else { |
|
10 |
//echo "Exiting $wp_root"; |
|
11 |
exit; |
|
12 |
} |
|
13 |
$wp_filemanager_path=plugin_dir_path("wp-filemanger"); |
|
14 |
# Check "docs/configurating.txt" for a more complete description of how you |
|
15 |
# set the different settings and what they will do. |
|
16 |
|
|
17 |
# Path from wp-admin to your images directory |
|
18 |
# Use forward slashes instead of backslashes and remember a traling slash! |
|
19 |
# This path should be RELATIVE to your wp-admin directory |
|
20 |
//$home_directory = "../../../"; |
|
21 |
if ( function_exists('get_option') && get_option('wp_fileman_home') != '') |
|
22 |
{ |
|
23 |
$home_directory = get_option('wp_fileman_home'); |
|
24 |
} |
|
25 |
else |
|
26 |
{ |
|
27 |
$home_directory = plugin_dir_path("wp-filemanger"); |
|
28 |
} |
|
29 |
# Language of PHPFM. |
|
30 |
$language = "english"; |
|
31 |
|
|
32 |
# Session save_path information |
|
33 |
# *NIX systems - set this to "/tmp/"; |
|
34 |
# WINDOWS systems - set this to "c:/winnt/temp/"; |
|
35 |
# NB! replace "c:/winnt/" with the path to your windows folder |
|
36 |
# |
|
37 |
# Uncomment _only_ if you are experiencing errors! |
|
38 |
# $session_save_path = "/tmp/"; |
|
39 |
|
|
40 |
# Login is handled by Wordpress in this hack |
|
41 |
# DO NOT enable phpfm_auth, as it will likely break the script |
|
42 |
$phpfm_auth = FALSE; |
|
43 |
$username = ""; |
|
44 |
$password = ""; |
|
45 |
|
|
46 |
# Access configuration |
|
47 |
# Each variable can be set to either TRUE or FALSE. |
|
48 |
if (function_exists('get_option') && get_option('wp_fileman_Allow_Download') == 'checked') |
|
49 |
$AllowDownload = TRUE; |
|
50 |
else |
|
51 |
$AllowDownload = FALSE; |
|
52 |
|
|
53 |
if (function_exists('get_option') && get_option('wp_fileman_Create_File') == 'checked') |
|
54 |
$AllowCreateFile = TRUE; |
|
55 |
else |
|
56 |
$AllowCreateFile = FALSE; |
|
57 |
|
|
58 |
if (function_exists('get_option') && get_option('wp_fileman_Create_Folder') == 'checked') |
|
59 |
$AllowCreateFolder = TRUE; |
|
60 |
else |
|
61 |
$AllowCreateFolder = FALSE; |
|
62 |
|
|
63 |
if (function_exists('get_option') && get_option('wp_fileman_Allow_Rename') == 'checked') |
|
64 |
$AllowRename = TRUE; |
|
65 |
else |
|
66 |
$AllowRename = FALSE; |
|
67 |
if (function_exists('get_option') && get_option('wp_fileman_Allow_Upload') == 'checked') |
|
68 |
$AllowUpload = TRUE; |
|
69 |
else |
|
70 |
$AllowUpload = FALSE; |
|
71 |
if (function_exists('get_option') && get_option('wp_fileman_Allow_Delete') == 'checked') |
|
72 |
$AllowDelete = TRUE; |
|
73 |
else |
|
74 |
$AllowDelete = FALSE; |
|
75 |
if (function_exists('get_option') && get_option('wp_fileman_Allow_View') == 'checked') |
|
76 |
$AllowView = TRUE; |
|
77 |
else |
|
78 |
$AllowView = FALSE; |
|
79 |
if (function_exists('get_option') && get_option('wp_fileman_Allow_Edit') == 'checked') |
|
80 |
$AllowEdit = TRUE; |
|
81 |
else |
|
82 |
$AllowEdit = FALSE; |
|
83 |
if (function_exists('get_option') && get_option('wp_fileman_Show_Extension') == 'checked') |
|
84 |
$ShowExtension = TRUE; |
|
85 |
else |
|
86 |
$ShowExtension = FALSE; |
|
87 |
|
|
88 |
# Icons for files |
|
89 |
$IconArray = array( |
|
90 |
"text.gif" => "txt ini xml xsl ini inf cfg log nfo", |
|
91 |
"layout.gif" => "html htm shtml htm pdf", |
|
92 |
"script.gif" => "php php4 php3 phtml phps conf sh shar csh ksh tcl cgi pl js", |
|
93 |
"image2.gif" => "jpeg jpe jpg gif png bmp", |
|
94 |
"c.gif" => "c cpp", |
|
95 |
"compressed.gif" => "zip tar gz tgz z ace rar arj cab bz2", |
|
96 |
"sound2.gif" => "wav mp1 mp2 mp3 mid", |
|
97 |
"movie.gif" => "mpeg mpg mov avi rm wmv divx", |
|
98 |
"binary.gif" => "exe com dll bin dat rpm deb", |
|
99 |
); |
|
100 |
|
|
101 |
# Files that can be edited in PHPFM's text editor |
|
102 |
|
|
103 |
if (trim(function_exists('get_option') && get_option('wp_fileman_editable_ext')) != "") |
|
104 |
{ |
|
105 |
$EditableFiles = get_option('wp_fileman_editable_ext'); |
|
106 |
} |
|
107 |
# Files that can be viewed in PHPFM's image viewer. |
|
108 |
if (trim(function_exists('get_option') && get_option('wp_fileman_viewable_ext')) != "") |
|
109 |
{ |
|
110 |
$ViewableFiles = get_option('wp_fileman_viewable_ext'); |
|
111 |
} |
|
112 |
|
|
113 |
# Format of last modification date |
|
114 |
$ModifiedFormat = "Y-m-d H:i"; |
|
115 |
|
|
116 |
# Zoom levels for PHPFM's image viewer. |
|
117 |
$ZoomArray = array( |
|
118 |
5, |
|
119 |
7, |
|
120 |
10, |
|
121 |
15, |
|
122 |
20, |
|
123 |
30, |
|
124 |
50, |
|
125 |
70, |
|
126 |
100, # Base zoom level (do not change) |
|
127 |
150, |
|
128 |
200, |
|
129 |
300, |
|
130 |
500, |
|
131 |
700, |
|
132 |
1000, |
|
133 |
); |
|
134 |
|
|
135 |
# Hidden files and directories |
|
136 |
if (function_exists('get_option') && get_option('wp_fileman_hidden_extension') != "") |
|
137 |
{ |
|
138 |
$hide_file_extension = explode(',',get_option('wp_fileman_hidden_extension')); |
|
139 |
} |
|
140 |
else |
|
141 |
{ |
|
142 |
$hide_file_extension = array( |
|
143 |
"foo", |
|
144 |
"bar", |
|
145 |
); |
|
146 |
} |
|
147 |
|
|
148 |
if (function_exists('get_option') && get_option('wp_fileman_hidden_file') != "") |
|
149 |
{ |
|
150 |
$hide_file_string = explode(',',get_option('wp_fileman_hidden_file')); |
|
151 |
} |
|
152 |
else |
|
153 |
{ |
|
154 |
$hide_file_string = array( |
|
155 |
".htaccess" |
|
156 |
); |
|
157 |
} |
|
158 |
if (function_exists('get_option') && get_option('wp_fileman_hidden_dir') != "") |
|
159 |
{ |
|
160 |
$hide_directory_string = explode(',',get_option('wp_fileman_hidden_dir')); |
|
161 |
} |
|
162 |
else |
|
163 |
{ |
|
164 |
$hide_directory_string = array( |
|
165 |
"secret dir", |
|
166 |
); |
|
167 |
} |
|
168 |
|
|
169 |
$MIMEtypes = array( |
|
170 |
"application/andrew-inset" => "ez", |
|
171 |
"application/mac-binhex40" => "hqx", |
|
172 |
"application/mac-compactpro" => "cpt", |
|
173 |
"application/msword" => "doc", |
|
174 |
"application/octet-stream" => "bin dms lha lzh exe class so dll", |
|
175 |
"application/oda" => "oda", |
|
176 |
"application/pdf" => "pdf", |
|
177 |
"application/postscript" => "ai eps ps", |
|
178 |
"application/smil" => "smi smil", |
|
179 |
"application/vnd.ms-excel" => "xls", |
|
180 |
"application/vnd.ms-powerpoint" => "ppt", |
|
181 |
"application/vnd.wap.wbxml" => "wbxml", |
|
182 |
"application/vnd.wap.wmlc" => "wmlc", |
|
183 |
"application/vnd.wap.wmlscriptc" => "wmlsc", |
|
184 |
"application/x-bcpio" => "bcpio", |
|
185 |
"application/x-cdlink" => "vcd", |
|
186 |
"application/x-chess-pgn" => "pgn", |
|
187 |
"application/x-cpio" => "cpio", |
|
188 |
"application/x-csh" => "csh", |
|
189 |
"application/x-director" => "dcr dir dxr", |
|
190 |
"application/x-dvi" => "dvi", |
|
191 |
"application/x-futuresplash" => "spl", |
|
192 |
"application/x-gtar" => "gtar", |
|
193 |
"application/x-hdf" => "hdf", |
|
194 |
"application/x-javascript" => "js", |
|
195 |
"application/x-koan" => "skp skd skt skm", |
|
196 |
"application/x-latex" => "latex", |
|
197 |
"application/x-netcdf" => "nc cdf", |
|
198 |
"application/x-sh" => "sh", |
|
199 |
"application/x-shar" => "shar", |
|
200 |
"application/x-shockwave-flash" => "swf", |
|
201 |
"application/x-stuffit" => "sit", |
|
202 |
"application/x-sv4cpio" => "sv4cpio", |
|
203 |
"application/x-sv4crc" => "sv4crc", |
|
204 |
"application/x-tar" => "tar", |
|
205 |
"application/x-tcl" => "tcl", |
|
206 |
"application/x-tex" => "tex", |
|
207 |
"application/x-texinfo" => "texinfo texi", |
|
208 |
"application/x-troff" => "t tr roff", |
|
209 |
"application/x-troff-man" => "man", |
|
210 |
"application/x-troff-me" => "me", |
|
211 |
"application/x-troff-ms" => "ms", |
|
212 |
"application/x-ustar" => "ustar", |
|
213 |
"application/x-wais-source" => "src", |
|
214 |
"application/zip" => "zip", |
|
215 |
"audio/basic" => "au snd", |
|
216 |
"audio/midi" => "mid midi kar", |
|
217 |
"audio/mpeg" => "mpga mp2 mp3", |
|
218 |
"audio/x-aiff" => "aif aiff aifc", |
|
219 |
"audio/x-mpegurl" => "m3u", |
|
220 |
"audio/x-pn-realaudio" => "ram rm", |
|
221 |
"audio/x-pn-realaudio-plugin" => "rpm", |
|
222 |
"audio/x-realaudio" => "ra", |
|
223 |
"audio/x-wav" => "wav", |
|
224 |
"chemical/x-pdb" => "pdb", |
|
225 |
"chemical/x-xyz" => "xyz", |
|
226 |
"image/bmp" => "bmp", |
|
227 |
"image/gif" => "gif", |
|
228 |
"image/ief" => "ief", |
|
229 |
"image/jpeg" => "jpeg jpg jpe", |
|
230 |
"image/png" => "png", |
|
231 |
"image/tiff" => "tiff tif", |
|
232 |
"image/vnd.wap.wbmp" => "wbmp", |
|
233 |
"image/x-cmu-raster" => "ras", |
|
234 |
"image/x-portable-anymap" => "pnm", |
|
235 |
"image/x-portable-bitmap" => "pbm", |
|
236 |
"image/x-portable-graymap" => "pgm", |
|
237 |
"image/x-portable-pixmap" => "ppm", |
|
238 |
"image/x-rgb" => "rgb", |
|
239 |
"image/x-xbitmap" => "xbm", |
|
240 |
"image/x-xpixmap" => "xpm", |
|
241 |
"image/x-xwindowdump" => "xwd", |
|
242 |
"model/iges" => "igs iges", |
|
243 |
"model/mesh" => "msh mesh silo", |
|
244 |
"model/vrml" => "wrl vrml", |
|
245 |
"text/css" => "css", |
|
246 |
"text/html" => "html htm", |
|
247 |
"text/plain" => "asc txt", |
|
248 |
"text/richtext" => "rtx", |
|
249 |
"text/rtf" => "rtf", |
|
250 |
"text/sgml" => "sgml sgm", |
|
251 |
"text/tab-separated-values" => "tsv", |
|
252 |
"text/vnd.wap.wml" => "wml", |
|
253 |
"text/vnd.wap.wmlscript" => "wmls", |
|
254 |
"text/x-setext" => "etx", |
|
255 |
"text/xml" => "xml xsl", |
|
256 |
"video/mpeg" => "mpeg mpg mpe", |
|
257 |
"video/quicktime" => "qt mov", |
|
258 |
"video/vnd.mpegurl" => "mxu", |
|
259 |
"video/x-msvideo" => "avi", |
|
260 |
"video/x-sgi-movie" => "movie", |
|
261 |
"x-conference/x-cooltalk" => "ice", |
|
262 |
); |
|
263 |
?> |