Ejemplo n.º 1
0
function rescue_item($user_id, $mail_id, $resend = false)
{
    global $dbh, $logger;
    $sth = $dbh->prepare("SELECT sender_email, contents, " . "envelope_to, maia_mail_recipients.type " . "FROM maia_mail, maia_mail_recipients " . "WHERE maia_mail.id = maia_mail_recipients.mail_id " . "AND maia_mail_recipients.recipient_id = ? " . "AND maia_mail_recipients.mail_id = ?");
    $res = $sth->execute(array($user_id, $mail_id));
    if (PEAR::isError($sth)) {
        die($sth->getMessage());
    }
    if ($row = $res->fetchrow()) {
        $sender_email = $row["sender_email"];
        $body = $row["contents"];
        $type = $row["type"];
        if (extension_loaded('mcrypt')) {
            if (text_is_encrypted($body)) {
                $key = get_encryption_key();
                $body = decrypt_text($key, $body);
            }
        }
        if (is_a_domain_default_user($user_id)) {
            // System default user (@.) or domain-class user (e.g. @domain)
            $my_email_address = $row["envelope_to"];
        } else {
            // Regular user (e.g. user@domain)
            $rlist = explode(" ", trim($row["envelope_to"]));
            $sth2 = $dbh->prepare("SELECT email FROM users " . "WHERE maia_user_id = ? " . "AND email = ?");
            $my_email_address = "";
            foreach ($rlist as $rmail) {
                $res2 = $sth2->execute(array($user_id, $rmail));
                if (PEAR::isError($sth2)) {
                    die($sth2->getMessage());
                }
                if ($row2 = $res2->fetchrow()) {
                    $my_email_address = $row2["email"];
                    break;
                }
            }
            $sth2->free();
        }
        if (!empty($my_email_address)) {
            if ($resend || $type != 'P') {
                // don't send if it is a labeled fp
                $smtp_result = smtp_send($sender_email, $my_email_address, $body);
            } else {
                $smtp_result = "200 no delivery needed";
            }
            if (($succeeded = strncmp($smtp_result, "2", 1) == 0) || $type == 'P') {
                if (!$resend) {
                    if ($type == 'S' || $type == 'P') {
                        record_mail_stats($user_id, $mail_id, "fp");
                        if (get_user_value($user_id, "auto_whitelist") == "Y") {
                            add_address_to_wb_list($user_id, $sender_email, "W");
                        }
                    }
                    set_item_confirmations('G', $user_id, $mail_id);
                }
            } else {
                $logger->err("rescue attempt failed! " . $smtp_result);
            }
        } else {
            $smtp_result = $lang['text_rescue_error'] . "(EmptyAddress)";
            // code really shouldn't be here.
        }
    } else {
        $smtp_result = $lang['text_rescue_error'] . "(MessageNotFound)";
        // code really shouldn't be here.
    }
    $sth->free();
    $logger->info($smtp_result);
    return $smtp_result;
}
Ejemplo n.º 2
0
 if ($row["DOB"] !== '//') {
     $pdf->SetXY(33, 55.3);
     $pdf->Write(10, decrypt_text($row["DOB"], $key1, $key2));
 }
 if ('M' == $row["GENDER"]) {
     //Gender: Male
     $pdf->SetXY(82.3, 55);
     $pdf->Write(10, 'x');
 } else {
     //Gender: Female
     $pdf->SetXY(100.7, 55);
     $pdf->Write(10, 'x');
 }
 //SSN
 $pdf->SetXY(136, 55.3);
 $pdf->Write(10, decrypt_text($row["SSN"], $key1, $key2));
 //Student
 //if ('Y' == $row["STUDENT"]){
 $pdf->SetXY(102.5, 61.5);
 $pdf->Write(10, 'x');
 //}
 //Employer
 $pdf->SetXY(28, 61.5);
 $pdf->Write(10, $row["EMPLOYER"]);
 //Employer address
 if (strlen($row["EMPLOYER_ADDRESS"]) < 30) {
     $pdf->SetXY(43, 68);
     $pdf->Write(10, $row["EMPLOYER_ADDRESS"]);
 } else {
     $pdf->SetFont('Arial', '', 10);
     $pdf->SetXY(43, 68);
Ejemplo n.º 3
0
// Decoding is provided for common formats:
//
//    base64
//    quoted-printable
//    8bit
//    7bit
//
$sth = $dbh->prepare("SELECT maia_mail.contents, maia_mail.sender_email " . "FROM maia_mail, maia_mail_recipients " . "WHERE maia_mail.id = maia_mail_recipients.mail_id " . "AND maia_mail.id = ? " . "AND maia_mail_recipients.recipient_id = ?");
$res = $sth->execute(array($id, $euid));
if ($row = $res->fetchrow()) {
    $contents = $row["contents"];
    $sender_email = $row['sender_email'];
    if (extension_loaded('mcrypt')) {
        if (text_is_encrypted($contents)) {
            $key = get_encryption_key();
            $contents = decrypt_text($key, $contents);
        }
    }
    $smarty->assign("spamreport_rows", display_spam_report($id));
    if (!$raw) {
        // Try to decode the mail and display all of its parts.
        $mail = new Mail_mimeDecode(get_magic_quotes_gpc() ? stripslashes($contents) : $contents);
        $args['include_bodies'] = true;
        $args['decode_bodies'] = true;
        $args['decode_headers'] = false;
        // the inconv decoding will handle the headers
        $structure = $mail->decode($args);
        $smarty->assign("message", display_parts($structure));
        $headers = $structure->headers;
        foreach ($headers as $key => $value) {
            if (is_array($value)) {
Ejemplo n.º 4
0
<?php

/*****
 *Database middle man by Leon Blakey
 ******/
include 'Crypto.php';
include 'DBCred.php';
$raw_get = decrypt_text($_GET['edata']);
mb_parse_str($raw_get, $_GET);
if (isset($_POST['edata'])) {
    $raw_post = decrypt_text($_POST['edata']);
    mb_parse_str($raw_post, $_POST);
}
if (!isset($_GET['mode'])) {
    die('No mode specified or not found');
}
function send($string)
{
    encrypt_text($string);
}
$MODE = $_GET['mode'];
switch ($MODE) {
    //Is this trying to see if the user is in gamers club?
    case "userExists":
        $user = mysql_real_escape_string($_GET['user']);
        $query = mysql_query("SELECT * FROM users WHERE `username`='{$user}'") or die("MYSQL ERROR: " + mysql_error());
        $numRows = mysql_num_rows($query);
        $result = mysql_fetch_assoc($query);
        if ($numRows == 0) {
            //user dosen't exist, return false
            die(encrypt_text("false"));
Ejemplo n.º 5
0
     //Auto
     $pdf->SetXY(38.5, 206.5);
     $pdf->Write(10, 'X');
 } elseif ($row["NEED_TREATMENT_FOR"] == 'Accident') {
     //Accident
     $pdf->SetXY(64, 206.5);
     $pdf->Write(10, 'X');
 }
 //Date of Injury
 if ($row["DATE_OF_INJURY"] !== '//') {
     $pdf->SetXY(37, 197);
     $pdf->Write(10, $row["DATE_OF_INJURY"]);
 }
 //Claim Number
 $pdf->SetXY(37, 202);
 $pdf->Write(10, decrypt_text($row["CLAIM_NUMBER"], $key1, $key2));
 //Emergency Contact
 $pdf->SetXY(52, 215.5);
 $pdf->Write(10, $row["EMERGENCY_CONTACT_FIRST"] . " " . $row["EMERGENCY_CONTACT_LAST"]);
 //Emergency Contact Phone Number
 if (strlen($row["EMERGENCY_CONTACT_PHONE"]) > 4) {
     $pdf->SetXY(155, 215.5);
     $pdf->Write(10, $row["EMERGENCY_CONTACT_PHONE"]);
 }
 //Signature
 $pdf->SetFont('Helvetica', '', 12);
 $pdf->SetXY(32, 248);
 $pdf->Write(10, $row["SIGNATURE"]);
 //Today's Date
 $pdf->SetXY(165, 248);
 $pdf->Write(10, $row["TODAY_DATE"]);
Ejemplo n.º 6
0
 //Father's address
 $pdf->SetXY(135, 142);
 $pdf->Write(10, $row["FATHER_ADDRESS"]);
 //Father's city
 $pdf->SetXY(19, 148.5);
 $pdf->Write(10, $row["FATHER_CITY"]);
 //Father's State
 $pdf->SetXY(108, 148.5);
 $pdf->Write(10, $row["FATHER_STATE"]);
 //Father's zip
 $pdf->SetXY(135, 148.5);
 $pdf->Write(10, $row["FATHER_ZIP"]);
 //Father's DOB
 if (decrypt_text($row["FATHER_DOB"], $key1, $key2) !== '//') {
     $pdf->SetXY(175, 148.5);
     $pdf->Write(10, decrypt_text($row["FATHER_DOB"], $key1, $key2));
 }
 //Father's employer
 if (strlen($row["FATHER_EMPLOYER"]) < 35) {
     $pdf->SetXY(28, 155);
     $pdf->Write(10, $row["FATHER_EMPLOYER"]);
 } else {
     $pdf->SetFont('Arial', '', 10);
     $pdf->SetXY(28, 155);
     $pdf->Write(10, $row["FATHER_EMPLOYER"]);
 }
 //Father's employer address
 $pdf->SetFont('Arial', '', 12);
 $pdf->SetXY(119, 155);
 $pdf->Write(10, $row["FATHER_EMPLOYER_ADDRESS"]);
 //Father's employer city