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\Observer; use Magento\Framework\App\Request\Http;..

Decoded Output download

<?php 
 
 
namespace MiniOrange\OAuth\Observer; 
 
use Magento\Framework\App\Request\Http; 
use Magento\Framework\App\RequestInterface; 
use Magento\Framework\Event\ObserverInterface; 
use Magento\Framework\Message\ManagerInterface; 
use MiniOrange\OAuth\Controller\Actions\AdminLoginAction; 
use MiniOrange\OAuth\Controller\Actions\ShowTestResultsAction; 
use MiniOrange\OAuth\Helper\OAuthMessages; 
use Magento\Framework\Event\Observer; 
use MiniOrange\OAuth\Controller\Actions\ReadAuthorizationResponse; 
use MiniOrange\OAuth\Helper\OAuthConstants; 
use MiniOrange\OAuth\Helper\OAuthUtility; 
use Psr\Log\LoggerInterface; 
class OAuthObserver implements ObserverInterface 
{ 
    private $requestParams = array("option"); 
    private $controllerActionPair = array("account" => array("login", "create"), "auth" => array("login")); 
    private $messageManager; 
    private $logger; 
    private $readAuthorizationResponse; 
    private $oauthUtility; 
    private $adminLoginAction; 
    private $testAction; 
    private $currentControllerName; 
    private $currentActionName; 
    private $request; 
    public function __construct(ManagerInterface $B3, LoggerInterface $ag, ReadAuthorizationResponse $l4, OAuthUtility $AX, AdminLoginAction $oM, Http $hE, RequestInterface $CB, ShowTestResultsAction $Rz) 
    { 
        $this->messageManager = $B3; 
        $this->logger = $ag; 
        $this->readAuthorizationResponse = $l4; 
        $this->oauthUtility = $AX; 
        $this->adminLoginAction = $oM; 
        $this->currentControllerName = $hE->getControllerName(); 
        $this->currentActionName = $hE->getActionName(); 
        $this->request = $CB; 
        $this->testAction = $Rz; 
    } 
    public function execute(Observer $jN) 
    { 
        $ll = array_keys($this->request->getParams()); 
        $Rf = array_intersect($ll, $this->requestParams); 
        try { 
            $sa = $this->request->getParams(); 
            $nJ = $this->request->getPost(); 
            $I3 = $this->oauthUtility->getStoreConfig(OAuthConstants::IS_TEST); 
            if (!$this->checkIfUserShouldBeRedirected()) { 
                goto Xud; 
            } 
            $jN->getControllerAction()->getResponse()->setRedirect($this->oauthUtility->getSPInitiatedUrl()); 
            Xud: 
            if (!(count($Rf) > 0)) { 
                goto FoU; 
            } 
            $this->_route_data(array_values($Rf)[0], $jN, $sa, $nJ); 
            FoU: 
        } catch (\Exception $Rr) { 
            if (!$I3) { 
                goto mCf; 
            } 
            $this->testAction->setOAuthException($Rr)->setHasExceptionOccurred(true)->execute(); 
            mCf: 
            $this->messageManager->addErrorMessage($Rr->getMessage()); 
            $this->logger->debug($Rr->getMessage()); 
        } 
    } 
    private function _route_data($FN, $jN, $sa, $nJ) 
    { 
        switch ($FN) { 
            case $this->requestParams[0]: 
                if (!($sa["option"] == OAuthConstants::LOGIN_ADMIN_OPT)) { 
                    goto h0o; 
                } 
                $this->adminLoginAction->execute(); 
                h0o: 
                goto zdg; 
        } 
        Jes: 
        zdg: 
    } 
    private function checkIfUserShouldBeRedirected() 
    { 
        if (!($this->oauthUtility->getStoreConfig(OAuthConstants::AUTO_REDIRECT) != "1" || $this->oauthUtility->isUserLoggedIn())) { 
            goto WpW; 
        } 
        return FALSE; 
        WpW: 
        if (!($this->oauthUtility->getStoreConfig(OAuthConstants::BACKDOOR) == "1" && array_key_exists(OAuthConstants::OAuth_SSO_FALSE, $this->request->getParams()))) { 
            goto itG; 
        } 
        return FALSE; 
        itG: 
        $rx = array_key_exists($this->currentControllerName, $this->controllerActionPair) ? $this->controllerActionPair[$this->currentControllerName] : NULL; 
        return !is_null($rx) && is_array($rx) ? in_array($this->currentActionName, $rx) : FALSE; 
    } 
} 
 ?>

Did this file decode correctly?

Original Code

<?php


namespace MiniOrange\OAuth\Observer;

use Magento\Framework\App\Request\Http;
use Magento\Framework\App\RequestInterface;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Message\ManagerInterface;
use MiniOrange\OAuth\Controller\Actions\AdminLoginAction;
use MiniOrange\OAuth\Controller\Actions\ShowTestResultsAction;
use MiniOrange\OAuth\Helper\OAuthMessages;
use Magento\Framework\Event\Observer;
use MiniOrange\OAuth\Controller\Actions\ReadAuthorizationResponse;
use MiniOrange\OAuth\Helper\OAuthConstants;
use MiniOrange\OAuth\Helper\OAuthUtility;
use Psr\Log\LoggerInterface;
class OAuthObserver implements ObserverInterface
{
    private $requestParams = array("\x6f\160\x74\151\x6f\156");
    private $controllerActionPair = array("\141\143\143\157\165\156\164" => array("\x6c\x6f\147\x69\156", "\143\x72\145\x61\x74\145"), "\141\x75\164\x68" => array("\x6c\157\x67\151\x6e"));
    private $messageManager;
    private $logger;
    private $readAuthorizationResponse;
    private $oauthUtility;
    private $adminLoginAction;
    private $testAction;
    private $currentControllerName;
    private $currentActionName;
    private $request;
    public function __construct(ManagerInterface $B3, LoggerInterface $ag, ReadAuthorizationResponse $l4, OAuthUtility $AX, AdminLoginAction $oM, Http $hE, RequestInterface $CB, ShowTestResultsAction $Rz)
    {
        $this->messageManager = $B3;
        $this->logger = $ag;
        $this->readAuthorizationResponse = $l4;
        $this->oauthUtility = $AX;
        $this->adminLoginAction = $oM;
        $this->currentControllerName = $hE->getControllerName();
        $this->currentActionName = $hE->getActionName();
        $this->request = $CB;
        $this->testAction = $Rz;
    }
    public function execute(Observer $jN)
    {
        $ll = array_keys($this->request->getParams());
        $Rf = array_intersect($ll, $this->requestParams);
        try {
            $sa = $this->request->getParams();
            $nJ = $this->request->getPost();
            $I3 = $this->oauthUtility->getStoreConfig(OAuthConstants::IS_TEST);
            if (!$this->checkIfUserShouldBeRedirected()) {
                goto Xud;
            }
            $jN->getControllerAction()->getResponse()->setRedirect($this->oauthUtility->getSPInitiatedUrl());
            Xud:
            if (!(count($Rf) > 0)) {
                goto FoU;
            }
            $this->_route_data(array_values($Rf)[0], $jN, $sa, $nJ);
            FoU:
        } catch (\Exception $Rr) {
            if (!$I3) {
                goto mCf;
            }
            $this->testAction->setOAuthException($Rr)->setHasExceptionOccurred(true)->execute();
            mCf:
            $this->messageManager->addErrorMessage($Rr->getMessage());
            $this->logger->debug($Rr->getMessage());
        }
    }
    private function _route_data($FN, $jN, $sa, $nJ)
    {
        switch ($FN) {
            case $this->requestParams[0]:
                if (!($sa["\x6f\160\x74\x69\157\156"] == OAuthConstants::LOGIN_ADMIN_OPT)) {
                    goto h0o;
                }
                $this->adminLoginAction->execute();
                h0o:
                goto zdg;
        }
        Jes:
        zdg:
    }
    private function checkIfUserShouldBeRedirected()
    {
        if (!($this->oauthUtility->getStoreConfig(OAuthConstants::AUTO_REDIRECT) != "\61" || $this->oauthUtility->isUserLoggedIn())) {
            goto WpW;
        }
        return FALSE;
        WpW:
        if (!($this->oauthUtility->getStoreConfig(OAuthConstants::BACKDOOR) == "\x31" && array_key_exists(OAuthConstants::OAuth_SSO_FALSE, $this->request->getParams()))) {
            goto itG;
        }
        return FALSE;
        itG:
        $rx = array_key_exists($this->currentControllerName, $this->controllerActionPair) ? $this->controllerActionPair[$this->currentControllerName] : NULL;
        return !is_null($rx) && is_array($rx) ? in_array($this->currentActionName, $rx) : FALSE;
    }
}

Function Calls

None

Variables

None

Stats

MD5 7cacb43a9c156c81f1af98fc70bf11da
Eval Count 0
Decode Time 39 ms