Пример #1
0
function globalErrorHandler($errno, $errstr, $errfile, $errline)
{
    switch ($errno) {
        case E_NOTICE:
        case E_USER_NOTICE:
            $errors = "Notice";
            break;
        case E_WARNING:
        case E_USER_WARNING:
            $errors = "Warning";
            break;
        case E_ERROR:
        case E_USER_ERROR:
            $errors = "Fatal Error";
            break;
        default:
            $errors = "Unknown Error";
            break;
    }
    error_log(sprintf("PHP %s:  %s in %s on line %d", $errors, $errstr, $errfile, $errline));
    $msg = "ERROR: [{$errno}] {$errstr}\r\n" . "{$errors} on line {$errline} in file {$errfile}\r\n";
    sendErrorEmail($msg);
    showErrorPage();
    exit(1);
}
Пример #2
0
function updateRegistration($conn, $transaction_results)
{
    $gamertag = trim($_SESSION['portal_form']['gamertag']);
    $melee_singles = is_null($_SESSION['portal_form']['melee_singles']) ? 0 : 1;
    $melee_doubles = is_null($_SESSION['portal_form']['melee_doubles']) ? 0 : 1;
    $melee_teammate = trim($_SESSION['portal_form']['melee_teammate'] ?: '');
    $pm_singles = is_null($_SESSION['portal_form']['pm_singles']) ? 0 : 1;
    $pm_doubles = is_null($_SESSION['portal_form']['pm_doubles']) ? 0 : 1;
    $pm_teammate = trim($_SESSION['portal_form']['pm_teammate'] ?: '');
    $smash4_singles = is_null($_SESSION['portal_form']['smash4_singles']) ? 0 : 1;
    $arcade = $_SESSION['auth']['arcade'] == 1 || $_SESSION['new_arcade'] == 1 ? 1 : 0;
    $credits = $_SESSION['new_credits'];
    $transactionID = $transaction_results['PAYMENTINFO_0_TRANSACTIONID'];
    $amtPaid = $transaction_results['PAYMENTINFO_0_AMT'];
    if (is_null($transaction_results)) {
        $query = "UPDATE registration r\n              LEFT JOIN teams t ON t.account_id = r.id\n              SET r.tag=?, r.melee_singles=?, r.melee_doubles=?, t.melee_partner=?, r.pm_singles=?, r.pm_doubles=?, t.pm_partner=?, r.smash4_singles=?, r.arcade=?, r.credits=r.credits+?\n              WHERE r.id=?";
        $stmt = $conn->prepare($query);
        $stmt->bind_param("siisiisiiii", $gamertag, $melee_singles, $melee_doubles, $melee_teammate, $pm_singles, $pm_doubles, $pm_teammate, $smash4_singles, $arcade, $credits, $_SESSION['auth']['id']);
    } else {
        $query = "UPDATE registration r\n              LEFT JOIN teams t ON t.account_id = r.id\n              SET r.tag=?, r.melee_singles=?, r.melee_doubles=?, t.melee_partner=?, r.pm_singles=?, r.pm_doubles=?, t.pm_partner=?, r.smash4_singles=?, r.arcade=?, r.credits=r.credits+?, r.paypal_transaction_id=r.paypal_transaction_id + ',' + ?, r.amount_paid=r.amount_paid+?\n              WHERE r.id=?";
        $stmt = $conn->prepare($query);
        $stmt->bind_param("siisiisiiisdi", $gamertag, $melee_singles, $melee_doubles, $melee_teammate, $pm_singles, $pm_doubles, $pm_teammate, $smash4_singles, $arcade, $credits, $transactionID, $amtPaid, $_SESSION['auth']['id']);
    }
    if ($stmt->execute()) {
        /* UPDATE SUCCESS, re-populate user session and send e-mails to all affected doubles partners */
        repopulateSession($conn);
        $email = $_SESSION['auth']['email'];
        $old_pm_teammate = $_SESSION['auth']['pm_partner'];
        $old_melee_teammate = $_SESSION['auth']['melee_partner'];
        // PROJECT M
        if ($pm_doubles == 1) {
            if ($_SESSION['auth']['pm_doubles'] == 1 && $pm_teammate != $old_pm_teammate) {
                // Send e-mail to old partner saying the teammate has left
                $message = [];
                $message[] = "Hey smasher,";
                $message[] = "We're just letting you know that {$gamertag} has unregistered you as their Project M Doubles partner.";
                $message[] = "You can update your registration information, including doubles partners, by visiting the Player Portal.";
                $message[] = "Click <a href='http://www.smashsummit.ca/?portal'>here</a> to go there now!";
                sendEmail($message, "{$gamertag} no longer wants to team!", $old_pm_teammate);
                // Send e-mail to new partner
                $status = checkPartnerStatus($conn, $email, $pm_teammate, "pm_doubles")[0];
                sendTeamStatusEmail($email, $gamertag, $pm_teammate, $status['tag'], "Project: M Doubles", $status['status']);
            } else {
                if ($_SESSION['auth']['pm_doubles'] == 0) {
                    // Send e-mail to new partner
                    $status = checkPartnerStatus($conn, $email, $pm_teammate, "pm_doubles")[0];
                    sendTeamStatusEmail($email, $gamertag, $pm_teammate, $status['tag'], "Project: M Doubles", $status['status']);
                }
            }
        } else {
            if ($pm_doubles == 0 && $_SESSION['auth']['pm_doubles'] == 1) {
                // Send e-mail to old partner saying the teammate has unregistered from doubles
                $message = [];
                $message[] = "Hey smasher,";
                $message[] = "We're just letting you know that {$gamertag} is no longer playing in Project M Doubles.";
                $message[] = "You can update your registration information, including doubles partners, by visiting the Player Portal.";
                $message[] = "Click <a href='http://www.smashsummit.ca/?portal'>here</a> to go there now!";
                sendEmail($message, "{$gamertag} is no longer playing in doubles!", $old_pm_teammate);
            }
        }
        // MELEE
        if ($melee_doubles == 1) {
            if ($_SESSION['auth']['melee_doubles'] == 1 && $melee_teammate != $old_melee_teammate) {
                // Send e-mail to old partner saying the teammate has left
                $message = [];
                $message[] = "Hey smasher,";
                $message[] = "We're just letting you know that {$gamertag} has unregistered you as their Melee Doubles partner.";
                $message[] = "You can update your registration information, including doubles partners, by visiting the Player Portal.";
                $message[] = "Click <a href='http://www.smashsummit.ca/?portal'>here</a> to go there now!";
                sendEmail($message, "{$gamertag} no longer wants to team!", $old_melee_teammate);
                // Send e-mail to new partner
                $status = checkPartnerStatus($conn, $email, $melee_teammate, "melee_doubles")[0];
                sendTeamStatusEmail($email, $gamertag, $melee_teammate, $status['tag'], "Melee Doubles", $status['status']);
            } else {
                if ($_SESSION['auth']['melee_doubles'] == 0) {
                    // Send e-mail to new partner
                    $status = checkPartnerStatus($conn, $email, $melee_teammate, "melee_doubles")[0];
                    sendTeamStatusEmail($email, $gamertag, $melee_teammate, $status['tag'], "Melee Doubles", $status['status']);
                }
            }
        } else {
            if ($melee_doubles == 0 && $_SESSION['auth']['melee_doubles'] == 1) {
                // Send e-mail to old partner saying the teammate has unregistered from doubles
                $message = [];
                $message[] = "Hey smasher,";
                $message[] = "We're just letting you know that {$gamertag} is no longer playing in Melee Doubles.";
                $message[] = "You can update your registration information, including doubles partners, by visiting the Player Portal.";
                $message[] = "Click <a href='http://www.smashsummit.ca/?portal'>here</a> to go there now!";
                sendEmail($message, "{$gamertag} is no longer playing in doubles!", $old_melee_teammate);
            }
        }
        // After update is complete, send user back to portal
        header('Location: /?portal');
    } else {
        // TODO: registration error page
        if (is_null(transaction_results)) {
            echo "Oops. Something went wrong.  Please contact support@smashsummit.ca and we'll get it sorted out.";
        } else {
            echo "Oops. Something went wrong.  Please contact support@smashsummit.ca with your paypal transaction ID and we'll get it sorted out.";
        }
        // TODO: more detailed error email
        $message = $stmt->error;
        $message .= "\r\n";
        if (!is_null($transaction_results)) {
            $message .= print_r($transaction_results, true);
        }
        $message .= "\r\n";
        $message .= print_r($_SESSION, true);
        sendErrorEmail($message);
    }
    $stmt->close();
    $conn->close();
}
     //<a href='mailto:support@clearmydues.com'>support@clearmydues.com</a> for further assistance.";
 } elseif ($exprianErrors == 'customError') {
     sendErrorEmail($exprianErrors, $score_id);
     $errorToDispaly = "Sorry! </br></br>We seem to be facing an technical problem. \n\t\tPlease try again later or contact 9599814083 or support@clearmydues.com if the problem still persists. \n\t\tWe apologise for any inconvenience caused.";
     // $errorToDispaly = "We are unable to authenticate you at this time. Please email scanned copy of your  PAN card and address proof to our Consumer Support
     //<a href='mailto:support@clearmydues.com'>support@clearmydues.com</a> for further assistance.";
 } elseif ($exprianErrors == 'voucherExpired') {
     sendErrorEmail($exprianErrors, $score_id);
     $errorToDispaly = "Sorry! </br></br>We seem to be facing an technical problem. \n\t\tPlease try again later or contact 9599814083 or support@clearmydues.com if the problem still persists. \n\t\tWe apologise for any inconvenience caused.";
 } elseif ($exprianErrors == 'Error inserting data in database. Please verify data.') {
     sendErrorEmail($exprianErrors, $score_id);
     $errorToDispaly = "Sorry! </br></br>We seem to be facing an technical problem. \n\t\tPlease try again later or contact 9599814083 or support@clearmydues.com if the problem still persists. \n\t\tWe apologise for any inconvenience caused.";
     // $errorToDispaly = "Error inserting data in database with experian server. Please verify data.";
 } else {
     $errorToDispaly = $experian_response['errorMessage'];
     sendErrorEmail($exprianErrors, $score_id);
 }
 //if($responseMap=='') { $exprianErrors='Some Error'; $errorToDispaly ="Some error occurred. Please contact our customer care..";}
 if ($exprianErrors != '') {
     $msg_register = "<div id='gt-formfeedback'>{$errorToDispaly}</div>";
 }
 $questionHeading = $experian_response['responseMap']['questionToCustomer']['question'];
 $optionsSet1 = $experian_response['responseMap']['questionToCustomer']['optionsSet1'];
 $optionsSet2 = $experian_response['responseMap']['questionToCustomer']['optionsSet2'];
 $qid = $experian_response['responseMap']['questionToCustomer']['qid'];
 $toolTip = $experian_response['responseMap']['questionToCustomer']['toolTip'];
 $stgOneHitId = $experian_response['responseMap']['stgOneHitId'];
 $stgTwoHitId = $experian_response['responseMap']['stgTwoHitId'];
 $jsessionId2 = $experian_response['responseMap']['jsessionId2'];
 if ($exprianErrors == 'Success') {
     $xmlResponse = $experian_response['xmlResponse'];
checklogin();
$score_id = $_GET["score_id"];
if ($_GET["msg"] == 2) {
    $msg = 2;
} elseif ($_GET["msg"] == 3) {
    $msg = 3;
} else {
    $msg = 1;
}
if (isset($_GET["redirect"])) {
    $msg = "";
    $redirect = $_GET['redirect'];
    if ($redirect == "ques") {
        sendErrorEmail("redirect kyc after checking question", $score_id);
    } else {
        sendErrorEmail("redirect kyc through pop up", $score_id);
    }
}
$user_id = $_SESSION['GTUserID'];
// send sms and email
$check_owner = "SELECT firstname, mobile, email, owner FROM `tbl_userdetails` WHERE `id` ='{$user_id}'";
$check_owner_data = mysql_query_with_throw($check_owner);
$user_set = mysql_fetch_assoc($check_owner_data);
$file_list = array();
$subject = "KYC Upload - Clearmydues";
$body = '
         <p>
         Dear ' . $user_set['firstname'] . ',<br><br> Sorry we could not authenticate you based upon your responses. Please upload your KYC (ID & Address proof) at www.clearmydues.com or email us at support@clearmydues.com to validate your identity & get your Credit Report.
         </p>';
$to = array($user_set['email']);
$cc = array("");
Пример #5
0
            $mail->AddAddress($to);
            // Recipient email address
            $mail->IsHTML(true);
            // Set email format to HTML
            $mail->Subject = $subject;
            $mail->Body = $message;
            if (!$mail->Send()) {
                error_log("cron.php: Message could not be sent.", 0);
                error_log("cron.php: PHPMailer error: " . $mail->ErrorInfo, 0);
            }
            $update_user_process_sql = "UPDATE VOCAB_DOWNLOAD.VOCABULARY_USER SET FILE_CREATION_JOB_RUNNING_FLAG = 'N' WHERE PROCESS_ID = '" . $item["PROCESS_ID"] . "'";
            $stid_update_user_process = oci_parse($conn, $update_user_process_sql);
            if (!$stid_update_user_process) {
                $e = oci_error($conn);
                sendErrorEmail("cron.php: oci_parse UPDATE VOCAB_DOWNLOAD.VOCABULARY_USER SET FILE_CREATION_JOB_RUNNING_FLAG = 'N' WHERE PROCESS_ID  = '" . $item["PROCESS_ID"] . "'" . " failed, sql=" . $update_user_process_sql . ", error message=" . $e['message']);
                die;
            }
            $returnvalue = oci_execute($stid_update_user_process);
            if (!$returnvalue) {
                $e = oci_error($stid_update_user_process);
                // For oci_execute errors pass the statement handle
                sendErrorEmail("cron.php: oci_execute UPDATE VOCAB_DOWNLOAD.VOCABULARY_USER SET FILE_CREATION_JOB_RUNNING_FLAG = 'N' WHERE PROCESS_ID  = '" . $item["PROCESS_ID"] . "'" . " failed, sql=" . $e['sqltext'] . ", error message=" . $e['message']);
                die;
            }
        }
    }
}
// free all statement identifiers and close the database connection
oci_free_statement($stid_user_process);
oci_free_statement($stid_update_user_process);
oci_close($conn);
Пример #6
0
$shell_exec_string = 'nohup ' . $perl_dump_script_dir . 'dump.pl ' . $Cred . ' ' . $CDMVersion . ' ' . $zip_file_output_dir . $FName . ' ' . $VocIds . ' > /dev/null & echo $!';
$PID = shell_exec($shell_exec_string);
if (!$PID) {
    $e = oci_error($stid);
    sendErrorEmail("downloads.php shell_exec failed, exec_string=" . $shell_exec_string);
    header("Location:error.php?errorMessage=" . urlencode("Error: unable to generate export file"));
    die;
}
$insert_user_process_sql = "INSERT INTO VOCAB_DOWNLOAD.VOCABULARY_USER (\n        EMAIL_ADDRESS,\n        NAME,\n        ORGANIZATION,\n        ADDRESS,\n        CITY_NAME,\n        COUNTRY_NAME,\n        PHONE_NUMBER,\n        VOCABULARY_LIST,\n        PROCESS_ID,\n        TITLE,\n        STATE,\n        ZIP_CODE,\n\tFILE_NAME,\n        FILE_CREATION_JOB_RUNNING_FLAG\n    ) VALUES (\n        '" . $email . "',\n        '" . $name . "',\n        '" . $Organization . "',\n        '" . $Address . "',\n        '" . $City . "',\n        '" . $Country . "',\n        '" . $Phone . "',\n        '" . $VocIds . "',\n        " . $PID . ",\n        '" . $Title . "',\n        '" . $State . "',\n        '" . $Zip . "',\n        '" . $FName . "',\n        'Y'\n    )";
$stid_add_user_process = oci_parse($conn, $insert_user_process_sql);
if (!$stid_add_user_process) {
    $e = oci_error($conn);
    sendErrorEmail("downloads.php: oci_parse INSERT INTO VOCAB_DOWNLOAD.VOCABULARY_USER table failed, sql=" . $insert_user_process_sql . ", error message=" . $e['message']);
    header("Location:error.php?errorMessage=" . urlencode("Error: unable to log export file request"));
    die;
}
$returnvalue = oci_execute($stid_add_user_process);
if (!$returnvalue) {
    $e = oci_error($stid_add_user_process);
    // For oci_execute errors pass the statement handle
    sendErrorEmail("downloads.php: oci_execute INSERT INTO VOCAB_DOWNLOAD.VOCABULARY_USER table failed, sql=" . $e['sqltext'] . ", error message=" . $e['message']);
    header("Location:error.php?errorMessage=" . urlencode("Error: unable to execute INSERT INTO VOCAB_DOWNLOAD.VOCABULARY_USER table"));
    die;
}
// free all statement identifiers and close the database connection
oci_free_statement($stid);
oci_free_statement($stid0);
oci_free_statement($stid_add_user_process);
oci_close($conn);
header("Location: download-process.php");
exit;
Пример #7
0
                $message[] = $line;
                $message[] = "You will receive an email in the following weeks with a link to the Summit account portal where you will be able to edit your registration information.";
                $message[] = "If you registered in any doubles brackets you will also receive an e-mail when your teammate(s) have confirmed.";
                sendEmail($message, "Summit Registration Confirmation", $email);
                // Attendees page displays registration success message
                $_SESSION['new_registrant'] = $_SESSION['registration_form']['gamertag'];
                header('Location: /?attendees');
            } else {
                // TODO: registration error page
                echo "Oops. Something went wrong.  Please contact support@smashsummit.ca with your paypal transaction ID and we'll get it sorted out.";
                // TODO: more detailed error email
                $message = $stmt->error;
                $message .= "\r\n";
                $message .= print_r($transaction_results, true);
                $message .= "\r\n";
                $message .= print_r($_SESSION, true);
                sendErrorEmail($message);
            }
            $stmt->close();
            $conn->close();
        } else {
            echo "Paypal transaction processing failed.  Summit staff has been notified, please check your paypal payment sources or try again later.  Sorry for the inconvenience.";
            $message .= print_r($transaction_results, true);
            $message .= "\r\n";
            $message .= print_r($_SESSION, true);
            sendErrorEmail($message);
        }
    } else {
        header('Location: http://www.smashsummit.ca/');
    }
}