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