$subject = http_post_string("subject", array("len" => 250, "valid" => "[ALL]")); $body = http_post_string("body", array("len" => 64000, "valid" => "[ALL]")); $in_reply_to = http_post_string("in_reply_to", array("required" => false, "len" => 250, "valid" => "[a-z][A-Z][0-9]-_.@+-")); send_web_mail($to, $subject, $body, $in_reply_to); header("Location: /mail/"); die; } $to = http_get_string("to", array("required" => false, "len" => 250, "valid" => "[a-z][A-Z][0-9]-_.<>@+ ")); $mid = http_get_int("mid", array("required" => false)); if ($mid > 0) { $message = db_get_rec("mail", $mid); $in_reply_to = $message["message_id"]; $to = $message["mail_from"]; $subject = $message["subject"]; if (substr($subject, 0, 4) != "Re: ") { $subject = "Re: {$subject}"; } } else { $in_reply_to = ""; $subject = ""; } print_header("Mail", array("Inbox"), array("inbox"), array("/mail/")); writeln('<form method="post">'); writeln('<input name="in_reply_to" type="hidden" value="' . $in_reply_to . '"/>'); beg_tab(); print_row(array("caption" => "To", "text_key" => "to", "text_value" => $to)); print_row(array("caption" => "Subject", "text_key" => "subject", "text_value" => $subject)); print_row(array("caption" => "Body", "textarea_key" => "body", "textarea_height" => 500)); end_tab(); right_box("Send"); writeln('</form>');
// Pipecode is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Pipecode. If not, see <http://www.gnu.org/licenses/>. // print_header("Create Poll"); writeln('<table class="fill">'); writeln('<tr>'); writeln('<td class="left_col">'); print_left_bar("main", "poll"); writeln('</td>'); writeln('<td class="fill">'); writeln('<h1>Create Poll</h1>'); beg_tab("Question"); print_row(array("caption" => "Text", "text_key" => "question")); print_row(array("caption" => "Type", "option_key" => "hide_threshold", "option_keys" => array(0, 1), "option_list" => array("Multiple Choice", "Approval Voting"))); end_tab(); beg_tab("Answers", array("colspan" => 2)); writeln(' <tr>'); writeln(' <td><input type="text"/></td>'); writeln(' <td style="text-align: right"><a href="delete" class="icon_16" style="background-image: url(/images/remove-16.png)">Remove</a></td>'); writeln(' </tr>'); end_tab(); writeln('<div class="right"><a href="add" class="icon_16" style="background-image: url(/images/add-16.png)">Add</a></div>'); writeln(' </td>'); writeln(' </tr>'); writeln('</table>'); print_footer();
function print_mail_dir($location) { global $auth_zid; print_header($location, array("Compose"), array("mail-compose"), array("/mail/compose")); writeln('<table class="fill">'); writeln('<tr>'); writeln('<td style="vertical-align: top">'); beg_tab(); writeln(' <tr>'); writeln(' <td><a href="/mail/" class="icon_16" style="background-image: url(/images/inbox-16.png)">Inbox</a></td>'); writeln(' </tr>'); writeln(' <tr>'); writeln(' <td><a href="/mail/sent" class="icon_16" style="background-image: url(/images/sent-16.png)">Sent</a></td>'); writeln(' </tr>'); writeln(' <tr>'); writeln(' <td><a href="/mail/junk" class="icon_16" style="background-image: url(/images/junk-16.png)">Junk</a></td>'); writeln(' </tr>'); writeln(' <tr>'); writeln(' <td><a href="/mail/trash" class="icon_16" style="background-image: url(/images/trash-16.png)">Trash</a></td>'); writeln(' </tr>'); end_tab(); writeln('</td>'); writeln('<td class="fill" style="padding-left: 8px">'); beg_tab(); $list = db_get_list("mail", "received_time", array("zid" => $auth_zid, "location" => $location)); $keys = array_keys($list); if (count($list) == 0) { writeln('<tr><td>(no messages)</td></tr>'); } for ($i = 0; $i < count($list); $i++) { $message = $list[$keys[$i]]; if ($location == "Sent") { $address = parse_mail_address($message["rcpt_to"]); } else { $address = parse_mail_address($message["mail_from"]); } if ($message["subject"] == "") { $subject = "(no subject)"; } else { $subject = $message["subject"]; } writeln(' <tr>'); writeln(' <td><a href="view?mid=' . $message["mail_id"] . '" class="icon_16" style="background-image: url(/images/mail-16.png)">' . $message["subject"] . '</a></td>'); if (string_has($address["email"], "no-reply@")) { writeln(' <td class="center">' . $address["email"] . '</td>'); } else { writeln(' <td class="center"><a href="compose?to=' . $address["email"] . '">' . $address["email"] . '</a></td>'); } writeln(' <td class="right">' . date("Y-m-d H:i", $message["received_time"]) . '</td>'); writeln(' </tr>'); } end_tab(); writeln('</td>'); writeln('</tr>'); writeln('</table>'); if (count($list) > 0) { writeln('<form method="post">'); if ($location == "Junk" || $location == "Trash") { right_box("Empty"); } else { right_box("Delete All"); } writeln('</form>'); } print_footer(); }
writeln('</td>'); writeln('<td class="fill">'); writeln('<h1>Settings</h1>'); writeln('<form method="post">'); beg_tab("JavaScript"); print_row(array("caption" => "Enable JavaScript", "check_key" => "javascript_enabled", "checked" => $user_conf["javascript_enabled"])); end_tab(); beg_tab("Date and Time"); print_row(array("caption" => "Time Zone", "option_key" => "time_zone", "option_list" => $zones, "option_value" => $user_conf["time_zone"])); end_tab(); beg_tab("Comments"); $scores = array("-1", "0", "1", "2", "3", "4", "5"); print_row(array("caption" => "Hide Threshold", "option_key" => "hide_threshold", "option_list" => $scores, "option_value" => $user_conf["hide_threshold"])); print_row(array("caption" => "Expand Threshold", "option_key" => "expand_threshold", "option_list" => $scores, "option_value" => $user_conf["expand_threshold"])); end_tab(); beg_tab("Mailing List"); print_row(array("caption" => "Subscribe to Mailing List (list@{$server_name})", "check_key" => "list_enabled", "checked" => $user_conf["list_enabled"])); print_row(array("caption" => "Real Name", "text_key" => "real_name", "text_value" => $user_conf["real_name"])); end_tab(); // // Eastern: America/New_York // Central: America/Chicago // Mountain: America/Denver // Pacific: America/Los_Angeles // British Summer Time: London // Central Europe Time: Paris // Eastern Europe Time: Athens // right_box("Save"); writeln('</form>'); writeln('</td>');