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