Some small bugfixes. Still testing.
[squirrelmail.git] / plugins / listcommands / mailout.php
... / ...
CommitLineData
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
11chdir('..');
12include_once ('../src/validate.php');
13include_once ('../functions/page_header.php');
14include_once ('../src/load_prefs.php');
15
16displayPageHeader($color, $mailbox);
17
18echo '<P><TABLE align="center" width="75%" BGCOLOR="' . $color[0] ."\">\n"
19 .'<TR><TH BGCOLOR="'. $color[9] . '">' . _("Mailinglist") . ' ' . _($action) .
20 "</TH></TR>\n<TR><TD>";
21
22
23switch ( $action ) {
24case 'Help':
25 $out_string = _("This will send a message to %s requesting help for this list. You will receive an emailed response at the address below.");
26 break;
27case 'Subscribe':
28 $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.");
29 break;
30case 'Unsubscribe':
31 $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.");
32}
33
34printf( $out_string, htmlspecialchars($send_to) );
35
36echo '<form method="POST" action="../../src/compose.php">';
37
38/*
39 * Identity support (RFC 2369 sect. B.1.)
40 *
41 * I had to copy this from compose.php because there doesn't
42 * seem to exist a function to get the identities.
43 */
44
45$defaultmail = htmlspecialchars(getPref($data_dir, $username, 'full_name'));
46$em = getPref($data_dir, $username, 'email_address');
47if ($em != '') {
48 $defaultmail .= htmlspecialchars(' <' . $em . '>') . "\n";
49}
50echo '<P><CENTER>' . _("From:") . ' ';
51
52$idents = getPref($data_dir, $username, 'identities');
53if ($idents != '' && $idents > 1) {
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} else {
71 echo $defaultmail;
72}
73
74echo '<BR>'
75. '<input type=hidden name="send_to" value="' . htmlspecialchars($send_to) . '">'
76. '<input type=hidden name="subject" value="' . htmlspecialchars($subject) . '">'
77. '<input type=hidden name="body" value="' . htmlspecialchars($body) . '">'
78. '<input type=hidden name="mailbox" value="' . htmlspecialchars($mailbox) . '">'
79. '<input type=submit name="send" value="' . _("Send Mail") . '"><BR><BR></CENTER>'
80. '</form></TD></TR></TABLE></P></BODY></HTML>';
81?>