예제 #1
0
 //generate unique code for email confirmation
 $intCode = createRandomKey_Num(12);
 $strEmailLink = WEBSITEFULLURLHTTPS . PAGE_WALLET . "?do=confirmemailcode&emailcode={$intCode}&id={$intNewRecordID}&email={$FormRegEmail}";
 //auto login
 if (LOGIN_ONJOIN) {
     //Write Session & Cookies to Login User
     $strRememberFlag = "1";
     //Remember username and password by default
     functLoginUser($intNewRecordID, $strRememberFlag, $FormRegpassword);
     $_SESSION["justjoined"] = time();
     //set flag for new user
 }
 //auto create bitcoin address on join
 if (CREATEADDRESS_ONJOIN) {
     //create a new wallet address for them
     $strWalletAddress = funct_MakeWalletAddressUpdate($intUserID);
 }
 //send new email code on join
 if (LOGIN_SENDEMAILCODE) {
     //update member record with new confirm code
     //$query = "UPDATE ".TBL_USERS." SET emailcode='$intCode' WHERE id = $intNewRecordID " ;
     //echo "SQL STMNT = " . $query . "<br>";
     //$rs = mysqli_query($DB_LINK, $query) or die(mysqli_error());
     if ($DB_MYSQLI->connect_errno) {
         echo "Failed to connect to MySQL: (" . $DB_MYSQLI->connect_errno . ") " . $DB_MYSQLI->connect_error;
     }
     if (!($stmt = $DB_MYSQLI->prepare("UPDATE " . TBL_USERS . " SET emailcode = ? WHERE id = ? "))) {
         echo "Prepare failed: (" . $DB_MYSQLI->errno . ") " . $DB_MYSQLI->error;
     }
     if (!$stmt->bind_param('sd', $intCode, $intNewRecordID)) {
         echo "Binding parameters failed: (" . $stmt->errno . ") " . $stmt->error;
//echo "intEmailConfirmed= ".$intEmailConfirmed."<br>";
//if email is not confirmed then show the confirm email form
if (!$intEmailConfirmed) {
    $strShowEmailConfirmFlag = true;
}
$intWalletReceiveOn = $row["wallet_receive_on"];
$strWallet_MainAddress = $row["wallet_address"];
//bitcoin wallet address
$strQRcodeIMG = PATH_QRCODES . $strWallet_MainAddress . ".png";
//echo "wallet: $strWallet_MainAddress <br>" ;
//#####################################################################################
//WALLET AUTO REGENERATION ROUTINE
//if their qrcode image doesn't exist then create it again (/media/qrcode/walletaddress.png)
if (!$strWallet_MainAddress) {
    //make new wallet address
    $strWallet_MainAddress = funct_MakeWalletAddressUpdate($intUserID1, $strCrypto_Code);
}
/*if($strWallet_MainAddress){
    //if no qr code image is detected then create one
    if(!file_exists(__ROOT__.$strQRcodeIMG)){
        $strError = funct_Billing_GetQRCodeImage($strWallet_MainAddress, $strQRcodeIMG ); //save img to disk
        echo "no qr image.. writing file... $strError - $strQRcodeIMG <br>";
    }
}*/
//#####################################################################################
//get balance for crypto
$query = "SELECT * FROM " . TBL_WALLET_BALANCES . " WHERE userid = " . $intUserID1 . " AND currency_code='" . $strCryptoCode . "' AND currency_type='crypto' ";
//echo "SQL STMNT = " . $query .  "<br>";
$rs = mysqli_query($DB_LINK, $query) or die(mysqli_error());
$row = mysqli_fetch_array($rs);
$intBalance = $row["balance"];