mailout.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. /**
  3. * mailout.php
  4. *
  5. * Copyright (c) 1999-2002 The SquirrelMail Project Team
  6. * Licensed under the GNU GPL. For full terms see the file COPYING.
  7. *
  8. * $Id$
  9. */
  10. chdir('..');
  11. include_once ('../src/validate.php');
  12. include_once ('../functions/page_header.php');
  13. include_once ('../src/load_prefs.php');
  14. displayPageHeader($color, $mailbox);
  15. echo '<P><TABLE align="center" width="75%" BGCOLOR="' . $color[0] ."\">\n"
  16. .'<TR><TH BGCOLOR="'. $color[9] . '">' . _("Mailinglist") . ' ' . _($action) .
  17. "</TH></TR>\n<TR><TD>";
  18. switch ( $action ) {
  19. case 'Help':
  20. $out_string = _("This will send a message to %s requesting help for this list. You will receive an emailed response at the address below.");
  21. break;
  22. case 'Subscribe':
  23. $out_string = _("This will send a message to %s requesting that you will be subscribed to this list. You will be subscribed with the address below.");
  24. break;
  25. case 'Unsubscribe':
  26. $out_string = _("This will send a message to %s requesting that you will be unsubscribed from this list. It will try to unsubscribe the adress below.");
  27. }
  28. printf( $out_string, htmlspecialchars($send_to) );
  29. echo '<form method="POST" action="../../src/compose.php">';
  30. /*
  31. * Identity support (RFC 2369 sect. B.1.)
  32. *
  33. * I had to copy this from compose.php because there doesn't
  34. * seem to exist a function to get the identities.
  35. */
  36. $defaultmail = htmlspecialchars(getPref($data_dir, $username, 'full_name'));
  37. $em = getPref($data_dir, $username, 'email_address');
  38. if ($em != '') {
  39. $defaultmail .= htmlspecialchars(' <' . $em . '>') . "\n";
  40. }
  41. echo '<P><CENTER>' . _("From:") . ' ';
  42. $idents = getPref($data_dir, $username, 'identities');
  43. if ($idents != '' && $idents > 1) {
  44. echo ' <select name=identity>' . "\n" .
  45. '<option value=default>' . $defaultmail;
  46. for ($i = 1; $i < $idents; $i ++) {
  47. echo '<option value="' . $i . '"';
  48. if (isset($identity) && $identity == $i) {
  49. echo ' SELECTED';
  50. }
  51. echo '>' . htmlspecialchars(getPref($data_dir, $username,
  52. 'full_name' . $i));
  53. $em = getPref($data_dir, $username, 'email_address' . $i);
  54. if ($em != '') {
  55. echo htmlspecialchars(' <' . $em . '>') . "\n";
  56. }
  57. }
  58. echo '</select>' . "\n" ;
  59. } else {
  60. echo $defaultmail;
  61. }
  62. echo '<BR>'
  63. . '<input type=hidden name="send_to" value="' . htmlspecialchars($send_to) . '">'
  64. . '<input type=hidden name="subject" value="' . htmlspecialchars($subject) . '">'
  65. . '<input type=hidden name="body" value="' . htmlspecialchars($body) . '">'
  66. . '<input type=hidden name="mailbox" value="' . htmlspecialchars($mailbox) . '">'
  67. . '<input type=submit name="send" value="' . _("Send Mail") . '"><BR><BR></CENTER>'
  68. . '</form></TD></TR></TABLE></P></BODY></HTML>';
  69. ?>