mailout.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. include_once('../functions/html.php');
  15. displayPageHeader($color, $mailbox);
  16. echo html_tag('p', '', 'left' ) .
  17. html_tag( 'table', '', 'center', $color[0], 'border="0" width="75%"' ) . "\n" .
  18. html_tag( 'tr',
  19. html_tag( 'th', _("Mailinglist") . ' ' . _($action), '', $color[9] )
  20. ) .
  21. html_tag( 'tr' ) .
  22. html_tag( 'td', '', 'left' );
  23. switch ( $action ) {
  24. case 'Help':
  25. $out_string = _("This will send a message to %s requesting help for this list. You will receive an emailed response at the address below.");
  26. break;
  27. case 'Subscribe':
  28. $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.");
  29. break;
  30. case 'Unsubscribe':
  31. $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.");
  32. }
  33. printf( $out_string, htmlspecialchars($send_to) );
  34. echo '<form method="post" action="../../src/compose.php">';
  35. /*
  36. * Identity support (RFC 2369 sect. B.1.)
  37. *
  38. * I had to copy this from compose.php because there doesn't
  39. * seem to exist a function to get the identities.
  40. */
  41. $defaultmail = htmlspecialchars(getPref($data_dir, $username, 'full_name'));
  42. $em = getPref($data_dir, $username, 'email_address');
  43. if ($em != '') {
  44. $defaultmail .= htmlspecialchars(' <' . $em . '>') . "\n";
  45. }
  46. echo html_tag('p', '', 'center' ) . _("From:") . ' ';
  47. $idents = getPref($data_dir, $username, 'identities');
  48. if ($idents != '' && $idents > 1) {
  49. echo ' <select name="identity">' . "\n" .
  50. '<option value="default">' . $defaultmail;
  51. for ($i = 1; $i < $idents; $i ++) {
  52. echo '<option value="' . $i . '"';
  53. if (isset($identity) && $identity == $i) {
  54. echo ' selected';
  55. }
  56. echo '>' . htmlspecialchars(getPref($data_dir, $username,
  57. 'full_name' . $i));
  58. $em = getPref($data_dir, $username, 'email_address' . $i);
  59. if ($em != '') {
  60. echo htmlspecialchars(' <' . $em . '>') . "\n";
  61. }
  62. }
  63. echo '</select>' . "\n" ;
  64. } else {
  65. echo $defaultmail;
  66. }
  67. echo '<br>'
  68. . '<input type=hidden name="send_to" value="' . htmlspecialchars($send_to) . '">'
  69. . '<input type=hidden name="subject" value="' . htmlspecialchars($subject) . '">'
  70. . '<input type=hidden name="body" value="' . htmlspecialchars($body) . '">'
  71. . '<input type=hidden name="mailbox" value="' . htmlspecialchars($mailbox) . '">'
  72. . '<input type=submit name="send" value="' . _("Send Mail") . '"><BR><BR></CENTER>'
  73. . '</form></TD></TR></TABLE></P></BODY></HTML>';
  74. ?>