/usr/share/IlohaMail/source/compose.php is in ilohamail 0.8.14-0rc3sid6.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 | <?php
/////////////////////////////////////////////////////////
//
// source/compose.php
//
// (C)Copyright 2000-2002 Ryo Chijiiwa <Ryo@IlohaMail.org>
//
// This file is part of IlohaMail.
// IlohaMail is free software released under the GPL
// license. See enclosed file COPYING for details,
// or see http://www.fsf.org/copyleft/gpl.html
//
/////////////////////////////////////////////////////////
/********************************************************
AUTHOR: Ryo Chijiiwa <ryo@ilohamail.org>
FILE: source/compose.php
PURPOSE:
1. Provide interface for creating messages
2. Provide interface for uploading attachments
3. Form MIME format (RFC822) compliant messages
4. Send message
5. Save to "sent items" folder if so specified
PRE-CONDITIONS:
$user - Session ID for session validation and user preference retreaval
POST-CONDITIONS:
Displays standard message composition interface by default
If "upload" button pressed, displays all inputted text and attachment info
If "send" button pressed, sends, files, and displays status
COMMENTS:
********************************************************/
include("../include/super2global.inc");
include("../include/header_main.inc");
include("../lang/".$my_prefs["lang"]."compose.inc");
include("../lang/".$my_prefs["lang"]."dates.inc");
include("../include/icl.inc");
include("../include/version.inc");
include("../conf/defaults.inc");
/******* Init values *******/
if (!isset($attachments)) $attachments=0;
if (isset($change_contacts)) $show_contacts = $new_show_contacts;
if (isset($change_show_cc)) $show_cc = $new_show_cc;
//Handle ddresses submitted from contacts list
//(in contacts window)
if (is_array($contact_to)) $to .= (empty($to)?"":", ").urldecode(implode(", ", $contact_to));
if (is_array($contact_cc)) $cc .= (empty($cc)?"":", ").urldecode(implode(", ", $contact_cc));
if (is_array($contact_bcc)) $bcc .= (empty($bcc)?"":", ").urldecode(implode(", ", $contact_bcc));
//(in compose window)
if ((isset($to_a)) && (is_array($to_a))){
reset($to_a);
while ( list($key, $val) = each($to_a)) $$to_a_field .= ($$to_a_field!=""?", ":"").stripslashes($val);
}
//generate authenticated email address
if (empty($init_from_address)){
$sender_addr = $loginID.( strpos($loginID, "@")>0 ? "":"@".$host );
}else{
$sender_addr = str_replace("%u", $loginID, str_replace("%h", $host, $init_from_address));
}
/***
generate user's name
***/
$from_name = (empty($my_prefs["user_name"])?"":"\"".LangEncodeSubject($my_prefs["user_name"], $my_charset)."\" ");
if ($TRUST_USER_ADDRESS){
//Honor User Address
//If email address is specified in prefs, use that in the "From"
//field, and set the Sender field to an authenticated address
$from_addr = (empty($my_prefs["email_address"]) ? $sender_addr : $my_prefs["email_address"] );
$from = $from_name."<".$from_addr.">";
$reply_to = "";
}else{
//Default
//Set "From" to authenticated user address
//Set "Reply-To" to user specified address (if any)
$from_addr = $sender_addr;
$from = $from_name."<".$sender_addr.">";
if (!empty($my_prefs["email_address"])) $reply_to = $from_name."<".$my_prefs["email_address"].">";
else $reply_to = "";
}
$original_from = $from;
/***
CHECK UPLOADS DIR
***/
$uploadDir = $UPLOAD_DIR.ereg_replace("[\\/]", "", $loginID.".".$host);
if (!is_dir($uploadDir)) $error .= "Invalid uploads dir<br>";
/****
SEND
****/
if (isset($send)){
$conn = iil_Connect($host, $loginID, $password, $AUTH_MODE);
if (!$conn)
echo "failed";
else{
//echo "Composing...<br>\n"; flush();
$error = "";
/**** Check for subject ***/
$no_subject = false;
if ((strlen($subject)==0)&&(!$confirm_no_subject)){
$error .= $composeErrors[0]."<br>\n";
$no_subject = true;
}
/**** Check "from" ***/
if (strlen($from)<7) $error .= $composeErrors[1]."<br>\n";
/**** Check for recepient ***/
$to = stripslashes($to);
if ((strcasecmp($to, "self")==0) || (strcasecmp($to, "me")==0)) $to=$my_prefs["email_address"];
if ((strlen($to) < 7) || (strpos($to, "@")===false))
$error .= $composeErrors[2]."<br>\n";
/**** Anti-Spam *****/
$as_ok = true;
//echo "lastSend: $lastSend <br> numSent: $numSent <br>\n";
//echo "$max_rcpt_message $max_rcpt_session $min_send_interval <br>";
if ((isset($max_rcpt_message)) && ((isset($max_rcpt_session))) && (isset($min_send_interval))){
$num_recepients = substr_count($to.$cc.$bcc, "@");
if ($num_recepients > $max_rcpt_message) $as_ok = false;
if (($num_recepients + $numSent) > $max_rcpt_session) $as_ok = false;
if ((time() - $lastSend) < $min_send_interval) $as_ok = false;
}else{
echo "Bypassing anti-spam<br>\n";
}
if (!$as_ok){
$as_error = $composeErrors[5];
$as_error = str_replace("%1", $max_rcpt_message, $as_error);
$as_error = str_replace("%2", $max_rcpt_session, $as_error);
$as_error = str_replace("%3", $min_send_interval, $as_error);
$error .= $as_error;
}
/**********************/
if ($error){
//echo "<font color=\"red\">".$error."</font><br><br>\n";
}else{
//echo "<p>Sending....";
//flush();
$num_parts=0;
/*** Initialize header ***/
$headerx = "Date: ".TZDate($my_prefs["timezone"])."\n";
$headerx.= "X-Mailer: IlohaMail/".$version." (On: ".$_SERVER["SERVER_NAME"].")\n";
if (!empty($replyto_messageID)) $headerx.= "In-Reply-To: <".$replyto_messageID.">\n";
/**** Attach Sig ****/
if ($attach_sig==1) $message.="\n\n".$my_prefs["signature1"];
/**** Attach Tag-line ***/
if ($userLevel < $TAG_LEVEL){
$message .= "\n\n".$TAG_LINE;
}
/**** Encode ****/
$subject=stripslashes($subject);
$message=stripslashes($message);
$subject=LangEncodeSubject($subject, $my_charset);
$part[0]=LangEncodeMessage($message, $my_charset);
/***********************/
/**** Pre-process addresses */
$from = stripslashes($from);
$to = stripslashes($to);
$to = LangEncodeAddressList($to, $my_charset);
$from = LangEncodeAddressList($from, $my_charset);
if (!empty($cc)){
$cc= stripslashes($cc);
$cc = LangEncodeAddressList($cc, $my_charset);
}
if (!empty($bcc)){
$bcc = stripslashes($bcc);
$bcc = LangEncodeAddressList($bcc, $my_charset);
}
/***********************/
/**** Add Recipients *********/
//$headerx.="Return-Path: ".$sender_addr."\n";
$headerx.="From: ".$from."\n";
//$headerx.="Sender: ".$sender_addr."\n";
$headerx.="Bounce-To: ".$from."\n";
$headerx.="Errors-To: ".$from."\n";
if (!empty($reply_to)) $headerx.="Reply-To: ".stripslashes($reply_to)."\n";
if ($cc){
$headerx.="CC: ". stripslashes($cc)."\n";
}
if ($bcc){
$headerx.="BCC: ".stripslashes($bcc)."\n";
}
/************************/
/**** Prepare attachments *****/
echo "Attachments: $attachments <br>\n";
if (is_dir($uploadDir)){
//open directory
if ($handle = opendir($uploadDir)) {
//loop through files
while (false !== ($file = readdir($handle))) {
if (($file != "." && $file != "..") && ($attach[$file]==1)) {
//split up file name
$file_parts = explode(".", $file);
//put together full path
$path = $uploadDir."/".$file;
//read data
$fp=fopen($path,"r");
$a_data=fread($fp,filesize($path));
fclose($fp);
//if data is good...
if ($a_data!=""){
echo "Attachment $i is good <br>\n";
$num_parts++;
//get name and type
$a_name=base64_decode($file_parts[1]);
$a_type=strtolower(base64_decode($file_parts[2]));
if ($a_type=="") $a_type="application/octet-stream";
//stick it in conent array
$part[$num_parts]["type"]="Content-Type: ".$a_type."; name=\"".$a_name."\"\n";
$part[$num_parts]["disposition"]="Content-Disposition: attachment; filename=\"".$a_name."\"\n";
$part[$num_parts]["encoding"]="Content-Transfer-Encoding: base64\n";
$part[$num_parts]["data"]=myWordWrap(base64_encode($a_data),76);
}
//delete file
unlink($path);
}
}
closedir($handle);
}
}
/**** Put together MIME message *****/
echo "Num parts: $num_parts <br>\n";
if ($num_parts==0){
$headerx.=$part[0]["type"];
if (!empty($part[0]["encoding"])) $headerx.=$part[0]["encoding"];
$body=$part[0]["data"];
}else{
$boundary="RWP_PART_".$loginID.time();
$headerx.="MIME-Version: 1.0 \n";
$headerx.="Content-Type: multipart/mixed; boundary=\"$boundary\"\n";
$body="This message is in MIME format.\n";
for ($i=0;$i<=$num_parts;$i++){
$body.="\n--".$boundary."\n";
if ($part[$i]["type"]!="") $body.=$part[$i]["type"];
if ($part[$i]["encoding"]!="") $body.=$part[$i]["encoding"];
if ($part[$i]["disposition"]!="") $body.=$part[$i]["disposition"];
$body.="\n";
$body.=$part[$i]["data"]."\n";
}
$body.="\n--".$boundary."--";
}
/**** Send message *****/
echo "Sending...<br>";
if (mail($to,$subject,$body,$headerx, "-f$from_addr")){
echo "Sent.<br>"; flush();
$error = "";
//save in send folder
$append_str="To: ".$to."\n".(!empty($subject)?"Subject: ".$subject:"")."\n".$headerx."\n\n".$body;
if ($my_prefs["save_sent"]==1){
$append_str="To: ".$to."\n"."Subject: ".$subject."\n".$headerx."\n\n".$body;
if (!iil_C_Append($conn, $my_prefs["sent_box_name"], $append_str)){
$error .= "Couldn't save in ".$my_prefs["sent_box_name"].":".$conn->error."<br>\n";
}else{
echo "Saved in ".$my_prefs["sent_box_name"]."<br>\n";
}
}
//echo nl2br($append_str);
//if replying, flag original message
if (isset($in_reply_to)) $reply_id = $in_reply_to;
else if (isset($forward_of)) $reply_id = $forward_of;
if (isset($reply_id)){
$pos = strrpos($reply_id, ":");
$reply_num = substr($reply_id, $pos+1);
$reply_folder = substr($reply_id, 0, $pos);
if (iil_C_Flag($conn, $reply_folder, $reply_num, "ANSWERED") < 1){
$error .= "Flagging failed:".$conn->error."<br>\n";
}
}
//update spam-prevention related records
include("../include/as_update.inc");
//close window
if ((empty($error))&&($my_prefs["closeAfterSend"]==1)){
echo "<p>Message successfully sent.";
echo "<script type=\"text/javascript\"><!--\nwindow.close();\n--></script>";
echo "<br><br>"; flush();
}else{
echo $error;
}
}else{
echo "<p><font color=\"red\">Send FAILED</font>";
}
iil_Close($conn);
exit;
}
iil_Close($conn);
}
}
/****
HANDLE UPLOADED FILE
****/
if (isset($upload)){
if (($userfile)&&($userfile!="none")){
$i=$attachments;
$newfile = base64_encode($userfile_name).".".base64_encode($userfile_type).".".base64_encode($userfile_size);
$newpath=$uploadDir."/".$user.".".$newfile;
if (!move_uploaded_file($userfile, $newpath)){
echo $userfile_name." : ".$composeErrors[3];
}
}else{
echo $composeErrors[4];
}
}
/****
FETCH LIST OF UPLOADED FILES
****/
if (is_dir($uploadDir)){
//open directory
if ($handle = opendir($uploadDir)) {
//loop through files
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
//split up file name
$file_parts = explode(".", $file);
//make sure first part is session ID, and add to list
if (strcmp($file_parts[0], $user)==0) $uploaded_files[] = $file;
}
}
closedir($handle);
}
}
/****
REPLYING OR FORWARDING
****/
if ((isset($replyto)) || (isset($forward))){
// if REPLY, or FORWARD
if ((isset($folder))&&(isset($id))){
include_once("../include/mime.inc");
$conn = iil_Connect($host, $loginID, $password, $AUTH_MODE);
$header=iil_C_FetchHeader($conn, $folder, $id);
$structure_str=iil_C_FetchStructureString($conn, $folder, $id);
$structure=iml_GetRawStructureArray($structure_str);
$subject=LangDecodeSubject($header->subject, $my_prefs["charset"]);
$lookfor=(isset($replyto)?"Re:":"Fwd:");
$pos = strpos ($subject, $lookfor);
if ($pos===false) {
$pos = strpos ($subject, strtoupper($lookfor));
if ($pos===false) {
$subject=$lookfor." ".$subject;
}
}
//get messageID
$replyto_messageID = $header->messageID;
//get "from";
$from = $header->from;
//replace to "reply-to" if specified
if ($replyto){
$to = $from;
if (!empty($header->replyto)) $to = $header->replyto;
}
if ($replyto_all){
if (!empty($header->to)) $to .= (empty($to)?"":", ").$header->to;
if (!empty($header->cc)) $cc .= (empty($cc)?"":", ").$header->cc;
}
//mime decode "to," "cc," and "from" fields
if (isset($to)){
$to_a = LangParseAddressList($to);
$to = "";
while ( list($k, $v) = each($to_a) ){
//remove user's own address from "to" list
if ((stristr($to_a[$k]["address"], $from_addr) === false) and
(stristr($to_a[$k]["address"], $loginID."@".$host) === false) and
(stristr($to_a[$k]["address"], $my_prefs["email_address"])===false)){
$to .= (empty($to)?"":", ")."\"".LangDecodeSubject($to_a[$k]["name"], $my_prefs["charset"])."\" <".$to_a[$k]["address"].">";
}
}
}
if (isset($cc)){
$cc_a = LangParseAddressList($cc);
$cc = "";
while ( list($k, $v) = each($cc_a) ){
//remove user's own address from "cc" list
if ((stristr($cc_a[$k]["address"], $from_addr) === false) and
(stristr($cc_a[$k]["address"], $loginID."@".$host) === false) and
(stristr($to_a[$k]["address"], $my_prefs["email_address"])===false)){
$cc .= (empty($cc)?"":", ")."\"".LangDecodeSubject($cc_a[$k]["name"], $my_prefs["charset"])."\" <".$cc_a[$k]["address"].">";
}
}
}
$from_a = LangParseAddressList($from);
$from = "\"".LangDecodeSubject($from_a[0]["name"], $my_prefs["charset"])."\" <".$from_a[0]["address"].">";
//format headers for reply/forward
if (isset($replyto)){
$message_head = $composeStrings[9];
$message_head = str_replace("%d", LangFormatDate($header->timestamp, $lang_datetime["prevyears"]), $message_head);
$message_head = str_replace("%s", $from, $message_head);
}else if (isset($forward)){
if ($show_header){
$message_head = iil_C_FetchPartHeader($conn, $folder, $id, 0);
}else{
$message_head = $composeStrings[10];
$message_head .= $composeHStrings[5].": ".ShowDate2($header->date,"","short")."\n";
$message_head .= $composeHStrings[1].": ". LangDecodeSubject($from, $my_prefs["charset"])."\n";
$message_head .= $composeHStrings[0].": ".LangDecodeSubject($header->subject, $my_prefs["charset"])."\n\n";
}
}
if (!empty($message_head)) $message_head = "\n".$message_head."\n";
//get message
if (!empty($part)) $part.=".1";
else{
$part = iml_GetFirstTextPart($structure, "");
}
$message=iil_C_FetchPartBody($conn, $folder, $id, $part);
if (empty($message)){
$part = 0;
$message = iil_C_FetchPartBody($conn, $folder, $id, $part);
}
//decode message if necessary
$encoding=iml_GetPartEncodingCode($structure, $part);
if ($encoding==3) $message = base64_decode($message);
else if ($encoding==4){
if ($encoding == 3 ) $message = base64_decode($message);
else if ($encoding == 4) $message = quoted_printable_decode($message);
//$message = str_replace("=\n", "\n", $message);
//$message = quoted_printable_decode(str_replace("=\r\n", "\n", $message));
}
//add quote marks
$message = str_replace("\r", "", $message);
$charset=iml_GetPartCharset($structure, $part);
$message=LangConvert($message, $my_prefs["charset"], $charset);
if (isset($replyto)) $message=">".str_replace("\n","\n>",$message);
$message = "\n".LangConvert($message_head, $my_prefs["charset"]).$message;
iil_Close($conn);
}
}
?>
<FORM ENCTYPE="multipart/form-data" ACTION="compose.php" METHOD=POST>
<input type="hidden" name="user" value="<?php echo $user?>">
<input type="hidden" name="show_contacts" value="<?php echo $show_contacts?>">
<input type="hidden" name="show_cc" value="<?php echo $show_cc?>">
<?php
if ($no_subject) echo '<input type="hidden" name="confirm_no_subject" value="1">';
if ($replyto){
$in_reply_to = $folder.":".$id;
echo "<input type=\"hidden\" name=\"in_reply_to\" value=\"$in_reply_to\">\n";
echo "<input type=\"hidden\" name=\"replyto_messageID\" value=\"$replyto_messageID\">\n";
}else if ($forward){
$forward_of = $folder.":".$id;
echo "<input type=\"hidden\" name=\"forward_of\" value=\"$forward_of\">\n";
}
?>
<table border="0" width="100%">
<tr>
<td valign="bottom" align="left">
<font size=+1><b><?php echo $composeStrings[0]; ?></b></font>
<font size="-1">[<a href="" onClick="window.close();"><?php echo $composeStrings[11]?></a>]</font>
</td>
<td valign="bottom" align="right">
</td>
</tr>
</table>
<?php
if (!empty($error)) echo '<br><font color="red">'.$error.'</font>';
?>
<p><?php echo $composeHStrings[0]?>:<input type=text name="subject" value="<?php echo htmlspecialchars(stripslashes($subject))?>" size="60">
<input type=submit name=send value="<?php echo $composeStrings[1]?>">
<?php
$to = htmlspecialchars($to);
$cc = htmlspecialchars($cc);
$bcc = htmlspecialchars($bcc);
// format sender's email address (i.e. "from" string)
$email_address = htmlspecialchars($original_from);
echo "<table>";
echo "<tr><td align=right>".$composeHStrings[1].":</td><td>".LangDecodeSubject($email_address, $my_prefs["charset"])."</td></tr>\n";
if (($show_contacts) || ($my_prefs["showContacts"])){
echo "<tr><td align=right valign=top>";
echo "<select name=\"to_a_field\">\n";
echo "<option value=\"to\">".$composeHStrings[2].":\n";
echo "<option value=\"cc\">".$composeHStrings[3].":\n";
echo "<option value=\"bcc\">".$composeHStrings[4].":\n";
echo "</select>\n";
echo"</td><td>";
// display "select" box with contacts
include("../include/read_contacts.inc");
if ((is_array($contacts)) && (count($contacts) > 0)){
echo "<select name=\"to_a[]\" MULTIPLE SIZE=5>\n";
while ( list($key, $foobar) = each($contacts) ){
$contact = $contacts[$key];
if (!empty($contact["email"])){
$line = "\"".$contact["name"]."\" <".$contact["email"].">";
echo "<option>".htmlspecialchars($line)."\n";
}
if (!empty($contact["email2"])){
$line = "\"".$contact["name"]."\" <".$contact["email2"].">";
echo "<option>".htmlspecialchars($line)."\n";
}
}
echo "</select>";
echo "<input type=\"submit\" name=\"add_contacts\" value=\"".$composeStrings[8]."\"><br>\n";
}
echo "</td></tr>\n";
$contacts_shown = true;
}else{
$contacts_shown = false;
}
// display to box
if (strlen($to) < 60)
echo "<tr><td align=right>".$composeHStrings[2].":</td><td><input type=text name=\"to\" value=\"".stripslashes($to)."\" size=60></td></tr>\n";
else
echo "<tr><td align=right>".$composeHStrings[2].":</td><td><textarea name=\"to\" cols=\"60\" rows=\"3\">".stripslashes($to)."</textarea></td></tr>\n";
if ((!empty($cc)) || ($my_prefs["showCC"]==1) || ($show_cc)){
// display cc box
if (strlen($cc) < 60)
echo "<tr><td align=right>".$composeHStrings[3].":</td><td><input type=text name=\"cc\" value=\"".stripslashes($cc)."\" size=60></td></tr>\n";
else
echo "<tr><td align=right>".$composeHStrings[3].":</td><td><textarea name=\"cc\" cols=\"60\" rows=\"3\">".stripslashes($cc)."</textarea></td></tr>\n";
$cc_field_shown = true;
}else{
$cc_field_shown = false;
}
if ((!empty($bcc)) || ($my_prefs["showCC"]==1) || ($show_cc)){
// display bcc box
if (strlen($bcc) < 60)
echo "<tr><td align=right>".$composeHStrings[4].":</td><td><input type=text name=\"bcc\" value=\"".stripslashes($bcc)."\" size=60></td></tr>\n";
else
echo "<tr><td align=right>".$composeHStrings[4].":</td><td><textarea name=\"bcc\" cols=\"60\" rows=\"3\">".stripslashes($bcc)."</textarea></td></tr>\n";
$bcc_field_shown = true;
}else{
$bcc_field_shown = false;
}
//show attachments
echo "<tr>";
echo "<td align=\"right\" valign=\"top\">".$composeStrings[4].":</td>";
echo "<td valign=\"top\">";
if ((is_array($uploaded_files)) && (count($uploaded_files)>0)){
echo "<table>";
reset($uploaded_files);
while ( list($k,$file) = each($uploaded_files) ){
$file_parts = explode(".", $file);
echo "<tr><td valign=\"bottom\"><input type=\"checkbox\" name=\"attach[$file]\" value=\"1\" ".($attach[$file]==1?"CHECKED":"")."></td>";
echo "<td valign=\"bottom\" bgcolor=\"".$my_colors["main_hilite"]."\">".base64_decode($file_parts[1])." </td>";
echo "<td valign=\"bottom\" bgcolor=\"".$my_colors["main_hilite"]."\" class=\"small\">".base64_decode($file_parts[3])."bytes </td>";
echo "<td valign=\"bottom\" bgcolor=\"".$my_colors["main_hilite"]."\" class=\"small\">(".base64_decode($file_parts[2]).")</td>";
echo "</td></tr>\n";
}
echo "</table>";
}
echo '<input type="hidden" name="MAX_FILE_SIZE" value="2000000">';
echo "<INPUT NAME=\"userfile\" TYPE=\"file\">";
echo '<INPUT TYPE="submit" NAME="upload" VALUE="'.$composeStrings[2].'">';
echo "</td></tr>\n";
echo "<tr><td></td><td>";
if (!$contacts_shown){
//"show contacts" button
echo "<input type=\"hidden\" name=\"new_show_contacts\" value=1>\n";
echo "<input type=\"submit\" name=\"change_contacts\" value=\"".$composeStrings[5]."\">\n";
}else{
//"hide contacts" button, if not specified in prefs
if ($my_prefs["showContacts"]!=1){
echo "<input type=\"hidden\" name=\"new_show_contacts\" value=0>\n";
echo "<input type=\"submit\" name=\"change_contacts\" value=\"".$composeStrings[6]."\">\n";
}
}
if ((!$cc_field_shown) || (!$bcc_field_shown)){
//"show cc/bcc field" button
include("../lang/".$my_prefs["lang"]."prefs.inc");
echo '<input type="hidden" name="new_show_cc" value="1">';
echo '<input type="submit" name="change_show_cc" value="'.$prefsStrings["6.2"].'">';
}else{
echo '<input type="hidden" name="new_show_cc" value="'.$show_cc.'">';
}
echo "</td></tr>\n";
echo "</table>";
?>
<br><?php echo $composeStrings[7]?><br>
<TEXTAREA NAME=message ROWS=20 COLS=77 WRAP=virtual><?php echo htmlspecialchars(stripslashes($message)); ?></TEXTAREA>
<br><input type=checkbox name="attach_sig" value=1 <?php echo ($my_prefs["show_sig1"]==1?"CHECKED":""); ?> ><?php echo $composeStrings[3]."\n"; ?>
<?php
?>
<input type="hidden" name="attachments" value="<?php echo $attachments; ?>">
</form>
<?php
?>
</BODY></HTML>
|