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\E..
Decoded Output download
<?php
namespace MiniOrange\OAuth\Controller\Actions;
use MiniOrange\OAuth\Helper\Exception\MissingAttributesException;
use MiniOrange\OAuth\Helper\OAuthConstants;
use Magento\Framework\App\Action\HttpPostActionInterface;
class CheckAttributeMappingAction extends BaseAction implements HttpPostActionInterface
{
const TEST_VALIDATE_RELAYSTATE = OAuthConstants::TEST_RELAYSTATE;
private $userInfoResponse;
private $flattenedUserInfoResponse;
private $relayState;
private $userEmail;
private $emailAttribute;
private $usernameAttribute;
private $firstName;
private $lastName;
private $checkIfMatchBy;
private $groupName;
private $testAction;
private $processUserAction;
public function __construct(\Magento\Framework\App\Action\Context $dS, \MiniOrange\OAuth\Helper\OAuthUtility $RV, \MiniOrange\OAuth\Controller\Actions\ShowTestResultsAction $q5, \MiniOrange\OAuth\Controller\Actions\ProcessUserAction $qm)
{
$this->emailAttribute = $RV->getStoreConfig(OAuthConstants::MAP_EMAIL);
$this->emailAttribute = $RV->isBlank($this->emailAttribute) ? OAuthConstants::DEFAULT_MAP_EMAIL : $this->emailAttribute;
$this->usernameAttribute = $RV->getStoreConfig(OAuthConstants::MAP_USERNAME);
$this->usernameAttribute = $RV->isBlank($this->usernameAttribute) ? OAuthConstants::DEFAULT_MAP_USERN : $this->usernameAttribute;
$this->firstName = $RV->getStoreConfig(OAuthConstants::MAP_FIRSTNAME);
$this->firstName = $RV->isBlank($this->firstName) ? OAuthConstants::DEFAULT_MAP_FN : $this->firstName;
$this->lastName = $RV->getStoreConfig(OAuthConstants::MAP_LASTNAME);
$this->checkIfMatchBy = $RV->getStoreConfig(OAuthConstants::MAP_MAP_BY);
$this->testAction = $q5;
$this->processUserAction = $qm;
parent::__construct($dS, $RV);
}
public function execute()
{
$cQ = $this->oauthUtility->getSessionData(OAuthConstants::APP_NAME);
$jH = $this->oauthUtility->getOAuthClientApps();
$Q2 = null;
foreach ($jH as $BC) {
if (!($BC->getData()["app_name"] === $cQ)) {
goto aR;
}
$Q2 = $BC->getData();
aR:
xl:
}
k1:
$this->emailAttribute = null;
$this->usernameAttribute = null;
$this->firstName = null;
$this->lastName = null;
if (!isset($Q2["email_attribute"])) {
goto yA;
}
$this->emailAttribute = $Q2["email_attribute"];
yA:
$this->emailAttribute = $this->oauthUtility->isBlank($this->emailAttribute) ? OAuthConstants::DEFAULT_MAP_EMAIL : $this->emailAttribute;
if (!isset($Q2["username_attribute"])) {
goto PN;
}
$this->usernameAttribute = $Q2["username_attribute"];
PN:
$this->usernameAttribute = $this->oauthUtility->isBlank($this->usernameAttribute) ? OAuthConstants::DEFAULT_MAP_USERN : $this->usernameAttribute;
if (!isset($Q2["firstname_attribute"])) {
goto kY;
}
$this->firstName = $Q2["firstname_attribute"];
kY:
$this->firstName = $this->oauthUtility->isBlank($this->firstName) ? OAuthConstants::DEFAULT_MAP_FN : $this->firstName;
if (!isset($Q2["lastname_attribute"])) {
goto vf;
}
$this->lastName = $Q2["lastname_attribute"];
vf:
$this->checkIfMatchBy = $this->oauthUtility->getStoreConfig(OAuthConstants::MAP_MAP_BY);
$this->oauthUtility->log_debug("CheckAttributeMappingAction: execute");
$Rs = $this->userInfoResponse;
$A6 = $this->flattenedUserInfoResponse;
$lG = $this->userEmail;
$this->moOAuthCheckMapping($Rs, $A6, $lG);
}
private function moOAuthCheckMapping($Rs, $A6, $lG)
{
$this->oauthUtility->log_debug("CheckAttributeMappingAction: moOAuthCheckMapping");
if (!empty($Rs)) {
goto s1;
}
throw new MissingAttributesException();
s1:
if ($this->checkIfMatchBy == "username") {
goto dc;
}
$this->processUserName($A6);
$this->processEmail($A6);
$this->processGroupName($A6);
$this->processResult($Rs, $A6, $lG);
goto Et;
dc:
$this->processResult($Rs, $A6, $lG);
Et:
}
private function processResult($Rs, $mS, $Dt)
{
$this->oauthUtility->log_debug("CheckAttributeMappingAction: processResult");
$UI = $this->oauthUtility->getStoreConfig(OAuthConstants::IS_TEST);
if ($this->relayState == "testvalidate") {
goto zh;
}
$this->processUserAction->setFlattenedAttrs($mS)->setAttrs($Rs)->setUserEmail($Dt)->execute();
goto Zy;
zh:
$this->oauthUtility->setStoreConfig(OAuthConstants::IS_TEST, false);
$this->oauthUtility->flushCache();
$this->testAction->setAttrs($mS)->setUserEmail($Dt)->setCheckIfMatchBy($this->checkIfMatchBy)->execute();
Zy:
}
private function processFirstName(&$Rs)
{
if (array_key_exists($this->firstName, $Rs)) {
goto DD;
}
$Wk = explode("@", $this->userEmail);
$jg = $Wk[0];
$Rs[$this->firstName] = $jg;
DD:
}
private function processLastName(&$Rs)
{
if (array_key_exists($this->lastName, $Rs)) {
goto ke;
}
$Wk = explode("@", $this->userEmail);
$jg = $Wk[1];
$Rs[$this->lastName] = $jg;
ke:
}
private function processUserName(&$Rs)
{
if (array_key_exists($this->usernameAttribute, $Rs)) {
goto vQ;
}
$Rs[$this->usernameAttribute] = $this->userEmail;
vQ:
}
private function processEmail(&$Rs)
{
if (array_key_exists($this->emailAttribute, $Rs)) {
goto vc;
}
$Rs[$this->emailAttribute] = $this->userEmail;
vc:
}
private function processGroupName(&$Rs)
{
if (array_key_exists($this->groupName, $Rs)) {
goto Zg;
}
$this->groupName = array();
Zg:
}
public function setUserInfoResponse($yk)
{
$this->userInfoResponse = $yk;
return $this;
}
public function setFlattenedUserInfoResponse($CF)
{
$this->flattenedUserInfoResponse = $CF;
return $this;
}
public function setUserEmail($lG)
{
$this->userEmail = $lG;
return $this;
}
public function setRelayState($Eq)
{
$this->relayState = $Eq;
return $this;
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace MiniOrange\OAuth\Controller\Actions;
use MiniOrange\OAuth\Helper\Exception\MissingAttributesException;
use MiniOrange\OAuth\Helper\OAuthConstants;
use Magento\Framework\App\Action\HttpPostActionInterface;
class CheckAttributeMappingAction extends BaseAction implements HttpPostActionInterface
{
const TEST_VALIDATE_RELAYSTATE = OAuthConstants::TEST_RELAYSTATE;
private $userInfoResponse;
private $flattenedUserInfoResponse;
private $relayState;
private $userEmail;
private $emailAttribute;
private $usernameAttribute;
private $firstName;
private $lastName;
private $checkIfMatchBy;
private $groupName;
private $testAction;
private $processUserAction;
public function __construct(\Magento\Framework\App\Action\Context $dS, \MiniOrange\OAuth\Helper\OAuthUtility $RV, \MiniOrange\OAuth\Controller\Actions\ShowTestResultsAction $q5, \MiniOrange\OAuth\Controller\Actions\ProcessUserAction $qm)
{
$this->emailAttribute = $RV->getStoreConfig(OAuthConstants::MAP_EMAIL);
$this->emailAttribute = $RV->isBlank($this->emailAttribute) ? OAuthConstants::DEFAULT_MAP_EMAIL : $this->emailAttribute;
$this->usernameAttribute = $RV->getStoreConfig(OAuthConstants::MAP_USERNAME);
$this->usernameAttribute = $RV->isBlank($this->usernameAttribute) ? OAuthConstants::DEFAULT_MAP_USERN : $this->usernameAttribute;
$this->firstName = $RV->getStoreConfig(OAuthConstants::MAP_FIRSTNAME);
$this->firstName = $RV->isBlank($this->firstName) ? OAuthConstants::DEFAULT_MAP_FN : $this->firstName;
$this->lastName = $RV->getStoreConfig(OAuthConstants::MAP_LASTNAME);
$this->checkIfMatchBy = $RV->getStoreConfig(OAuthConstants::MAP_MAP_BY);
$this->testAction = $q5;
$this->processUserAction = $qm;
parent::__construct($dS, $RV);
}
public function execute()
{
$cQ = $this->oauthUtility->getSessionData(OAuthConstants::APP_NAME);
$jH = $this->oauthUtility->getOAuthClientApps();
$Q2 = null;
foreach ($jH as $BC) {
if (!($BC->getData()["\141\160\160\x5f\156\x61\x6d\x65"] === $cQ)) {
goto aR;
}
$Q2 = $BC->getData();
aR:
xl:
}
k1:
$this->emailAttribute = null;
$this->usernameAttribute = null;
$this->firstName = null;
$this->lastName = null;
if (!isset($Q2["\x65\155\141\151\x6c\137\141\164\x74\x72\151\142\165\164\x65"])) {
goto yA;
}
$this->emailAttribute = $Q2["\x65\x6d\141\151\154\137\x61\x74\164\162\151\x62\x75\164\145"];
yA:
$this->emailAttribute = $this->oauthUtility->isBlank($this->emailAttribute) ? OAuthConstants::DEFAULT_MAP_EMAIL : $this->emailAttribute;
if (!isset($Q2["\165\163\x65\x72\x6e\x61\155\x65\137\141\x74\164\x72\151\x62\165\x74\x65"])) {
goto PN;
}
$this->usernameAttribute = $Q2["\x75\x73\145\x72\156\x61\x6d\145\137\141\164\x74\x72\x69\142\x75\164\x65"];
PN:
$this->usernameAttribute = $this->oauthUtility->isBlank($this->usernameAttribute) ? OAuthConstants::DEFAULT_MAP_USERN : $this->usernameAttribute;
if (!isset($Q2["\146\151\x72\x73\164\x6e\141\155\145\x5f\141\164\164\162\x69\142\x75\164\x65"])) {
goto kY;
}
$this->firstName = $Q2["\x66\x69\162\163\164\x6e\x61\x6d\x65\x5f\x61\x74\x74\x72\x69\x62\165\x74\145"];
kY:
$this->firstName = $this->oauthUtility->isBlank($this->firstName) ? OAuthConstants::DEFAULT_MAP_FN : $this->firstName;
if (!isset($Q2["\154\x61\x73\164\x6e\x61\x6d\x65\x5f\141\164\164\162\151\x62\x75\x74\x65"])) {
goto vf;
}
$this->lastName = $Q2["\x6c\141\x73\x74\x6e\x61\155\145\x5f\x61\164\164\x72\151\142\x75\164\x65"];
vf:
$this->checkIfMatchBy = $this->oauthUtility->getStoreConfig(OAuthConstants::MAP_MAP_BY);
$this->oauthUtility->log_debug("\103\150\x65\x63\x6b\x41\164\164\x72\151\142\165\x74\x65\115\141\160\160\151\x6e\x67\101\143\x74\x69\157\x6e\72\40\145\170\145\143\x75\164\145");
$Rs = $this->userInfoResponse;
$A6 = $this->flattenedUserInfoResponse;
$lG = $this->userEmail;
$this->moOAuthCheckMapping($Rs, $A6, $lG);
}
private function moOAuthCheckMapping($Rs, $A6, $lG)
{
$this->oauthUtility->log_debug("\x43\150\145\143\153\x41\x74\x74\162\151\x62\x75\x74\x65\115\141\x70\160\x69\156\147\101\143\x74\151\157\156\x3a\x20\x6d\x6f\117\x41\165\x74\x68\x43\x68\145\143\153\x4d\x61\x70\x70\x69\156\147");
if (!empty($Rs)) {
goto s1;
}
throw new MissingAttributesException();
s1:
if ($this->checkIfMatchBy == "\165\x73\x65\162\156\141\x6d\145") {
goto dc;
}
$this->processUserName($A6);
$this->processEmail($A6);
$this->processGroupName($A6);
$this->processResult($Rs, $A6, $lG);
goto Et;
dc:
$this->processResult($Rs, $A6, $lG);
Et:
}
private function processResult($Rs, $mS, $Dt)
{
$this->oauthUtility->log_debug("\x43\150\x65\143\x6b\101\164\164\162\x69\x62\165\x74\x65\115\141\160\160\x69\156\147\101\143\164\151\x6f\156\x3a\x20\160\162\x6f\143\145\x73\163\x52\145\163\x75\154\x74");
$UI = $this->oauthUtility->getStoreConfig(OAuthConstants::IS_TEST);
if ($this->relayState == "\164\145\163\164\x76\141\154\x69\144\141\164\x65") {
goto zh;
}
$this->processUserAction->setFlattenedAttrs($mS)->setAttrs($Rs)->setUserEmail($Dt)->execute();
goto Zy;
zh:
$this->oauthUtility->setStoreConfig(OAuthConstants::IS_TEST, false);
$this->oauthUtility->flushCache();
$this->testAction->setAttrs($mS)->setUserEmail($Dt)->setCheckIfMatchBy($this->checkIfMatchBy)->execute();
Zy:
}
private function processFirstName(&$Rs)
{
if (array_key_exists($this->firstName, $Rs)) {
goto DD;
}
$Wk = explode("\x40", $this->userEmail);
$jg = $Wk[0];
$Rs[$this->firstName] = $jg;
DD:
}
private function processLastName(&$Rs)
{
if (array_key_exists($this->lastName, $Rs)) {
goto ke;
}
$Wk = explode("\100", $this->userEmail);
$jg = $Wk[1];
$Rs[$this->lastName] = $jg;
ke:
}
private function processUserName(&$Rs)
{
if (array_key_exists($this->usernameAttribute, $Rs)) {
goto vQ;
}
$Rs[$this->usernameAttribute] = $this->userEmail;
vQ:
}
private function processEmail(&$Rs)
{
if (array_key_exists($this->emailAttribute, $Rs)) {
goto vc;
}
$Rs[$this->emailAttribute] = $this->userEmail;
vc:
}
private function processGroupName(&$Rs)
{
if (array_key_exists($this->groupName, $Rs)) {
goto Zg;
}
$this->groupName = array();
Zg:
}
public function setUserInfoResponse($yk)
{
$this->userInfoResponse = $yk;
return $this;
}
public function setFlattenedUserInfoResponse($CF)
{
$this->flattenedUserInfoResponse = $CF;
return $this;
}
public function setUserEmail($lG)
{
$this->userEmail = $lG;
return $this;
}
public function setRelayState($Eq)
{
$this->relayState = $Eq;
return $this;
}
}
Function Calls
None |
Stats
MD5 | 57cb055c70b2ab45657f2b28e6edda41 |
Eval Count | 0 |
Decode Time | 55 ms |