Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace MiniOrange\OAuth\Controller\Actions; use MiniOrange\OAuth\Helper\C..
Decoded Output download
<?php
namespace MiniOrange\OAuth\Controller\Actions;
use MiniOrange\OAuth\Helper\Curl;
use MiniOrange\OAuth\Helper\OAuthConstants;
use MiniOrange\OAuth\Helper\OAuthMessages;
use MiniOrange\OAuth\Helper\Exception\PasswordMismatchException;
use MiniOrange\OAuth\Helper\Exception\OTPSendingFailedException;
class RegisterNewUserAction extends BaseAdminAction
{
private $REQUEST;
private $loginExistingUserAction;
public function __construct(\Magento\Backend\App\Action\Context $N4, \Magento\Framework\View\Result\PageFactory $kL, \MiniOrange\OAuth\Helper\OAuthUtility $Dz, \Magento\Framework\Message\ManagerInterface $Vz, \Psr\Log\LoggerInterface $yA, \MiniOrange\OAuth\Controller\Actions\LoginExistingUserAction $HK)
{
parent::__construct($N4, $kL, $Dz, $Vz, $yA);
$this->loginExistingUserAction = $HK;
}
public function execute()
{
$this->oauthUtility->log_debug("RegisterNewUser: execute");
$this->checkIfRequiredFieldsEmpty(array("email" => $this->REQUEST, "password" => $this->REQUEST, "confirmPassword" => $this->REQUEST));
$ed = $this->REQUEST["email"];
$Er = $this->REQUEST["password"];
$aN = $this->REQUEST["confirmPassword"];
$lX = $this->REQUEST["companyName"];
$Pq = $this->REQUEST["firstName"];
$VZ = $this->REQUEST["lastName"];
if (!(strcasecmp($aN, $Er) != 0)) {
goto Jh;
}
throw new PasswordMismatchException();
Jh:
$El = $this->checkIfUserExists($ed);
if (strcasecmp($El["status"], "CUSTOMER_NOT_FOUND") == 0) {
goto RE;
}
$this->loginExistingUserAction->setRequestParam($this->REQUEST)->execute();
goto DS;
RE:
$this->startVerificationProcess($El, $ed, $lX, $Pq, $VZ);
DS:
}
private function checkIfUserExists($ed)
{
$this->oauthUtility->log_debug("RegisterNewUserAction: checkIfUserExists");
$this->oauthUtility->setStoreConfig(OAuthConstants::CUSTOMER_EMAIL, $ed);
$Ot = Curl::check_customer($ed);
return json_decode($Ot, true);
}
private function startVerificationProcess($El, $ed, $lX, $Pq, $VZ)
{
$this->oauthUtility->log_debug("RegisterNewUserAction: StartVerificationProcess");
$El = Curl::mo_send_otp_token(OAuthConstants::OTP_TYPE_EMAIL, $ed);
$El = json_decode($El, true);
if (strcasecmp($El["status"], "SUCCESS") == 0) {
goto AC;
}
$this->handleOTPSendFailed();
goto Hq;
AC:
$this->handleOTPSentSuccess($El, $ed, $lX, $Pq, $VZ);
Hq:
}
private function handleOTPSentSuccess($El, $ed, $lX, $Pq, $VZ)
{
$this->oauthUtility->setStoreConfig(OAuthConstants::TXT_ID, $El["txId"]);
$this->oauthUtility->setStoreConfig(OAuthConstants::CUSTOMER_EMAIL, $ed);
$this->oauthUtility->setStoreConfig(OAuthConstants::CUSTOMER_NAME, $lX);
$this->oauthUtility->setStoreConfig(OAuthConstants::CUSTOMER_FNAME, $Pq);
$this->oauthUtility->setStoreConfig(OAuthConstants::CUSTOMER_LNAME, $VZ);
$this->oauthUtility->setStoreConfig(OAuthConstants::OTP_TYPE, OAuthConstants::OTP_TYPE_EMAIL);
$this->oauthUtility->setStoreConfig(OAuthConstants::REG_STATUS, OAuthConstants::STATUS_VERIFY_EMAIL);
$this->messageManager->addSuccessMessage(OAuthMessages::parse("EMAIL_OTP_SENT", array("email" => $ed)));
}
private function handleOTPSendFailed()
{
$this->oauthUtility->setStoreConfig(OAuthConstants::REG_STATUS, OAuthConstants::STATUS_VERIFY_EMAIL);
throw new OTPSendingFailedException();
}
public function setRequestParam($tb)
{
$this->REQUEST = $tb;
return $this;
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace MiniOrange\OAuth\Controller\Actions;
use MiniOrange\OAuth\Helper\Curl;
use MiniOrange\OAuth\Helper\OAuthConstants;
use MiniOrange\OAuth\Helper\OAuthMessages;
use MiniOrange\OAuth\Helper\Exception\PasswordMismatchException;
use MiniOrange\OAuth\Helper\Exception\OTPSendingFailedException;
class RegisterNewUserAction extends BaseAdminAction
{
private $REQUEST;
private $loginExistingUserAction;
public function __construct(\Magento\Backend\App\Action\Context $N4, \Magento\Framework\View\Result\PageFactory $kL, \MiniOrange\OAuth\Helper\OAuthUtility $Dz, \Magento\Framework\Message\ManagerInterface $Vz, \Psr\Log\LoggerInterface $yA, \MiniOrange\OAuth\Controller\Actions\LoginExistingUserAction $HK)
{
parent::__construct($N4, $kL, $Dz, $Vz, $yA);
$this->loginExistingUserAction = $HK;
}
public function execute()
{
$this->oauthUtility->log_debug("\x52\145\x67\151\x73\164\145\162\116\145\167\125\163\x65\x72\x3a\40\x65\170\145\x63\x75\x74\145");
$this->checkIfRequiredFieldsEmpty(array("\x65\x6d\x61\151\x6c" => $this->REQUEST, "\160\141\163\x73\167\157\162\144" => $this->REQUEST, "\143\x6f\x6e\x66\151\162\155\x50\141\x73\163\x77\157\x72\x64" => $this->REQUEST));
$ed = $this->REQUEST["\x65\155\x61\151\154"];
$Er = $this->REQUEST["\x70\x61\x73\x73\167\x6f\x72\144"];
$aN = $this->REQUEST["\143\157\156\x66\x69\162\155\x50\x61\x73\x73\x77\x6f\162\144"];
$lX = $this->REQUEST["\143\x6f\x6d\160\x61\156\171\x4e\141\155\145"];
$Pq = $this->REQUEST["\146\x69\162\x73\164\116\141\x6d\145"];
$VZ = $this->REQUEST["\x6c\x61\x73\164\x4e\x61\155\x65"];
if (!(strcasecmp($aN, $Er) != 0)) {
goto Jh;
}
throw new PasswordMismatchException();
Jh:
$El = $this->checkIfUserExists($ed);
if (strcasecmp($El["\x73\164\141\x74\165\x73"], "\x43\125\x53\x54\117\115\x45\122\137\116\117\x54\x5f\x46\x4f\x55\x4e\104") == 0) {
goto RE;
}
$this->loginExistingUserAction->setRequestParam($this->REQUEST)->execute();
goto DS;
RE:
$this->startVerificationProcess($El, $ed, $lX, $Pq, $VZ);
DS:
}
private function checkIfUserExists($ed)
{
$this->oauthUtility->log_debug("\122\145\147\151\x73\x74\x65\x72\x4e\x65\167\x55\x73\145\x72\x41\x63\164\151\157\x6e\x3a\x20\143\x68\145\143\153\x49\146\125\163\x65\x72\105\x78\151\163\164\163");
$this->oauthUtility->setStoreConfig(OAuthConstants::CUSTOMER_EMAIL, $ed);
$Ot = Curl::check_customer($ed);
return json_decode($Ot, true);
}
private function startVerificationProcess($El, $ed, $lX, $Pq, $VZ)
{
$this->oauthUtility->log_debug("\122\145\x67\151\163\164\x65\162\116\145\167\x55\163\145\162\101\143\x74\x69\157\156\72\40\123\164\141\x72\x74\x56\145\x72\151\x66\x69\x63\x61\x74\x69\x6f\x6e\x50\162\157\x63\x65\x73\163");
$El = Curl::mo_send_otp_token(OAuthConstants::OTP_TYPE_EMAIL, $ed);
$El = json_decode($El, true);
if (strcasecmp($El["\x73\x74\141\164\165\x73"], "\123\x55\103\x43\105\123\123") == 0) {
goto AC;
}
$this->handleOTPSendFailed();
goto Hq;
AC:
$this->handleOTPSentSuccess($El, $ed, $lX, $Pq, $VZ);
Hq:
}
private function handleOTPSentSuccess($El, $ed, $lX, $Pq, $VZ)
{
$this->oauthUtility->setStoreConfig(OAuthConstants::TXT_ID, $El["\x74\x78\x49\144"]);
$this->oauthUtility->setStoreConfig(OAuthConstants::CUSTOMER_EMAIL, $ed);
$this->oauthUtility->setStoreConfig(OAuthConstants::CUSTOMER_NAME, $lX);
$this->oauthUtility->setStoreConfig(OAuthConstants::CUSTOMER_FNAME, $Pq);
$this->oauthUtility->setStoreConfig(OAuthConstants::CUSTOMER_LNAME, $VZ);
$this->oauthUtility->setStoreConfig(OAuthConstants::OTP_TYPE, OAuthConstants::OTP_TYPE_EMAIL);
$this->oauthUtility->setStoreConfig(OAuthConstants::REG_STATUS, OAuthConstants::STATUS_VERIFY_EMAIL);
$this->messageManager->addSuccessMessage(OAuthMessages::parse("\x45\115\101\x49\x4c\x5f\x4f\124\120\137\123\105\x4e\x54", array("\145\155\x61\x69\x6c" => $ed)));
}
private function handleOTPSendFailed()
{
$this->oauthUtility->setStoreConfig(OAuthConstants::REG_STATUS, OAuthConstants::STATUS_VERIFY_EMAIL);
throw new OTPSendingFailedException();
}
public function setRequestParam($tb)
{
$this->REQUEST = $tb;
return $this;
}
}
Function Calls
None |
Stats
MD5 | 321690861cd0bccdcc7f8bdbc249a279 |
Eval Count | 0 |
Decode Time | 47 ms |