Loading htdocs/create.php +9 −0 Original line number Diff line number Diff line Loading @@ -194,6 +194,7 @@ function shouldRewardReferrer(object $userData): bool function createAccounts(array $accountsCreators, object $userData) { error_log('In createAccounts'); global $shopLocation; foreach ($accountsCreators as $accountCreator) { try { Loading @@ -216,10 +217,12 @@ function createAccounts(array $accountsCreators, object $userData) $wpShop = new \WPAccountCreator($E_SHOP_URL, $E_SHOP_USERNAME, $E_SHOP_APP_PASS, $shopLocation); $status = $wpShop->sendWPRewardRequest($userData, $shopLocation); } error_log('Out createAccounts'); } function validateAccountOnAllServices(array $accountsCreators, object $userData) { error_log('In validateAccountOnAllServices'); foreach ($accountsCreators as $accountCreator) { $validatedData = $accountCreator->validateData($userData); if ($validatedData->isValid()) { Loading @@ -227,10 +230,12 @@ function validateAccountOnAllServices(array $accountsCreators, object $userData) } sendAPIResponseFromValidatedData($userData, $validatedData); } error_log('Out validateAccountOnAllServices'); } function sendAPIResponseFromValidatedData(object $userData, ValidatedData $validatedData) { error_log('In sendAPIResponseFromValidatedData'); global $strings; if ($validatedData->getErrorCode() === "error_account_taken") { $message = $strings["error_account_taken"]; Loading @@ -255,6 +260,7 @@ function sendAPIResponseFromValidatedData(object $userData, ValidatedData $valid function sendWelcomeMail($to, $mbox, $domain, $displayName) { error_log('In sendWelcomeMail'); $mailDomain = getMailDomain(); if (!empty(getenv("SENDGRID_API_KEY"))) { return sendWelcomeMailWithSendGrid($to, $mbox, $domain, $mailDomain, $displayName); Loading @@ -264,6 +270,7 @@ function sendWelcomeMail($to, $mbox, $domain, $displayName) function sendWelcomeMailWithPHPMail(string $to, string $mbox, string $domain, string $mailDomain, string $displayName) { error_log('In sendWelcomeMailWithPHPMail'); global $strings; $lang = strtolower(getCurrentRequestLanguage()); Loading Loading @@ -326,6 +333,7 @@ function getAccountCreatedHTMLEmailTemplate(string $lang): string function getAccountCreatedTextEmailTemplate(string $lang): string { error_log('In getAccountCreatedTextEmailTemplate'); $lang = check_if_lang_exists($lang) ? $lang : "en"; $file_path = "/var/www/html/account_created_templates/$lang.txt"; return file_get_contents($file_path); Loading Loading @@ -356,6 +364,7 @@ function has_invalid_password_characters(string $password): bool function addUserToList(string $email) { error_log('In addUserToList'); global $newUserMapFile; file_put_contents($newUserMapFile, $email.PHP_EOL , FILE_APPEND | LOCK_EX); } Loading
htdocs/create.php +9 −0 Original line number Diff line number Diff line Loading @@ -194,6 +194,7 @@ function shouldRewardReferrer(object $userData): bool function createAccounts(array $accountsCreators, object $userData) { error_log('In createAccounts'); global $shopLocation; foreach ($accountsCreators as $accountCreator) { try { Loading @@ -216,10 +217,12 @@ function createAccounts(array $accountsCreators, object $userData) $wpShop = new \WPAccountCreator($E_SHOP_URL, $E_SHOP_USERNAME, $E_SHOP_APP_PASS, $shopLocation); $status = $wpShop->sendWPRewardRequest($userData, $shopLocation); } error_log('Out createAccounts'); } function validateAccountOnAllServices(array $accountsCreators, object $userData) { error_log('In validateAccountOnAllServices'); foreach ($accountsCreators as $accountCreator) { $validatedData = $accountCreator->validateData($userData); if ($validatedData->isValid()) { Loading @@ -227,10 +230,12 @@ function validateAccountOnAllServices(array $accountsCreators, object $userData) } sendAPIResponseFromValidatedData($userData, $validatedData); } error_log('Out validateAccountOnAllServices'); } function sendAPIResponseFromValidatedData(object $userData, ValidatedData $validatedData) { error_log('In sendAPIResponseFromValidatedData'); global $strings; if ($validatedData->getErrorCode() === "error_account_taken") { $message = $strings["error_account_taken"]; Loading @@ -255,6 +260,7 @@ function sendAPIResponseFromValidatedData(object $userData, ValidatedData $valid function sendWelcomeMail($to, $mbox, $domain, $displayName) { error_log('In sendWelcomeMail'); $mailDomain = getMailDomain(); if (!empty(getenv("SENDGRID_API_KEY"))) { return sendWelcomeMailWithSendGrid($to, $mbox, $domain, $mailDomain, $displayName); Loading @@ -264,6 +270,7 @@ function sendWelcomeMail($to, $mbox, $domain, $displayName) function sendWelcomeMailWithPHPMail(string $to, string $mbox, string $domain, string $mailDomain, string $displayName) { error_log('In sendWelcomeMailWithPHPMail'); global $strings; $lang = strtolower(getCurrentRequestLanguage()); Loading Loading @@ -326,6 +333,7 @@ function getAccountCreatedHTMLEmailTemplate(string $lang): string function getAccountCreatedTextEmailTemplate(string $lang): string { error_log('In getAccountCreatedTextEmailTemplate'); $lang = check_if_lang_exists($lang) ? $lang : "en"; $file_path = "/var/www/html/account_created_templates/$lang.txt"; return file_get_contents($file_path); Loading Loading @@ -356,6 +364,7 @@ function has_invalid_password_characters(string $password): bool function addUserToList(string $email) { error_log('In addUserToList'); global $newUserMapFile; file_put_contents($newUserMapFile, $email.PHP_EOL , FILE_APPEND | LOCK_EX); }