예제 #1
0
#
# $Id: compose.php,v 1.5 2005/02/19 00:32:34 filetreefrog Exp $
##################################################
if (!defined("PATHOS")) {
    exit("");
}
if ($user) {
    $msg = null;
    if (isset($_GET['recipient'])) {
        $msg->recipient = $_GET['recipient'];
    }
    if (isset($_GET['replyto'])) {
        $orig = $db->selectObject("privatemessage", "id=" . $_GET['replyto']);
        $msg->recipient = $orig->from_id;
        $msg->subject = "Re: " . $orig->subject;
        $msg->body = "";
    } else {
        if (isset($_GET['subject'])) {
            $msg->subject = $_GET['subject'];
        }
        if (isset($_GET['body'])) {
            $msg->body = $_GET['body'];
        }
    }
    $form = privatemessage::form($msg);
    $form->meta("module", "inboxmodule");
    $form->meta("action", "send");
    $template = new template("inboxmodule", "_form_compose", $loc);
    $template->assign("form_html", $form->toHTML());
    $template->output();
}
예제 #2
0
             }
         } else {
             $list = $db->selectObject('inbox_contactlist', 'id=' . $gid);
             if ($list->owner == $user->id) {
                 foreach ($db->selectObjects('inbox_contactlist_member', 'list_id=' . $list->id) as $m) {
                     if (!in_array($u->id, $banned)) {
                         $recipients[] = $m->user_id;
                     }
                 }
             }
         }
     }
 }
 // remove duplicates
 $recipients = array_flip(array_flip($recipients));
 $message = privatemessage::update($_POST, null);
 if (trim($message->subject) == '') {
     $post = $_POST;
     unset($post['subject']);
     $post['_formError'] = $i18n['err_no_subject'];
     $post['recipients'] = $recipients;
     $post['group_recipients'] = $gr;
     exponent_sessions_set('last_POST', $post);
     header('Location: ' . $_SERVER['HTTP_REFERER']);
     exit;
 }
 if (count($recipients) == 0) {
     $post = $_POST;
     $post['_formError'] = $i18n['err_no_recipients'];
     $post['recipients'] = $recipients;
     $post['group_recipients'] = $gr;