Beispiel #1
0
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/php/init.php";
Security::demand(USER, null, false);
$smarty = new PopSmarty();
$mid = Security::escape($_GET['id']);
$do = Security::escape($_GET['do']);
$medlem_to_send = Medlem::loadById($mid);
$smarty->assign("medlem_to_send", $medlem_to_send);
$smarty->assign("mid", $mid);
if ($do == 'send') {
    $smarty->assign("is_replay", false);
    if (isset($_GET['re'])) {
        $id = Security::escape($_GET['re']);
        $mail_to_read = MotiomeraMail::loadById($id);
        $smarty->assign("is_replay", true);
        $text_message_decoded = str_replace("<br>", "", $mail_to_read->getMsg());
        $text_message_decoded = str_replace("<br />", "", $mail_to_read->getMsg());
        $text_message = "\n\n********************\n";
        $text_message .= $text_message_decoded;
        $smarty->assign("text_message", $text_message);
        $smarty->assign("mail_to_read", $mail_to_read);
    }
    $action = "send";
} else {
    if ($do == 'sent') {
        $action = "sent";
    }
}
$smarty->assign("action", $action);
$smarty->display('send_mail.tpl');
Beispiel #2
0
    if (MedlemsBlockering::verifyBlocked($USER->getId(), $mid)) {
        echo 'blockerad_user';
        die;
        //throw new MedlemsBlockeringException("Kan ej skicka mail till medlemmen, medlemmen har spärrat dig.", 6);
    }
    if (MedlemsBlockering::verifyBlocked($mid, $USER->getId())) {
        echo 'blockerad_target';
        die;
        //throw new MedlemsBlockeringException("Kan ej skicka mail till medlemmen, du har spärrat medlemmen.", 5);
    }
    if ($send_to_Obj->getMotiomeraMailBlock() == 'true' && !$send_to_Obj->inAdressbok($USER)) {
        /** If user blocks mails from none friends */
        echo 'targetBlockMail';
        die;
    }
    if (!$send_to_Obj->synlig()) {
        echo 'blockedByProfile';
        die;
    }
    //åtkomst - ingen, foretag, adressbok (kom ihåg adminanvändare)
    new MotiomeraMail($amne, $msg, $sent_from, $send_to, $date, 0, 0, $allow_links);
    if (isset($_POST['rmid']) && !empty($_POST['rmid'])) {
        $reply_to = Security::escape($_POST['rmid']);
        $replyToMail = MotiomeraMail::loadById($reply_to);
        $replyToMail->setIsAnswered(1);
        $replyToMail->commit();
    }
    echo 'ok';
    //header("Location: /pages/mail.php?do=sent&mid=" . $send_to);
    //header("Location: /popup/pages/send_mail.php?do=sent&mid=" . $send_to);
}
Beispiel #3
0
 public static function removeMail($mail_id, $remover_id, $remover)
 {
     global $db;
     Security::demand(USER);
     $t = MotiomeraMail::loadById($mail_id);
     if ($remover == "to_deleted") {
         $t->setIsRead(1);
         $t->setToDeleted(1);
     } else {
         $t->setFromDeleted(1);
     }
     if ($t->getToDeleted() == 1 && $t->getFromDeleted() == 1) {
         $t->delete();
     }
     $t->commit();
 }
Beispiel #4
0
<?php

include $_SERVER["DOCUMENT_ROOT"] . "/php/init.php";
Security::demand(USER);
$folder_id = Security::escape($_GET['folder_id']);
$move_to = Security::escape($_GET['move_to']);
$nrofmails = Security::escape($_GET['nrofmails']);
if ($nrofmails > 0) {
    for ($i = 0; $i < $nrofmails; $i++) {
        $getvar = 'mail_id_' . $i;
        $mail_id = Security::escape($_GET[$getvar]);
        $motiomeraMail = MotiomeraMail::loadById($mail_id);
        $motiomeraMail->setToInFolder($move_to);
    }
}
header("Location: /pages/mail.php?do=inbox&folder_id=" . $folder_id);