Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. +-----------------------------------------------------------------------+
  4. | program/steps/mail/headers.inc |
  5. | |
  6. | This file is part of the Roundcube Webmail client |
  7. | Copyright (C) 2005-2016, The Roundcube Dev Team |
  8. | |
  9. | Licensed under the GNU General Public License version 3 or |
  10. | any later version with exceptions for skins & plugins. |
  11. | See the README file for a full license statement. |
  12. | |
  13. | PURPOSE: |
  14. | Fetch message headers in raw format for display |
  15. | |
  16. +-----------------------------------------------------------------------+
  17. | Author: Aleksander Machniak <alec@alec.pl> |
  18. +-----------------------------------------------------------------------+
  19. */
  20. if ($uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST)) {
  21. if ($pos = strpos($uid, '.')) {
  22. $message = new rcube_message($uid);
  23. $source = $message->get_part_body(substr($uid, $pos + 1));
  24. $source = substr($source, 0, strpos($source, "\r\n\r\n"));
  25. }
  26. else {
  27. $source = $RCMAIL->storage->get_raw_headers($uid);
  28. }
  29. if ($source !== false) {
  30. $source = trim(rcube_charset::clean($source));
  31. $source = htmlspecialchars($source);
  32. $source = preg_replace(
  33. array(
  34. '/\n[\t\s]+/',
  35. '/^([a-z0-9_:-]+)/im',
  36. '/\r?\n/'
  37. ),
  38. array(
  39. "\n&nbsp;&nbsp;&nbsp;&nbsp;",
  40. '<font class="bold">\1</font>',
  41. '<br />'
  42. ), $source);
  43. $OUTPUT->command('set_headers', $source);
  44. }
  45. else {
  46. $RCMAIL->output->show_message('messageopenerror', 'error');
  47. }
  48. $OUTPUT->send();
  49. }
  50. exit;