Time to stop coding for tonight. Making this kind of terrible bugs is bad.
[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 define('SM_PATH','../../');
12
13 /* SquirrelMail required files. */
14 require_once(SM_PATH . 'include/validate.php');
15 include_once(SM_PATH . 'functions/page_header.php');
16 include_once(SM_PATH . 'include/load_prefs.php');
17 include_once(SM_PATH . 'functions/html.php');
18
19 displayPageHeader($color, $mailbox);
20
21 echo html_tag('p', '', 'left' ) .
22 html_tag( 'table', '', 'center', $color[0], 'border="0" width="75%"' ) . "\n" .
23 html_tag( 'tr',
24 html_tag( 'th', _("Mailinglist") . ' ' . _($action), '', $color[9] )
25 ) .
26 html_tag( 'tr' ) .
27 html_tag( 'td', '', 'left' );
28
29 switch ( $action ) {
30 case 'help':
31 $out_string = _("This will send a message to %s requesting help for this list. You will receive an emailed response at the address below.");
32 break;
33 case 'subscribe':
34 $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.");
35 break;
36 case 'unsubscribe':
37 $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.");
38 }
39
40 printf( $out_string, htmlspecialchars($send_to) );
41
42 echo '<form method="post" action="../../src/compose.php">';
43
44 /*
45 * Identity support (RFC 2369 sect. B.1.)
46 *
47 * I had to copy this from compose.php because there doesn't
48 * seem to exist a function to get the identities.
49 */
50
51 $defaultmail = htmlspecialchars(getPref($data_dir, $username, 'full_name'));
52 $em = getPref($data_dir, $username, 'email_address');
53 if ($em != '') {
54 $defaultmail .= htmlspecialchars(' <' . $em . '>') . "\n";
55 }
56 echo html_tag('p', '', 'center' ) . _("From:") . ' ';
57
58 $idents = getPref($data_dir, $username, 'identities');
59 if ($idents != '' && $idents > 1) {
60 echo ' <select name="identity">' . "\n" .
61 '<option value="default">' . $defaultmail;
62 for ($i = 1; $i < $idents; $i ++) {
63 echo '<option value="' . $i . '"';
64 if (isset($identity) && $identity == $i) {
65 echo ' selected';
66 }
67 echo '>' . htmlspecialchars(getPref($data_dir, $username,
68 'full_name' . $i));
69 $em = getPref($data_dir, $username, 'email_address' . $i);
70 if ($em != '') {
71 echo htmlspecialchars(' <' . $em . '>') . "\n";
72 }
73 }
74 echo '</select>' . "\n" ;
75
76 } else {
77 echo $defaultmail;
78 }
79
80 echo '<br>'
81 . '<input type=hidden name="send_to" value="' . htmlspecialchars($send_to) . '">'
82 . '<input type=hidden name="subject" value="' . htmlspecialchars($subject) . '">'
83 . '<input type=hidden name="body" value="' . htmlspecialchars($body) . '">'
84 . '<input type=hidden name="mailbox" value="' . htmlspecialchars($mailbox) . '">'
85 . '<input type=submit name="send" value="' . _("Send Mail") . '"><BR><BR></CENTER>'
86 . '</form></TD></TR></TABLE></P></BODY></HTML>';
87 ?>