PageRenderTime 79ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/index.php

https://github.com/mooncrooner/encode-explorer
PHP | 2552 lines | 1886 code | 264 blank | 402 comment | 412 complexity | d24d03e0eb4de986d51985a7c16cf327 MD5 | raw file
  1. <?php
  2. /***************************************************************************
  3. *
  4. * Encode Explorer
  5. *
  6. * Author / Autor : Marek Rei (marek 채t siineiolekala dot net)
  7. *
  8. * Version / Versioon : 6.3
  9. *
  10. * Last change / Viimati muudetud: 23.09.2011
  11. *
  12. * Homepage / Koduleht: encode-explorer.siineiolekala.net
  13. *
  14. *
  15. * NB!: Comments are in english.
  16. * Comments needed for configuring are in both estonian and english.
  17. * If you change anything, save with UTF-8! Otherwise you may
  18. * encounter problems, especially when displaying images.
  19. *
  20. ***************************************************************************/
  21. /***************************************************************************
  22. *
  23. * This is free software and it's distributed under GPL Licence.
  24. *
  25. * Encode Explorer is written in the hopes that it can be useful to people.
  26. * It has NO WARRANTY and when you use it, the author is not responsible
  27. * for how it works (or doesn't).
  28. *
  29. * The icon images are designed by Mark James (http://www.famfamfam.com)
  30. * and distributed under the Creative Commons Attribution 3.0 License.
  31. *
  32. ***************************************************************************/
  33. /***************************************************************************/
  34. /* HERE ARE THE SETTINGS FOR CONFIGURATION */
  35. /***************************************************************************/
  36. //
  37. // Initialising variables. Don't change these.
  38. //
  39. $_CONFIG = array();
  40. $_ERROR = "";
  41. $_START_TIME = microtime(TRUE);
  42. /*
  43. * GENERAL SETTINGS
  44. */
  45. //
  46. // Choose a language. See below in the language section for options.
  47. // Default: $_CONFIG['lang'] = "en";
  48. //
  49. $_CONFIG['lang'] = "en";
  50. //
  51. // Display thumbnails when hovering over image entries in the list.
  52. // Common image types are supported (jpeg, png, gif).
  53. // Pdf files are also supported but require ImageMagick to be installed.
  54. // Default: $_CONFIG['thumbnails'] = true;
  55. //
  56. $_CONFIG['thumbnails'] = true;
  57. //
  58. // Maximum sizes of the thumbnails.
  59. // Default: $_CONFIG['thumbnails_width'] = 200;
  60. // Default: $_CONFIG['thumbnails_height'] = 200;
  61. //
  62. $_CONFIG['thumbnails_width'] = 300;
  63. $_CONFIG['thumbnails_height'] = 300;
  64. //
  65. // Mobile interface enabled. true/false
  66. // Default: $_CONFIG['mobile_enabled'] = true;
  67. //
  68. $_CONFIG['mobile_enabled'] = true;
  69. //
  70. // Mobile interface as the default setting. true/false
  71. // Default: $_CONFIG['mobile_default'] = false;
  72. //
  73. $_CONFIG['mobile_default'] = false;
  74. /*
  75. * USER INTERFACE
  76. */
  77. //
  78. // Will the files be opened in a new window? true/false
  79. // Default: $_CONFIG['open_in_new_window'] = false;
  80. //
  81. $_CONFIG['open_in_new_window'] = false;
  82. //
  83. // How deep in subfolders will the script search for files?
  84. // Set it larger than 0 to display the total used space.
  85. // Default: $_CONFIG['calculate_space_level'] = 0;
  86. //
  87. $_CONFIG['calculate_space_level'] = 0;
  88. //
  89. // Will the page header be displayed? 0=no, 1=yes.
  90. // Default: $_CONFIG['show_top'] = true;
  91. //
  92. $_CONFIG['show_top'] = true;
  93. //
  94. // The title for the page
  95. // Default: $_CONFIG['main_title'] = "Directory Contents";
  96. //
  97. $_CONFIG['main_title'] = "Directory Contents";
  98. //
  99. // The secondary page titles, randomly selected and displayed under the main header.
  100. // For example: $_CONFIG['secondary_titles'] = array("Secondary title", "&ldquo;Secondary title with quotes&rdquo;");
  101. // Default: $_CONFIG['secondary_titles'] = array();
  102. //
  103. $_CONFIG['secondary_titles'] = array();
  104. //
  105. // Display breadcrumbs (relative path of the location).
  106. // Default: $_CONFIG['show_path'] = true;
  107. //
  108. $_CONFIG['show_path'] = true;
  109. //
  110. // Display the time it took to load the page.
  111. // Default: $_CONFIG['show_load_time'] = true;
  112. //
  113. $_CONFIG['show_load_time'] = true;
  114. //
  115. // The time format for the "last changed" column.
  116. // Default: $_CONFIG['time_format'] = "d.m.y H:i:s";
  117. //
  118. $_CONFIG['time_format'] = "d.m.y H:i:s";
  119. //
  120. // Charset. Use the one that suits for you.
  121. // Default: $_CONFIG['charset'] = "UTF-8";
  122. //
  123. $_CONFIG['charset'] = "UTF-8";
  124. /*
  125. * PERMISSIONS
  126. */
  127. //
  128. // The array of folder names that will be hidden from the list.
  129. // Default: $_CONFIG['hidden_dirs'] = array();
  130. //
  131. $_CONFIG['hidden_dirs'] = array();
  132. //
  133. // Filenames that will be hidden from the list.
  134. // Default: $_CONFIG['hidden_files'] = array(".ftpquota", "index.php", "index.php~", ".htaccess", ".htpasswd");
  135. //
  136. $_CONFIG['hidden_files'] = array(".ftpquota", "index.php", "index.php~", ".htaccess", ".htpasswd");
  137. //
  138. // Whether authentication is required to see the contents of the page.
  139. // If set to false, the page is public.
  140. // If set to true, you should specify some users as well (see below).
  141. // Important: This only prevents people from seeing the list.
  142. // They will still be able to access the files with a direct link.
  143. // Default: $_CONFIG['require_login'] = false;
  144. //
  145. $_CONFIG['require_login'] = false;
  146. //
  147. // Usernames and passwords for restricting access to the page.
  148. // The format is: array(username, password, status)
  149. // Status can be either "user" or "admin". User can read the page, admin can upload and delete.
  150. // For example: $_CONFIG['users'] = array(array("username1", "password1", "user"), array("username2", "password2", "admin"));
  151. // You can also keep require_login=false and specify an admin.
  152. // That way everyone can see the page but username and password are needed for uploading.
  153. // For example: $_CONFIG['users'] = array(array("username", "password", "admin"));
  154. // Default: $_CONFIG['users'] = array();
  155. //
  156. $_CONFIG['users'] = array();
  157. //
  158. // Permissions for uploading, creating new directories and deleting.
  159. // They only apply to admin accounts, regular users can never perform these operations.
  160. // Default:
  161. // $_CONFIG['upload_enable'] = true;
  162. // $_CONFIG['newdir_enable'] = true;
  163. // $_CONFIG['delete_enable'] = false;
  164. //
  165. $_CONFIG['upload_enable'] = true;
  166. $_CONFIG['newdir_enable'] = true;
  167. $_CONFIG['delete_enable'] = false;
  168. /*
  169. * UPLOADING
  170. */
  171. //
  172. // List of directories where users are allowed to upload.
  173. // For example: $_CONFIG['upload_dirs'] = array("./myuploaddir1/", "./mydir/upload2/");
  174. // The path should be relative to the main directory, start with "./" and end with "/".
  175. // All the directories below the marked ones are automatically included as well.
  176. // If the list is empty (default), all directories are open for uploads, given that the password has been set.
  177. // Default: $_CONFIG['upload_dirs'] = array();
  178. //
  179. $_CONFIG['upload_dirs'] = array();
  180. //
  181. // MIME type that are allowed to be uploaded.
  182. // For example, to only allow uploading of common image types, you could use:
  183. // $_CONFIG['upload_allow_type'] = array("image/png", "image/gif", "image/jpeg");
  184. // Default: $_CONFIG['upload_allow_type'] = array();
  185. //
  186. $_CONFIG['upload_allow_type'] = array();
  187. //
  188. // File extensions that are not allowed for uploading.
  189. // For example: $_CONFIG['upload_reject_extension'] = array("php", "html", "htm");
  190. // Default: $_CONFIG['upload_reject_extension'] = array();
  191. //
  192. $_CONFIG['upload_reject_extension'] = array("php");
  193. /*
  194. * LOGGING
  195. */
  196. //
  197. // Upload notification e-mail.
  198. // If set, an e-mail will be sent every time someone uploads a file or creates a new dirctory.
  199. // Default: $_CONFIG['upload_email'] = "";
  200. //
  201. $_CONFIG['upload_email'] = "";
  202. //
  203. // Logfile name. If set, a log line will be written there whenever a directory or file is accessed.
  204. // For example: $_CONFIG['log_file'] = ".log.txt";
  205. // Default: $_CONFIG['log_file'] = "";
  206. //
  207. $_CONFIG['log_file'] = "";
  208. /*
  209. * SYSTEM
  210. */
  211. //
  212. // The starting directory. Normally no need to change this.
  213. // Use only relative subdirectories!
  214. // For example: $_CONFIG['starting_dir'] = "./mysubdir/";
  215. // Default: $_CONFIG['starting_dir'] = ".";
  216. //
  217. $_CONFIG['starting_dir'] = ".";
  218. //
  219. // Location in the server. Usually this does not have to be set manually.
  220. // Default: $_CONFIG['basedir'] = "";
  221. //
  222. $_CONFIG['basedir'] = "";
  223. //
  224. // Big files. If you have some very big files (>4GB), enable this for correct
  225. // file size calculation.
  226. // Default: $_CONFIG['large_files'] = false;
  227. //
  228. $_CONFIG['large_files'] = false;
  229. //
  230. // The session name, which is used as a cookie name.
  231. // Change this to something original if you have multiple copies in the same space
  232. // and wish to keep their authentication separate.
  233. // The value can contain only letters and numbers. For example: MYSESSION1
  234. // More info at: http://www.php.net/manual/en/function.session-name.php
  235. // Default: $_CONFIG['session_name'] = "";
  236. //
  237. $_CONFIG['session_name'] = "";
  238. /***************************************************************************/
  239. /* TRANSLATIONS. */
  240. /***************************************************************************/
  241. $_TRANSLATIONS = array();
  242. // English
  243. $_TRANSLATIONS["en"] = array(
  244. "file_name" => "File name",
  245. "size" => "Size",
  246. "last_changed" => "Last changed",
  247. "total_used_space" => "Total used space",
  248. "free_space" => "Free space",
  249. "password" => "Password",
  250. "upload" => "Upload",
  251. "failed_upload" => "Failed to upload the file!",
  252. "failed_move" => "Failed to move the file into the right directory!",
  253. "wrong_password" => "Wrong password",
  254. "make_directory" => "New dir",
  255. "new_dir_failed" => "Failed to create directory",
  256. "chmod_dir_failed" => "Failed to change directory rights",
  257. "unable_to_read_dir" => "Unable to read directory",
  258. "location" => "Location",
  259. "root" => "Root",
  260. "log_file_permission_error" => "The script does not have permissions to write the log file.",
  261. "upload_not_allowed" => "The script configuration does not allow uploading in this directory.",
  262. "upload_dir_not_writable" => "This directory does not have write permissions.",
  263. "mobile_version" => "Mobile view",
  264. "standard_version" => "Standard view",
  265. "page_load_time" => "Page loaded in %.2f ms",
  266. "wrong_pass" => "Wrong username or password",
  267. "username" => "Username",
  268. "log_in" => "Log in",
  269. "upload_type_not_allowed" => "This file type is not allowed for uploading.",
  270. "del" => "Del", // short for Delete
  271. "log_out" => "Log out"
  272. );
  273. /***************************************************************************/
  274. /* CSS FOR TWEAKING THE DESIGN */
  275. /***************************************************************************/
  276. function css()
  277. {
  278. ?>
  279. <style type="text/css">
  280. /* General styles */
  281. BODY {
  282. background-color:#FFFFFF;
  283. font-family:Verdana;
  284. font-size:small;
  285. }
  286. A {
  287. color: #000000;
  288. text-decoration: none;
  289. }
  290. A:hover {
  291. text-decoration: underline;
  292. }
  293. #top {
  294. width:100%;
  295. padding-bottom: 20px;
  296. }
  297. #top a span, #top a:hover, #top a span:hover{
  298. color:#68a9d2;
  299. font-weight:bold;
  300. text-align:center;
  301. font-size:large;
  302. }
  303. #top a {
  304. display:block;
  305. padding:20px 0 0 0;
  306. }
  307. #top span {
  308. display:block;
  309. }
  310. div.subtitle{
  311. width:80%;
  312. margin: 0 auto;
  313. color:#68a9d2;
  314. text-align:center;
  315. }
  316. #frame {
  317. border: 1px solid #CDD2D6;
  318. text-align:left;
  319. position: relative;
  320. margin: 0 auto;
  321. max-width:680px;
  322. overflow:hidden;
  323. }
  324. #error {
  325. max-width:450px;
  326. background-color:#FFE4E1;
  327. color:#000000;
  328. padding:7pt;
  329. position: relative;
  330. margin: 10pt auto;
  331. text-align:center;
  332. border: 1px dotted #CDD2D6;
  333. }
  334. input {
  335. border: 1px solid #CDD2D6;
  336. }
  337. .bar{
  338. width:100%;
  339. clear:both;
  340. height:1px;
  341. }
  342. /* File list */
  343. table.table {
  344. width:100%;
  345. border-collapse: collapse;
  346. }
  347. table.table td{
  348. padding:3px;
  349. }
  350. table.table tr.row.two {
  351. background-color:#fcfdfe;
  352. }
  353. table.table tr.row.one {
  354. background-color:#f8f9fa;
  355. }
  356. table.table tr.row td.icon {
  357. width:25px;
  358. padding-top:3px;
  359. padding-bottom:1px;
  360. }
  361. table.table td.del {
  362. width:25px;
  363. }
  364. table.table tr.row td.size {
  365. width: 100px;
  366. text-align: right;
  367. }
  368. table.table tr.row td.changed {
  369. width: 150px;
  370. text-align: center;
  371. }
  372. table.table tr.header img {
  373. vertical-align:bottom;
  374. }
  375. table img{
  376. border:0;
  377. }
  378. /* Info area */
  379. #info {
  380. color:#000000;
  381. font-family:Verdana;
  382. max-width:680px;
  383. position: relative;
  384. margin: 0 auto;
  385. text-align:center;
  386. }
  387. /* Thumbnail area */
  388. #thumb {
  389. position:absolute;
  390. border: 1px solid #CDD2D6;
  391. background:#f8f9fa;
  392. display:none;
  393. padding:3px;
  394. }
  395. #thumb img {
  396. display:block;
  397. }
  398. /* Login bar (at the bottom of the page) */
  399. #login_bar {
  400. margin: 0 auto;
  401. margin-top:2px;
  402. max-width:680px;
  403. }
  404. #login_bar input.submit{
  405. float:right;
  406. }
  407. /* Upload area */
  408. #upload {
  409. margin: 0 auto;
  410. margin-top:2px;
  411. max-width:680px;
  412. }
  413. #upload #password_container {
  414. margin-right:20px;
  415. }
  416. #upload #newdir_container, #upload #password_container {
  417. float:left;
  418. }
  419. #upload #upload_container{
  420. float:right;
  421. }
  422. #upload input.upload_dirname, #upload input.upload_password{
  423. width:140px;
  424. }
  425. #upload input.upload_file{
  426. font-size:small;
  427. }
  428. /* Breadcrumbs */
  429. div.breadcrumbs {
  430. display:block;
  431. padding:1px 3px;
  432. color:#cccccc;
  433. font-size:x-small;
  434. }
  435. div.breadcrumbs a{
  436. display:inline-block;
  437. color:#cccccc;
  438. padding:2px 0;
  439. font-size:small;
  440. }
  441. /* Login area */
  442. #login {
  443. max-width:280px;
  444. text-align:right;
  445. margin:15px auto 50px auto;
  446. }
  447. #login div {
  448. display:block;
  449. width:100%;
  450. margin-top:5px;
  451. }
  452. #login label{
  453. width: 120px;
  454. text-align: right;
  455. }
  456. /* Mobile interface */
  457. body.mobile #frame, body.mobile #info, body.mobile #upload {
  458. max-width:none;
  459. }
  460. body.mobile {
  461. font-size:medium;
  462. }
  463. body.mobile a.item {
  464. display:block;
  465. padding:10px 0;
  466. }
  467. body.mobile a.item span.size {
  468. float:right;
  469. margin-left:10px;
  470. }
  471. body.mobile table.table {
  472. margin-bottom:30px;
  473. }
  474. body.mobile table.table tr td {
  475. border-top: 1px solid #CDD2D6;
  476. }
  477. body.mobile table.table tr.last td {
  478. border-bottom: 1px solid #CDD2D6;
  479. }
  480. body.mobile #top {
  481. padding-bottom:3px;
  482. }
  483. body.mobile #top a {
  484. padding-top:3px;
  485. }
  486. body.mobile #upload #password_container, body.mobile #upload #upload_container, body.mobile #upload #newdir_container {
  487. float:none;
  488. margin-top:5px;
  489. }
  490. body.mobile #upload input.upload_dirname, body.mobile #upload input.upload_password{
  491. width:240px;
  492. }
  493. body.mobile #upload {
  494. margin-bottom:15px;
  495. }
  496. </style>
  497. <?php
  498. }
  499. /***************************************************************************/
  500. /* IMAGE CODES IN BASE64 */
  501. /* You can generate your own with a converter */
  502. /* Like here: http://www.motobit.com/util/base64-decoder-encoder.asp */
  503. /* Or here: http://www.greywyvern.com/code/php/binary2base64 */
  504. /* Or just use PHP base64_encode() function */
  505. /***************************************************************************/
  506. $_IMAGES = array();
  507. $_IMAGES["arrow_down"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  508. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAABbSURBVCjPY/jPgB8yDCkFB/7v+r/5/+r/
  509. i/7P+N/3DYuC7V93/d//fydQ0Zz/9eexKFgtsejLiv8b/8/8X/WtUBGrGyZLdH6f8r/sW64cTkdW
  510. SRS+zpQbgiEJAI4UCqdRg1A6AAAAAElFTkSuQmCC";
  511. $_IMAGES["arrow_up"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  512. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAABbSURBVCjPY/jPgB8yDDkFmyVWv14kh1PB
  513. eoll31f/n/ytUw6rgtUSi76s+L/x/8z/Vd8KFbEomPt16f/1/1f+X/S/7X/qeSwK+v63/K/6X/g/
  514. 83/S/5hvQywkAdMGCdCoabZeAAAAAElFTkSuQmCC";
  515. $_IMAGES["del"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  516. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJdSURBVDjLpZP7S1NhGMf9W7YfogSJboSE
  517. UVCY8zJ31trcps6zTI9bLGJpjp1hmkGNxVz4Q6ildtXKXzJNbJRaRmrXoeWx8tJOTWptnrNryre5
  518. YCYuI3rh+8vL+/m8PA/PkwIg5X+y5mJWrxfOUBXm91QZM6UluUmthntHqplxUml2lciF6wrmdHri
  519. I0Wx3xw2hAediLwZRWRkCPzdDswaSvGqkGCfq8VEUsEyPF1O8Qu3O7A09RbRvjuIttsRbT6HHzeb
  520. sDjcB4/JgFFlNv9MnkmsEszodIIY7Oaut2OJcSF68Qx8dgv8tmqEL1gQaaARtp5A+N4NzB0lMXxo
  521. n/uxbI8gIYjB9HytGYuusfiPIQcN71kjgnW6VeFOkgh3XcHLvAwMSDPohOADdYQJdF1FtLMZPmsl
  522. vhZJk2ahkgRvq4HHUoWHRDqTEDDl2mDkfheiDgt8pw340/EocuClCuFvboQzb0cwIZgki4KhzlaE
  523. 6w0InipbVzBfqoK/qRH94i0rgokSFeO11iBkp8EdV8cfJo0yD75aE2ZNRvSJ0lZKcBXLaUYmQrCz
  524. DT6tDN5SyRqYlWeDLZAg0H4JQ+Jt6M3atNLE10VSwQsN4Z6r0CBwqzXesHmV+BeoyAUri8EyMfi2
  525. FowXS5dhd7doo2DVII0V5BAjigP89GEVAtda8b2ehodU4rNaAW+dGfzlFkyo89GTlcrHYCLpKD+V
  526. 7yeeHNzLjkp24Uu1Ed6G8/F8qjqGRzlbl2H2dzjpMg1KdwsHxOlmJ7GTeZC/nesXbeZ6c9OYnuxU
  527. c3fmBuFft/Ff8xMd0s65SXIb/gAAAABJRU5ErkJggg==";
  528. $_IMAGES["archive"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  529. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJmSURBVDjLhZNNS5RRGIav8+HMvDNO5ZhO
  530. YqXQF2FgVNRCCKM2EbQ1ok2b/AG16F/0ge5qUwitghbWooikiIhI3AQVFER+VsyMztg7vuecp4U2
  531. ORH5wLM5cK7n5r65lYgAoJTaDhQBw/9nAfgiIgEAEWENcjiO43KSJN45J//aOI5lZGTkBtALaBFp
  532. AhxNksRXq1Wp1WqNrVQqUiqVZH5+XpxzMjs7K6Ojow2Imri9Z1Dntjwo2dObZr7vpKXFoDVAwFpN
  533. vR6za9du+vr6KRQKrKysEEJgbGzs5vDw8DX1/N6Rrx0HOrpfvOqnWs0CCgQkaJTJEkIAHENDFygW
  534. i01mWGuP2Vw+KnT3djPUM0eLzZO4L6ikztQz6Dl2i4ePxgk+IYoylMtlQgg45+js7FyFKKUk/llh
  535. evplg9zTtR8RC0AmSlGtrGCMxVqF9x5j/gRlRQLZbIbt3fvW4lwmpS0IhCA4FwgEjDForVFK/Ta9
  536. oYDa8jdmpt83Hndu86DaEQkgHgkBrXXT5QaA4FuiqI3itl4IPzHWk7G5NQUBQgISUEoBYIxpVlAr
  537. le9+fCbntFY6qM2Z4BOWazFzS13UPrwjlUqzuFhtXF9NZZ0Cn7hLc59mrly+/uPQ+OO3T+6PP8W7
  538. OpH1fJ6cpLU1hUsSphcqRLlNFHK6GXD84nuvlCoDS1FrgZn28+T5zom933jzeoKpyZeY9oPceOJp
  539. z1e4erbtLw/WTTBZWVpaVNmcYuvWDk6eOsPAwCCLseHOpCOfNg0vgACg1rXxSL1enzDGZAC9QSOD
  540. 9345nU4PrgfsWKvzRp9/jwcWfgF7VEKXfHY5kwAAAABJRU5ErkJggg==";
  541. $_IMAGES["audio"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  542. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIvSURBVDjLjZPLaxNRFIeriP+AO7Gg7nRX
  543. qo1ogoKCK0Fbig8QuxKhPop04SYLNYqlKpEmQlDBRRcFFWlBqqJYLVpbq6ktaRo0aWmamUxmJpN5
  544. ZvKoP++9mmlqWuzAt7jc+X2Hcy6nDkAdhXxbCI2Epv+wlbDeyVUJGm3bzpVKpcVyuYyVIPcIBAL3
  545. qiXVgiYaNgwDpmk6qKoKRVEgCAKT8DyPYDDoSCrhdYHrO9qzkdOQvp+E+O04hC+tED63gBs+QiDn
  546. hQgTWJYFWiQUCv2RUEH/g4YNXwdcT/VEJ6xkF8zEDRixq1CnriD94SikH08gikJNS2wmVLDwybON
  547. H3GbNt8DY+YMrDk/tGkvhOFmKPE+pxVJkpDJZMBx3JJAHN+/MTPq8amxdtj8fWjhwzB+diH5ag9y
  548. 8V6QubDhUYmmaWwesiwvCYRRtyv9ca9oc37kk3egTbbBiPowP+iGOHGT0A1h7BrS43ehiXHous5E
  549. joCEx3IzF6FMnYMcPgs95iOCW1DDXqTfnEBqsBnRR9shTvYibyhsiBRHwL13dabe7r797uHOx3Kk
  550. m1T2IDfhhTRyAfMDh5Aauox8Ns5aKRQKDNrSsiHSZ6SHoq1i9nkDuNfHkHi2D9loHwtSisUig4ZX
  551. FaSG2pB8cZBUPY+ila0JV1Mj8F/a3DHbfwDq3Mtlb12R/EuNoKN10ylLmv612h6swKIj+CvZRQZk
  552. 0ou1hMm/OtveKkE9laxhnSvQ1a//DV9axd5NSHlCAAAAAElFTkSuQmCC";
  553. $_IMAGES["code"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  554. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHtSURBVDjLjZM9T9tQFIYpQ5eOMBKlW6eW
  555. IQipa8RfQKQghEAKqZgKFQgmFn5AWyVDCipVQZC2EqBWlEqdO2RCpAssQBRsx1+1ndix8wFvfW6w
  556. cUhQsfTI0j33PD7n+N4uAF2E+/S5RFwG/8Njl24/LyCIOI6j1+v1y0ajgU64cSSTybdBSVAwSMmm
  557. acKyLB/DMKBpGkRRZBJBEJBKpXyJl/yABLTBtm1Uq1X2JsrlMnRdhyRJTFCpVEAfSafTTUlQoFs1
  558. luxBAkoolUqQZbmtJTYTT/AoHInOfpcwtVtkwcSBgrkDGYph+60oisIq4Xm+VfB0+U/P0Lvj3NwP
  559. GfHPTcHMvoyFXwpe7UmQtAqTUCU0D1VVbwTPVk5jY19Fe3ZfQny7CE51WJDXqpjeEUHr45ki9rIq
  560. a4dmQiJfMLItGEs/FcQ2ucbRmdnSYy5vYWyLx/w3EaMfLmBaDpMQvuDJ65PY8Dpnz3wpYmLtApzc
  561. rIAqmfrEgdZH1grY/a36w6Xz0DKD8ES25/niYS6+wWE8mWfByY8cXmYEJFYLkHUHtVqNQcltAvoL
  562. D3v7o/FUHsNvzlnwxfsCEukC/ho3yUHaBN5Buo17Ojtyl+DqrnvQgUtfcC0ZcAdkUeA+ye7eMru9
  563. AUGIJPe4zh509UP/AAfNypi8oj/mAAAAAElFTkSuQmCC";
  564. $_IMAGES["database"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  565. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHVSURBVDjLjZPLaiJBFIZNHmJWCeQdMuT1
  566. Mi/gYlARBRUkao+abHUhmhgU0QHtARVxJ0bxhvfGa07Of5Iu21yYFPyLrqrz1f+f6rIRkQ3icca6
  567. ZF39RxesU1VnAVyuVqvJdrvd73Y7+ky8Tk6n87cVYgVcoXixWNByuVSaTqc0Ho+p1+sJpNvtksvl
  568. UhCb3W7/cf/w+BSLxfapVIqSySRlMhnSdZ2GwyHN53OaTCbU7/cFYBgG4RCPx/MKub27+1ur1Xqj
  569. 0YjW6zWxCyloNBqUSCSkYDab0WAw+BBJeqLFtQpvGoFqAlAEaZomuc0ocAQnnU7nALiJ3uh8whgn
  570. ttttarVaVCgUpCAUCgnQhMAJ+gG3CsDZa7xh1mw2ZbFSqYgwgsGgbDQhcIWeAHSIoP1pcGeNarUq
  571. gFKpJMLw+/0q72azkYhmPAWIRmM6AGbXc7kc5fN5AXi9XgWACwAguLEAojrfsVGv1yV/sVikcrks
  572. AIfDIYUQHEAoPgLwT3GdzWYNdBfXh3xwApDP5zsqtkoBwuHwaSAQ+OV2u//F43GKRCLEc5ROpwVo
  573. OngvBXj7jU/wwZPPX72DT7RXgDfIT27QEgvfKea9c3m9FsA5IN94zqbw9M9fAEuW+zzj8uLvAAAA
  574. AElFTkSuQmCC";
  575. $_IMAGES["directory"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  576. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGrSURBVDjLxZO7ihRBFIa/6u0ZW7GHBUV0
  577. UQQTZzd3QdhMQxOfwMRXEANBMNQX0MzAzFAwEzHwARbNFDdwEd31Mj3X7a6uOr9BtzNjYjKBJ6ni
  578. cP7v3KqcJFaxhBVtZUAK8OHlld2st7Xl3DJPVONP+zEUV4HqL5UDYHr5xvuQAjgl/Qs7TzvOOVAj
  579. xjlC+ePSwe6DfbVegLVuT4r14eTr6zvA8xSAoBLzx6pvj4l+DZIezuVkG9fY2H7YRQIMZIBwycmz
  580. H1/s3F8AapfIPNF3kQk7+kw9PWBy+IZOdg5Ug3mkAATy/t0usovzGeCUWTjCz0B+Sj0ekfdvkZ3a
  581. bBv+U4GaCtJ1iEm6ANQJ6fEzrG/engcKw/wXQvEKxSEKQxRGKE7Izt+DSiwBJMUSm71rguMYhQKr
  582. BygOIRStf4TiFFRBvbRGKiQLWP29yRSHKBTtfdBmHs0BUpgvtgF4yRFR+NUKi0XZcYjCeCG2smkz
  583. LAHkbRBmP0/Uk26O5YnUActBp1GsAI+S5nRJJJal5K1aAMrq0d6Tm9uI6zjyf75dAe6tx/SsWeD/
  584. /o2/Ab6IH3/h25pOAAAAAElFTkSuQmCC";
  585. $_IMAGES["graphics"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  586. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAH8SURBVDjLjZPLaxNRFIfHLrpx10WbghXx
  587. H7DQx6p14cadiCs31Y2LLizYhdBFWyhYaFUaUxLUQFCxL61E+0gofWGLRUqGqoWp2JpGG8g4ybTJ
  588. JJm86897Ls4QJIm98DED9/6+mXNmjiAIwhlGE6P1P5xjVAEQiqHVlMlkYvl8/rhQKKAUbB92u91W
  589. SkKrlcLJZBK6rptomoZoNApFUbhElmU4HA4u8YzU1PsmWryroxYrF9CBdDqNbDbLr0QikUAsFkM4
  590. HOaCVCoFesjzpwMuaeXuthYcw4rtvG4KKGxAAgrE43FEIhGzlJQWxE/RirQ6i8/T7XjXV2szBawM
  591. 8yDdU91GKaqqInQgwf9xCNmoB7LYgZn+Oud0T121KfiXYokqf8X+5jAyR3NQvtzEq96z4os7lhqz
  592. ieW6TxJN3UVg8yEPqzu38P7xRVy+cPoay52qKDhUf0HaWsC3xRvstd3Qvt9mTWtEOPAJf/+L8oKA
  593. fwfLnil43z7Bkusqdr2X4Btvg1+c5fsVBZJ/H9aXbix/2EAouAVx4zVmHl2BtOrkPako2DsIwule
  594. xKhnG/cmfbg+uIbukXkooR/I5XKcioLu+8/QNTyGzqE36OidQNeDJayLe7yZBuUEv8t9iRIcU6Z4
  595. FprZ36fTxknC7GyCBrBY0ECSE4yzAY1+gyH4Ay9cw2Ifwv9mAAAAAElFTkSuQmCC";
  596. $_IMAGES["image"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  597. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGWSURBVBgZpcE/a1NhGMbh3/OeN56cKq2D
  598. p6AoCOKmk4uCn8DNycEOIojilr2TaBfRzVnESQR3Bz+FFDoWA2IjtkRqmpyc97k9qYl/IQV7XSaJ
  599. w4g0VlZfP0m13dwepPbuiH85fyhyWCx4/ubxjU6kkdxWHt69VC6XpZlFBAhwJgwJJHAmRKorbj94
  600. ewvoRBrbuykvT5R2/+lLTp05Tp45STmEJYJBMAjByILxYeM9jzr3GCczGpHGYAQhRM6fO8uFy1fJ
  601. QoaUwCKYEcwwC4QQaGUBd36KTDmQ523axTGQmEcIEBORKQfG1ZDxcA/MkBxXwj1ggCQyS9TVAMmZ
  602. iUxJ8Ln/kS+9PmOvcSW+jrao0mmMH5bzHfa+9UGBmciUBJ+2Fmh1h+yTQCXSkJkdCrpd8btIwwEJ
  603. QnaEkOXMk7XaiF8CUxL/JdKQOwb0Ntc5SG9zHXQNd/ZFGsaEeLa2ChjzXQcqZiKNxSL0vR4unVww
  604. MENMCATib0ZdV+QtE41I42geXt1Ze3dlMNZFdw6Ut6CIvKBhkjiM79Pyq1YUmtkKAAAAAElFTkSu
  605. QmCC";
  606. $_IMAGES["presentation"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  607. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHeSURBVDjLjZO/i1NBEMc/u+/lBYxiLkgU
  608. 7vRstLEUDyxtxV68ykIMWlocaGHrD1DxSAqxNf4t115jo6DYhCRCEsk733s7u2PxkuiRoBkYdmGZ
  609. z3xndsaoKgDGmC3gLBDxbxsA31U1AKCqzCBXsywbO+e8iOgqz7JM2+32W+AiYFX1GGDHOeen06mm
  610. abrwyWSio9FI+/2+ioj2ej3tdDoLiJm+bimAhgBeUe9RmbkrT5wgT97RaDQoioIQAt1ud7/Var1h
  611. +uq+/s9+PLilw+FwqSRgJ1YpexHSKenHF4DFf/uC3b7CydsPsafraO5IkoTxeEwIARGh2WwCYNUJ
  612. AOmHZ5y4eY/a7h4hPcIdHvDz/fMSnjviOCZJEiqVCtVqdfEl8RygHkz9DLZWQzOHisd9OizfckcU
  613. RRhjMMbMm14CQlEC/NfPjPd2CSJQCEEEDWYBsNZijFkaCqu5Ky+blwl5geaOUDg0c8TnNssSClkE
  614. R1GEtXYZcOruI6ILl1AJqATirW02Hr8sFThBVZfklyXMFdQbbDzdXzm78z4Bx7KXTcwdgzs3yizu
  615. zxAhHvVh4avqBzAzaQa4JiIHgGE9C3EcX7ezhVIgeO9/AWGdYO/9EeDNX+t8frbOdk0FHhj8BvUs
  616. fP0TH5dOAAAAAElFTkSuQmCC";
  617. $_IMAGES["spreadsheet"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  618. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIpSURBVDjLjZNPSFRRFMZ/9707o0SOOshM
  619. 0x/JFtUmisKBooVEEUThsgi3KS0CN0G2lagWEYkSUdsRWgSFG9sVFAW1EIwQqRZiiDOZY804b967
  620. 954249hUpB98y/PjO5zzKREBQCm1E0gDPv9XHpgTEQeAiFCDHAmCoBhFkTXGyL8cBIGMjo7eA3YD
  621. nog0ALJRFNlSqSTlcrnulZUVWV5elsXFRTHGyMLCgoyNjdUhanCyV9ayOSeIdTgnOCtY43DWYY3j
  622. 9ulxkskkYRjinCOXy40MDAzcZXCyVzZS38MeKRQKf60EZPXSXInL9y+wLZMkCMs0RR28mJ2grSWJ
  623. Eo+lH9/IpNPE43GKxSLOOYwxpFIpAPTWjiaOtZ+gLdFKlJlD8u00xWP8lO/M5+e5efEB18b70Vqj
  624. lMJai++vH8qLqoa+nn4+fJmiNNPCvMzQnIjzZuo1V88Ns3/HAcKKwfd9tNZorYnFYuuAMLDMfJ3m
  625. +fQznr7L0Vk9zGpLmezB4zx++YggqhAFEZ7n4ft+HVQHVMoB5++cJNWaRrQwMjHM9qCLTFcnJJq5
  626. 9WSIMLAopQDwfR/P8+oAbaqWK2eGSGxpxVrDnvQ+3s++4tPnj4SewYscUdUgIiilcM41/uXZG9kN
  627. z9h9aa+EYdjg+hnDwHDq+iGsaXwcZ6XhsdZW+FOqFk0B3caYt4Bic3Ja66NerVACOGttBXCbGbbW
  628. rgJW/VbnXbU6e5tMYIH8L54Xq0cq018+AAAAAElFTkSuQmCC";
  629. $_IMAGES["textdocument"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  630. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIdSURBVDjLjZO7a5RREMV/9/F9yaLBzQY3
  631. CC7EpBGxU2O0EBG0sxHBUitTWYitYCsiiJL0NvlfgoWSRpGA4IMsm43ZXchmv8e9MxZZN1GD5MCB
  632. W8yce4aZY1QVAGPMaWAacPwfm8A3VRUAVJWhyIUsy7plWcYQgh7GLMt0aWnpNTADWFX9Q2C+LMu4
  633. s7Oj/X5/xF6vp51OR1utloYQtNls6vLy8kjE3Huz9qPIQjcUg/GZenVOokIEiSBBCKUSQ+TFwwa1
  634. Wo2iKBARVlZW3iwuLr7izssPnwZ50DLIoWz9zPT+s/fabrf/GQmY97GIIXGWp28/08si5+oV1jcG
  635. TCSO6nHH2pddYqmkaUq320VECCFQr9cBsBIVBbJcSdXQmK7Q6Qsnq54sj2gBplS896RpSpIkjI2N
  636. jVZitdh7jAOSK6trXcpC2GjlfP1esHD+GDYozjm893jvSZJkXyAWe+ssc6W5G9naLqkaw/pGxBrl
  637. 1tVpJCrWWpxzI6GRgOQKCv2BYHPl5uUatROeSsVy7eIkU9UUiYoxBgDnHNbagw4U6yAWwpmphNvX
  638. T6HAhAZuLNRx1iDDWzHG/L6ZEbyJVLa2c54/PgsKgyzw5MHcqKC9nROK/aaDvwN4KYS7j959DHk2
  639. PtuYnBUBFUEVVBQRgzX7I/wNM7RmgEshhFXAcDSI9/6KHQZKAYkxDgA5SnOMcReI5kCcG8M42yM6
  640. iMDmL261eaOOnqrOAAAAAElFTkSuQmCC";
  641. $_IMAGES["unknown"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  642. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAC4SURBVCjPdZFbDsIgEEWnrsMm7oGGfZro
  643. hxvU+Iq1TyjU60Bf1pac4Yc5YS4ZAtGWBMk/drQBOVwJlZrWYkLhsB8UV9K0BUrPGy9cWbng2CtE
  644. EUmLGppPjRwpbixUKHBiZRS0p+ZGhvs4irNEvWD8heHpbsyDXznPhYFOyTjJc13olIqzZCHBouE0
  645. FRMUjA+s1gTjaRgVFpqRwC8mfoXPPEVPS7LbRaJL2y7bOifRCTEli3U7BMWgLzKlW/CuebZPAAAA
  646. AElFTkSuQmCC";
  647. $_IMAGES["vectorgraphics"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  648. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIWSURBVDjLhZNPbxJRFMWhRrYu3NrExIUb
  649. dzWte6M7d34Eo2Hjxm8gwZUxIYEARUKAWgwbV0BpxAW11bpQFrCoCVEMDplhQMow782/enx3WsiU
  650. 0jrJ2bz7zu+9e95cHwAfSXzXhFaEVv+j60JLM58HsGIYxsi27SPHcbBIoo5oNBrxQryAVTJPJhPo
  651. uu6q0+mgVquh0WhAlmUX0uv1EIvFZpCp2U8A2sA5h2maYIyhUChA0zTU63UoiuICaJ0OSSaTx5B5
  652. AJnpqqVSCbmNTWxVt9FsNtHv98+05GYyD7AsC5VKBZvFd/j2k6Etc6gjHfLgELKiujeRJGkxQGSA
  653. YDCIx8+eI/ORIb3Lkf0sWvmio9aaoC2NoQ7+QFUHCwFr5XIZ8bfvhZFhq2XgU9tEb2Tj99DCgcTx
  654. 9YeOg64GZTCGPQdYEnpaLBbxZl9HfIejo1rg5nGvti3CMyxouonhIYM8ZG7NBWSz2YepVKobiUR+
  655. UXjrwry+wzBm9qnAqD03YHohbsASUP+ly2u+XC7XzmQyt9LpdJc2xuscr0ULU9NUFC6JDiFRCy4g
  656. n88/EWqFw+EEmfL7HK8+8FOAqdmrWYjC7E8kElcCgcAdWmx2LbzY5mCmc+YWXp33H/w1LQehKhPP
  657. ZuK8mTjR0QxwArktQtKpsLHHEarwC81ir+ZOrwewTBCiXr157/7d0PfqjQcvH10w1jT6y/8A/nHJ
  658. HcAgm2AAAAAASUVORK5CYII=";
  659. $_IMAGES["video"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  660. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIfSURBVDjLpZNPaBNBGMXfbrubzBqbg4kL
  661. 0lJLgiVKE/AP6Kl6UUFQNAeDIAjVS08aELx59GQPAREV/4BeiqcqROpRD4pUNCJSS21OgloISWME
  662. Z/aPb6ARdNeTCz92mO+9N9/w7RphGOJ/nsH+olqtvg+CYJR8q9VquThxuVz+oJTKeZ63Uq/XC38E
  663. 0Jj3ff8+OVupVGLbolkzQw5HOqAxQU4wXWWnZrykmYD0QsgAOJe9hpEUcPr8i0GaJ8n2vs/sL2h8
  664. R66TpVfWTdETHWE6GRGKjGiiKNLii5BSLpN7pBHpgMYhMkm8tPUWz3sL2D1wFaY/jvnWcTTaE5Dy
  665. jMfTT5J0XIAiTRYn3ASwZ1MKbTmN7z+KaHUOYqmb1fcPiNa4kQBuyvWAHYfcHGzDgYcx9NKrwJYH
  666. CAyF21JiPWBnXMAQOea6bmn+4ueYGZi8gtymNVobF7BG5prNpjd+eW6X4BSUD0gOdCpzA8MpA/v2
  667. v15kl4+pK0emwHSbjJGBlz+vYM1fQeDrYOBTdzOGvDf6EFNr+LYjHbBgsaCLxr+moNQjU2vYhRXp
  668. gIUOmSWWnsJRfjlOZhrexgtYDZ/gWbetNRbNs6QT10GJglNk64HMaGgbAkoMo5fiFNy7CKDQUGqE
  669. 5r38YktxAfSqW7Zt33l66WtkAkACjuNsaLVaDxlw5HdJ/86aYrG4WCgUZD6fX+jv/U0ymfxoWVZo
  670. muZyf+8XqfGP49CCrBUAAAAASUVORK5CYII=";
  671. $_IMAGES["webpage"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  672. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJwSURBVDjLjZPdT1JhHMetvyO3/gfLKy+6
  673. 8bLV2qIAq7UyG6IrdRPL5hs2U5FR0MJIAqZlh7BVViI1kkyyiPkCyUtztQYTYbwJE8W+Pc8pjofK
  674. 1dk+OxfP+X3O83srAVBCIc8eQhmh/B/sJezm4niCsvX19cTm5uZWPp/H3yDnUKvVKr6ELyinwWtr
  675. a8hkMhzJZBLxeBwrKyusJBwOQ6PRcJJC8K4DJ/dXM04DOswNqNOLybsRo9N6LCy7kUgkEIlEWEE2
  676. mwX9iVar/Smhglqd8IREKwya3qhg809gPLgI/XsrOp/IcXVMhqnFSayurv6RElsT6ZCoov5u1fzU
  677. VwvcKRdefVuEKRCA3OFHv2MOxtlBdFuaMf/ZhWg0yt4kFAoVCZS3Hd1gkpOwRt9h0LOES3YvamzP
  678. cdF7A6rlPrSbpbhP0kmlUmw9YrHYtoDku2T6pEZ/2ICXEQ8kTz+g2TkNceAKKv2nIHachn6qBx1M
  679. I5t/Op1mRXzBd31AiRafBp1vZyEcceGCzQ6p24yjEzocGT6LUacS0iExcrkcK6Fsp6AXLRnmFOjy
  680. PMIZixPHmAAOGxZQec2OQyo7zpm6cNN6GZ2kK1RAofPAr8GA4oUMrdNNkIw/wPFhDwSjX3Dwlg0C
  681. Qy96HreiTlcFZsaAjY0NNvh3QUXtHeHcoKMNA7NjqLd8xHmzDzXDRvRO1KHtngTyhzL4SHeooAAn
  682. KMxBtUYQbGWa0Dc+AsWzSVy3qkjeItLCFsz4XoNMaRFFAm4SyTXbmQa2YHQSGacR/pAXO+zGFif4
  683. JdlHCpShBzstEz+YfJtmt5cnKKWS/1jnAnT1S38AGTynUFUTzJcAAAAASUVORK5CYII=";
  684. $_IMAGES["7z"] = $_IMAGES["archive"];
  685. $_IMAGES["as"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  686. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIqSURBVDjLjZPNi1JRGMan/ooWDbSKNq2s
  687. gZqh0UgqKVoOU7OooEWLgZi+JIaYGolaRAS60JXuxJWoIC6E0KAgAzGbCqpFmua393qv9+PoPJ33
  688. THPHcYy68HDPvee8v/e8zznvFIApEn8Octm4Zv6hQ1z7rbgRgE3X9S5jbDgYDDBJfB5er/flKGQU
  689. MEPBiqJAVVVLkiSh0+mgVqsJSLVahc/nsyDbwfsIQAs0TYNhGNDevIX29BnUxx50u13U63UB6Pf7
  690. oCR+v38LMg6gYCOdhnb1GgaeVajnL0CWZTQajT0lCU/GAea379AWFsHu3kJ/4TLUO/etUprNpthJ
  691. pVL5C4Ax6I/WwVbvoe9+AMazMvrHzSMI7YT8aLVakwHs8xdoS1eguC7CeJUBa3fEwkKhgEwmI+pP
  692. 8/Ly+fxkgP78BZj7NgYP3ZDn7FDXPGJhKpVCuVwW/tA7HA7vBawdPrJEmZl7hQc7IJ2YtwCxWEyU
  693. IgzmCgaDuwF157kDlVOnC+bKMmS7E8a79zA3PsEs/0Q8Hkc2m4VpmkLkB5URjUa3AMpZ1+uew/lV
  694. mnMw/cZ1qOtPrGOirKVSCclk0gKQQqGQOFYB6NnPKPKsfdNYvgnJdQnsV23XWRMkkUig3W6LMSkQ
  695. COyUIJ+ch3R8Fj+O2j6YHzc2J/VAsVgUEBpHIhHkcjkaDy0P/hh5jBuk0sQ4gO4AXSIa09b595Cv
  696. 7YnuHQFME+Q/2nlb1PrTvwGo2K3gWVH3FgAAAABJRU5ErkJggg==";
  697. $_IMAGES["avi"] = $_IMAGES["video"];
  698. $_IMAGES["bz2"] = $_IMAGES["archive"];
  699. $_IMAGES["c"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  700. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHdSURBVDjLjZNLS+NgFIad+R0KwuzcSQdd
  701. unTWXraKA4KCuFKcWYqgVbE4TKJWNyqC2oHKoDBeEBF04UpFUVQqUoemSVOTJr2lrb5+5xsTUy+j
  702. gYdc3yfnnOQrAVBCsK2U4WFUvUE546OTcwk82WxWz+fzt4VCAS/B7kMQhB9uiVtQReFkMolUKuWQ
  703. SCSgaRpkWeYSSZIgiqIjscMfSEAPZDIZWJbF94RpmtB1HYqicEE6nQa9xO/3/5OQoM57/qm2a3PG
  704. tyzDtxzF/FYMe6c6F1DAMAzEYrFnLfGZ1A9devqC8o2wpmL8jwJhRcbw7ygGAxJYS7xvuxVVVXkl
  705. kUjkUdAshgP+DRVfureXbPPcuoKe2b/QDKtIQpXQPOLx+KOgf0nGCCu9smHiu7u8IGuDBHRsS6gd
  706. mgmJHEHfLwn9wSgqagc6Xvt8RC6X48MlCeEI2ibDIS8TVDYGBHfAO3ONowvTOacqSEBQNY6gpvOk
  707. p3cxgq8/Q8ZxyISWsDAwfY32sSscnhk8SFAFBIWLBPQZq1sOvjX5LozOqTBaxSu0jF5iYVV+FnZT
  708. JLB/pN0DDTv7WlHvtuQpLwrYxbv/DfIJt47gQfKZDShFN94TZs+afPW6BGUkecdytqGlX3YPTr7m
  709. omspN0YAAAAASUVORK5CYII=";
  710. $_IMAGES["cab"] = $_IMAGES["archive"];
  711. $_IMAGES["cpp"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  712. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAH/SURBVDjLjZPNaxNRFMWrf4cFwV13JVKX
  713. Luta61apIChIV0rblUqhjYpRcUaNboxIqxFTQgVti4hQQTe1C7FFSUmnmvmM85XJzCSpx3efzmTS
  714. RtqBw7yZ9+5v7rl3bg+AHhK7DjClmAZ20UGm/XFcApAKgsBqNptbrVYL3cT2IQjCnSQkCRig4Fqt
  715. Bs/zYtm2DdM0oaoqh8iyDFEUY0gUvI8AdMD3fYRhyO8k13VhWRY0TeOAer0O+kg2m/0LIcDx9LdD
  716. gxff5jJzKjJzCmbe6fi0anEABTiOA13Xd1jiNTlxfT01UVB/CfMG7r/WILxScaOo4FpeBrPEfUdW
  717. DMPgmVQqlTbgtCjls4sGjl16PxuRny5oGH3yA7oZoPjR4BDbqeHlksLrUa1W24DJWRU3Wer9Qw/G
  718. k+kVmA2lGuDKtMQzsVwfl6c3eE3IUgyYeCFjsqCgb3DqQhJwq/gTY7lyV61Jdhtw7qFUSjNA/8m8
  719. kASkc5tYXnN4BvTs1kO23uAdIksx4OjI19Grzys4c7fkfCm5MO0QU483cf5eGcurNq8BWfD8kK11
  720. HtwBoDYeGV4ZO5X57ow8knBWLGP49jqevVF5IKnRaOxQByD6kT6smFj6bHb0OoJsV1cAe/n7f3PQ
  721. RVsx4B/kMCuQRxt7CWZnXT69CUAvQfYwzpFo9Hv/AD332dKni9XnAAAAAElFTkSuQmCC";
  722. $_IMAGES["cs"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  723. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJOSURBVDjLjZPbaxNBFMarf4cFwb9AIgXB
  724. R18Enyw+i1gs4g01kphSlPjQeAtNzNqGNLVpNCGhEvBS21Rr0ZIK6ovFiKbNbXNpdpNsstncUz9n
  725. NiauErEDHwMz8/1mzjlz+gD0UZGxh0hFNPAf7SXa3fUpAKparVZoNpvbrVYLvUT2YbFYTEqIEjBA
  726. zZIkoVwud1UsFiEIAjKZjAxJp9NgGKYL6Zh3UQA9UK1WUa/X5ZmqVCqhUCiA4zgZUKlUQC+xWq1t
  727. CAUM3v6+74hu2cH4eUz6OcwFcvgYEmUANYiiiFF3Aq5XHIJRCeqHLOJbFcg5OW6Mqm495fL2NznY
  728. l7OwveYxsZSF6QUHEpIc9+eQgOvuFL6EMjC6wrg4GZZfIwOGbazX8TaPY/qAr5Ms72oOBt8WknwV
  729. em8KWmcCY0/S0E1HcXYyhjNMBAYH2waYF8izl3I4eGLqmjLjz9by+PRNxCMS0k0C0c+yMDjj0Mwm
  730. MOGJ4+Vqtg0Yn+dwf5HH/sG75/4uWzAiwbfCQ+dMYSGQxdhMHMPmMFY+8MgX623AiDu9+YAADg35
  731. LErzHU8SGkcSI4+T0DoSuGRnoZ5mcdIUwdC9zd85OHpjQzP+nMOVmZj4NSZBKNVh9LbN6xslnGai
  732. 8CxmMP+Ol81criwntgugZTysDmovTEXEUVcKV8lt520s5kjJvP4MTpkjyApVXCZmvTWKRqMh6w9A
  733. 5yO9Xy9ijUgZCi1lL/UEkMUf/+qDHtruAn5BDpAvXKYbOzGTsyW5exWAfgrZQTt3RFu//yfHVsX/
  734. fi5tjwAAAABJRU5ErkJggg==";
  735. $_IMAGES["css"] = $_IMAGES["code"];
  736. $_IMAGES["doc"] = $_IMAGES["textdocument"];
  737. $_IMAGES["docx"] = $_IMAGES["textdocument"];
  738. $_IMAGES["exe"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  739. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAEkSURBVCjPbdE9S0IBGIbhxxobWxP8D8r5
  740. I60RLg0NNTS21VBRQwg1aA4VOAWBpBVCFhKUtkVJtPQx9GFFWh49x3P0bvAjjsWzXrzvcAtpREEZ
  741. fQtoACEkpKBVdpouv7NYi3SJkAynWcXExKTCJ6+4PLPeIZJPhksdmzp1vilTwqVGlWhEgR6wsbGp
  742. U+OLt94rGfJ1gIOLi4OFSYV3Sjx5QXdtkiHFx//gjiwlTshyT5LV3T8gwy3HFLnhkCuWmB3qA0Uu
  743. 2WGOZVIUmN/ru5CiwAsLNLCI8cg+i3hAggMeiNOgwQbXRJnwghoX5DkiTow0OcLJ8HAbtLpkkzwJ
  744. CuTY4pQppgeFFLJNtxMrzSRFtlnhvDXO6Fk7ll8hb+wZxpChoPzoB6aiXIYcSLDWAAAAAElFTkSu
  745. QmCC";
  746. $_IMAGES["gz"] = $_IMAGES["archive"];
  747. $_IMAGES["gif"] = $_IMAGES["image"];
  748. $_IMAGES["h"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  749. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHtSURBVDjLjZNLS9xQFMe138C9A/0OynyB
  750. UjeFQjduROi2MMtCEalS0ToLEdQMdEShoKDWRymKigWxII7PhaB9aBFUJjHJpHlnnvbfe27NJcVI
  751. DfwIyT3nd885cOoA1BHsaWQ0MZL/4SHjgciLCJpKpZJVrVava7Ua4mDnkCRpKCqJCpKU7HkefN8X
  752. 2LYN0zShqiqXKIqCTCYjJGFyPQkooFgsolwu8zfhui4sy4KmaVwQBAHokmw2+1cSClpSUmr12MP7
  753. LQunii8klOA4DnRdv9USn0koePRiJDW+aTGBjcOLgAewlnjfYSuFQoFXIsvybQF9jG2avIKFPQtz
  754. OyZmcyZMtywkVAnNwzCMeMG7jV+YyFmQ1g30L2kYWitAWtZFJdQOzYREsYLhzwZGGF+OHez/9PD2
  755. k4aeeYUHVyoVPheSELGCwRUdA+zG/VMPeycu3iyo6J5WxDxIQFA1QtCauUwPrOpIPh/vSC+qSC/q
  756. PHn3u4uu2Su8nsrzZKqAoOR/BO2j+Q+DTPC0/2CdSu79qOLVlIyXk3l0zsjomJYxv6ELQYgQPOk7
  757. a2jpOnmcaG57tvuD3fzNxc5XB9sEm0XuyMb5VcCriBI7A/bz9117EMO1ENxImtmAfDq4TzKLdfn2
  758. RgQJktxjnUNo9RN/AFmTwlP7TY1uAAAAAElFTkSuQmCC";
  759. $_IMAGES["htm"] = $_IMAGES["webpage"];
  760. $_IMAGES["html"] = $_IMAGES["webpage"];
  761. $_IMAGES["iso"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  762. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIsSURBVDjLjZNfa9NQGIdnP4cDv8Nkn8PL
  763. 6UfwSgQZOoSBYkUvZLN1lMFArQyHrsIuWkE3ug2t1K3O0LXrZotdlzZp0qZp/qc9P8852qyyigs8
  764. F8nJ7znveZN3DMAYg14XKROUyf9wiRIKckOCCcdxNN/3+71eD6Og64hEInPDkmHBJAsbhgHTNAM6
  765. nQ7a7TYkSeKSer2OaDQaSAbhC7efJGY28gZWPrUQTyt4l2lCKLfR7XahaRpkWeYCy7LANonFYr8l
  766. qzt26PUXIxzf7pCfioeS5EI2fVQkG+GVH0hlRVqFjmazeeZIvCc0PBXf1ohu96GZBEnBQMMmcAjg
  767. eH3cWRKQyTf4URRF4ZWIongqoOFURXZpUEOt1YNm+BzDI6AeFKo6IqsF3g9d13k/VFU9FSytK9V8
  768. zUJiR0WbBh+/2cVich+trodvNQeFEwvTsa/8C7Dzs54wUSBYeN+ofq+ageDZmoBX64dQdRcbByaE
  769. qoGbTzPwPA+u63IJIxDMrR2nDkUTR6oPxSJ8ZxYuNlxsHtnYLal48DIH+om5gMGqCQSP3lam7i+X
  770. SMfp40AFsjWCrbKHdMlGpeng2uxHpHM1XgGDhf8S3Fsuhe4+3w9PL+6RvbKGguhAODaRLSq4OvsB
  771. L5JFvutAMCAQDH6kK9fnZyKJAm4tZHFj/jMexnPYzJ3w0kdxRsBu6EPyrzkYQT8Q/JFcpqWabOE8
  772. Yfpul0/vkGCcSc4xzgPY6I//AmC87eKq4rrzAAAAAElFTkSuQmCC";
  773. $_IMAGES["java"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  774. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIRSURBVDjLjZPJa1NRFIera/8ECy7dV7tx
  775. kb2UOoDgzo0R3YuLrFwWIVglWQRtN0GCLkIixJDJQJKGQOYBA4akmec5eSFT/XnPsXlNsWIffOTd
  776. d3O+e+6PezcAbBDiuS7YEmz/hxuCq3LdmmBrOp32F4vFyXK5xEWIeWg0mnfrknXBNhWPx2NIkiQz
  777. GAzQ6/XQaDRYUqvVoNVqZQkXGwyGm2q1+k00GkUkEkE4HEYwGGQCgQDS6TSKxSILJpMJaBGdTvdH
  778. YjKZHvp8vuNsNot6vc7QavRLq1UqFcTjcbhcLrmLFZyJ2+0u9Pt9hC1f8OHpDt4/uoO3928zmscK
  779. HD5/gKPPB8jn8yxpNpuoVqtnAqPRiOFwiPGgB/fhPr7uvcJH5S4Ont3Dp5dP8G3/NX4cfedCi8XC
  780. eXQ6nTOBzWaT5vM5J0yTFFy325WhtmkbhN1ux2g04gVlgcfj+UmDUqkEh8OBcrnM7xRaLpdDIpHg
  781. cSqVYihEYr0DL61O6fv9fhQKBd4vhUrpk6DdbsNsNrN8Nptxt7JApVK9EMW9TCbDEgqI2qUOSELv
  782. JPF6vbw9Kj4nEM81pVJ5V6/XH8diMQ6IaLVaLAmFQnA6nfyNslohC05P4RWFQrFLHVitVoYSF2cE
  783. yWSSgxOn9Bx/CWggPv761z24gBNZcCq5JQKSaOIyxeK/I769a4JNklziOq+gq7/5Gx172kZga+XW
  784. AAAAAElFTkSuQmCC";
  785. $_IMAGES["jpg"] = $_IMAGES["image"];
  786. $_IMAGES["jpeg"] = $_IMAGES["image"];
  787. $_IMAGES["js"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  788. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHdSURBVDjLjZNPaxNBGIdrLwURLznWgkcv
  789. IrQhRw9FGgy01IY0TVsQ0q6GFkT0kwjJId9AP4AHP4Q9FO2hJ7El2+yf7OzMbja7Sf0578QdNybF
  790. LjwszLu/Z2femZkDMEfI54FkRVL4Dw8l8zqXEawMBgM2HA6vR6MRZiHraDabH7KSrKBA4SAIEIah
  791. xvd9eJ6HbrerJKZpotVqaUkavkMC+iCKIsRxrN6EEAKMMViWpQT9fh/0k3a7PZZkBUPmqXAKCSjA
  792. OYdt21NLUj1JBYW7C6vi6BC8vKWKQXUXQcNA5Nh6KY7jqJl0Op1JwY/Hi7mLp/lT/uoA/OX2WLC3
  793. C9FoQBwfILKulIRmQv1wXfevwHmyuMPXS5Fv1MHrFSTmhSomnUvw/Spo3C+vg3/+pJZDPSGRFvil
  794. NV+8PUZvoziKvn+d3LZvJ/BelMDevIZXK2EQCiUhtMDM53bY5rOIGXtwjU3EVz/HM5Az8eplqPFK
  795. EfzLR91cOg8TPTgr3MudFx+d9owK7KMNVfQOtyQ1OO9qiHsWkiRRUHhKQLuwfH9+1XpfhVVfU0V3
  796. //k4zFwdzjIlSA/Sv8jTOZObBL9uugczuNaCP5K8bFBIhduE5bdC3d6MYIkkt7jOKXT1l34DkIu9
  797. e0agZjoAAAAASUVORK5CYII=";
  798. $_IMAGES["mov"] = $_IMAGES["video"];
  799. $_IMAGES["mp3"] = $_IMAGES["audio"];
  800. $_IMAGES["mp4"] = $_IMAGES["audio"];
  801. $_IMAGES["mpeg"] = $_IMAGES["video"];
  802. $_IMAGES["mpg"] = $_IMAGES["video"];
  803. $_IMAGES["odg"] = $_IMAGES["vectorgraphics"];
  804. $_IMAGES["odp"] = $_IMAGES["presentation"];
  805. $_IMAGES["ods"] = $_IMAGES["spreadsheet"];
  806. $_IMAGES["odt"] = $_IMAGES["textdocument"];
  807. $_IMAGES["pdf"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  808. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHhSURBVDjLjZPLSxtRFIfVZRdWi0oFBf+B
  809. rhRx5dKVYKG4tLhRqlgXPmIVJQiC60JCCZYqFHQh7rrQlUK7aVUUfCBRG5RkJpNkkswrM5NEf73n
  810. 6gxpHujAB/fOvefjnHM5VQCqCPa1MNoZnU/Qxqhx4woE7ZZlpXO53F0+n0c52Dl8Pt/nQkmhoJOC
  811. dUWBsvQJ2u4ODMOAwvapVAqSJHGJKIrw+/2uxAmuJgFdMDUVincSxvEBTNOEpmlIp9OIxWJckMlk
  812. oOs6AoHAg6RYYNs2kp4RqOvfuIACVFVFPB4vKYn3pFjAykDSOwVta52vqW6nlEQiwTMRBKGygIh9
  813. GEDCMwZH6EgoE+qHLMuVBdbfKwjv3yE6Ogjz/PQ/CZVDPSFRRYE4/RHy1y8wry8RGWGSqyC/nM1m
  814. eX9IQpQV2JKIUH8vrEgYmeAFwuPDCHa9QehtD26HBhCZnYC8ucGzKSsIL8wgsjiH1PYPxL+vQvm5
  815. B/3sBMLyIm7GhhCe90BaWykV/Gp+VR9oqPVe9vfBTsruM1HtBKVPmFIUNusBrV3B4ev6bsbyXlPd
  816. kbr/u+StHUkxruBPY+0KY8f38oWX/byvNAdluHNLeOxDB+uyQQfPCWZ3NT69BYJWkjxjnB1o9Fv/
  817. ASQ5s+ABz8i2AAAAAElFTkSuQmCC";
  818. $_IMAGES["php"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  819. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGsSURBVDjLjZNLSwJRFICtFv2AgggS2vQL
  820. DFvVpn0Pi4iItm1KItvWJqW1pYsRemyyNILARbZpm0WtrJ0kbmbUlHmr4+t0z60Z7oSSAx935txz
  821. vrlPBwA4EPKMEVwE9z+ME/qtOkbgqtVqUqPRaDWbTegE6YdQKBRkJazAjcWapoGu6xayLIMoilAo
  822. FKhEEAQIh8OWxCzuQwEmVKtVMAyDtoiqqiBJEhSLRSqoVCqAP+E47keCAvfU5sDQ8MRs/OYNtr1x
  823. 2PXdwuJShLLljcFlNAW5HA9khLYp0TUhSYMLHm7PLEDS7zyw3ybRqyfg+TyBtwl2sDP1nKWFiUSa
  824. zFex3tk45sXjL1Aul20CGTs+syVY37igBbwg03eMsfH9gwSsrZ+Doig2QZsdNiZmMkVrKmwc18az
  825. HKELyQrOMEHTDJp8HXu1hostG8dY8PiRngdWMEq467ZwbDxwlIR8XrQLcBvn5k9Gpmd8fn/gHlZW
  826. T20C/D4k8eTDB3yVFKjX6xSbgD1If8G970Q3QbvbPehAyxL8SibJEdaxo5dikqvS28sInCjp4Tqb
  827. 4NV3fgPirZ4pD4KS4wAAAABJRU5ErkJggg==";
  828. $_IMAGES["png"] = $_IMAGES["image"];
  829. $_IMAGES["pps"] = $_IMAGES["presentation"];
  830. $_IMAGES["ppsx"] = $_IMAGES["presentation"];
  831. $_IMAGES["ppt"] = $_IMAGES["presentation"];
  832. $_IMAGES["pptx"] = $_IMAGES["presentation"];
  833. $_IMAGES["psd"] = $_IMAGES["graphics"];
  834. $_IMAGES["rar"] = $_IMAGES["archive"];
  835. $_IMAGES["rb"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  836. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIESURBVDjLjZNPTxNBGIexid9CEr8DBr8C
  837. HEiMVoomJiQkxBIM3dgIiaIESJTGGpVtyXIzHhoM4SIe9KAnEi4clQtJEczWFrbdP93d7s7u/JwZ
  838. 7XYJBdnkyRxmfs/MvO9OD4AeDvuuMPoY/f/hKiMR5WKCvlarpRNCwiAI0A02D1mW38QlcUE/Dzeb
  839. Tdi2HWEYBhqNBqrVqpBUKhUUCoVI0g5f4gK+wHVdeJ4nRo5lWdB1HbVaTQgcxwHfRFGUvxIuCKYf
  840. zmqZyZ2wKIO8fQ3/1Uv4Sy/QWliAO/sU9qMZmFMS3HfvT1xJ1ITOZJ9RpQi6+RH0y2fQb19BP23C
  841. VhRo+TysXA71+XkcMIk6fAfHK6tQVfWEoESXngNra0C5DHZJYGMDZiaD35IEi41qOo3vc3MoJ1Oo
  842. j92HpmkdQZiVEsHUAzl88hjY3gYIAdbXYQ0MoDo4CH1kBHssvH8jCf3eGKzDXzBNsyNoF/HH7WSJ
  843. ZLPA7i6wtQVnaAhmKoXjxUX8vDkMY3Qcnm6IInJOCS4nEte9QhF+RhInIRMTcFhYvZWCcXcUPmsl
  844. 7w6H/w+nBFEb5SLc8TTo8jLq7M4m25mHfd8X8PC5AtHrXB5NdmwRrnfCcc4VCEnpA8jREasp6cpZ
  845. AnrWO+hCGAn+Sa6xAtl84iJhttYSrzcm6OWSCzznNvzp9/4BgwKvG3Zq1eoAAAAASUVORK5CYII=";
  846. $_IMAGES["sln"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  847. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJQSURBVDjLjZNvSBNxGMeX9O+FOAkaLbeh
  848. ozdGRGiMQqTIlEqJMIig3oxl0YxcgYt6FUZRryLYwpFWCr2wXgjBIMJMYhFjgZSiEXOg5c5N593u
  849. dne7u+2+3V3tT22SBx/uxe/5fu7uuefRAdCpKJdJoVHB9h9qFSryuSJBYzqdpiRJymYyGZRDOYfH
  850. 43lULCkW2NRwKpUCy7J5kskkSJJELBbTJARBwOv15iW58AZVoBbwPA9BELS7CsMwoCgK8XhcE3Ac
  851. B/UhPp/vtyQnGBi03pYXjyAbPQuRD2sSbmUFVN9NLJ5ux9DryZJP0nqiChzjl48Oh9oYRPTAXBVk
  852. sgnS0hRWu7uxXG/EfL0ZZ9yjGHgb1t4kGo0WBO6AvcUVsFP9oTZZjlQCP7ZA/r4JpHM3lup2Im6p
  853. RsRai2PX/GjoDWEk8BWJRKIg6P147mfP+CW63d16RUyOQP5SA6rLAsKyA0TNNizvM4D9/A4Tk2Ec
  854. 7nuPE0+vgqbpgqBnzLl6vv8N3+x4eEsS0mAvHAJhMoAw6kHUVUF4rkeWHAKXZtA15kDL6C6tkXmB
  855. ffiZs/P+NE7dC4pBhwsJY6USVjBtBO/bCswrbfq2GS+Ce9DwyooHoRvaPPzVxI67IVfHnQA+2JqQ
  856. MFQgur0anP8J5IVmYEopmdbh5YQO1wMu0BxdKlB/44GLg48/HT8J8uBesH6/ViDxC5DnWiHPWjAz
  857. 0wleYCGKokaJIDdI/6JMZ1nWEshr7UEZsnnBH8l+ZfpY9WA9YaWW0ba3SGBWJetY5xzq6pt/AY6/
  858. mKmzshF5AAAAAElFTkSuQmCC";
  859. $_IMAGES["sql"] = $_IMAGES["database"];
  860. $_IMAGES["tar"] = $_IMAGES["archive"];
  861. $_IMAGES["tgz"] = $_IMAGES["archive"];
  862. $_IMAGES["txt"] = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0
  863. U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADoSURBVBgZBcExblNBGAbA2ceegTRBuIKO
  864. giihSZNTcC5LUHAihNJR0kGKCDcYJY6D3/77MdOinTvzAgCw8ysThIvn/VojIyMjIyPP+bS1sUQI
  865. V2s95pBDDvmbP/mdkft83tpYguZq5Jh/OeaYh+yzy8hTHvNlaxNNczm+la9OTlar1UdA/+C2A4tr
  866. RCnD3jS8BB1obq2Gk6GU6QbQAS4BUaYSQAf4bhhKKTFdAzrAOwAxEUAH+KEM01SY3gM6wBsEAQB0
  867. gJ+maZoC3gI6iPYaAIBJsiRmHU0AALOeFC3aK2cWAACUXe7+AwO0lc9eTHYTAAAAAElFTkSuQmCC";
  868. $_IMAGES["wav"] = $_IMAGES["audio"];
  869. $_IMAGES["wma"] = $_IMAGES["audio"];
  870. $_IMAGES["wmv"] = $_IMAGES["video"];
  871. $_IMAGES["xcf"] = $_IMAGES["graphics"];
  872. $_IMAGES["xls"] = $_IMAGES["spreadsheet"];
  873. $_IMAGES["xlsx"] = $_IMAGES["spreadsheet"];
  874. $_IMAGES["xml"] = $_IMAGES["code"];
  875. $_IMAGES["zip"] = $_IMAGES["archive"];
  876. /***************************************************************************/
  877. /* HERE COMES THE CODE. */
  878. /* DON'T CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING ;) */
  879. /***************************************************************************/
  880. //
  881. // The class that displays images (icons and thumbnails)
  882. //
  883. class ImageServer
  884. {
  885. //
  886. // Checks if an image is requested and displays one if needed
  887. //
  888. public static function showImage()
  889. {
  890. global $_IMAGES;
  891. if(isset($_GET['img']))
  892. {
  893. if(strlen($_GET['img']) > 0)
  894. {
  895. $mtime = gmdate('r', filemtime($_SERVER['SCRIPT_FILENAME']));
  896. $etag = md5($mtime.$_SERVER['SCRIPT_FILENAME']);
  897. if ((isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $_SERVER['HTTP_IF_MODIFIED_SINCE'] == $mtime)
  898. || (isset($_SERVER['HTTP_IF_NONE_MATCH']) && str_replace('"', '', stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])) == $etag))
  899. {
  900. header('HTTP/1.1 304 Not Modified');
  901. return true;
  902. }
  903. else {
  904. header('ETag: "'.$etag.'"');
  905. header('Last-Modified: '.$mtime);
  906. header('Content-type: image/gif');
  907. if(isset($_IMAGES[$_GET['img']]))
  908. print base64_decode($_IMAGES[$_GET['img']]);
  909. else
  910. print base64_decode($_IMAGES["unknown"]);
  911. }
  912. }
  913. return true;
  914. }
  915. else if(isset($_GET['thumb']))
  916. {
  917. if(strlen($_GET['thumb']) > 0 && EncodeExplorer::getConfig('thumbnails') == true)
  918. {
  919. ImageServer::showThumbnail($_GET['thumb']);
  920. }
  921. return true;
  922. }
  923. return false;
  924. }
  925. public static function isEnabledPdf()
  926. {
  927. if(class_exists("Imagick"))
  928. return true;
  929. return false;
  930. }
  931. public static function openPdf($file)
  932. {
  933. if(!ImageServer::isEnabledPdf())
  934. return null;
  935. $im = new Imagick($file.'[0]');
  936. $im->setImageFormat( "png" );
  937. $str = $im->getImageBlob();
  938. $im2 = imagecreatefromstring($str);
  939. return $im2;
  940. }
  941. //
  942. // Creates and returns a thumbnail image object from an image file
  943. //
  944. public static function createThumbnail($file)
  945. {
  946. if(is_int(EncodeExplorer::getConfig('thumbnails_width')))
  947. $max_width = EncodeExplorer::getConfig('thumbnails_width');
  948. else
  949. $max_width = 200;
  950. if(is_int(EncodeExplorer::getConfig('thumbnails_height')))
  951. $max_height = EncodeExplorer::getConfig('thumbnails_height');
  952. else
  953. $max_height = 200;
  954. if(File::isPdfFile($file))
  955. $image = ImageServer::openPdf($file);
  956. else
  957. $image = ImageServer::openImage($file);
  958. if($image == null)
  959. return;
  960. imagealphablending($image, true);
  961. imagesavealpha($image, true);
  962. $width = imagesx($image);
  963. $height = imagesy($image);
  964. $new_width = $max_width;
  965. $new_height = $max_height;
  966. if(($width/$height) > ($new_width/$new_height))
  967. $new_height = $new_width * ($height / $width);
  968. else
  969. $new_width = $new_height * ($width / $height);
  970. if($new_width >= $width && $new_height >= $height)
  971. {
  972. $new_width = $width;
  973. $new_height = $height;
  974. }
  975. $new_image = ImageCreateTrueColor($new_width, $new_height);
  976. imagealphablending($new_image, true);
  977. imagesavealpha($new_image, true);
  978. $trans_colour = imagecolorallocatealpha($new_image, 0, 0, 0, 127);
  979. imagefill($new_image, 0, 0, $trans_colour);
  980. imagecopyResampled ($new_image, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
  981. return $new_image;
  982. }
  983. //
  984. // Function for displaying the thumbnail.
  985. // Includes attempts at cacheing it so that generation is minimised.
  986. //
  987. public static function showThumbnail($file)
  988. {
  989. if(filemtime($file) < filemtime($_SERVER['SCRIPT_FILENAME']))
  990. $mtime = gmdate('r', filemtime($_SERVER['SCRIPT_FILENAME']));
  991. else
  992. $mtime = gmdate('r', filemtime($file));
  993. $etag = md5($mtime.$file);
  994. if ((isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $_SERVER['HTTP_IF_MODIFIED_SINCE'] == $mtime)
  995. || (isset($_SERVER['HTTP_IF_NONE_MATCH']) && str_replace('"', '', stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])) == $etag))
  996. {
  997. header('HTTP/1.1 304 Not Modified');
  998. return;
  999. }
  1000. else
  1001. {
  1002. header('ETag: "'.$etag.'"');
  1003. header('Last-Modified: '.$mtime);
  1004. header('Content-Type: image/png');
  1005. $image = ImageServer::createThumbnail($file);
  1006. imagepng($image);
  1007. }
  1008. }
  1009. //
  1010. // A helping function for opening different types of image files
  1011. //
  1012. public static function openImage ($file)
  1013. {
  1014. $size = getimagesize($file);
  1015. switch($size["mime"])
  1016. {
  1017. case "image/jpeg":
  1018. $im = imagecreatefromjpeg($file);
  1019. break;
  1020. case "image/gif":
  1021. $im = imagecreatefromgif($file);
  1022. break;
  1023. case "image/png":
  1024. $im = imagecreatefrompng($file);
  1025. break;
  1026. default:
  1027. $im=null;
  1028. break;
  1029. }
  1030. return $im;
  1031. }
  1032. }
  1033. //
  1034. // The class for logging user activity
  1035. //
  1036. class Logger
  1037. {
  1038. public static function log($message)
  1039. {
  1040. global $encodeExplorer;
  1041. if(strlen(EncodeExplorer::getConfig('log_file')) > 0)
  1042. {
  1043. if(Location::isFileWritable(EncodeExplorer::getConfig('log_file')))
  1044. {
  1045. $message = "[" . date("Y-m-d h:i:s", mktime()) . "] ".$message." (".$_SERVER["HTTP_USER_AGENT"].")\n";
  1046. error_log($message, 3, EncodeExplorer::getConfig('log_file'));
  1047. }
  1048. else
  1049. $encodeExplorer->setErrorString("log_file_permission_error");
  1050. }
  1051. }
  1052. public static function logAccess($path, $isDir)
  1053. {
  1054. $message = $_SERVER['REMOTE_ADDR']." ".GateKeeper::getUserName()." accessed ";
  1055. $message .= $isDir?"dir":"file";
  1056. $message .= " ".$path;
  1057. Logger::log($message);
  1058. }
  1059. public static function logQuery()
  1060. {
  1061. if(isset($_POST['log']) && strlen($_POST['log']) > 0)
  1062. {
  1063. Logger::logAccess($_POST['log'], false);
  1064. return true;
  1065. }
  1066. else
  1067. return false;
  1068. }
  1069. public static function logCreation($path, $isDir)
  1070. {
  1071. $message = $_SERVER['REMOTE_ADDR']." ".GateKeeper::getUserName()." created ";
  1072. $message .= $isDir?"dir":"file";
  1073. $message .= " ".$path;
  1074. Logger::log($message);
  1075. }
  1076. public static function emailNotification($path, $isFile)
  1077. {
  1078. if(strlen(EncodeExplorer::getConfig('upload_email')) > 0)
  1079. {
  1080. $message = "This is a message to let you know that ".GateKeeper::getUserName()." ";
  1081. $message .= ($isFile?"uploaded a new file":"created a new directory")." in Encode Explorer.\n\n";
  1082. $message .= "Path : ".$path."\n";
  1083. $message .= "IP : ".$_SERVER['REMOTE_ADDR']."\n";
  1084. mail(EncodeExplorer::getConfig('upload_email'), "Upload notification", $message);
  1085. }
  1086. }
  1087. }
  1088. //
  1089. // The class controls logging in and authentication
  1090. //
  1091. class GateKeeper
  1092. {
  1093. public static function init()
  1094. {
  1095. global $encodeExplorer;
  1096. if(strlen(EncodeExplorer::getConfig("session_name")) > 0)
  1097. session_name(EncodeExplorer::getConfig("session_name"));
  1098. if(count(EncodeExplorer::getConfig("users")) > 0)
  1099. session_start();
  1100. else
  1101. return;
  1102. if(isset($_GET['logout']))
  1103. {
  1104. $_SESSION['ee_user_name'] = null;
  1105. $_SESSION['ee_user_pass'] = null;
  1106. }
  1107. if(isset($_POST['user_pass']) && strlen($_POST['user_pass']) > 0)
  1108. {
  1109. if(GateKeeper::isUser((isset($_POST['user_name'])?$_POST['user_name']:""), $_POST['user_pass']))
  1110. {
  1111. $_SESSION['ee_user_name'] = isset($_POST['user_name'])?$_POST['user_name']:"";
  1112. $_SESSION['ee_user_pass'] = $_POST['user_pass'];
  1113. $addr = $_SERVER['PHP_SELF'];
  1114. if(isset($_GET['m']))
  1115. $addr .= "?m";
  1116. else if(isset($_GET['s']))
  1117. $addr .= "?s";
  1118. header( "Location: ".$addr);
  1119. }
  1120. else
  1121. $encodeExplorer->setErrorString("wrong_pass");
  1122. }
  1123. }
  1124. public static function isUser($userName, $userPass)
  1125. {
  1126. foreach(EncodeExplorer::getConfig("users") as $user)
  1127. {
  1128. if($user[1] == $userPass)
  1129. {
  1130. if(strlen($userName) == 0 || $userName == $user[0])
  1131. {
  1132. return true;
  1133. }
  1134. }
  1135. }
  1136. return false;
  1137. }
  1138. public static function isLoginRequired()
  1139. {
  1140. if(EncodeExplorer::getConfig("require_login") == false){
  1141. return false;
  1142. }
  1143. return true;
  1144. }
  1145. public static function isUserLoggedIn()
  1146. {
  1147. if(isset($_SESSION['ee_user_name']) && isset($_SESSION['ee_user_pass']))
  1148. {
  1149. if(GateKeeper::isUser($_SESSION['ee_user_name'], $_SESSION['ee_user_pass']))
  1150. return true;
  1151. }
  1152. return false;
  1153. }
  1154. public static function isAccessAllowed()
  1155. {
  1156. if(!GateKeeper::isLoginRequired() || GateKeeper::isUserLoggedIn())
  1157. return true;
  1158. return false;
  1159. }
  1160. public static function isUploadAllowed(){
  1161. if(EncodeExplorer::getConfig("upload_enable") == true && GateKeeper::isUserLoggedIn() == true && GateKeeper::getUserStatus() == "admin")
  1162. return true;
  1163. return false;
  1164. }
  1165. public static function isNewdirAllowed(){
  1166. if(EncodeExplorer::getConfig("newdir_enable") == true && GateKeeper::isUserLoggedIn() == true && GateKeeper::getUserStatus() == "admin")
  1167. return true;
  1168. return false;
  1169. }
  1170. public static function isDeleteAllowed(){
  1171. if(EncodeExplorer::getConfig("delete_enable") == true && GateKeeper::isUserLoggedIn() == true && GateKeeper::getUserStatus() == "admin")
  1172. return true;
  1173. return false;
  1174. }
  1175. public static function getUserStatus(){
  1176. if(GateKeeper::isUserLoggedIn() == true && EncodeExplorer::getConfig("users") != null && is_array(EncodeExplorer::getConfig("users"))){
  1177. foreach(EncodeExplorer::getConfig("users") as $user){
  1178. if($user[0] != null && $user[0] == $_SESSION['ee_user_name'])
  1179. return $user[2];
  1180. }
  1181. }
  1182. return null;
  1183. }
  1184. public static function getUserName()
  1185. {
  1186. if(GateKeeper::isUserLoggedIn() == true && isset($_SESSION['ee_user_name']) && strlen($_SESSION['ee_user_name']) > 0)
  1187. return $_SESSION['ee_user_name'];
  1188. if(isset($_SERVER["REMOTE_USER"]) && strlen($_SERVER["REMOTE_USER"]) > 0)
  1189. return $_SERVER["REMOTE_USER"];
  1190. if(isset($_SERVER['PHP_AUTH_USER']) && strlen($_SERVER['PHP_AUTH_USER']) > 0)
  1191. return $_SERVER['PHP_AUTH_USER'];
  1192. return "an anonymous user";
  1193. }
  1194. public static function showLoginBox(){
  1195. if(!GateKeeper::isUserLoggedIn() && count(EncodeExplorer::getConfig("users")) > 0)
  1196. return true;
  1197. return false;
  1198. }
  1199. }
  1200. //
  1201. // The class for any kind of file managing (new folder, upload, etc).
  1202. //
  1203. class FileManager
  1204. {
  1205. /* Obsolete code
  1206. function checkPassword($inputPassword)
  1207. {
  1208. global $encodeExplorer;
  1209. if(strlen(EncodeExplorer::getConfig("upload_password")) > 0 && $inputPassword == EncodeExplorer::getConfig("upload_password"))
  1210. {
  1211. return true;
  1212. }
  1213. else
  1214. {
  1215. $encodeExplorer->setErrorString("wrong_password");
  1216. return false;
  1217. }
  1218. }
  1219. */
  1220. function newFolder($location, $dirname)
  1221. {
  1222. global $encodeExplorer;
  1223. if(strlen($dirname) > 0)
  1224. {
  1225. $forbidden = array(".", "/", "\\");
  1226. for($i = 0; $i < count($forbidden); $i++)
  1227. {
  1228. $dirname = str_replace($forbidden[$i], "", $dirname);
  1229. }
  1230. if(!$location->uploadAllowed())
  1231. {
  1232. // The system configuration does not allow uploading here
  1233. $encodeExplorer->setErrorString("upload_not_allowed");
  1234. }
  1235. else if(!$location->isWritable())
  1236. {
  1237. // The target directory is not writable
  1238. $encodeExplorer->setErrorString("upload_dir_not_writable");
  1239. }
  1240. else if(!mkdir($location->getDir(true, false, false, 0).$dirname, 0777))
  1241. {
  1242. // Error creating a new directory
  1243. $encodeExplorer->setErrorString("new_dir_failed");
  1244. }
  1245. else if(!chmod($location->getDir(true, false, false, 0).$dirname, 0777))
  1246. {
  1247. // Error applying chmod 777
  1248. $encodeExplorer->setErrorString("chmod_dir_failed");
  1249. }
  1250. else
  1251. {
  1252. // Directory successfully created, sending e-mail notification
  1253. Logger::logCreation($location->getDir(true, false, false, 0).$dirname, true);
  1254. Logger::emailNotification($location->getDir(true, false, false, 0).$dirname, false);
  1255. }
  1256. }
  1257. }
  1258. function uploadFile($location, $userfile)
  1259. {
  1260. global $encodeExplorer;
  1261. $name = basename($userfile['name']);
  1262. if(get_magic_quotes_gpc())
  1263. $name = stripslashes($name);
  1264. $upload_dir = $location->getFullPath();
  1265. $upload_file = $upload_dir . $name;
  1266. if(function_exists("finfo_open") && function_exists("finfo_file"))
  1267. $mime_type = File::getFileMime($userfile['tmp_name']);
  1268. else
  1269. $mime_type = $userfile['type'];
  1270. $extension = File::getFileExtension($userfile['name']);
  1271. if(!$location->uploadAllowed())
  1272. {
  1273. $encodeExplorer->setErrorString("upload_not_allowed");
  1274. }
  1275. else if(!$location->isWritable())
  1276. {
  1277. $encodeExplorer->setErrorString("upload_dir_not_writable");
  1278. }
  1279. else if(!is_uploaded_file($userfile['tmp_name']))
  1280. {
  1281. $encodeExplorer->setErrorString("failed_upload");
  1282. }
  1283. else if(is_array(EncodeExplorer::getConfig("upload_allow_type")) && count(EncodeExplorer::getConfig("upload_allow_type")) > 0 && !in_array($mime_type, EncodeExplorer::getConfig("upload_allow_type")))
  1284. {
  1285. $encodeExplorer->setErrorString("upload_type_not_allowed");
  1286. }
  1287. else if(is_array(EncodeExplorer::getConfig("upload_reject_extension")) && count(EncodeExplorer::getConfig("upload_reject_extension")) > 0 && in_array($extension, EncodeExplorer::getConfig("upload_reject_extension")))
  1288. {
  1289. $encodeExplorer->setErrorString("upload_type_not_allowed");
  1290. }
  1291. else if(!@move_uploaded_file($userfile['tmp_name'], $upload_file))
  1292. {
  1293. $encodeExplorer->setErrorString("failed_move");
  1294. }
  1295. else
  1296. {
  1297. chmod($upload_file, 0755);
  1298. Logger::logCreation($location->getDir(true, false, false, 0).$name, false);
  1299. Logger::emailNotification($location->getDir(true, false, false, 0).$name, true);
  1300. }
  1301. }
  1302. public static function delete_dir($dir) {
  1303. if (is_dir($dir)) {
  1304. $objects = scandir($dir);
  1305. foreach ($objects as $object) {
  1306. if ($object != "." && $object != "..") {
  1307. if (filetype($dir."/".$object) == "dir")
  1308. FileManager::delete_dir($dir."/".$object);
  1309. else
  1310. unlink($dir."/".$object);
  1311. }
  1312. }
  1313. reset($objects);
  1314. rmdir($dir);
  1315. }
  1316. }
  1317. public static function delete_file($file){
  1318. if(is_file($file)){
  1319. unlink($file);
  1320. }
  1321. }
  1322. //
  1323. // The main function, checks if the user wants to perform any supported operations
  1324. //
  1325. function run($location)
  1326. {
  1327. if(isset($_POST['userdir']) && strlen($_POST['userdir']) > 0){
  1328. if($location->uploadAllowed() && GateKeeper::isUserLoggedIn() && GateKeeper::isAccessAllowed() && GateKeeper::isNewdirAllowed()){
  1329. $this->newFolder($location, $_POST['userdir']);
  1330. }
  1331. }
  1332. if(isset($_FILES['userfile']['name']) && strlen($_FILES['userfile']['name']) > 0){
  1333. if($location->uploadAllowed() && GateKeeper::isUserLoggedIn() && GateKeeper::isAccessAllowed() && GateKeeper::isUploadAllowed()){
  1334. $this->uploadFile($location, $_FILES['userfile']);
  1335. }
  1336. }
  1337. if(isset($_GET['del'])){
  1338. if(GateKeeper::isUserLoggedIn() && GateKeeper::isAccessAllowed() && GateKeeper::isDeleteAllowed()){
  1339. $split_path = Location::splitPath($_GET['del']);
  1340. $path = "";
  1341. for($i = 0; $i < count($split_path); $i++){
  1342. $path .= $split_path[$i];
  1343. if($i + 1 < count($split_path))
  1344. $path .= "/";
  1345. }
  1346. if($path == "" || $path == "/" || $path == "\\" || $path == ".")
  1347. return;
  1348. if(is_dir($path))
  1349. FileManager::delete_dir($path);
  1350. else if(is_file($path))
  1351. FileManager::delete_file($path);
  1352. }
  1353. }
  1354. }
  1355. }
  1356. //
  1357. // Dir class holds the information about one directory in the list
  1358. //
  1359. class Dir
  1360. {
  1361. var $name;
  1362. var $location;
  1363. //
  1364. // Constructor
  1365. //
  1366. function Dir($name, $location)
  1367. {
  1368. $this->name = $name;
  1369. $this->location = $location;
  1370. }
  1371. function getName()
  1372. {
  1373. return $this->name;
  1374. }
  1375. function getNameHtml()
  1376. {
  1377. return htmlspecialchars($this->name);
  1378. }
  1379. function getNameEncoded()
  1380. {
  1381. return rawurlencode($this->name);
  1382. }
  1383. //
  1384. // Debugging output
  1385. //
  1386. function debug()
  1387. {
  1388. print("Dir name (htmlspecialchars): ".$this->getName()."\n");
  1389. print("Dir location: ".$this->location->getDir(true, false, false, 0)."\n");
  1390. }
  1391. }
  1392. //
  1393. // File class holds the information about one file in the list
  1394. //
  1395. class File
  1396. {
  1397. var $name;
  1398. var $location;
  1399. var $size;
  1400. //var $extension;
  1401. var $type;
  1402. var $modTime;
  1403. //
  1404. // Constructor
  1405. //
  1406. function File($name, $location)
  1407. {
  1408. $this->name = $name;
  1409. $this->location = $location;
  1410. $this->type = File::getFileType($this->location->getDir(true, false, false, 0).$this->getName());
  1411. $this->size = File::getFileSize($this->location->getDir(true, false, false, 0).$this->getName());
  1412. $this->modTime = filemtime($this->location->getDir(true, false, false, 0).$this->getName());
  1413. }
  1414. function getName()
  1415. {
  1416. return $this->name;
  1417. }
  1418. function getNameEncoded()
  1419. {
  1420. return rawurlencode($this->name);
  1421. }
  1422. function getNameHtml()
  1423. {
  1424. return htmlspecialchars($this->name);
  1425. }
  1426. function getSize()
  1427. {
  1428. return $this->size;
  1429. }
  1430. function getType()
  1431. {
  1432. return $this->type;
  1433. }
  1434. function getModTime()
  1435. {
  1436. return $this->modTime;
  1437. }
  1438. //
  1439. // Determine the size of a file
  1440. //
  1441. public static function getFileSize($file)
  1442. {
  1443. $sizeInBytes = filesize($file);
  1444. // If filesize() fails (with larger files), try to get the size from unix command line.
  1445. if (EncodeExplorer::getConfig("large_files") == true || !$sizeInBytes || $sizeInBytes < 0) {
  1446. $sizeInBytes=exec("ls -l '$file' | awk '{print $5}'");
  1447. }
  1448. return $sizeInBytes;
  1449. }
  1450. public static function getFileType($filepath)
  1451. {
  1452. /*
  1453. * This extracts the information from the file contents.
  1454. * Unfortunately it doesn't properly detect the difference between text-based file types.
  1455. *
  1456. $mime_type = File::getMimeType($filepath);
  1457. $mime_type_chunks = explode("/", $mime_type, 2);
  1458. $type = $mime_type_chunks[1];
  1459. */
  1460. return File::getFileExtension($filepath);
  1461. }
  1462. public static function getFileMime($filepath)
  1463. {
  1464. $fhandle = finfo_open(FILEINFO_MIME);
  1465. $mime_type = finfo_file($fhandle, $filepath);
  1466. $mime_type_chunks = preg_split('/\s+/', $mime_type);
  1467. $mime_type = $mime_type_chunks[0];
  1468. $mime_type_chunks = explode(";", $mime_type);
  1469. $mime_type = $mime_type_chunks[0];
  1470. return $mime_type;
  1471. }
  1472. public static function getFileExtension($filepath)
  1473. {
  1474. return strtolower(pathinfo($filepath, PATHINFO_EXTENSION));
  1475. }
  1476. //
  1477. // Debugging output
  1478. //
  1479. function debug()
  1480. {
  1481. print("File name: ".$this->getName()."\n");
  1482. print("File location: ".$this->location->getDir(true, false, false, 0)."\n");
  1483. print("File size: ".$this->size."\n");
  1484. print("File modTime: ".$this->modTime."\n");
  1485. }
  1486. function isImage()
  1487. {
  1488. $type = $this->getType();
  1489. if($type == "png" || $type == "jpg" || $type == "gif" || $type == "jpeg")
  1490. return true;
  1491. return false;
  1492. }
  1493. function isPdf()
  1494. {
  1495. if(strtolower($this->getType()) == "pdf")
  1496. return true;
  1497. return false;
  1498. }
  1499. public static function isPdfFile($file)
  1500. {
  1501. if(File::getFileType($file) == "pdf")
  1502. return true;
  1503. return false;
  1504. }
  1505. function isValidForThumb()
  1506. {
  1507. if($this->isImage() || ($this->isPdf() && ImageServer::isEnabledPdf()))
  1508. return true;
  1509. return false;
  1510. }
  1511. }
  1512. class Location
  1513. {
  1514. var $path;
  1515. //
  1516. // Split a file path into array elements
  1517. //
  1518. public static function splitPath($dir)
  1519. {
  1520. $dir = stripslashes($dir);
  1521. $path1 = preg_split("/[\\\\\/]+/", $dir);
  1522. $path2 = array();
  1523. for($i = 0; $i < count($path1); $i++)
  1524. {
  1525. if($path1[$i] == ".." || $path1[$i] == "." || $path1[$i] == "")
  1526. continue;
  1527. $path2[] = $path1[$i];
  1528. }
  1529. return $path2;
  1530. }
  1531. //
  1532. // Get the current directory.
  1533. // Options: Include the prefix ("./"); URL-encode the string; HTML-encode the string; return directory n-levels up
  1534. //
  1535. function getDir($prefix, $encoded, $html, $up)
  1536. {
  1537. $dir = "";
  1538. if($prefix == true)
  1539. $dir .= "./";
  1540. for($i = 0; $i < ((count($this->path) >= $up && $up > 0)?count($this->path)-$up:count($this->path)); $i++)
  1541. {
  1542. $temp = $this->path[$i];
  1543. if($encoded)
  1544. $temp = rawurlencode($temp);
  1545. if($html)
  1546. $temp = htmlspecialchars($temp);
  1547. $dir .= $temp."/";
  1548. }
  1549. return $dir;
  1550. }
  1551. function getPathLink($i, $html)
  1552. {
  1553. if($html)
  1554. return htmlspecialchars($this->path[$i]);
  1555. else
  1556. return $this->path[$i];
  1557. }
  1558. function getFullPath()
  1559. {
  1560. return (strlen(EncodeExplorer::getConfig('basedir')) > 0?EncodeExplorer::getConfig('basedir'):dirname($_SERVER['SCRIPT_FILENAME']))."/".$this->getDir(true, false, false, 0);
  1561. }
  1562. //
  1563. // Debugging output
  1564. //
  1565. function debug()
  1566. {
  1567. print_r($this->path);
  1568. print("Dir with prefix: ".$this->getDir(true, false, false, 0)."\n");
  1569. print("Dir without prefix: ".$this->getDir(false, false, false, 0)."\n");
  1570. print("Upper dir with prefix: ".$this->getDir(true, false, false, 1)."\n");
  1571. print("Upper dir without prefix: ".$this->getDir(false, false, false, 1)."\n");
  1572. }
  1573. //
  1574. // Set the current directory
  1575. //
  1576. function init()
  1577. {
  1578. if(!isset($_GET['dir']) || strlen($_GET['dir']) == 0)
  1579. {
  1580. $this->path = $this->splitPath(EncodeExplorer::getConfig('starting_dir'));
  1581. }
  1582. else
  1583. {
  1584. $this->path = $this->splitPath($_GET['dir']);
  1585. }
  1586. }
  1587. //
  1588. // Checks if the current directory is below the input path
  1589. //
  1590. function isSubDir($checkPath)
  1591. {
  1592. for($i = 0; $i < count($this->path); $i++)
  1593. {
  1594. if(strcmp($this->getDir(true, false, false, $i), $checkPath) == 0)
  1595. return true;
  1596. }
  1597. return false;
  1598. }
  1599. //
  1600. // Check if uploading is allowed into the current directory, based on the configuration
  1601. //
  1602. function uploadAllowed()
  1603. {
  1604. if(EncodeExplorer::getConfig('upload_enable') != true)
  1605. return false;
  1606. if(EncodeExplorer::getConfig('upload_dirs') == null || count(EncodeExplorer::getConfig('upload_dirs')) == 0)
  1607. return true;
  1608. $upload_dirs = EncodeExplorer::getConfig('upload_dirs');
  1609. for($i = 0; $i < count($upload_dirs); $i++)
  1610. {
  1611. if($this->isSubDir($upload_dirs[$i]))
  1612. return true;
  1613. }
  1614. return false;
  1615. }
  1616. function isWritable()
  1617. {
  1618. return is_writable($this->getDir(true, false, false, 0));
  1619. }
  1620. public static function isDirWritable($dir)
  1621. {
  1622. return is_writable($dir);
  1623. }
  1624. public static function isFileWritable($file)
  1625. {
  1626. if(file_exists($file))
  1627. {
  1628. if(is_writable($file))
  1629. return true;
  1630. else
  1631. return false;
  1632. }
  1633. else if(Location::isDirWritable(dirname($file)))
  1634. return true;
  1635. else
  1636. return false;
  1637. }
  1638. }
  1639. class EncodeExplorer
  1640. {
  1641. var $location;
  1642. var $dirs;
  1643. var $files;
  1644. var $sort_by;
  1645. var $sort_as;
  1646. var $mobile;
  1647. var $logging;
  1648. var $spaceUsed;
  1649. var $lang;
  1650. //
  1651. // Determine sorting, calculate space.
  1652. //
  1653. function init()
  1654. {
  1655. $this->sort_by = "";
  1656. $this->sort_as = "";
  1657. if(isset($_GET["sort_by"]) && isset($_GET["sort_as"]))
  1658. {
  1659. if($_GET["sort_by"] == "name" || $_GET["sort_by"] == "size" || $_GET["sort_by"] == "mod")
  1660. if($_GET["sort_as"] == "asc" || $_GET["sort_as"] == "desc")
  1661. {
  1662. $this->sort_by = $_GET["sort_by"];
  1663. $this->sort_as = $_GET["sort_as"];
  1664. }
  1665. }
  1666. if(strlen($this->sort_by) <= 0 || strlen($this->sort_as) <= 0)
  1667. {
  1668. $this->sort_by = "name";
  1669. $this->sort_as = "desc";
  1670. }
  1671. global $_TRANSLATIONS;
  1672. if(isset($_GET['lang']) && isset($_TRANSLATIONS[$_GET['lang']]))
  1673. $this->lang = $_GET['lang'];
  1674. else
  1675. $this->lang = EncodeExplorer::getConfig("lang");
  1676. $this->mobile = false;
  1677. if(EncodeExplorer::getConfig("mobile_enabled") == true)
  1678. {
  1679. if((EncodeExplorer::getConfig("mobile_default") == true || isset($_GET['m'])) && !isset($_GET['s']))
  1680. $this->mobile = true;
  1681. }
  1682. $this->logging = false;
  1683. if(EncodeExplorer::getConfig("log_file") != null && strlen(EncodeExplorer::getConfig("log_file")) > 0)
  1684. $this->logging = true;
  1685. }
  1686. //
  1687. // Read the file list from the directory
  1688. //
  1689. function readDir()
  1690. {
  1691. global $encodeExplorer;
  1692. //
  1693. // Reading the data of files and directories
  1694. //
  1695. if($open_dir = @opendir($this->location->getFullPath()))
  1696. {
  1697. $this->dirs = array();
  1698. $this->files = array();
  1699. while ($object = readdir($open_dir))
  1700. {
  1701. if($object != "." && $object != "..")
  1702. {
  1703. if(is_dir($this->location->getDir(true, false, false, 0)."/".$object))
  1704. {
  1705. if(!in_array($object, EncodeExplorer::getConfig('hidden_dirs')))
  1706. $this->dirs[] = new Dir($object, $this->location);
  1707. }
  1708. else if(!in_array($object, EncodeExplorer::getConfig('hidden_files')))
  1709. $this->files[] = new File($object, $this->location);
  1710. }
  1711. }
  1712. closedir($open_dir);
  1713. }
  1714. else
  1715. {
  1716. $encodeExplorer->setErrorString("unable_to_read_dir");;
  1717. }
  1718. }
  1719. //
  1720. // A recursive function for calculating the total used space
  1721. //
  1722. function sum_dir($start_dir, $ignore_files, $levels = 1)
  1723. {
  1724. if ($dir = opendir($start_dir))
  1725. {
  1726. $total = 0;
  1727. while ((($file = readdir($dir)) !== false))
  1728. {
  1729. if (!in_array($file, $ignore_files))
  1730. {
  1731. if ((is_dir($start_dir . '/' . $file)) && ($levels - 1 >= 0))
  1732. {
  1733. $total += $this->sum_dir($start_dir . '/' . $file, $ignore_files, $levels-1);
  1734. }
  1735. elseif (is_file($start_dir . '/' . $file))
  1736. {
  1737. $total += File::getFileSize($start_dir . '/' . $file) / 1024;
  1738. }
  1739. }
  1740. }
  1741. closedir($dir);
  1742. return $total;
  1743. }
  1744. }
  1745. function calculateSpace()
  1746. {
  1747. if(EncodeExplorer::getConfig('calculate_space_level') <= 0)
  1748. return;
  1749. $ignore_files = array('..', '.');
  1750. $start_dir = getcwd();
  1751. $spaceUsed = $this->sum_dir($start_dir, $ignore_files, EncodeExplorer::getConfig('calculate_space_level'));
  1752. $this->spaceUsed = round($spaceUsed/1024, 3);
  1753. }
  1754. function sort()
  1755. {
  1756. if(is_array($this->files)){
  1757. usort($this->files, "EncodeExplorer::cmp_".$this->sort_by);
  1758. if($this->sort_as == "desc")
  1759. $this->files = array_reverse($this->files);
  1760. }
  1761. if(is_array($this->dirs)){
  1762. usort($this->dirs, "EncodeExplorer::cmp_name");
  1763. if($this->sort_by == "name" && $this->sort_as == "desc")
  1764. $this->dirs = array_reverse($this->dirs);
  1765. }
  1766. }
  1767. function makeArrow($sort_by)
  1768. {
  1769. if($this->sort_by == $sort_by && $this->sort_as == "asc")
  1770. {
  1771. $sort_as = "desc";
  1772. $img = "arrow_up";
  1773. }
  1774. else
  1775. {
  1776. $sort_as = "asc";
  1777. $img = "arrow_down";
  1778. }
  1779. if($sort_by == "name")
  1780. $text = $this->getString("file_name");
  1781. else if($sort_by == "size")
  1782. $text = $this->getString("size");
  1783. else if($sort_by == "mod")
  1784. $text = $this->getString("last_changed");
  1785. return "<a href=\"".$this->makeLink(false, false, $sort_by, $sort_as, null, $this->location->getDir(false, true, false, 0))."\">
  1786. $text <img style=\"border:0;\" alt=\"".$sort_as."\" src=\"?img=".$img."\" /></a>";
  1787. }
  1788. function makeLink($switchVersion, $logout, $sort_by, $sort_as, $delete, $dir)
  1789. {
  1790. $link = "?";
  1791. if($switchVersion == true && EncodeExplorer::getConfig("mobile_enabled") == true)
  1792. {
  1793. if($this->mobile == false)
  1794. $link .= "m&amp;";
  1795. else
  1796. $link .= "s&amp;";
  1797. }
  1798. else if($this->mobile == true && EncodeExplorer::getConfig("mobile_enabled") == true && EncodeExplorer::getConfig("mobile_default") == false)
  1799. $link .= "m&amp;";
  1800. else if($this->mobile == false && EncodeExplorer::getConfig("mobile_enabled") == true && EncodeExplorer::getConfig("mobile_default") == true)
  1801. $link .= "s&amp;";
  1802. if($logout == true)
  1803. {
  1804. $link .= "logout";
  1805. return $link;
  1806. }
  1807. if(isset($this->lang) && $this->lang != EncodeExplorer::getConfig("lang"))
  1808. $link .= "lang=".$this->lang."&amp;";
  1809. if($sort_by != null && strlen($sort_by) > 0)
  1810. $link .= "sort_by=".$sort_by."&amp;";
  1811. if($sort_as != null && strlen($sort_as) > 0)
  1812. $link .= "sort_as=".$sort_as."&amp;";
  1813. $link .= "dir=".$dir;
  1814. if($delete != null)
  1815. $link .= "&amp;del=".$delete;
  1816. return $link;
  1817. }
  1818. function makeIcon($l)
  1819. {
  1820. $l = strtolower($l);
  1821. return "?img=".$l;
  1822. }
  1823. function formatModTime($time)
  1824. {
  1825. $timeformat = "d.m.y H:i:s";
  1826. if(EncodeExplorer::getConfig("time_format") != null && strlen(EncodeExplorer::getConfig("time_format")) > 0)
  1827. $timeformat = EncodeExplorer::getConfig("time_format");
  1828. return date($timeformat, $time);
  1829. }
  1830. function formatSize($size)
  1831. {
  1832. $sizes = Array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB');
  1833. $y = $sizes[0];
  1834. for ($i = 1; (($i < count($sizes)) && ($size >= 1024)); $i++)
  1835. {
  1836. $size = $size / 1024;
  1837. $y = $sizes[$i];
  1838. }
  1839. return round($size, 2)." ".$y;
  1840. }
  1841. //
  1842. // Debugging output
  1843. //
  1844. function debug()
  1845. {
  1846. print("Explorer location: ".$this->location->getDir(true, false, false, 0)."\n");
  1847. for($i = 0; $i < count($this->dirs); $i++)
  1848. $this->dirs[$i]->output();
  1849. for($i = 0; $i < count($this->files); $i++)
  1850. $this->files[$i]->output();
  1851. }
  1852. //
  1853. // Comparison functions for sorting.
  1854. //
  1855. public static function cmp_name($b, $a)
  1856. {
  1857. return strcasecmp($a->name, $b->name);
  1858. }
  1859. public static function cmp_size($a, $b)
  1860. {
  1861. return ($a->size - $b->size);
  1862. }
  1863. public static function cmp_mod($b, $a)
  1864. {
  1865. return ($a->modTime - $b->modTime);
  1866. }
  1867. //
  1868. // The function for getting a translated string.
  1869. // Falls back to english if the correct language is missing something.
  1870. //
  1871. public static function getLangString($stringName, $lang)
  1872. {
  1873. global $_TRANSLATIONS;
  1874. if(isset($_TRANSLATIONS[$lang]) && is_array($_TRANSLATIONS[$lang])
  1875. && isset($_TRANSLATIONS[$lang][$stringName]))
  1876. return $_TRANSLATIONS[$lang][$stringName];
  1877. else if(isset($_TRANSLATIONS["en"]))// && is_array($_TRANSLATIONS["en"])
  1878. //&& isset($_TRANSLATIONS["en"][$stringName]))
  1879. return $_TRANSLATIONS["en"][$stringName];
  1880. else
  1881. return "Translation error";
  1882. }
  1883. function getString($stringName)
  1884. {
  1885. return EncodeExplorer::getLangString($stringName, $this->lang);
  1886. }
  1887. //
  1888. // The function for getting configuration values
  1889. //
  1890. public static function getConfig($name)
  1891. {
  1892. global $_CONFIG;
  1893. if(isset($_CONFIG) && isset($_CONFIG[$name]))
  1894. return $_CONFIG[$name];
  1895. return null;
  1896. }
  1897. public static function setError($message)
  1898. {
  1899. global $_ERROR;
  1900. if(isset($_ERROR) && strlen($_ERROR) > 0)
  1901. ;// keep the first error and discard the rest
  1902. else
  1903. $_ERROR = $message;
  1904. }
  1905. function setErrorString($stringName)
  1906. {
  1907. EncodeExplorer::setError($this->getString($stringName));
  1908. }
  1909. //
  1910. // Main function, activating tasks
  1911. //
  1912. function run($location)
  1913. {
  1914. $this->location = $location;
  1915. $this->calculateSpace();
  1916. $this->readDir();
  1917. $this->sort();
  1918. $this->outputHtml();
  1919. }
  1920. public function printLoginBox()
  1921. {
  1922. ?>
  1923. <div id="login">
  1924. <form enctype="multipart/form-data" action="<?php print $this->makeLink(false, false, null, null, null, ""); ?>" method="post">
  1925. <?php
  1926. if(GateKeeper::isLoginRequired())
  1927. {
  1928. $require_username = false;
  1929. foreach(EncodeExplorer::getConfig("users") as $user){
  1930. if($user[0] != null && strlen($user[0]) > 0){
  1931. $require_username = true;
  1932. break;
  1933. }
  1934. }
  1935. if($require_username)
  1936. {
  1937. ?>
  1938. <div><label for="user_name"><?php print $this->getString("username"); ?>:</label>
  1939. <input type="text" name="user_name" value="" id="user_name" /></div>
  1940. <?php
  1941. }
  1942. ?>
  1943. <div><label for="user_pass"><?php print $this->getString("password"); ?>:</label>
  1944. <input type="password" name="user_pass" id="user_pass" /></div>
  1945. <div><input type="submit" value="<?php print $this->getString("log_in"); ?>" class="button" /></div>
  1946. </form>
  1947. </div>
  1948. <?php
  1949. }
  1950. }
  1951. //
  1952. // Printing the actual page
  1953. //
  1954. function outputHtml()
  1955. {
  1956. global $_ERROR;
  1957. global $_START_TIME;
  1958. ?>
  1959. <!DOCTYPE HTML>
  1960. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $this->getConfig('lang'); ?>" lang="<?php print $this->getConfig('lang'); ?>">
  1961. <head>
  1962. <meta name="viewport" content="width=device-width" />
  1963. <meta http-equiv="Content-Type" content="text/html; charset=<?php print $this->getConfig('charset'); ?>">
  1964. <?php css(); ?>
  1965. <!-- <meta charset="<?php print $this->getConfig('charset'); ?>" /> -->
  1966. <?php
  1967. if(($this->getConfig('log_file') != null && strlen($this->getConfig('log_file')) > 0)
  1968. || ($this->getConfig('thumbnails') != null && $this->getConfig('thumbnails') == true && $this->mobile == false)
  1969. || (GateKeeper::isDeleteAllowed()))
  1970. {
  1971. ?>
  1972. <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
  1973. <script type="text/javascript">
  1974. //<![CDATA[
  1975. $(document).ready(function() {
  1976. <?php
  1977. if(GateKeeper::isDeleteAllowed()){
  1978. ?>
  1979. $('td.del a').click(function(){
  1980. var answer = confirm('Are you sure you want to delete : \'' + $(this).attr("data-name") + "\' ?");
  1981. return answer;
  1982. });
  1983. <?php
  1984. }
  1985. if($this->logging == true)
  1986. {
  1987. ?>
  1988. function logFileClick(path)
  1989. {
  1990. $.ajax({
  1991. async: false,
  1992. type: "POST",
  1993. data: {log: path},
  1994. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  1995. cache: false
  1996. });
  1997. }
  1998. $("a.file").click(function(){
  1999. logFileClick("<?php print $this->location->getDir(true, true, false, 0);?>" + $(this).html());
  2000. return true;
  2001. });
  2002. <?php
  2003. }
  2004. if(EncodeExplorer::getConfig("thumbnails") == true && $this->mobile == false)
  2005. {
  2006. ?>
  2007. function positionThumbnail(e) {
  2008. xOffset = 30;
  2009. yOffset = 10;
  2010. $("#thumb").css("left",(e.clientX + xOffset) + "px");
  2011. diff = 0;
  2012. if(e.clientY + $("#thumb").height() > $(window).height())
  2013. diff = e.clientY + $("#thumb").height() - $(window).height();
  2014. $("#thumb").css("top",(e.pageY - yOffset - diff) + "px");
  2015. }
  2016. $("a.thumb").hover(function(e){
  2017. $("#thumb").remove();
  2018. $("body").append("<div id=\"thumb\"><img src=\"?thumb="+ $(this).attr("href") +"\" alt=\"Preview\" \/><\/div>");
  2019. positionThumbnail(e);
  2020. $("#thumb").fadeIn("medium");
  2021. },
  2022. function(){
  2023. $("#thumb").remove();
  2024. });
  2025. $("a.thumb").mousemove(function(e){
  2026. positionThumbnail(e);
  2027. });
  2028. $("a.thumb").click(function(e){$("#thumb").remove(); return true;});
  2029. <?php
  2030. }
  2031. ?>
  2032. });
  2033. //]]>
  2034. </script>
  2035. <?php
  2036. }
  2037. ?>
  2038. <title><?php if(EncodeExplorer::getConfig('main_title') != null) print EncodeExplorer::getConfig('main_title'); ?></title>
  2039. </head>
  2040. <body class="<?php print ($this->mobile == true?"mobile":"standard");?>">
  2041. <?php
  2042. //
  2043. // Print the error (if there is something to print)
  2044. //
  2045. if(isset($_ERROR) && strlen($_ERROR) > 0)
  2046. {
  2047. print "<div id=\"error\">".$_ERROR."</div>";
  2048. }
  2049. ?>
  2050. <div id="frame">
  2051. <?php
  2052. if(EncodeExplorer::getConfig('show_top') == true)
  2053. {
  2054. ?>
  2055. <div id="top">
  2056. <a href="<?php print $this->makeLink(false, false, null, null, null, ""); ?>"><span><?php if(EncodeExplorer::getConfig('main_title') != null) print EncodeExplorer::getConfig('main_title'); ?></span></a>
  2057. <?php
  2058. if(EncodeExplorer::getConfig("secondary_titles") != null && is_array(EncodeExplorer::getConfig("secondary_titles")) && count(EncodeExplorer::getConfig("secondary_titles")) > 0 && $this->mobile == false)
  2059. {
  2060. $secondary_titles = EncodeExplorer::getConfig("secondary_titles");
  2061. print "<div class=\"subtitle\">".$secondary_titles[array_rand($secondary_titles)]."</div>\n";
  2062. }
  2063. ?>
  2064. </div>
  2065. <?php
  2066. }
  2067. // Checking if the user is allowed to access the page, otherwise showing the login box
  2068. if(!GateKeeper::isAccessAllowed())
  2069. {
  2070. $this->printLoginBox();
  2071. }
  2072. else
  2073. {
  2074. if($this->mobile == false && EncodeExplorer::getConfig("show_path") == true)
  2075. {
  2076. ?>
  2077. <div class="breadcrumbs">
  2078. <a href="?dir="><?php print $this->getString("root"); ?></a>
  2079. <?php
  2080. for($i = 0; $i < count($this->location->path); $i++)
  2081. {
  2082. print "&gt; <a href=\"".$this->makeLink(false, false, null, null, null, $this->location->getDir(false, true, false, count($this->location->path) - $i - 1))."\">";
  2083. print $this->location->getPathLink($i, true);
  2084. print "</a>\n";
  2085. }
  2086. ?>
  2087. </div>
  2088. <?php
  2089. }
  2090. ?>
  2091. <!-- START: List table -->
  2092. <table class="table">
  2093. <?php
  2094. if($this->mobile == false)
  2095. {
  2096. ?>
  2097. <tr class="row one header">
  2098. <td class="icon"> </td>
  2099. <td class="name"><?php print $this->makeArrow("name");?></td>
  2100. <td class="size"><?php print $this->makeArrow("size"); ?></td>
  2101. <td class="changed"><?php print $this->makeArrow("mod"); ?></td>
  2102. <?php if($this->mobile == false && GateKeeper::isDeleteAllowed()){?>
  2103. <td class="del"><?php print EncodeExplorer::getString("del"); ?></td>
  2104. <?php } ?>
  2105. </tr>
  2106. <?php
  2107. }
  2108. ?>
  2109. <tr class="row two">
  2110. <td class="icon"><img alt="dir" src="?img=directory" /></td>
  2111. <td colspan="<?php print (($this->mobile == true?2:(GateKeeper::isDeleteAllowed()?4:3))); ?>" class="long">
  2112. <a class="item" href="<?php print $this->makeLink(false, false, null, null, null, $this->location->getDir(false, true, false, 1)); ?>">..</a>
  2113. </td>
  2114. </tr>
  2115. <?php
  2116. //
  2117. // Ready to display folders and files.
  2118. //
  2119. $row = 1;
  2120. //
  2121. // Folders first
  2122. //
  2123. if($this->dirs)
  2124. {
  2125. foreach ($this->dirs as $dir)
  2126. {
  2127. $row_style = ($row ? "one" : "two");
  2128. print "<tr class=\"row ".$row_style."\">\n";
  2129. print "<td class=\"icon\"><img alt=\"dir\" src=\"?img=directory\" /></td>\n";
  2130. print "<td class=\"name\" colspan=\"".($this->mobile == true?2:3)."\">\n";
  2131. print "<a href=\"".$this->makeLink(false, false, null, null, null, $this->location->getDir(false, true, false, 0).$dir->getNameEncoded())."\" class=\"item dir\">";
  2132. print $dir->getNameHtml();
  2133. print "</a>\n";
  2134. print "</td>\n";
  2135. if($this->mobile == false && GateKeeper::isDeleteAllowed()){
  2136. print "<td class=\"del\"><a data-name=\"".htmlentities($dir->getName())."\" href=\"".$this->makeLink(false, false, null, null, $this->location->getDir(false, true, false, 0).$dir->getNameEncoded(), $this->location->getDir(false, true, false, 0))."\"><img src=\"?img=del\" alt=\"Delete\" /></a></td>";
  2137. }
  2138. print "</tr>\n";
  2139. $row =! $row;
  2140. }
  2141. }
  2142. //
  2143. // Now the files
  2144. //
  2145. if($this->files)
  2146. {
  2147. $count = 0;
  2148. foreach ($this->files as $file)
  2149. {
  2150. $row_style = ($row ? "one" : "two");
  2151. print "<tr class=\"row ".$row_style.(++$count == count($this->files)?" last":"")."\">\n";
  2152. print "<td class=\"icon\"><img alt=\"".$file->getType()."\" src=\"".$this->makeIcon($file->getType())."\" /></td>\n";
  2153. print "<td class=\"name\">\n";
  2154. print "\t\t<a href=\"".$this->location->getDir(false, true, false, 0).$file->getNameEncoded()."\"";
  2155. if(EncodeExplorer::getConfig('open_in_new_window') == true)
  2156. print "target=\"_blank\"";
  2157. print " class=\"item file";
  2158. if($file->isValidForThumb())
  2159. print " thumb";
  2160. print "\">";
  2161. print $file->getNameHtml();
  2162. if($this->mobile == true)
  2163. {
  2164. print "<span class =\"size\">".$this->formatSize($file->getSize())."</span>";
  2165. }
  2166. print "</a>\n";
  2167. print "</td>\n";
  2168. if($this->mobile != true)
  2169. {
  2170. print "<td class=\"size\">".$this->formatSize($file->getSize())."</td>\n";
  2171. print "<td class=\"changed\">".$this->formatModTime($file->getModTime())."</td>\n";
  2172. }
  2173. if($this->mobile == false && GateKeeper::isDeleteAllowed()){
  2174. print "<td class=\"del\">
  2175. <a data-name=\"".htmlentities($file->getName())."\" href=\"".$this->makeLink(false, false, null, null, $this->location->getDir(false, true, false, 0).$file->getNameEncoded(), $this->location->getDir(false, true, false, 0))."\">
  2176. <img src=\"?img=del\" alt=\"Delete\" />
  2177. </a>
  2178. </td>";
  2179. }
  2180. print "</tr>\n";
  2181. $row =! $row;
  2182. }
  2183. }
  2184. //
  2185. // The files and folders have been displayed
  2186. //
  2187. ?>
  2188. </table>
  2189. <!-- END: List table -->
  2190. <?php
  2191. }
  2192. ?>
  2193. </div>
  2194. <?php
  2195. if(GateKeeper::isAccessAllowed() && GateKeeper::showLoginBox()){
  2196. ?>
  2197. <!-- START: Login area -->
  2198. <form enctype="multipart/form-data" method="post">
  2199. <div id="login_bar">
  2200. <?php print $this->getString("username"); ?>:
  2201. <input type="text" name="user_name" value="" id="user_name" />
  2202. <?php print $this->getString("password"); ?>:
  2203. <input type="password" name="user_pass" id="user_pass" />
  2204. <input type="submit" class="submit" value="<?php print $this->getString("log_in"); ?>" />
  2205. <div class="bar"></div>
  2206. </div>
  2207. </form>
  2208. <!-- END: Login area -->
  2209. <?php
  2210. }
  2211. if(GateKeeper::isAccessAllowed() && $this->location->uploadAllowed() && (GateKeeper::isUploadAllowed() || GateKeeper::isNewdirAllowed()))
  2212. {
  2213. ?>
  2214. <!-- START: Upload area -->
  2215. <form enctype="multipart/form-data" method="post">
  2216. <div id="upload">
  2217. <?php
  2218. if(GateKeeper::isNewdirAllowed()){
  2219. ?>
  2220. <div id="newdir_container">
  2221. <input name="userdir" type="text" class="upload_dirname" />
  2222. <input type="submit" value="<?php print $this->getString("make_directory"); ?>" />
  2223. </div>
  2224. <?php
  2225. }
  2226. if(GateKeeper::isUploadAllowed()){
  2227. ?>
  2228. <div id="upload_container">
  2229. <input name="userfile" type="file" class="upload_file" />
  2230. <input type="submit" value="<?php print $this->getString("upload"); ?>" class="upload_sumbit" />
  2231. </div>
  2232. <?php
  2233. }
  2234. ?>
  2235. <div class="bar"></div>
  2236. </div>
  2237. </form>
  2238. <!-- END: Upload area -->
  2239. <?php
  2240. }
  2241. ?>
  2242. <!-- START: Info area -->
  2243. <div id="info">
  2244. <?php
  2245. if(GateKeeper::isUserLoggedIn())
  2246. print "<a href=\"".$this->makeLink(false, true, null, null, null, "")."\">".$this->getString("log_out")."</a> | ";
  2247. if(EncodeExplorer::getConfig("mobile_enabled") == true)
  2248. {
  2249. print "<a href=\"".$this->makeLink(true, false, null, null, null, $this->location->getDir(false, true, false, 0))."\">\n";
  2250. print ($this->mobile == true)?$this->getString("standard_version"):$this->getString("mobile_version")."\n";
  2251. print "</a> \n";
  2252. }
  2253. if(GateKeeper::isAccessAllowed() && $this->getConfig("calculate_space_level") > 0 && $this->mobile == false)
  2254. {
  2255. print $this->getString("total_used_space").": ".$this->spaceUsed." MB ";
  2256. }
  2257. if($this->mobile == false && $this->getConfig("show_load_time") == true)
  2258. {
  2259. printf($this->getString("page_load_time")." ", (microtime(TRUE) - $_START_TIME)*1000);
  2260. }
  2261. ?>
  2262. </div>
  2263. <!-- END: Info area -->
  2264. </body>
  2265. </html>
  2266. <?php
  2267. }
  2268. }
  2269. //
  2270. // This is where the system is activated.
  2271. // We check if the user wants an image and show it. If not, we show the explorer.
  2272. //
  2273. $encodeExplorer = new EncodeExplorer();
  2274. $encodeExplorer->init();
  2275. GateKeeper::init();
  2276. if(!ImageServer::showImage() && !Logger::logQuery())
  2277. {
  2278. $location = new Location();
  2279. $location->init();
  2280. if(GateKeeper::isAccessAllowed())
  2281. {
  2282. Logger::logAccess($location->getDir(true, false, false, 0), true);
  2283. $fileManager = new FileManager();
  2284. $fileManager->run($location);
  2285. }
  2286. $encodeExplorer->run($location);
  2287. }
  2288. ?>