More fixes due to R2L implementation (bugs were posted to squirrel-devel)
[squirrelmail.git] / plugins / listcommands / mailout.php
1 <?php
2 /**
3 * mailout.php
4 *
5 * Copyright (c) 1999-2002 The SquirrelMail Project Team
6 * Licensed under the GNU GPL. For full terms see the file COPYING.
7 *
8 * $Id$
9 */
10
11 chdir('..');
12 include_once ('../src/validate.php');
13 include_once ('../functions/page_header.php');
14 include_once ('../src/load_prefs.php');
15 include_once('../functions/html.php');
16
17 displayPageHeader($color, $mailbox);
18
19 echo html_tag('p', '', 'left' ) .
20 html_tag( 'table', '', 'center', $color[0], 'border="0" width="75%"' ) . "\n" .
21 html_tag( 'tr',
22 html_tag( 'th', _("Mailinglist") . ' ' . _($action), '', $color[9] )
23 ) .
24 html_tag( 'tr' ) .
25 html_tag( 'td', '', 'left' );
26
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 }
37
38 printf( $out_string, htmlspecialchars($send_to) );
39
40 echo '<form method="post" action="../../src/compose.php">';
41
42 /*
43 * Identity support (RFC 2369 sect. B.1.)
44 *
45 * I had to copy this from compose.php because there doesn't
46 * seem to exist a function to get the identities.
47 */
48
49 $defaultmail = htmlspecialchars(getPref($data_dir, $username, 'full_name'));
50 $em = getPref($data_dir, $username, 'email_address');
51 if ($em != '') {
52 $defaultmail .= htmlspecialchars(' <' . $em . '>') . "\n";
53 }
54 echo html_tag('p', '', 'center' ) . _("From:") . ' ';
55
56 $idents = getPref($data_dir, $username, 'identities');
57 if ($idents != '' && $idents > 1) {
58 echo ' <select name="identity">' . "\n" .
59 '<option value="default">' . $defaultmail;
60 for ($i = 1; $i < $idents; $i ++) {
61 echo '<option value="' . $i . '"';
62 if (isset($identity) && $identity == $i) {
63 echo ' selected';
64 }
65 echo '>' . htmlspecialchars(getPref($data_dir, $username,
66 'full_name' . $i));
67 $em = getPref($data_dir, $username, 'email_address' . $i);
68 if ($em != '') {
69 echo htmlspecialchars(' <' . $em . '>') . "\n";
70 }
71 }
72 echo '</select>' . "\n" ;
73
74 } else {
75 echo $defaultmail;
76 }
77
78 echo '<br>'
79 . '<input type=hidden name="send_to" value="' . htmlspecialchars($send_to) . '">'
80 . '<input type=hidden name="subject" value="' . htmlspecialchars($subject) . '">'
81 . '<input type=hidden name="body" value="' . htmlspecialchars($body) . '">'
82 . '<input type=hidden name="mailbox" value="' . htmlspecialchars($mailbox) . '">'
83 . '<input type=submit name="send" value="' . _("Send Mail") . '"><BR><BR></CENTER>'
84 . '</form></TD></TR></TABLE></P></BODY></HTML>';
85 ?>