X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Flistcommands%2Fmailout.php;h=db305b5c0435505fb972847e235add6361a77230;hb=d6bc7d16ef46a6ccb5bb12eb857f9aa43e4c738e;hp=6f608f26a590772a65841622d0fdbf588d3448e0;hpb=4cf438432a1f2bfdba752e075ec6458ec3e290ba;p=squirrelmail.git diff --git a/plugins/listcommands/mailout.php b/plugins/listcommands/mailout.php index 6f608f26..db305b5c 100644 --- a/plugins/listcommands/mailout.php +++ b/plugins/listcommands/mailout.php @@ -2,20 +2,34 @@ /** * mailout.php * - * Copyright (c) 1999-2002 The SquirrelMail Project Team + * Copyright (c) 1999-2004 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * * $Id$ + * @package plugins + * @subpackage listcommands */ -chdir('..'); -include_once ('../src/validate.php'); -include_once ('../functions/page_header.php'); -include_once ('../src/load_prefs.php'); -include_once('../functions/html.php'); +/** @ignore */ +define('SM_PATH','../../'); + +/* SquirrelMail required files. */ +require_once(SM_PATH . 'include/validate.php'); +include_once(SM_PATH . 'functions/page_header.php'); +include_once(SM_PATH . 'include/load_prefs.php'); +include_once(SM_PATH . 'functions/html.php'); +require_once(SM_PATH . 'functions/identity.php'); +require_once(SM_PATH . 'functions/forms.php'); displayPageHeader($color, $mailbox); +/* get globals */ +sqgetGlobalVar('mailbox', $mailbox, SQ_GET); +sqgetGlobalVar('send_to', $send_to, SQ_GET); +sqgetGlobalVar('subject', $subject, SQ_GET); +sqgetGlobalVar('body', $body, SQ_GET); +sqgetGlobalVar('action', $action, SQ_GET); + echo html_tag('p', '', 'left' ) . html_tag( 'table', '', 'center', $color[0], 'border="0" width="75%"' ) . "\n" . html_tag( 'tr', @@ -25,61 +39,44 @@ html_tag( 'table', '', 'center', $color[0], 'border="0" width="75%"' ) . "\n" . html_tag( 'td', '', 'left' ); switch ( $action ) { -case 'Help': +case 'help': $out_string = _("This will send a message to %s requesting help for this list. You will receive an emailed response at the address below."); break; -case 'Subscribe': +case 'subscribe': $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."); break; -case 'Unsubscribe': +case 'unsubscribe': $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."); } printf( $out_string, htmlspecialchars($send_to) ); -echo '
'; +echo addForm('../../src/compose.php', 'POST'); -/* - * Identity support (RFC 2369 sect. B.1.) - * - * I had to copy this from compose.php because there doesn't - * seem to exist a function to get the identities. - */ -$defaultmail = htmlspecialchars(getPref($data_dir, $username, 'full_name')); -$em = getPref($data_dir, $username, 'email_address'); -if ($em != '') { - $defaultmail .= htmlspecialchars(' <' . $em . '>') . "\n"; -} +$idents = get_identities(); + echo html_tag('p', '', 'center' ) . _("From:") . ' '; -$idents = getPref($data_dir, $username, 'identities'); -if ($idents != '' && $idents > 1) { - echo ' '; + foreach($idents as $nr=>$data) { + echo '

'; +echo '
' +. addHidden('send_to', $send_to) +. addHidden('subject', $subject) +. addHidden('body', $body) +. addHidden('mailbox', $mailbox) +. addSubmit(_("Send Mail"), 'send') +. '

' +. '

'; ?>