mailout.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * mailout.php
  4. *
  5. * @copyright 1999-2015 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. switch ( $action ) {
  28. case 'help':
  29. $out_string = _("This will send a message to %s requesting help for this list. You will receive an emailed response at the address below.");
  30. break;
  31. case 'subscribe':
  32. $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.");
  33. break;
  34. case 'unsubscribe':
  35. $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.");
  36. break;
  37. default:
  38. error_box(sprintf(_("Unknown action: %s"),sm_encode_html_special_chars($action)));
  39. // display footer (closes html tags) and stop script execution
  40. $oTemplate->display('footer.tpl');
  41. exit;
  42. }
  43. $out_string = sprintf($out_string, '&quot;' . sm_encode_html_special_chars($send_to) . '&quot;');
  44. $idents = get_identities();
  45. $fieldsdescr = listcommands_fieldsdescr();
  46. $fielddescr = $fieldsdescr[$action];
  47. $oTemplate->assign('out_string', $out_string);
  48. $oTemplate->assign('fielddescr', $fielddescr);
  49. $oTemplate->assign('send_to', $send_to);
  50. $oTemplate->assign('subject', $subject);
  51. $oTemplate->assign('body', $body);
  52. $oTemplate->assign('mailbox', $mailbox);
  53. $oTemplate->assign('idents', $idents);
  54. $oTemplate->display('plugins/listcommands/mailout.tpl');
  55. $oTemplate->display('footer.tpl');