Ejemplo n.º 1
0
     $user = $user->load();
     $user->updateStatus($CFG->USER_STATUS_REPORTED);
 } else {
     $node = new CNode($id);
     $node = $node->load();
     $node->updateStatus($CFG->STATUS_SPAM);
     $type = $node->role->name;
 }
 auditSpamReport($USER->userid, $id, $type);
 //send email
 if ($CFG->send_mail) {
     $headpath = $HUB_FLM->getMailTemplatePath("emailhead.txt");
     $headtemp = loadFileToString($headpath);
     $head = vsprintf($headtemp, array($HUB_FLM->getImagePath('evidence-hub-logo-email.png')));
     $footpath = $HUB_FLM->getMailTemplatePath("emailfoot.txt");
     $foottemp = loadFileToString($footpath);
     $foot = vsprintf($foottemp, array());
     $message = "SERVER: " . $CFG->homeAddress . "<br>";
     $message .= "TYPE: " . $type . "<br>";
     $message .= "ID: " . $id;
     if ($USER->userid) {
         $message .= "<br>Reported By: " . $USER->name . " (" . $USER->userid . ")";
     }
     $message = $head . "<br><br>" . $message . "<br><br>" . $foot;
     $recipient = $CFG->SPAM_ALERT_RECIPIENT;
     $subject = "Spam Report";
     $headers = "Content-type: text/html; charset=utf-8\r\n";
     ini_set("sendmail_from", $CFG->EMAIL_FROM_ADDRESS);
     $headers .= "From: " . $CFG->EMAIL_FROM_NAME . " <" . $CFG->EMAIL_FROM_ADDRESS . ">\r\n";
     $headers .= "Reply-To: " . $CFG->EMAIL_REPLY_TO . "\r\n";
     mail($recipient, $subject, $message, $headers);
Ejemplo n.º 2
0
/**
 * Sends an email of the specified template
 *
 * @param string $email
 * @return boolean
 */
function sendMailMessage($subject, $to, $message)
{
    global $CFG, $HUB_FLM;
    if ($CFG->send_mail) {
        //get emailhead and foot
        $headpath = $HUB_FLM->getMailTemplatePath("emailhead.txt");
        $headtemp = loadFileToString($headpath);
        $head = vsprintf($headtemp, array($HUB_FLM->getImagePath('evidence-hub-logo-email.png')));
        $footpath = $HUB_FLM->getMailTemplatePath("emailfoot.txt");
        $foottemp = loadFileToString($footpath);
        $foot = vsprintf($foottemp, array($CFG->homeAddress));
        $message = $head . $message . $foot;
        $headers = "Content-type: text/html; charset=utf-8\r\n";
        ini_set("sendmail_from", $CFG->EMAIL_FROM_ADDRESS);
        $headers .= "From: " . $CFG->EMAIL_FROM_NAME . " <" . $CFG->EMAIL_FROM_ADDRESS . ">\r\n";
        $headers .= "Reply-To: " . $CFG->EMAIL_REPLY_TO . "\r\n";
        mail($to, $subject, $message, $headers);
    }
}