mailout.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /**
  3. * mailout.php
  4. *
  5. * @copyright &copy; 1999-2006 The SquirrelMail Project Team
  6. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  7. * @version $Id$
  8. * @package plugins
  9. * @subpackage listcommands
  10. */
  11. /**
  12. * Path for SquirrelMail required files.
  13. * @ignore
  14. */
  15. require('../../include/init.php');
  16. /* SquirrelMail required files. */
  17. require(SM_PATH . 'functions/identity.php');
  18. require(SM_PATH . 'functions/forms.php');
  19. require(SM_PATH . 'plugins/listcommands/functions.php');
  20. /* get globals */
  21. sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
  22. sqgetGlobalVar('send_to', $send_to, SQ_GET);
  23. sqgetGlobalVar('subject', $subject, SQ_GET);
  24. sqgetGlobalVar('body', $body, SQ_GET);
  25. sqgetGlobalVar('action', $action, SQ_GET);
  26. displayPageHeader($color, $mailbox);
  27. $fieldsdescr = listcommands_fieldsdescr();
  28. switch ( $action ) {
  29. case 'help':
  30. $out_string = _("This will send a message to %s requesting help for this list. You will receive an emailed response at the address below.");
  31. break;
  32. case 'subscribe':
  33. $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.");
  34. break;
  35. case 'unsubscribe':
  36. $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.");
  37. break;
  38. default:
  39. error_box(sprintf(_("Unknown action: %s"),htmlspecialchars($action)));
  40. // display footer (closes html tags) and stop script execution
  41. $oTemplate->display('footer.tpl');
  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 />
  75. </form></td></tr></table></p></body></html>