mailout.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * mailout.php
  4. *
  5. * @copyright 1999-2025 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. sqgetGlobalVar('identity', $identity, SQ_GET);
  27. displayPageHeader($color, $mailbox);
  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"),sm_encode_html_special_chars($action)));
  40. // display footer (closes html tags) and stop script execution
  41. $oTemplate->display('footer.tpl');
  42. exit;
  43. }
  44. $out_string = sprintf($out_string, '&quot;' . sm_encode_html_special_chars($send_to) . '&quot;');
  45. $idents = get_identities();
  46. $fieldsdescr = listcommands_fieldsdescr();
  47. $fielddescr = $fieldsdescr[$action];
  48. $oTemplate->assign('out_string', $out_string);
  49. $oTemplate->assign('fielddescr', $fielddescr);
  50. $oTemplate->assign('send_to', $send_to);
  51. $oTemplate->assign('subject', $subject);
  52. $oTemplate->assign('body', $body);
  53. $oTemplate->assign('mailbox', $mailbox);
  54. $oTemplate->assign('idents', $idents);
  55. $oTemplate->assign('identity', $identity);
  56. $oTemplate->display('plugins/listcommands/mailout.tpl');
  57. $oTemplate->display('footer.tpl');