PageRenderTime 73ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/profiles/codex.php

https://gitlab.com/endomorphosis/aegir
PHP | 1911 lines | 1754 code | 129 blank | 28 comment | 18 complexity | ac11083e4a1bf7a1bf22bfb527d055b9 MD5 | raw file
  1. <?php
  2. /*
  3. bbb
  4. */
  5. $lang = 'auto';
  6. /* Charset of output:
  7. * possible values are described in the charset table at
  8. * http://www.php.net/manual/en/function.htmlentities.php
  9. * 'auto' - use the same charset as the words of my language are encoded
  10. */
  11. $site_charset = 'auto';
  12. /* Homedir:
  13. * For example: './' - the script's directory
  14. */
  15. $homedir = './';
  16. /* Size of the edit textarea
  17. */
  18. $editcols = 80;
  19. $editrows = 25;
  20. /* -------------------------------------------
  21. * Optional configuration (remove # to enable)
  22. */
  23. /* Permission of created directories:
  24. * For example: 0705 would be 'drwx---r-x'.
  25. */
  26. # $dirpermission = 0705;
  27. /* Permission of created files:
  28. * For example: 0604 would be '-rw----r--'.
  29. */
  30. # $filepermission = 0604;
  31. /* Filenames related to the apache web server:
  32. */
  33. $htaccess = '.htaccess';
  34. $htpasswd = '.htpasswd';
  35. /* ------------------------------------------------------------------------- */
  36. if (get_magic_quotes_gpc()) {
  37. array_walk($_GET, 'strip');
  38. array_walk($_POST, 'strip');
  39. array_walk($_REQUEST, 'strip');
  40. }
  41. if (array_key_exists('image', $_GET)) {
  42. header('Content-Type: image/gif');
  43. die(getimage($_GET['image']));
  44. }
  45. if (!function_exists('lstat')) {
  46. function lstat ($filename) {
  47. return stat($filename);
  48. }
  49. }
  50. $delim = DIRECTORY_SEPARATOR;
  51. if (function_exists('php_uname')) {
  52. $win = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? true : false;
  53. } else {
  54. $win = ($delim == '\\') ? true : false;
  55. }
  56. if (!empty($_SERVER['PATH_TRANSLATED'])) {
  57. $scriptdir = dirname($_SERVER['PATH_TRANSLATED']);
  58. } elseif (!empty($_SERVER['SCRIPT_FILENAME'])) {
  59. $scriptdir = dirname($_SERVER['SCRIPT_FILENAME']);
  60. } elseif (function_exists('getcwd')) {
  61. $scriptdir = getcwd();
  62. } else {
  63. $scriptdir = '.';
  64. }
  65. $homedir = relative2absolute($homedir, $scriptdir);
  66. $dir = (array_key_exists('dir', $_REQUEST)) ? $_REQUEST['dir'] : $homedir;
  67. if (array_key_exists('olddir', $_POST) && !path_is_relative($_POST['olddir'])) {
  68. $dir = relative2absolute($dir, $_POST['olddir']);
  69. }
  70. $directory = simplify_path(addslash($dir));
  71. $files = array();
  72. $action = '';
  73. if (!empty($_POST['submit_all'])) {
  74. $action = $_POST['action_all'];
  75. for ($i = 0; $i < $_POST['num']; $i++) {
  76. if (array_key_exists("checked$i", $_POST) && $_POST["checked$i"] == 'true') {
  77. $files[] = $_POST["file$i"];
  78. }
  79. }
  80. } elseif (!empty($_REQUEST['action'])) {
  81. $action = $_REQUEST['action'];
  82. $files[] = relative2absolute($_REQUEST['file'], $directory);
  83. } elseif (!empty($_POST['submit_upload']) && !empty($_FILES['upload']['name'])) {
  84. $files[] = $_FILES['upload'];
  85. $action = 'upload';
  86. } elseif (array_key_exists('num', $_POST)) {
  87. for ($i = 0; $i < $_POST['num']; $i++) {
  88. if (array_key_exists("submit$i", $_POST)) break;
  89. }
  90. if ($i < $_POST['num']) {
  91. $action = $_POST["action$i"];
  92. $files[] = $_POST["file$i"];
  93. }
  94. }
  95. if (empty($action) && (!empty($_POST['submit_create']) || (array_key_exists('focus', $_POST) && $_POST['focus'] == 'create')) && !empty($_POST['create_name'])) {
  96. $files[] = relative2absolute($_POST['create_name'], $directory);
  97. switch ($_POST['create_type']) {
  98. case 'directory':
  99. $action = 'create_directory';
  100. break;
  101. case 'file':
  102. $action = 'create_file';
  103. }
  104. }
  105. if (sizeof($files) == 0) $action = ''; else $file = reset($files);
  106. if ($lang == 'auto') {
  107. if (array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER) && strlen($_SERVER['HTTP_ACCEPT_LANGUAGE']) >= 2) {
  108. $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
  109. } else {
  110. $lang = 'en';
  111. }
  112. }
  113. $words = getwords($lang);
  114. if ($site_charset == 'auto') {
  115. $site_charset = $word_charset;
  116. }
  117. $cols = ($win) ? 4 : 7;
  118. if (!isset($dirpermission)) {
  119. $dirpermission = (function_exists('umask')) ? (0777 & ~umask()) : 0755;
  120. }
  121. if (!isset($filepermission)) {
  122. $filepermission = (function_exists('umask')) ? (0666 & ~umask()) : 0644;
  123. }
  124. if (!empty($_SERVER['SCRIPT_NAME'])) {
  125. $self = html(basename($_SERVER['SCRIPT_NAME']));
  126. } elseif (!empty($_SERVER['PHP_SELF'])) {
  127. $self = html(basename($_SERVER['PHP_SELF']));
  128. } else {
  129. $self = '';
  130. }
  131. if (!empty($_SERVER['SERVER_SOFTWARE'])) {
  132. if (strtolower(substr($_SERVER['SERVER_SOFTWARE'], 0, 6)) == 'apache') {
  133. $apache = true;
  134. } else {
  135. $apache = false;
  136. }
  137. } else {
  138. $apache = true;
  139. }
  140. switch ($action) {
  141. case 'view':
  142. if (is_script($file)) {
  143. /* highlight_file is a mess! */
  144. ob_start();
  145. highlight_file($file);
  146. $src = ereg_replace('<font color="([^"]*)">', '<span style="color: \1">', ob_get_contents());
  147. $src = str_replace(array('</font>', "\r", "\n"), array('</span>', '', ''), $src);
  148. ob_end_clean();
  149. html_header();
  150. echo '<h2 style="text-align: left; margin-bottom: 0">' . html($file) . '</h2>
  151. <hr />
  152. <table>
  153. <tr>
  154. <td style="text-align: right; vertical-align: top; color: gray; padding-right: 3pt; border-right: 1px solid gray">
  155. <pre style="margin-top: 0"><code>';
  156. for ($i = 1; $i <= sizeof(file($file)); $i++) echo "$i\n";
  157. echo '</code></pre>
  158. </td>
  159. <td style="text-align: left; vertical-align: top; padding-left: 3pt">
  160. <pre style="margin-top: 0">' . $src . '</pre>
  161. </td>
  162. </tr>
  163. </table>
  164. ';
  165. html_footer();
  166. } else {
  167. header('Content-Type: ' . getmimetype($file));
  168. header('Content-Disposition: filename=' . basename($file));
  169. readfile($file);
  170. }
  171. break;
  172. case 'download':
  173. header('Pragma: public');
  174. header('Expires: 0');
  175. header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  176. header('Content-Type: ' . getmimetype($file));
  177. header('Content-Disposition: attachment; filename=' . basename($file) . ';');
  178. header('Content-Length: ' . filesize($file));
  179. readfile($file);
  180. break;
  181. case 'upload':
  182. $dest = relative2absolute($file['name'], $directory);
  183. if (@file_exists($dest)) {
  184. listing_page(error('already_exists', $dest));
  185. } elseif (@move_uploaded_file($file['tmp_name'], $dest)) {
  186. @chmod($dest, $filepermission);
  187. listing_page(notice('uploaded', $file['name']));
  188. } else {
  189. listing_page(error('not_uploaded', $file['name']));
  190. }
  191. break;
  192. case 'create_directory':
  193. if (@file_exists($file)) {
  194. listing_page(error('already_exists', $file));
  195. } else {
  196. $old = @umask(0777 & ~$dirpermission);
  197. if (@mkdir($file, $dirpermission)) {
  198. listing_page(notice('created', $file));
  199. } else {
  200. listing_page(error('not_created', $file));
  201. }
  202. @umask($old);
  203. }
  204. break;
  205. case 'create_file':
  206. if (@file_exists($file)) {
  207. listing_page(error('already_exists', $file));
  208. } else {
  209. $old = @umask(0777 & ~$filepermission);
  210. if (@touch($file)) {
  211. edit($file);
  212. } else {
  213. listing_page(error('not_created', $file));
  214. }
  215. @umask($old);
  216. }
  217. break;
  218. case 'execute':
  219. chdir(dirname($file));
  220. $output = array();
  221. $retval = 0;
  222. exec('echo "./' . basename($file) . '" | /bin/sh', $output, $retval);
  223. $error = ($retval == 0) ? false : true;
  224. if (sizeof($output) == 0) $output = array('<' . $words['no_output'] . '>');
  225. if ($error) {
  226. listing_page(error('not_executed', $file, implode("\n", $output)));
  227. } else {
  228. listing_page(notice('executed', $file, implode("\n", $output)));
  229. }
  230. break;
  231. case 'delete':
  232. if (!empty($_POST['no'])) {
  233. listing_page();
  234. } elseif (!empty($_POST['yes'])) {
  235. $failure = array();
  236. $success = array();
  237. foreach ($files as $file) {
  238. if (del($file)) {
  239. $success[] = $file;
  240. } else {
  241. $failure[] = $file;
  242. }
  243. }
  244. $message = '';
  245. if (sizeof($failure) > 0) {
  246. $message = error('not_deleted', implode("\n", $failure));
  247. }
  248. if (sizeof($success) > 0) {
  249. $message .= notice('deleted', implode("\n", $success));
  250. }
  251. listing_page($message);
  252. } else {
  253. html_header();
  254. echo '<form action="' . $self . '" method="post">
  255. <table class="dialog">
  256. <tr>
  257. <td class="dialog">
  258. ';
  259. request_dump();
  260. echo "\t<b>" . word('really_delete') . '</b>
  261. <p>
  262. ';
  263. foreach ($files as $file) {
  264. echo "\t" . html($file) . "<br />\n";
  265. }
  266. echo ' </p>
  267. <hr />
  268. <input type="submit" name="no" value="' . word('no') . '" id="red_button" />
  269. <input type="submit" name="yes" value="' . word('yes') . '" id="green_button" style="margin-left: 50px" />
  270. </td>
  271. </tr>
  272. </table>
  273. </form>
  274. ';
  275. html_footer();
  276. }
  277. break;
  278. case 'rename':
  279. if (!empty($_POST['destination'])) {
  280. $dest = relative2absolute($_POST['destination'], $directory);
  281. if (!@file_exists($dest) && @rename($file, $dest)) {
  282. listing_page(notice('renamed', $file, $dest));
  283. } else {
  284. listing_page(error('not_renamed', $file, $dest));
  285. }
  286. } else {
  287. $name = basename($file);
  288. html_header();
  289. echo '<form action="' . $self . '" method="post">
  290. <table class="dialog">
  291. <tr>
  292. <td class="dialog">
  293. <input type="hidden" name="action" value="rename" />
  294. <input type="hidden" name="file" value="' . html($file) . '" />
  295. <input type="hidden" name="dir" value="' . html($directory) . '" />
  296. <b>' . word('rename_file') . '</b>
  297. <p>' . html($file) . '</p>
  298. <b>' . substr($file, 0, strlen($file) - strlen($name)) . '</b>
  299. <input type="text" name="destination" size="' . textfieldsize($name) . '" value="' . html($name) . '" />
  300. <hr />
  301. <input type="submit" value="' . word('rename') . '" />
  302. </td>
  303. </tr>
  304. </table>
  305. <p><a href="' . $self . '?dir=' . urlencode($directory) . '">[ ' . word('back') . ' ]</a></p>
  306. </form>
  307. ';
  308. html_footer();
  309. }
  310. break;
  311. case 'move':
  312. if (!empty($_POST['destination'])) {
  313. $dest = relative2absolute($_POST['destination'], $directory);
  314. $failure = array();
  315. $success = array();
  316. foreach ($files as $file) {
  317. $filename = substr($file, strlen($directory));
  318. $d = $dest . $filename;
  319. if (!@file_exists($d) && @rename($file, $d)) {
  320. $success[] = $file;
  321. } else {
  322. $failure[] = $file;
  323. }
  324. }
  325. $message = '';
  326. if (sizeof($failure) > 0) {
  327. $message = error('not_moved', implode("\n", $failure), $dest);
  328. }
  329. if (sizeof($success) > 0) {
  330. $message .= notice('moved', implode("\n", $success), $dest);
  331. }
  332. listing_page($message);
  333. } else {
  334. html_header();
  335. echo '<form action="' . $self . '" method="post">
  336. <table class="dialog">
  337. <tr>
  338. <td class="dialog">
  339. ';
  340. request_dump();
  341. echo "\t<b>" . word('move_files') . '</b>
  342. <p>
  343. ';
  344. foreach ($files as $file) {
  345. echo "\t" . html($file) . "<br />\n";
  346. }
  347. echo ' </p>
  348. <hr />
  349. ' . word('destination') . ':
  350. <input type="text" name="destination" size="' . textfieldsize($directory) . '" value="' . html($directory) . '" />
  351. <input type="submit" value="' . word('move') . '" />
  352. </td>
  353. </tr>
  354. </table>
  355. <p><a href="' . $self . '?dir=' . urlencode($directory) . '">[ ' . word('back') . ' ]</a></p>
  356. </form>
  357. ';
  358. html_footer();
  359. }
  360. break;
  361. case 'copy':
  362. if (!empty($_POST['destination'])) {
  363. $dest = relative2absolute($_POST['destination'], $directory);
  364. if (@is_dir($dest)) {
  365. $failure = array();
  366. $success = array();
  367. foreach ($files as $file) {
  368. $filename = substr($file, strlen($directory));
  369. $d = addslash($dest) . $filename;
  370. if (!@is_dir($file) && !@file_exists($d) && @copy($file, $d)) {
  371. $success[] = $file;
  372. } else {
  373. $failure[] = $file;
  374. }
  375. }
  376. $message = '';
  377. if (sizeof($failure) > 0) {
  378. $message = error('not_copied', implode("\n", $failure), $dest);
  379. }
  380. if (sizeof($success) > 0) {
  381. $message .= notice('copied', implode("\n", $success), $dest);
  382. }
  383. listing_page($message);
  384. } else {
  385. if (!@file_exists($dest) && @copy($file, $dest)) {
  386. listing_page(notice('copied', $file, $dest));
  387. } else {
  388. listing_page(error('not_copied', $file, $dest));
  389. }
  390. }
  391. } else {
  392. html_header();
  393. echo '<form action="' . $self . '" method="post">
  394. <table class="dialog">
  395. <tr>
  396. <td class="dialog">
  397. ';
  398. request_dump();
  399. echo "\n<b>" . word('copy_files') . '</b>
  400. <p>
  401. ';
  402. foreach ($files as $file) {
  403. echo "\t" . html($file) . "<br />\n";
  404. }
  405. echo ' </p>
  406. <hr />
  407. ' . word('destination') . ':
  408. <input type="text" name="destination" size="' . textfieldsize($directory) . '" value="' . html($directory) . '" />
  409. <input type="submit" value="' . word('copy') . '" />
  410. </td>
  411. </tr>
  412. </table>
  413. <p><a href="' . $self . '?dir=' . urlencode($directory) . '">[ ' . word('back') . ' ]</a></p>
  414. </form>
  415. ';
  416. html_footer();
  417. }
  418. break;
  419. case 'create_symlink':
  420. if (!empty($_POST['destination'])) {
  421. $dest = relative2absolute($_POST['destination'], $directory);
  422. if (substr($dest, -1, 1) == $delim) $dest .= basename($file);
  423. if (!empty($_POST['relative'])) $file = absolute2relative(addslash(dirname($dest)), $file);
  424. if (!@file_exists($dest) && @symlink($file, $dest)) {
  425. listing_page(notice('symlinked', $file, $dest));
  426. } else {
  427. listing_page(error('not_symlinked', $file, $dest));
  428. }
  429. } else {
  430. html_header();
  431. echo '<form action="' . $self . '" method="post">
  432. <table class="dialog" id="symlink">
  433. <tr>
  434. <td style="vertical-align: top">' . word('destination') . ': </td>
  435. <td>
  436. <b>' . html($file) . '</b><br />
  437. <input type="checkbox" name="relative" value="yes" id="checkbox_relative" checked="checked" style="margin-top: 1ex" />
  438. <label for="checkbox_relative">' . word('relative') . '</label>
  439. <input type="hidden" name="action" value="create_symlink" />
  440. <input type="hidden" name="file" value="' . html($file) . '" />
  441. <input type="hidden" name="dir" value="' . html($directory) . '" />
  442. </td>
  443. </tr>
  444. <tr>
  445. <td>' . word('symlink') . ': </td>
  446. <td>
  447. <input type="text" name="destination" size="' . textfieldsize($directory) . '" value="' . html($directory) . '" />
  448. <input type="submit" value="' . word('create_symlink') . '" />
  449. </td>
  450. </tr>
  451. </table>
  452. <p><a href="' . $self . '?dir=' . urlencode($directory) . '">[ ' . word('back') . ' ]</a></p>
  453. </form>
  454. ';
  455. html_footer();
  456. }
  457. break;
  458. case 'edit':
  459. if (!empty($_POST['save'])) {
  460. $content = str_replace("\r\n", "\n", $_POST['content']);
  461. if (($f = @fopen($file, 'w')) && @fwrite($f, $content) !== false && @fclose($f)) {
  462. listing_page(notice('saved', $file));
  463. } else {
  464. listing_page(error('not_saved', $file));
  465. }
  466. } else {
  467. if (@is_readable($file) && @is_writable($file)) {
  468. edit($file);
  469. } else {
  470. listing_page(error('not_edited', $file));
  471. }
  472. }
  473. break;
  474. case 'permission':
  475. if (!empty($_POST['set'])) {
  476. $mode = 0;
  477. if (!empty($_POST['ur'])) $mode |= 0400; if (!empty($_POST['uw'])) $mode |= 0200; if (!empty($_POST['ux'])) $mode |= 0100;
  478. if (!empty($_POST['gr'])) $mode |= 0040; if (!empty($_POST['gw'])) $mode |= 0020; if (!empty($_POST['gx'])) $mode |= 0010;
  479. if (!empty($_POST['or'])) $mode |= 0004; if (!empty($_POST['ow'])) $mode |= 0002; if (!empty($_POST['ox'])) $mode |= 0001;
  480. if (@chmod($file, $mode)) {
  481. listing_page(notice('permission_set', $file, decoct($mode)));
  482. } else {
  483. listing_page(error('permission_not_set', $file, decoct($mode)));
  484. }
  485. } else {
  486. html_header();
  487. $mode = fileperms($file);
  488. echo '<form action="' . $self . '" method="post">
  489. <table class="dialog">
  490. <tr>
  491. <td class="dialog">
  492. <p style="margin: 0">' . phrase('permission_for', $file) . '</p>
  493. <hr />
  494. <table id="permission">
  495. <tr>
  496. <td></td>
  497. <td style="border-right: 1px solid black">' . word('owner') . '</td>
  498. <td style="border-right: 1px solid black">' . word('group') . '</td>
  499. <td>' . word('other') . '</td>
  500. </tr>
  501. <tr>
  502. <td style="text-align: right">' . word('read') . ':</td>
  503. <td><input type="checkbox" name="ur" value="1"'; if ($mode & 00400) echo ' checked="checked"'; echo ' /></td>
  504. <td><input type="checkbox" name="gr" value="1"'; if ($mode & 00040) echo ' checked="checked"'; echo ' /></td>
  505. <td><input type="checkbox" name="or" value="1"'; if ($mode & 00004) echo ' checked="checked"'; echo ' /></td>
  506. </tr>
  507. <tr>
  508. <td style="text-align: right">' . word('write') . ':</td>
  509. <td><input type="checkbox" name="uw" value="1"'; if ($mode & 00200) echo ' checked="checked"'; echo ' /></td>
  510. <td><input type="checkbox" name="gw" value="1"'; if ($mode & 00020) echo ' checked="checked"'; echo ' /></td>
  511. <td><input type="checkbox" name="ow" value="1"'; if ($mode & 00002) echo ' checked="checked"'; echo ' /></td>
  512. </tr>
  513. <tr>
  514. <td style="text-align: right">' . word('execute') . ':</td>
  515. <td><input type="checkbox" name="ux" value="1"'; if ($mode & 00100) echo ' checked="checked"'; echo ' /></td>
  516. <td><input type="checkbox" name="gx" value="1"'; if ($mode & 00010) echo ' checked="checked"'; echo ' /></td>
  517. <td><input type="checkbox" name="ox" value="1"'; if ($mode & 00001) echo ' checked="checked"'; echo ' /></td>
  518. </tr>
  519. </table>
  520. <hr />
  521. <input type="submit" name="set" value="' . word('set') . '" />
  522. <input type="hidden" name="action" value="permission" />
  523. <input type="hidden" name="file" value="' . html($file) . '" />
  524. <input type="hidden" name="dir" value="' . html($directory) . '" />
  525. </td>
  526. </tr>
  527. </table>
  528. <p><a href="' . $self . '?dir=' . urlencode($directory) . '">[ ' . word('back') . ' ]</a></p>
  529. </form>
  530. ';
  531. html_footer();
  532. }
  533. break;
  534. default:
  535. listing_page();
  536. }
  537. /* ------------------------------------------------------------------------- */
  538. function getlist ($directory) {
  539. global $delim, $win;
  540. if ($d = @opendir($directory)) {
  541. while (($filename = @readdir($d)) !== false) {
  542. $path = $directory . $filename;
  543. if ($stat = @lstat($path)) {
  544. $file = array(
  545. 'filename' => $filename,
  546. 'path' => $path,
  547. 'is_file' => @is_file($path),
  548. 'is_dir' => @is_dir($path),
  549. 'is_link' => @is_link($path),
  550. 'is_readable' => @is_readable($path),
  551. 'is_writable' => @is_writable($path),
  552. 'size' => $stat['size'],
  553. 'permission' => $stat['mode'],
  554. 'owner' => $stat['uid'],
  555. 'group' => $stat['gid'],
  556. 'mtime' => @filemtime($path),
  557. 'atime' => @fileatime($path),
  558. 'ctime' => @filectime($path)
  559. );
  560. if ($file['is_dir']) {
  561. $file['is_executable'] = @file_exists($path . $delim . '.');
  562. } else {
  563. if (!$win) {
  564. $file['is_executable'] = @is_executable($path);
  565. } else {
  566. $file['is_executable'] = true;
  567. }
  568. }
  569. if ($file['is_link']) $file['target'] = @readlink($path);
  570. if (function_exists('posix_getpwuid')) $file['owner_name'] = @reset(posix_getpwuid($file['owner']));
  571. if (function_exists('posix_getgrgid')) $file['group_name'] = @reset(posix_getgrgid($file['group']));
  572. $files[] = $file;
  573. }
  574. }
  575. return $files;
  576. } else {
  577. return false;
  578. }
  579. }
  580. function sortlist ($list, $key, $reverse) {
  581. $dirs = array();
  582. $files = array();
  583. for ($i = 0; $i < sizeof($list); $i++) {
  584. if ($list[$i]['is_dir']) $dirs[] = $list[$i];
  585. else $files[] = $list[$i];
  586. }
  587. quicksort($dirs, 0, sizeof($dirs) - 1, $key);
  588. if ($reverse) $dirs = array_reverse($dirs);
  589. quicksort($files, 0, sizeof($files) - 1, $key);
  590. if ($reverse) $files = array_reverse($files);
  591. return array_merge($dirs, $files);
  592. }
  593. function quicksort (&$array, $first, $last, $key) {
  594. if ($first < $last) {
  595. $cmp = $array[floor(($first + $last) / 2)][$key];
  596. $l = $first;
  597. $r = $last;
  598. while ($l <= $r) {
  599. while ($array[$l][$key] < $cmp) $l++;
  600. while ($array[$r][$key] > $cmp) $r--;
  601. if ($l <= $r) {
  602. $tmp = $array[$l];
  603. $array[$l] = $array[$r];
  604. $array[$r] = $tmp;
  605. $l++;
  606. $r--;
  607. }
  608. }
  609. quicksort($array, $first, $r, $key);
  610. quicksort($array, $l, $last, $key);
  611. }
  612. }
  613. function permission_octal2string ($mode) {
  614. if (($mode & 0xC000) === 0xC000) {
  615. $type = 's';
  616. } elseif (($mode & 0xA000) === 0xA000) {
  617. $type = 'l';
  618. } elseif (($mode & 0x8000) === 0x8000) {
  619. $type = '-';
  620. } elseif (($mode & 0x6000) === 0x6000) {
  621. $type = 'b';
  622. } elseif (($mode & 0x4000) === 0x4000) {
  623. $type = 'd';
  624. } elseif (($mode & 0x2000) === 0x2000) {
  625. $type = 'c';
  626. } elseif (($mode & 0x1000) === 0x1000) {
  627. $type = 'p';
  628. } else {
  629. $type = '?';
  630. }
  631. $owner = ($mode & 00400) ? 'r' : '-';
  632. $owner .= ($mode & 00200) ? 'w' : '-';
  633. if ($mode & 0x800) {
  634. $owner .= ($mode & 00100) ? 's' : 'S';
  635. } else {
  636. $owner .= ($mode & 00100) ? 'x' : '-';
  637. }
  638. $group = ($mode & 00040) ? 'r' : '-';
  639. $group .= ($mode & 00020) ? 'w' : '-';
  640. if ($mode & 0x400) {
  641. $group .= ($mode & 00010) ? 's' : 'S';
  642. } else {
  643. $group .= ($mode & 00010) ? 'x' : '-';
  644. }
  645. $other = ($mode & 00004) ? 'r' : '-';
  646. $other .= ($mode & 00002) ? 'w' : '-';
  647. if ($mode & 0x200) {
  648. $other .= ($mode & 00001) ? 't' : 'T';
  649. } else {
  650. $other .= ($mode & 00001) ? 'x' : '-';
  651. }
  652. return $type . $owner . $group . $other;
  653. }
  654. function is_script ($filename) {
  655. return ereg('\.php$|\.php3$|\.php4$|\.php5$', $filename);
  656. }
  657. function getmimetype ($filename) {
  658. static $mimes = array(
  659. '\.jpg$|\.jpeg$' => 'image/jpeg',
  660. '\.gif$' => 'image/gif',
  661. '\.png$' => 'image/png',
  662. '\.html$|\.html$' => 'text/html',
  663. '\.txt$|\.asc$' => 'text/plain',
  664. '\.xml$|\.xsl$' => 'application/xml',
  665. '\.pdf$' => 'application/pdf'
  666. );
  667. foreach ($mimes as $regex => $mime) {
  668. if (eregi($regex, $filename)) return $mime;
  669. }
  670. // return 'application/octet-stream';
  671. return 'text/plain';
  672. }
  673. function del ($file) {
  674. global $delim;
  675. if (!file_exists($file)) return false;
  676. if (@is_dir($file) && !@is_link($file)) {
  677. $success = false;
  678. if (@rmdir($file)) {
  679. $success = true;
  680. } elseif ($dir = @opendir($file)) {
  681. $success = true;
  682. while (($f = readdir($dir)) !== false) {
  683. if ($f != '.' && $f != '..' && !del($file . $delim . $f)) {
  684. $success = false;
  685. }
  686. }
  687. closedir($dir);
  688. if ($success) $success = @rmdir($file);
  689. }
  690. return $success;
  691. }
  692. return @unlink($file);
  693. }
  694. function addslash ($directory) {
  695. global $delim;
  696. if (substr($directory, -1, 1) != $delim) {
  697. return $directory . $delim;
  698. } else {
  699. return $directory;
  700. }
  701. }
  702. function relative2absolute ($string, $directory) {
  703. if (path_is_relative($string)) {
  704. return simplify_path(addslash($directory) . $string);
  705. } else {
  706. return simplify_path($string);
  707. }
  708. }
  709. function path_is_relative ($path) {
  710. global $win;
  711. if ($win) {
  712. return (substr($path, 1, 1) != ':');
  713. } else {
  714. return (substr($path, 0, 1) != '/');
  715. }
  716. }
  717. function absolute2relative ($directory, $target) {
  718. global $delim;
  719. $path = '';
  720. while ($directory != $target) {
  721. if ($directory == substr($target, 0, strlen($directory))) {
  722. $path .= substr($target, strlen($directory));
  723. break;
  724. } else {
  725. $path .= '..' . $delim;
  726. $directory = substr($directory, 0, strrpos(substr($directory, 0, -1), $delim) + 1);
  727. }
  728. }
  729. if ($path == '') $path = '.';
  730. return $path;
  731. }
  732. function simplify_path ($path) {
  733. global $delim;
  734. if (@file_exists($path) && function_exists('realpath') && @realpath($path) != '') {
  735. $path = realpath($path);
  736. if (@is_dir($path)) {
  737. return addslash($path);
  738. } else {
  739. return $path;
  740. }
  741. }
  742. $pattern = $delim . '.' . $delim;
  743. if (@is_dir($path)) {
  744. $path = addslash($path);
  745. }
  746. while (strpos($path, $pattern) !== false) {
  747. $path = str_replace($pattern, $delim, $path);
  748. }
  749. $e = addslashes($delim);
  750. $regex = $e . '((\.[^\.' . $e . '][^' . $e . ']*)|(\.\.[^' . $e . ']+)|([^\.][^' . $e . ']*))' . $e . '\.\.' . $e;
  751. while (ereg($regex, $path)) {
  752. $path = ereg_replace($regex, $delim, $path);
  753. }
  754. return $path;
  755. }
  756. function human_filesize ($filesize) {
  757. $suffices = 'kMGTPE';
  758. $n = 0;
  759. while ($filesize >= 1000) {
  760. $filesize /= 1024;
  761. $n++;
  762. }
  763. $filesize = round($filesize, 3 - strpos($filesize, '.'));
  764. if (strpos($filesize, '.') !== false) {
  765. while (in_array(substr($filesize, -1, 1), array('0', '.'))) {
  766. $filesize = substr($filesize, 0, strlen($filesize) - 1);
  767. }
  768. }
  769. $suffix = (($n == 0) ? '' : substr($suffices, $n - 1, 1));
  770. return $filesize . " {$suffix}B";
  771. }
  772. function strip (&$str) {
  773. $str = stripslashes($str);
  774. }
  775. /* ------------------------------------------------------------------------- */
  776. function listing_page ($message = null) {
  777. global $self, $directory, $sort, $reverse;
  778. html_header();
  779. $list = getlist($directory);
  780. if (array_key_exists('sort', $_GET)) $sort = $_GET['sort']; else $sort = 'filename';
  781. if (array_key_exists('reverse', $_GET) && $_GET['reverse'] == 'true') $reverse = true; else $reverse = false;
  782. $list = sortlist($list, $sort, $reverse);
  783. echo '<h1 style="margin-bottom: 0">mavix1x</h1>
  784. <form enctype="multipart/form-data" action="' . $self . '" method="post">
  785. <table id="main">
  786. ';
  787. directory_choice();
  788. if (!empty($message)) {
  789. spacer();
  790. echo $message;
  791. }
  792. if (@is_writable($directory)) {
  793. upload_box();
  794. create_box();
  795. } else {
  796. spacer();
  797. }
  798. if ($list) {
  799. listing($list);
  800. } else {
  801. echo error('not_readable', $directory);
  802. }
  803. echo '</table>
  804. </form>
  805. ';
  806. html_footer();
  807. }
  808. function listing ($list) {
  809. global $directory, $homedir, $sort, $reverse, $win, $cols, $date_format, $self;
  810. echo '<tr class="listing">
  811. <th style="text-align: center; vertical-align: middle"><img src="' . $self . '?image=smiley" alt="smiley" /></th>
  812. ';
  813. column_title('filename', $sort, $reverse);
  814. column_title('size', $sort, $reverse);
  815. if (!$win) {
  816. column_title('permission', $sort, $reverse);
  817. column_title('owner', $sort, $reverse);
  818. column_title('group', $sort, $reverse);
  819. }
  820. echo ' <th class="functions">' . word('functions') . '</th>
  821. </tr>
  822. ';
  823. for ($i = 0; $i < sizeof($list); $i++) {
  824. $file = $list[$i];
  825. $timestamps = 'mtime: ' . date($date_format, $file['mtime']) . ', ';
  826. $timestamps .= 'atime: ' . date($date_format, $file['atime']) . ', ';
  827. $timestamps .= 'ctime: ' . date($date_format, $file['ctime']);
  828. echo '<tr class="listing">
  829. <td class="checkbox"><input type="checkbox" name="checked' . $i . '" value="true" onfocus="activate(\'other\')" /></td>
  830. <td class="filename" title="' . html($timestamps) . '">';
  831. if ($file['is_link']) {
  832. echo '<img src="' . $self . '?image=link" alt="link" /> ';
  833. echo html($file['filename']) . ' &rarr; ';
  834. $real_file = relative2absolute($file['target'], $directory);
  835. if (@is_readable($real_file)) {
  836. if (@is_dir($real_file)) {
  837. echo '[ <a href="' . $self . '?dir=' . urlencode($real_file) . '">' . html($file['target']) . '</a> ]';
  838. } else {
  839. echo '<a href="' . $self . '?action=view&amp;file=' . urlencode($real_file) . '">' . html($file['target']) . '</a>';
  840. }
  841. } else {
  842. echo html($file['target']);
  843. }
  844. } elseif ($file['is_dir']) {
  845. echo '<img src="' . $self . '?image=folder" alt="folder" /> [ ';
  846. if ($win || $file['is_executable']) {
  847. echo '<a href="' . $self . '?dir=' . urlencode($file['path']) . '">' . html($file['filename']) . '</a>';
  848. } else {
  849. echo html($file['filename']);
  850. }
  851. echo ' ]';
  852. } else {
  853. if (substr($file['filename'], 0, 1) == '.') {
  854. echo '<img src="' . $self . '?image=hidden_file" alt="hidden file" /> ';
  855. } else {
  856. echo '<img src="' . $self . '?image=file" alt="file" /> ';
  857. }
  858. if ($file['is_file'] && $file['is_readable']) {
  859. echo '<a href="' . $self . '?action=view&amp;file=' . urlencode($file['path']) . '">' . html($file['filename']) . '</a>';
  860. } else {
  861. echo html($file['filename']);
  862. }
  863. }
  864. if ($file['size'] >= 1000) {
  865. $human = ' title="' . human_filesize($file['size']) . '"';
  866. } else {
  867. $human = '';
  868. }
  869. echo "</td>\n";
  870. echo "\t<td class=\"size\"$human>{$file['size']} B</td>\n";
  871. if (!$win) {
  872. echo "\t<td class=\"permission\" title=\"" . decoct($file['permission']) . '">';
  873. $l = !$file['is_link'] && (!function_exists('posix_getuid') || $file['owner'] == posix_getuid());
  874. if ($l) echo '<a href="' . $self . '?action=permission&amp;file=' . urlencode($file['path']) . '&amp;dir=' . urlencode($directory) . '">';
  875. echo html(permission_octal2string($file['permission']));
  876. if ($l) echo '</a>';
  877. echo "</td>\n";
  878. if (array_key_exists('owner_name', $file)) {
  879. echo "\t<td class=\"owner\" title=\"uid: {$file['owner']}\">{$file['owner_name']}</td>\n";
  880. } else {
  881. echo "\t<td class=\"owner\">{$file['owner']}</td>\n";
  882. }
  883. if (array_key_exists('group_name', $file)) {
  884. echo "\t<td class=\"group\" title=\"gid: {$file['group']}\">{$file['group_name']}</td>\n";
  885. } else {
  886. echo "\t<td class=\"group\">{$file['group']}</td>\n";
  887. }
  888. }
  889. echo ' <td class="functions">
  890. <input type="hidden" name="file' . $i . '" value="' . html($file['path']) . '" />
  891. ';
  892. $actions = array();
  893. if (function_exists('symlink')) {
  894. $actions[] = 'create_symlink';
  895. }
  896. if (@is_writable(dirname($file['path']))) {
  897. $actions[] = 'delete';
  898. $actions[] = 'rename';
  899. $actions[] = 'move';
  900. }
  901. if ($file['is_file'] && $file['is_readable']) {
  902. $actions[] = 'copy';
  903. $actions[] = 'download';
  904. if ($file['is_writable']) $actions[] = 'edit';
  905. }
  906. if (!$win && function_exists('exec') && $file['is_file'] && $file['is_executable'] && file_exists('/bin/sh')) {
  907. $actions[] = 'execute';
  908. }
  909. if (sizeof($actions) > 0) {
  910. echo ' <select class="small" name="action' . $i . '" size="1">
  911. <option value="">' . str_repeat('&nbsp;', 30) . '</option>
  912. ';
  913. foreach ($actions as $action) {
  914. echo "\t\t<option value=\"$action\">" . word($action) . "</option>\n";
  915. }
  916. echo ' </select>
  917. <input class="small" type="submit" name="submit' . $i . '" value=" &gt; " onfocus="activate(\'other\')" />
  918. ';
  919. }
  920. echo ' </td>
  921. </tr>
  922. ';
  923. }
  924. echo '<tr class="listing_footer">
  925. <td style="text-align: right; vertical-align: top"><img src="' . $self . '?image=arrow" alt="&gt;" /></td>
  926. <td colspan="' . ($cols - 1) . '">
  927. <input type="hidden" name="num" value="' . sizeof($list) . '" />
  928. <input type="hidden" name="focus" value="" />
  929. <input type="hidden" name="olddir" value="' . html($directory) . '" />
  930. ';
  931. $actions = array();
  932. if (@is_writable(dirname($file['path']))) {
  933. $actions[] = 'delete';
  934. $actions[] = 'move';
  935. }
  936. $actions[] = 'copy';
  937. echo ' <select class="small" name="action_all" size="1">
  938. <option value="">' . str_repeat('&nbsp;', 30) . '</option>
  939. ';
  940. foreach ($actions as $action) {
  941. echo "\t\t<option value=\"$action\">" . word($action) . "</option>\n";
  942. }
  943. echo ' </select>
  944. <input class="small" type="submit" name="submit_all" value=" &gt; " onfocus="activate(\'other\')" />
  945. </td>
  946. </tr>
  947. ';
  948. }
  949. function column_title ($column, $sort, $reverse) {
  950. global $self, $directory;
  951. $d = 'dir=' . urlencode($directory) . '&amp;';
  952. if ($sort == $column) {
  953. if (!$reverse) {
  954. $r = '&amp;reverse=true';
  955. $arr = ' &and;';
  956. } else {
  957. $arr = ' &or;';
  958. }
  959. } else {
  960. $r = '';
  961. }
  962. echo "\t<th class=\"$column\"><a href=\"$self?{$d}sort=$column$r\">" . word($column) . "</a>$arr</th>\n";
  963. }
  964. function directory_choice () {
  965. global $directory, $homedir, $cols, $self;
  966. echo '<tr>
  967. <td colspan="' . $cols . '" id="directory">
  968. <a href="' . $self . '?dir=' . urlencode($homedir) . '">' . word('directory') . '</a>:
  969. <input type="text" name="dir" size="' . textfieldsize($directory) . '" value="' . html($directory) . '" onfocus="activate(\'directory\')" />
  970. <input type="submit" name="changedir" value="' . word('change') . '" onfocus="activate(\'directory\')" />
  971. </td>
  972. </tr>
  973. ';
  974. }
  975. function upload_box () {
  976. global $cols;
  977. echo '<tr>
  978. <td colspan="' . $cols . '" id="upload">
  979. ' . word('file') . ':
  980. <input type="file" name="upload" onfocus="activate(\'other\')" />
  981. <input type="submit" name="submit_upload" value="' . word('upload') . '" onfocus="activate(\'other\')" />
  982. </td>
  983. </tr>
  984. ';
  985. }
  986. function create_box () {
  987. global $cols;
  988. echo '<tr>
  989. <td colspan="' . $cols . '" id="create">
  990. <select name="create_type" size="1" onfocus="activate(\'create\')">
  991. <option value="file">' . word('file') . '</option>
  992. <option value="directory">' . word('directory') . '</option>
  993. </select>
  994. <input type="text" name="create_name" onfocus="activate(\'create\')" />
  995. <input type="submit" name="submit_create" value="' . word('create') . '" onfocus="activate(\'create\')" />
  996. </td>
  997. </tr>
  998. ';
  999. }
  1000. function edit ($file) {
  1001. global $self, $directory, $editcols, $editrows, $apache, $htpasswd, $htaccess;
  1002. html_header();
  1003. echo '<h2 style="margin-bottom: 3pt">' . html($file) . '</h2>
  1004. <form action="' . $self . '" method="post">
  1005. <table class="dialog">
  1006. <tr>
  1007. <td class="dialog">
  1008. <textarea name="content" cols="' . $editcols . '" rows="' . $editrows . '" WRAP="off">';
  1009. if (array_key_exists('content', $_POST)) {
  1010. echo $_POST['content'];
  1011. } else {
  1012. $f = fopen($file, 'r');
  1013. while (!feof($f)) {
  1014. echo html(fread($f, 8192));
  1015. }
  1016. fclose($f);
  1017. }
  1018. if (!empty($_POST['user'])) {
  1019. echo "\n" . $_POST['user'] . ':' . crypt($_POST['password']);
  1020. }
  1021. if (!empty($_POST['basic_auth'])) {
  1022. if ($win) {
  1023. $authfile = str_replace('\\', '/', $directory) . $htpasswd;
  1024. } else {
  1025. $authfile = $directory . $htpasswd;
  1026. }
  1027. echo "\nAuthType Basic\nAuthName &quot;Restricted Directory&quot;\n";
  1028. echo 'AuthUserFile &quot;' . html($authfile) . "&quot;\n";
  1029. echo 'Require valid-user';
  1030. }
  1031. echo '</textarea>
  1032. <hr />
  1033. ';
  1034. if ($apache && basename($file) == $htpasswd) {
  1035. echo '
  1036. ' . word('user') . ': <input type="text" name="user" />
  1037. ' . word('password') . ': <input type="password" name="password" />
  1038. <input type="submit" value="' . word('add') . '" />
  1039. <hr />
  1040. ';
  1041. }
  1042. if ($apache && basename($file) == $htaccess) {
  1043. echo '
  1044. <input type="submit" name="basic_auth" value="' . word('add_basic_auth') . '" />
  1045. <hr />
  1046. ';
  1047. }
  1048. echo '
  1049. <input type="hidden" name="action" value="edit" />
  1050. <input type="hidden" name="file" value="' . html($file) . '" />
  1051. <input type="hidden" name="dir" value="' . html($directory) . '" />
  1052. <input type="reset" value="' . word('reset') . '" id="red_button" />
  1053. <input type="submit" name="save" value="' . word('save') . '" id="green_button" style="margin-left: 50px" />
  1054. </td>
  1055. </tr>
  1056. </table>
  1057. <p><a href="' . $self . '?dir=' . urlencode($directory) . '">[ ' . word('back') . ' ]</a></p>
  1058. </form>
  1059. ';
  1060. html_footer();
  1061. }
  1062. function spacer () {
  1063. global $cols;
  1064. echo '<tr>
  1065. <td colspan="' . $cols . '" style="height: 1em"></td>
  1066. </tr>
  1067. ';
  1068. }
  1069. function textfieldsize ($content) {
  1070. $size = strlen($content) + 5;
  1071. if ($size < 30) $size = 30;
  1072. return $size;
  1073. }
  1074. function request_dump () {
  1075. foreach ($_REQUEST as $key => $value) {
  1076. echo "\t<input type=\"hidden\" name=\"" . html($key) . '" value="' . html($value) . "\" />\n";
  1077. }
  1078. }
  1079. /* ------------------------------------------------------------------------- */
  1080. function html ($string) {
  1081. global $site_charset;
  1082. return htmlentities($string, ENT_COMPAT, $site_charset);
  1083. }
  1084. function word ($word) {
  1085. global $words, $word_charset;
  1086. return htmlentities($words[$word], ENT_COMPAT, $word_charset);
  1087. }
  1088. function phrase ($phrase, $arguments) {
  1089. global $words;
  1090. static $search;
  1091. if (!is_array($search)) for ($i = 1; $i <= 8; $i++) $search[] = "%$i";
  1092. for ($i = 0; $i < sizeof($arguments); $i++) {
  1093. $arguments[$i] = nl2br(html($arguments[$i]));
  1094. }
  1095. $replace = array('{' => '<pre>', '}' =>'</pre>', '[' => '<b>', ']' => '</b>');
  1096. return str_replace($search, $arguments, str_replace(array_keys($replace), $replace, nl2br(html($words[$phrase]))));
  1097. }
  1098. function getwords ($lang) {
  1099. global $word_charset, $date_format;
  1100. switch ($lang) {
  1101. case 'de':
  1102. $date_format = 'd.m.y H:i:s';
  1103. $word_charset = 'ISO-8859-1';
  1104. return array(
  1105. 'directory' => 'Verzeichnis',
  1106. 'file' => 'Datei',
  1107. 'filename' => 'Dateiname',
  1108. 'size' => 'Größe',
  1109. 'permission' => 'Rechte',
  1110. 'owner' => 'Eigner',
  1111. 'group' => 'Gruppe',
  1112. 'other' => 'Andere',
  1113. 'functions' => 'Funktionen',
  1114. 'read' => 'lesen',
  1115. 'write' => 'schreiben',
  1116. 'execute' => 'ausführen',
  1117. 'create_symlink' => 'Symlink erstellen',
  1118. 'delete' => 'löschen',
  1119. 'rename' => 'umbenennen',
  1120. 'move' => 'verschieben',
  1121. 'copy' => 'kopieren',
  1122. 'edit' => 'editieren',
  1123. 'download' => 'herunterladen',
  1124. 'upload' => 'hochladen',
  1125. 'create' => 'erstellen',
  1126. 'change' => 'wechseln',
  1127. 'save' => 'speichern',
  1128. 'set' => 'setze',
  1129. 'reset' => 'zurücksetzen',
  1130. 'relative' => 'Pfad zum Ziel relativ',
  1131. 'yes' => 'Ja',
  1132. 'no' => 'Nein',
  1133. 'back' => 'zurück',
  1134. 'destination' => 'Ziel',
  1135. 'symlink' => 'Symbolischer Link',
  1136. 'no_output' => 'keine Ausgabe',
  1137. 'user' => 'Benutzername',
  1138. 'password' => 'Kennwort',
  1139. 'add' => 'hinzufügen',
  1140. 'add_basic_auth' => 'HTTP-Basic-Auth hinzufügen',
  1141. 'uploaded' => '"[%1]" wurde hochgeladen.',
  1142. 'not_uploaded' => '"[%1]" konnte nicht hochgeladen werden.',
  1143. 'already_exists' => '"[%1]" existiert bereits.',
  1144. 'created' => '"[%1]" wurde erstellt.',
  1145. 'not_created' => '"[%1]" konnte nicht erstellt werden.',
  1146. 'really_delete' => 'Sollen folgende Dateien wirklich gelöscht werden?',
  1147. 'deleted' => "Folgende Dateien wurden gelöscht:\n[%1]",
  1148. 'not_deleted' => "Folgende Dateien konnten nicht gelöscht werden:\n[%1]",
  1149. 'rename_file' => 'Benenne Datei um:',
  1150. 'renamed' => '"[%1]" wurde in "[%2]" umbenannt.',
  1151. 'not_renamed' => '"[%1] konnte nicht in "[%2]" umbenannt werden.',
  1152. 'move_files' => 'Verschieben folgende Dateien:',
  1153. 'moved' => "Folgende Dateien wurden nach \"[%2]\" verschoben:\n[%1]",
  1154. 'not_moved' => "Folgende Dateien konnten nicht nach \"[%2]\" verschoben werden:\n[%1]",
  1155. 'copy_files' => 'Kopiere folgende Dateien:',
  1156. 'copied' => "Folgende Dateien wurden nach \"[%2]\" kopiert:\n[%1]",
  1157. 'not_copied' => "Folgende Dateien konnten nicht nach \"[%2]\" kopiert werden:\n[%1]",
  1158. 'not_edited' => '"[%1]" kann nicht editiert werden.',
  1159. 'executed' => "\"[%1]\" wurde erfolgreich ausgeführt:\n{%2}",
  1160. 'not_executed' => "\"[%1]\" konnte nicht erfolgreich ausgeführt werden:\n{%2}",
  1161. 'saved' => '"[%1]" wurde gespeichert.',
  1162. 'not_saved' => '"[%1]" konnte nicht gespeichert werden.',
  1163. 'symlinked' => 'Symbolischer Link von "[%2]" nach "[%1]" wurde erstellt.',
  1164. 'not_symlinked' => 'Symbolischer Link von "[%2]" nach "[%1]" konnte nicht erstellt werden.',
  1165. 'permission_for' => 'Rechte für "[%1]":',
  1166. 'permission_set' => 'Die Rechte für "[%1]" wurden auf [%2] gesetzt.',
  1167. 'permission_not_set' => 'Die Rechte für "[%1]" konnten nicht auf [%2] gesetzt werden.',
  1168. 'not_readable' => '"[%1]" kann nicht gelesen werden.'
  1169. );
  1170. case 'fr':
  1171. $date_format = 'd.m.y H:i:s';
  1172. $word_charset = 'ISO-8859-1';
  1173. return array(
  1174. 'directory' => 'Répertoire',
  1175. 'file' => 'Fichier',
  1176. 'filename' => 'Nom fichier',
  1177. 'size' => 'Taille',
  1178. 'permission' => 'Droits',
  1179. 'owner' => 'Propriétaire',
  1180. 'group' => 'Groupe',
  1181. 'other' => 'Autres',
  1182. 'functions' => 'Fonctions',
  1183. 'read' => 'Lire',
  1184. 'write' => 'Ecrire',
  1185. 'execute' => 'Exécuter',
  1186. 'create_symlink' => 'Créer lien symbolique',
  1187. 'delete' => 'Effacer',
  1188. 'rename' => 'Renommer',
  1189. 'move' => 'Déplacer',
  1190. 'copy' => 'Copier',
  1191. 'edit' => 'Ouvrir',
  1192. 'download' => 'Télécharger sur PC',
  1193. 'upload' => 'Télécharger sur serveur',
  1194. 'create' => 'Créer',
  1195. 'change' => 'Changer',
  1196. 'save' => 'Sauvegarder',
  1197. 'set' => 'Exécuter',
  1198. 'reset' => 'Réinitialiser',
  1199. 'relative' => 'Relatif',
  1200. 'yes' => 'Oui',
  1201. 'no' => 'Non',
  1202. 'back' => 'Retour',
  1203. 'destination' => 'Destination',
  1204. 'symlink' => 'Lien symbollique',
  1205. 'no_output' => 'Pas de sortie',
  1206. 'user' => 'Utilisateur',
  1207. 'password' => 'Mot de passe',
  1208. 'add' => 'Ajouter',
  1209. 'add_basic_auth' => 'add basic-authentification',
  1210. 'uploaded' => '"[%1]" a été téléchargé sur le serveur.',
  1211. 'not_uploaded' => '"[%1]" n a pas été téléchargé sur le serveur.',
  1212. 'already_exists' => '"[%1]" existe déjà.',
  1213. 'created' => '"[%1]" a été créé.',
  1214. 'not_created' => '"[%1]" n a pas pu être créé.',
  1215. 'really_delete' => 'Effacer le fichier?',
  1216. 'deleted' => "Ces fichiers ont été détuits:\n[%1]",
  1217. 'not_deleted' => "Ces fichiers n ont pu être détruits:\n[%1]",
  1218. 'rename_file' => 'Renomme fichier:',
  1219. 'renamed' => '"[%1]" a été renommé en "[%2]".',
  1220. 'not_renamed' => '"[%1] n a pas pu être renommé en "[%2]".',
  1221. 'move_files' => 'Déplacer ces fichiers:',
  1222. 'moved' => "Ces fichiers ont été déplacés en \"[%2]\":\n[%1]",
  1223. 'not_moved' => "Ces fichiers n ont pas pu être déplacés en \"[%2]\":\n[%1]",
  1224. 'copy_files' => 'Copier ces fichiers:',
  1225. 'copied' => "Ces fichiers ont été copiés en \"[%2]\":\n[%1]",
  1226. 'not_copied' => "Ces fichiers n ont pas pu être copiés en \"[%2]\":\n[%1]",
  1227. 'not_edited' => '"[%1]" ne peut être ouvert.',
  1228. 'executed' => "\"[%1]\" a été brillamment exécuté :\n{%2}",
  1229. 'not_executed' => "\"[%1]\" n a pas pu être exécuté:\n{%2}",
  1230. 'saved' => '"[%1]" a été sauvegardé.',
  1231. 'not_saved' => '"[%1]" n a pas pu être sauvegardé.',
  1232. 'symlinked' => 'Un lien symbolique depuis "[%2]" vers "[%1]" a été crée.',
  1233. 'not_symlinked' => 'Un lien symbolique depuis "[%2]" vers "[%1]" n a pas pu être créé.',
  1234. 'permission_for' => 'Droits de "[%1]":',
  1235. 'permission_set' => 'Droits de "[%1]" ont été changés en [%2].',
  1236. 'permission_not_set' => 'Droits de "[%1]" n ont pas pu être changés en[%2].',
  1237. 'not_readable' => '"[%1]" ne peut pas être ouvert.'
  1238. );
  1239. case 'it':
  1240. $date_format = 'd-m-Y H:i:s';
  1241. $word_charset = 'ISO-8859-1';
  1242. return array(
  1243. 'directory' => 'Directory',
  1244. 'file' => 'File',
  1245. 'filename' => 'Nome File',
  1246. 'size' => 'Dimensioni',
  1247. 'permission' => 'Permessi',
  1248. 'owner' => 'Proprietario',
  1249. 'group' => 'Gruppo',
  1250. 'other' => 'Altro',
  1251. 'functions' => 'Funzioni',
  1252. 'read' => 'leggi',
  1253. 'write' => 'scrivi',
  1254. 'execute' => 'esegui',
  1255. 'create_symlink' => 'crea link simbolico',
  1256. 'delete' => 'cancella',
  1257. 'rename' => 'rinomina',
  1258. 'move' => 'sposta',
  1259. 'copy' => 'copia',
  1260. 'edit' => 'modifica',
  1261. 'download' => 'download',
  1262. 'upload' => 'upload',
  1263. 'create' => 'crea',
  1264. 'change' => 'cambia',
  1265. 'save' => 'salva',
  1266. 'set' => 'imposta',
  1267. 'reset' => 'reimposta',
  1268. 'relative' => 'Percorso relativo per la destinazione',
  1269. 'yes' => 'Si',
  1270. 'no' => 'No',
  1271. 'back' => 'indietro',
  1272. 'destination' => 'Destinazione',
  1273. 'symlink' => 'Link simbolico',
  1274. 'no_output' => 'no output',
  1275. 'user' => 'User',
  1276. 'password' => 'Password',
  1277. 'add' => 'aggiungi',
  1278. 'add_basic_auth' => 'aggiungi autenticazione base',
  1279. 'uploaded' => '"[%1]" è stato caricato.',
  1280. 'not_uploaded' => '"[%1]" non è stato caricato.',
  1281. 'already_exists' => '"[%1]" esiste già.',
  1282. 'created' => '"[%1]" è stato creato.',
  1283. 'not_created' => '"[%1]" non è stato creato.',
  1284. 'really_delete' => 'Cancello questi file ?',
  1285. 'deleted' => "Questi file sono stati cancellati:\n[%1]",
  1286. 'not_deleted' => "Questi file non possono essere cancellati:\n[%1]",
  1287. 'rename_file' => 'File rinominato:',
  1288. 'renamed' => '"[%1]" è stato rinominato in "[%2]".',
  1289. 'not_renamed' => '"[%1] non è stato rinominato in "[%2]".',
  1290. 'move_files' => 'Sposto questi file:',
  1291. 'moved' => "Questi file sono stati spostati in \"[%2]\":\n[%1]",
  1292. 'not_moved' => "Questi file non possono essere spostati in \"[%2]\":\n[%1]",
  1293. 'copy_files' => 'Copio questi file',
  1294. 'copied' => "Questi file sono stati copiati in \"[%2]\":\n[%1]",
  1295. 'not_copied' => "Questi file non possono essere copiati in \"[%2]\":\n[%1]",
  1296. 'not_edited' => '"[%1]" non può essere modificato.',
  1297. 'executed' => "\"[%1]\" è stato eseguito con successo:\n{%2}",
  1298. 'not_executed' => "\"[%1]\" non è stato eseguito con successo\n{%2}",
  1299. 'saved' => '"[%1]" è stato salvato.',
  1300. 'not_saved' => '"[%1]" non è stato salvato.',
  1301. 'symlinked' => 'Il link siambolico da "[%2]" a "[%1]" è stato creato.',
  1302. 'not_symlinked' => 'Il link siambolico da "[%2]" a "[%1]" non è stato creato.',
  1303. 'permission_for' => 'Permessi di "[%1]":',
  1304. 'permission_set' => 'I permessi di "[%1]" sono stati impostati [%2].',
  1305. 'permission_not_set' => 'I permessi di "[%1]" non sono stati impostati [%2].',
  1306. 'not_readable' => '"[%1]" non può essere letto.'
  1307. );
  1308. case 'nl':
  1309. $date_format = 'n/j/y H:i:s';
  1310. $word_charset = 'ISO-8859-1';
  1311. return array(
  1312. 'directory' => 'Directory',
  1313. 'file' => 'Bestand',
  1314. 'filename' => 'Bestandsnaam',
  1315. 'size' => 'Grootte',
  1316. 'permission' => 'Bevoegdheid',
  1317. 'owner' => 'Eigenaar',
  1318. 'group' => 'Groep',
  1319. 'other' => 'Anderen',
  1320. 'functions' => 'Functies',
  1321. 'read' => 'lezen',
  1322. 'write' => 'schrijven',
  1323. 'execute' => 'uitvoeren',
  1324. 'create_symlink' => 'maak symlink',
  1325. 'delete' => 'verwijderen',
  1326. 'rename' => 'hernoemen',
  1327. 'move' => 'verplaatsen',
  1328. 'copy' => 'kopieren',
  1329. 'edit' => 'bewerken',
  1330. 'download' => 'downloaden',
  1331. 'upload' => 'uploaden',
  1332. 'create' => 'aanmaken',
  1333. 'change' => 'veranderen',
  1334. 'save' => 'opslaan',
  1335. 'set' => 'instellen',
  1336. 'reset' => 'resetten',
  1337. 'relative' => 'Relatief pat naar doel',
  1338. 'yes' => 'Ja',
  1339. 'no' => 'Nee',
  1340. 'back' => 'terug',
  1341. 'destination' => 'Bestemming',
  1342. 'symlink' => 'Symlink',
  1343. 'no_output' => 'geen output',
  1344. 'user' => 'Gebruiker',
  1345. 'password' => 'Wachtwoord',
  1346. 'add' => 'toevoegen',
  1347. 'add_basic_auth' => 'add basic-authentification',
  1348. 'uploaded' => '"[%1]" is verstuurd.',
  1349. 'not_uploaded' => '"[%1]" kan niet worden verstuurd.',
  1350. 'already_exists' => '"[%1]" bestaat al.',
  1351. 'created' => '"[%1]" is aangemaakt.',
  1352. 'not_created' => '"[%1]" kan niet worden aangemaakt.',
  1353. 'really_delete' => 'Deze bestanden verwijderen?',
  1354. 'deleted' => "Deze bestanden zijn verwijderd:\n[%1]",
  1355. 'not_deleted' => "Deze bestanden konden niet worden verwijderd:\n[%1]",
  1356. 'rename_file' => 'Bestandsnaam veranderen:',
  1357. 'renamed' => '"[%1]" heet nu "[%2]".',
  1358. 'not_renamed' => '"[%1] kon niet worden veranderd in "[%2]".',
  1359. 'move_files' => 'Verplaats deze bestanden:',
  1360. 'moved' => "Deze bestanden zijn verplaatst naar \"[%2]\":\n[%1]",
  1361. 'not_moved' => "Kan deze bestanden niet verplaatsen naar \"[%2]\":\n[%1]",
  1362. 'copy_files' => 'Kopieer deze bestanden:',
  1363. 'copied' => "Deze bestanden zijn gekopieerd naar \"[%2]\":\n[%1]",
  1364. 'not_copied' => "Deze bestanden kunnen niet worden gekopieerd naar \"[%2]\":\n[%1]",
  1365. 'not_edited' => '"[%1]" kan niet worden bewerkt.',
  1366. 'executed' => "\"[%1]\" is met succes uitgevoerd:\n{%2}",
  1367. 'not_executed' => "\"[%1]\" is niet goed uitgevoerd:\n{%2}",
  1368. 'saved' => '"[%1]" is opgeslagen.',
  1369. 'not_saved' => '"[%1]" is niet opgeslagen.',
  1370. 'symlinked' => 'Symlink van "[%2]" naar "[%1]" is aangemaakt.',
  1371. 'not_symlinked' => 'Symlink van "[%2]" naar "[%1]" is niet aangemaakt.',
  1372. 'permission_for' => 'Bevoegdheid voor "[%1]":',
  1373. 'permission_set' => 'Bevoegdheid van "[%1]" is ingesteld op [%2].',
  1374. 'permission_not_set' => 'Bevoegdheid van "[%1]" is niet ingesteld op [%2].',
  1375. 'not_readable' => '"[%1]" kan niet worden gelezen.'
  1376. );
  1377. case 'se':
  1378. $date_format = 'n/j/y H:i:s';
  1379. $word_charset = 'ISO-8859-1';
  1380. return array(
  1381. 'directory' => 'Mapp',
  1382. 'file' => 'Fil',
  1383. 'filename' => 'Filnamn',
  1384. 'size' => 'Storlek',
  1385. 'permission' => 'Säkerhetsnivå',
  1386. 'owner' => 'Ägare',
  1387. 'group' => 'Grupp',
  1388. 'other' => 'Andra',
  1389. 'functions' => 'Funktioner',
  1390. 'read' => 'Läs',
  1391. 'write' => 'Skriv',
  1392. 'execute' => 'Utför',
  1393. 'create_symlink' => 'Skapa symlink',
  1394. 'delete' => 'Radera',
  1395. 'rename' => 'Byt namn',
  1396. 'move' => 'Flytta',
  1397. 'copy' => 'Kopiera',
  1398. 'edit' => 'Ändra',
  1399. 'download' => 'Ladda ner',
  1400. 'upload' => 'Ladda upp',
  1401. 'create' => 'Skapa',
  1402. 'change' => 'Ändra',
  1403. 'save' => 'Spara',
  1404. 'set' => 'Markera',
  1405. 'reset' => 'Töm',
  1406. 'relative' => 'Relative path to target',
  1407. 'yes' => 'Ja',
  1408. 'no' => 'Nej',
  1409. 'back' => 'Tillbaks',
  1410. 'destination' => 'Destination',
  1411. 'symlink' => 'Symlink',
  1412. 'no_output' => 'no output',
  1413. 'user' => 'Användare',
  1414. 'password' => 'Lösenord',
  1415. 'add' => 'Lägg till',
  1416. 'add_basic_auth' => 'add basic-authentification',
  1417. 'uploaded' => '"[%1]" har laddats upp.',
  1418. 'not_uploaded' => '"[%1]" kunde inte laddas upp.',
  1419. 'already_exists' => '"[%1]" finns redan.',
  1420. 'created' => '"[%1]" har skapats.',
  1421. 'not_created' => '"[%1]" kunde inte skapas.',
  1422. 'really_delete' => 'Radera dessa filer?',
  1423. 'deleted' => "De här filerna har raderats:\n[%1]",
  1424. 'not_deleted' => "Dessa filer kunde inte raderas:\n[%1]",
  1425. 'rename_file' => 'Byt namn på fil:',
  1426. 'renamed' => '"[%1]" har bytt namn till "[%2]".',
  1427. 'not_renamed' => '"[%1] kunde inte döpas om till "[%2]".',
  1428. 'move_files' => 'Flytta dessa filer:',
  1429. 'moved' => "Dessa filer har flyttats till \"[%2]\":\n[%1]",
  1430. 'not_moved' => "Dessa filer kunde inte flyttas till \"[%2]\":\n[%1]",
  1431. 'copy_files' => 'Kopiera dessa filer:',
  1432. 'copied' => "Dessa filer har kopierats till \"[%2]\":\n[%1]",
  1433. 'not_copied' => "Dessa filer kunde inte kopieras till \"[%2]\":\n[%1]",
  1434. 'not_edited' => '"[%1]" kan inte ändras.',
  1435. 'executed' => "\"[%1]\" har utförts:\n{%2}",
  1436. 'not_executed' => "\"[%1]\" kunde inte utföras:\n{%2}",
  1437. 'saved' => '"[%1]" har sparats.',
  1438. 'not_saved' => '"[%1]" kunde inte sparas.',
  1439. 'symlinked' => 'Symlink från "[%2]" till "[%1]" har skapats.',
  1440. 'not_symlinked' => 'Symlink från "[%2]" till "[%1]" kunde inte skapas.',
  1441. 'permission_for' => 'Rättigheter för "[%1]":',
  1442. 'permission_set' => 'Rättigheter för "[%1]" ändrades till [%2].',
  1443. 'permission_not_set' => 'Permission of "[%1]" could not be set to [%2].',
  1444. 'not_readable' => '"[%1]" kan inte läsas.'
  1445. );
  1446. case 'sp':
  1447. $date_format = 'j/n/y H:i:s';
  1448. $word_charset = 'ISO-8859-1';
  1449. return array(
  1450. 'directory' => 'Directorio',
  1451. 'file' => 'Archivo',
  1452. 'filename' => 'Nombre Archivo',
  1453. 'size' => 'Tamaño',
  1454. 'permission' => 'Permisos',
  1455. 'owner' => 'Propietario',
  1456. 'group' => 'Grupo',
  1457. 'other' => 'Otros',
  1458. 'functions' => 'Funciones',
  1459. 'read' => 'lectura',
  1460. 'write' => 'es