$subj = $spell && !$no_spell_subject && $text_s ? check_data_spell($text_s, 'subject', $usr->pspell_lang) : $text_s; $signature = $FUD_OPT_1 & 32768 && $usr->sig && $msg_show_sig ? '<p><u> </u><br />' . $usr->sig . '' : ''; $apply_spell_changes = $spell ? '<input type="submit" class="button" name="btn_spell" value="Apply Spelling Changes"> ' : ''; $preview_message = '<div align="center"><table border="0" cellspacing="1" cellpadding="2" class="PreviewTable"> <tr><th colspan=2>Post Preview</th></tr> <tr><td class="RowStyleA"><font class="MsgSubText">' . $subj . '</font></td></tr> <tr><td class="RowStyleA"><font class="MsgBodyText">' . $text . $signature . '</font></td></tr> <tr><td align="left" class="RowStyleB">' . $apply_spell_changes . '<input type="submit" class="button" name="btn_submit" value="Send" tabindex="5" onClick="javascript: document.post_form.btn_action.value=\'send\';"> <input type="submit" tabindex="4" class="button" value="Preview Message" name="preview"> ' . $spell_check_button . '<input type="submit" class="button" name="btn_draft" value="Save Draft" onClick="javascript: document.post_form.btn_action.value=\'draft\';"></td></tr> </table></div><br />'; } else { $preview_message = ''; } $post_error = is_post_error() ? '<h4 align="center"><font class="ErrorText">You have an error</font></h4>' : ''; $to_err = get_err('msg_to_list'); $msg_subect_err = get_err('msg_subject'); $message_err = get_err('msg_body', 1); $post_smilies = $FUD_OPT_1 & 8192 ? draw_post_smiley_cntrl() : ''; $post_icons = draw_post_icons($msg_icon); $fud_code_icons = $FUD_OPT_1 & 4096 ? '<tr class="RowStyleA"><td nowrap class="GenText">Formatting Tools:</td><td> <table border=0 cellspacing=0 cellpadding=0> <tr><td> <table border=0 cellspacing=1 cellpadding=2 class="FormattingToolsBG"> <tr> <td class="FormattingToolsCLR"><a href="javascript: insertTag(document.post_form.msg_body, \'[B]\', \'[/B]\');"><img alt="" src="/egroupware/fudforum/3814588639/theme/default/images/b_bold.gif" /></a></td> <td class="FormattingToolsCLR"><a href="javascript: insertTag(document.post_form.msg_body, \'[I]\', \'[/I]\');"><img alt="" src="/egroupware/fudforum/3814588639/theme/default/images/b_italic.gif" /></a></td> <td class="FormattingToolsCLR"><a href="javascript: insertTag(document.post_form.msg_body, \'[U]\', \'[/U]\');"><img alt="" src="/egroupware/fudforum/3814588639/theme/default/images/b_underline.gif" /></a></td> <td class="FormattingToolsCLR"><a href="javascript: insertTag(document.post_form.msg_body, \'[ALIGN=left]\', \'[/ALIGN]\');"><img alt="" src="/egroupware/fudforum/3814588639/theme/default/images/b_aleft.gif" /></a></td> <td class="FormattingToolsCLR"><a href="javascript: insertTag(document.post_form.msg_body, \'[ALIGN=center]\', \'[/ALIGN]\');"><img alt="" src="/egroupware/fudforum/3814588639/theme/default/images/b_acenter.gif" /></a></td> <td class="FormattingToolsCLR"><a href="javascript: insertTag(document.post_form.msg_body, \'[ALIGN=right]\', \'[/ALIGN]\');"><img alt="" src="/egroupware/fudforum/3814588639/theme/default/images/b_aright.gif" /></a></td> <td class="FormattingToolsCLR"><a href="javascript: url_insert();"><img alt="" src="/egroupware/fudforum/3814588639/theme/default/images/b_url.gif" /></a></td> <td class="FormattingToolsCLR"><a href="javascript: email_insert();"><img alt="" src="/egroupware/fudforum/3814588639/theme/default/images/b_email.gif" /></a></td>
if (isset($_POST['posted']) && _uid && !check_femail_form()) { $to = empty($POST['fname']) ? $_POST['femail'] : $_POST['fname'] . ' <' . $_POST['femail'] . '>'; $from = $usr->alias . '<' . $usr->email . '>'; send_email($from, $to, $_POST['subj'], $_POST['body']); error_dialog('Email was sent', 'The email to your friend at ' . htmlspecialchars($_POST['femail']) . ' about the ' . $data->subject . ' topic was successfully sent.'); } else { if (!isset($_POST['posted'])) { $def_thread_view = $FUD_OPT_2 & 4 ? 'msg' : 'tree'; } } $remail_error = is_post_error() ? '<h4 align="center"><font class="ErrorText">You have an error</font></h4>' : ''; $body = isset($_POST['body']) ? htmlspecialchars($_POST['body']) : 'Hello,\\n\\nThere is an interesting topic about "' . $data->subject . '" on ' . $GLOBALS['FORUM_TITLE'] . ' forum that you may to want read. You can see the topic at:\\n /egroupware/fudforum/3814588639/index.php?t=' . $def_thread_view . '&th=' . $data->id . '&rid=' . _uid . '\\n\\n Your friend,\\n\\n' . $usr->alias . '\\n'; if (_uid) { $femail_error = get_err('femail'); $subject_error = get_err('subj'); $body_error = get_err('body'); $fname = isset($_POST['fname']) ? $_POST['fname'] : ''; $femail = isset($_POST['femail']) ? $_POST['femail'] : ''; $subject = isset($_POST['subject']) ? htmlspecialchars($_POST['subject']) : $data->subject; $form_data = '<tr class="' . alt_var('page_alt', 'RowStyleA', 'RowStyleB') . '"><td class="GenText" nowrap>Your Name:</td><td width="100%">' . $usr->alias . '</td></tr> <tr class="' . alt_var('page_alt', 'RowStyleA', 'RowStyleB') . '"><td class="GenText" nowrap>Your Email:</td><td width="100%">' . $usr->email . '</td></tr> <tr class="' . alt_var('page_alt', 'RowStyleA', 'RowStyleB') . '"><td class="GenText" nowrap>Friend's Name:</td><td width="100%"><input type="text" name="fname" value="' . htmlspecialchars($fname) . '"></td></tr> <tr class="' . alt_var('page_alt', 'RowStyleA', 'RowStyleB') . '"><td class="GenText" valign="top" nowrap><font class="SmallText">Friend's Email:<br /><i>required</i></font></td><td valign="top"><input type="text" name="femail" value="' . htmlspecialchars($femail) . '">' . $femail_error . '</td></tr> <tr class="' . alt_var('page_alt', 'RowStyleA', 'RowStyleB') . '"><td class="GenText" valign="top" nowrap><font class="SmallText">Subject:<br /><i>required</i></font></td><td nowrap valign="top"><input type="text" name="subj" value="' . $subject . '">' . $subject_error . '</td></tr> <tr class="' . alt_var('page_alt', 'RowStyleA', 'RowStyleB') . '"><td class="GenText" valign="top" nowrap>Message:<font class="SmallText"><br /><i>required</i></font></td><td valign="top" nowrap><textarea name="body" rows="19" cols="78" wrap="PHYSICAL">' . $body . '</textarea>' . $body_error . '</td></tr> <tr class="' . alt_var('page_alt', 'RowStyleA', 'RowStyleB') . '"><td class="GenText" colspan=2 align="right"><input type="submit" class="button" name="submit" value="Send Email Now"></td></tr>'; } else { $form_data = '<tr class="' . alt_var('page_alt', 'RowStyleA', 'RowStyleB') . '"><td class="GenText" align="center"><font class="SmallText">Copy this message into a mail client of your choice to send it to your friend(s).</font></td></tr> <tr class="' . alt_var('page_alt', 'RowStyleA', 'RowStyleB') . '"><td class="GenText"><textarea name="body" rows="19" cols="78">' . $body . '</textarea></td></tr> <tr class="' . alt_var('page_alt', 'RowStyleA', 'RowStyleB') . '"><td class="GenText" align="right"><input type="submit" class="button" name="done" value="Done"></td></tr>'; }
if (isset($_POST['btn_submit']) && !mail_check()) { if (!($email = q_singleval("SELECT email FROM phpgw_fud_users WHERE alias='" . addslashes(htmlspecialchars($_POST['tx_name'])) . "' AND (users_opt & 16) > 0"))) { error_dialog('ERROR: Unable to email', 'Sorry, the system was unable to email ' . htmlspecialchars($_POST['tx_name']) . ' because it was unable to locate his email address'); } send_email($usr->email, $email, $_POST['tx_subject'], $_POST['tx_body'], 'Reply-To: ' . $usr->email); check_return($usr->returnto); } } $tx_name = isset($_POST['tx_name']) ? $_POST['tx_name'] : ''; $tx_body = isset($_POST['tx_body']) ? $_POST['tx_body'] : ''; $tx_subject = isset($_POST['tx_subject']) ? $_POST['tx_subject'] : ''; /* start page */ $TITLE_EXTRA = ': Email Form'; $name_err = get_err('tx_name'); $sub_err = get_err('tx_subject'); $body_err = get_err('tx_body'); $destination = '<tr class="RowStyleB"><td nowrap class="GenText">To: ' . $name_err . '</td><td width="100%" class="RowStyleA"><input type="text" name="tx_name" value="' . htmlspecialchars($tx_name) . '"></td></tr>'; if ($FUD_OPT_2 & 2) { $page_gen_end = gettimeofday(); $page_gen_time = sprintf('%.5f', $page_gen_end['sec'] - $PAGE_TIME['sec'] + ($page_gen_end['usec'] - $PAGE_TIME['usec']) / 1000000); $page_stats = '<br /><div align="left" class="SmallText">Total time taken to generate the page: ' . $page_gen_time . ' seconds</div>'; } else { $page_stats = ''; } echo $GLOBALS['fud_egw_hdr']; ?> <table width="100%" border="0" cellspacing="3" cellpadding="5"><tr><td class="ForumBackground"> <form method="post" action="/egroupware/fudforum/3814588639/index.php?t=email"> <table border="0" cellspacing="1" cellpadding="2" class="ContentTable"> <tr><th colspan=2>Email</th></tr> <?php
protected function getNotFound() { return get_err('The Entity you where looking for could either not be found or you don´t have the required permissions to view it.'); }