73ee43b1 |
1 | <?php |
519f07d7 |
2 | /** |
3 | * mailout.php |
73ee43b1 |
4 | * |
519f07d7 |
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$ |
73ee43b1 |
9 | */ |
050722c4 |
10 | |
8d6a115b |
11 | define('SM_PATH','../../'); |
cdf82d4a |
12 | |
13 | /* SquirrelMail required files. */ |
14 | require_once(SM_PATH . 'include/validate.php'); |
15 | include_once(SM_PATH . 'functions/page_header.php'); |
aa7fb30c |
16 | include_once(SM_PATH . 'include/load_prefs.php'); |
cdf82d4a |
17 | include_once(SM_PATH . 'functions/html.php'); |
73ee43b1 |
18 | |
19 | displayPageHeader($color, $mailbox); |
20 | |
4cf43843 |
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' ); |
73ee43b1 |
28 | |
29 | switch ( $action ) { |
83feb57a |
30 | case 'help': |
519f07d7 |
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."); |
73ee43b1 |
32 | break; |
83feb57a |
33 | case 'subscribe': |
519f07d7 |
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."); |
73ee43b1 |
35 | break; |
83feb57a |
36 | case 'unsubscribe': |
050722c4 |
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."); |
73ee43b1 |
38 | } |
39 | |
40 | printf( $out_string, htmlspecialchars($send_to) ); |
41 | |
4cf43843 |
42 | echo '<form method="post" action="../../src/compose.php">'; |
73ee43b1 |
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 | } |
4cf43843 |
56 | echo html_tag('p', '', 'center' ) . _("From:") . ' '; |
73ee43b1 |
57 | |
050722c4 |
58 | $idents = getPref($data_dir, $username, 'identities'); |
59 | if ($idents != '' && $idents > 1) { |
4cf43843 |
60 | echo ' <select name="identity">' . "\n" . |
61 | '<option value="default">' . $defaultmail; |
73ee43b1 |
62 | for ($i = 1; $i < $idents; $i ++) { |
63 | echo '<option value="' . $i . '"'; |
64 | if (isset($identity) && $identity == $i) { |
4cf43843 |
65 | echo ' selected'; |
73ee43b1 |
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 | } |
050722c4 |
73 | } |
73ee43b1 |
74 | echo '</select>' . "\n" ; |
75 | |
050722c4 |
76 | } else { |
73ee43b1 |
77 | echo $defaultmail; |
050722c4 |
78 | } |
79 | |
4cf43843 |
80 | echo '<br>' |
050722c4 |
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>'; |
665ec685 |
87 | ?> |