mailout.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /**
  3. * mailout.php
  4. *
  5. * Copyright (c) 1999-2005 The SquirrelMail Project Team
  6. * Licensed under the GNU GPL. For full terms see the file COPYING.
  7. *
  8. * @version $Id$
  9. * @package plugins
  10. * @subpackage listcommands
  11. */
  12. /** @ignore */
  13. define('SM_PATH','../../');
  14. /* SquirrelMail required files. */
  15. require_once(SM_PATH . 'include/validate.php');
  16. include_once(SM_PATH . 'functions/page_header.php');
  17. include_once(SM_PATH . 'include/load_prefs.php');
  18. include_once(SM_PATH . 'functions/html.php');
  19. require_once(SM_PATH . 'functions/identity.php');
  20. require_once(SM_PATH . 'functions/forms.php');
  21. include_once(SM_PATH . 'plugins/listcommands/functions.php');
  22. /* get globals */
  23. sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
  24. sqgetGlobalVar('send_to', $send_to, SQ_GET);
  25. sqgetGlobalVar('subject', $subject, SQ_GET);
  26. sqgetGlobalVar('body', $body, SQ_GET);
  27. sqgetGlobalVar('action', $action, SQ_GET);
  28. displayPageHeader($color, $mailbox);
  29. $fieldsdescr = listcommands_fieldsdescr();
  30. switch ( $action ) {
  31. case 'help':
  32. $out_string = _("This will send a message to %s requesting help for this list. You will receive an emailed response at the address below.");
  33. break;
  34. case 'subscribe':
  35. $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.");
  36. break;
  37. case 'unsubscribe':
  38. $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.");
  39. break;
  40. default:
  41. error_box(sprintf(_("Unknown action: %s"),htmlspecialchars($action)), $color);
  42. exit;
  43. }
  44. echo html_tag('p', '', 'left' ) .
  45. html_tag( 'table', '', 'center', $color[0], 'border="0" width="75%"' ) . "\n" .
  46. html_tag( 'tr',
  47. html_tag( 'th', _("Mailinglist") . ': ' . $fieldsdescr[$action], '', $color[9] )
  48. ) .
  49. html_tag( 'tr' ) .
  50. html_tag( 'td', '', 'left' );
  51. printf($out_string, '&quot;' . htmlspecialchars($send_to) . '&quot;');
  52. echo addForm(SM_PATH . 'src/compose.php', 'post');
  53. $idents = get_identities();
  54. echo html_tag('p', '', 'center' ) . _("From:") . ' ';
  55. if (count($idents) > 1) {
  56. echo '<select name="identity">';
  57. foreach($idents as $nr=>$data) {
  58. echo '<option value="' . $nr . '">' .
  59. htmlspecialchars(
  60. $data['full_name'].' <'.
  61. $data['email_address'] . ">\n");
  62. }
  63. echo '</select>' . "\n" ;
  64. } else {
  65. echo htmlspecialchars('"'.$idents[0]['full_name'].'" <'.$idents[0]['email_address'].'>');
  66. }
  67. echo '<br />' .
  68. addHidden('send_to', $send_to) .
  69. addHidden('subject', $subject) .
  70. addHidden('body', $body) .
  71. addHidden('mailbox', $mailbox) .
  72. addSubmit(_("Send Mail"), 'send');
  73. ?>
  74. <br /><br /></center>
  75. </form></td></tr></table></p></body></html>