a46815694fc5a4a350262ade375faf155f789513
[squirrelmail.git] / plugins / listcommands / mailout.php
1 <?php
2 /*
3 * mailout.php part of listcommands plugin
4 * last modified: 2002/01/21 by Thijs Kinkhorst
5 *
6 */
7
8 chdir('..');
9 include_once ('../src/validate.php');
10 include_once ('../functions/page_header.php');
11 include_once ('../src/load_prefs.php');
12
13 displayPageHeader($color, $mailbox);
14
15 echo '<P><TABLE align="center" width="75%" BGCOLOR="' . $color[0] ."\">\n"
16 .'<TR><TH BGCOLOR="'. $color[9] . '">' . _("Mailinglist") . ' ' . _($action) .
17 "</TH></TR>\n<TR><TD>";
18
19
20 switch ( $action ) {
21 case 'Help':
22 $out_string .= _("This will send a message to %s requesting help for this list. You will receive an emailed response at the address below.");
23 break;
24 case 'Subscribe':
25 $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.");
26 break;
27 case 'Unsubscribe':
28 $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.");
29 }
30
31 printf( $out_string, htmlspecialchars($send_to) );
32
33 echo '<form method="POST" action="../../src/compose.php">';
34
35 /*
36 * Identity support (RFC 2369 sect. B.1.)
37 *
38 * I had to copy this from compose.php because there doesn't
39 * seem to exist a function to get the identities.
40 */
41
42 $defaultmail = htmlspecialchars(getPref($data_dir, $username, 'full_name'));
43 $em = getPref($data_dir, $username, 'email_address');
44 if ($em != '') {
45 $defaultmail .= htmlspecialchars(' <' . $em . '>') . "\n";
46 }
47 echo '<P><CENTER>' . _("From:");
48
49 $idents = getPref($data_dir, $username, 'identities');
50 if ($idents != '' && $idents > 1) {
51 echo ' <select name=identity>' . "\n" .
52 '<option value=default>' . $defaultmail;
53 for ($i = 1; $i < $idents; $i ++) {
54 echo '<option value="' . $i . '"';
55 if (isset($identity) && $identity == $i) {
56 echo ' SELECTED';
57 }
58 echo '>' . htmlspecialchars(getPref($data_dir, $username,
59 'full_name' . $i));
60 $em = getPref($data_dir, $username, 'email_address' . $i);
61 if ($em != '') {
62 echo htmlspecialchars(' <' . $em . '>') . "\n";
63 }
64 }
65 echo '</select>' . "\n" ;
66
67 } else {
68 echo $defaultmail;
69 }
70
71 echo '<BR>'
72 . '<input type=hidden name="send_to" value="' . htmlspecialchars($send_to) . '">'
73 . '<input type=hidden name="subject" value="' . htmlspecialchars($subject) . '">'
74 . '<input type=hidden name="body" value="' . htmlspecialchars($body) . '">'
75 . '<input type=hidden name="mailbox" value="' . htmlspecialchars($mailbox) . '">'
76 . '<input type=submit name="send" value="' . _("Send Mail") . '"><BR><BR></CENTER>'
77 . '</form></TD></TR></TABLE></P></BODY></HTML>';
78 ?>