PalmaSolutions

dk.php

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