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