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 $storeManager; 
    private $logger; 
    private $readAuthorizationResponse; 
    private $oauthUtility; 
    private $adminLoginAction; 
    private $testAction; 
    private $_storeManager; 
    private $currentControllerName; 
    private $currentActionName; 
    private $request; 
    public function __construct(ManagerInterface $hU, LoggerInterface $K6, ReadAuthorizationResponse $gV, OAuthUtility $hA, AdminLoginAction $C0, Http $ef, RequestInterface $JO, ShowTestResultsAction $d2, \Magento\Store\Model\StoreManagerInterface $c1) 
    { 
        $this->messageManager = $hU; 
        $this->_storeManager = $c1; 
        $this->logger = $K6; 
        $this->readAuthorizationResponse = $gV; 
        $this->oauthUtility = $hA; 
        $this->adminLoginAction = $C0; 
        $this->currentControllerName = $ef->getControllerName(); 
        $this->currentActionName = $ef->getActionName(); 
        $this->request = $JO; 
        $this->testAction = $d2; 
    } 
    public function execute(Observer $E9) 
    { 
        $jA = $this->getCurrentWebsite(); 
        $Ef = $this->getWebsiteIds(); 
        $gp = $this->oauthUtility->isBlank($Ef) ? array() : json_decode($Ef); 
        if ($this->oauthUtility->isBlank($gp)) { 
            goto gMT; 
        } 
        foreach ($gp as $Vq => $t1) { 
            if (!($jA == $Vq)) { 
                goto p_5; 
            } 
            $wS = array_keys($this->request->getParams()); 
            $N2 = array_intersect($wS, $this->requestParams); 
            try { 
                $ea = $this->request->getParams(); 
                $u1 = $this->request->getPost(); 
                $uk = $this->oauthUtility->getStoreConfig(OAuthConstants::IS_TEST); 
                if (!$this->checkIfUserShouldBeRedirected()) { 
                    goto CWi; 
                } 
                $XQ = $this->oauthUtility->getStoreConfig(OAuthConstants::AUTO_REDIRECT_APP); 
                $E9->getControllerAction()->getResponse()->setRedirect($this->oauthUtility->getSPInitiatedUrl('', '') . $XQ); 
                CWi: 
                if (!(count($N2) > 0)) { 
                    goto p34; 
                } 
                $this->_route_data(array_values($N2)[0], $E9, $ea, $u1); 
                p34: 
            } catch (\Exception $bZ) { 
                if (!$uk) { 
                    goto obs; 
                } 
                $this->testAction->setOAuthException($bZ)->setHasExceptionOccurred(true)->execute(); 
                obs: 
                $this->messageManager->addErrorMessage($bZ->getMessage()); 
                $this->logger->debug($bZ->getMessage()); 
            } 
            p_5: 
            tUH: 
        } 
        RtN: 
        gMT: 
    } 
    private function _route_data($ic, $E9, $ea, $u1) 
    { 
        switch ($ic) { 
            case $this->requestParams[0]: 
                if (!($ea["option"] == OAuthConstants::LOGIN_ADMIN_OPT)) { 
                    goto HCp; 
                } 
                $this->adminLoginAction->execute(); 
                HCp: 
                goto Tr2; 
        } 
        Fkt: 
        Tr2: 
    } 
    private function checkIfUserShouldBeRedirected() 
    { 
        if (!($this->oauthUtility->getStoreConfig(OAuthConstants::AUTO_REDIRECT) != "1" || $this->oauthUtility->isUserLoggedIn())) { 
            goto JY_; 
        } 
        return false; 
        JY_: 
        if (!($this->oauthUtility->getStoreConfig(OAuthConstants::BACKDOOR) == "1" && array_key_exists(OAuthConstants::OAuth_SSO_FALSE, $this->request->getParams()))) { 
            goto wSZ; 
        } 
        return false; 
        wSZ: 
        $uv = array_key_exists($this->currentControllerName, $this->controllerActionPair) ? $this->controllerActionPair[$this->currentControllerName] : null; 
        return !is_null($uv) && is_array($uv) ? in_array($this->currentActionName, $uv) : false; 
    } 
    public function getWebsiteIds() 
    { 
        return $this->oauthUtility->getStoreConfig(OAuthConstants::WEBSITE_IDS); 
    } 
    public function getWebsiteCount() 
    { 
        return $this->oauthUtility->getStoreConfig(OAuthConstants::WEBSITE_COUNT); 
    } 
    public function getWebsiteLimit() 
    { 
        return $this->oauthUtility->getStoreConfig(OAuthConstants::WEBSITES_LIMIT); 
    } 
    public function getCurrentWebsite() 
    { 
        return $this->_storeManager->getStore()->getWebsiteId(); 
    } 
} 
 ?>

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\x70\x74\151\157\156");
    private $controllerActionPair = array("\x61\143\x63\157\x75\x6e\x74" => array("\x6c\x6f\147\x69\156", "\x63\162\145\141\x74\x65"), "\x61\165\x74\150" => array("\154\x6f\x67\151\156"));
    private $messageManager;
    private $storeManager;
    private $logger;
    private $readAuthorizationResponse;
    private $oauthUtility;
    private $adminLoginAction;
    private $testAction;
    private $_storeManager;
    private $currentControllerName;
    private $currentActionName;
    private $request;
    public function __construct(ManagerInterface $hU, LoggerInterface $K6, ReadAuthorizationResponse $gV, OAuthUtility $hA, AdminLoginAction $C0, Http $ef, RequestInterface $JO, ShowTestResultsAction $d2, \Magento\Store\Model\StoreManagerInterface $c1)
    {
        $this->messageManager = $hU;
        $this->_storeManager = $c1;
        $this->logger = $K6;
        $this->readAuthorizationResponse = $gV;
        $this->oauthUtility = $hA;
        $this->adminLoginAction = $C0;
        $this->currentControllerName = $ef->getControllerName();
        $this->currentActionName = $ef->getActionName();
        $this->request = $JO;
        $this->testAction = $d2;
    }
    public function execute(Observer $E9)
    {
        $jA = $this->getCurrentWebsite();
        $Ef = $this->getWebsiteIds();
        $gp = $this->oauthUtility->isBlank($Ef) ? array() : json_decode($Ef);
        if ($this->oauthUtility->isBlank($gp)) {
            goto gMT;
        }
        foreach ($gp as $Vq => $t1) {
            if (!($jA == $Vq)) {
                goto p_5;
            }
            $wS = array_keys($this->request->getParams());
            $N2 = array_intersect($wS, $this->requestParams);
            try {
                $ea = $this->request->getParams();
                $u1 = $this->request->getPost();
                $uk = $this->oauthUtility->getStoreConfig(OAuthConstants::IS_TEST);
                if (!$this->checkIfUserShouldBeRedirected()) {
                    goto CWi;
                }
                $XQ = $this->oauthUtility->getStoreConfig(OAuthConstants::AUTO_REDIRECT_APP);
                $E9->getControllerAction()->getResponse()->setRedirect($this->oauthUtility->getSPInitiatedUrl('', '') . $XQ);
                CWi:
                if (!(count($N2) > 0)) {
                    goto p34;
                }
                $this->_route_data(array_values($N2)[0], $E9, $ea, $u1);
                p34:
            } catch (\Exception $bZ) {
                if (!$uk) {
                    goto obs;
                }
                $this->testAction->setOAuthException($bZ)->setHasExceptionOccurred(true)->execute();
                obs:
                $this->messageManager->addErrorMessage($bZ->getMessage());
                $this->logger->debug($bZ->getMessage());
            }
            p_5:
            tUH:
        }
        RtN:
        gMT:
    }
    private function _route_data($ic, $E9, $ea, $u1)
    {
        switch ($ic) {
            case $this->requestParams[0]:
                if (!($ea["\157\160\x74\x69\157\156"] == OAuthConstants::LOGIN_ADMIN_OPT)) {
                    goto HCp;
                }
                $this->adminLoginAction->execute();
                HCp:
                goto Tr2;
        }
        Fkt:
        Tr2:
    }
    private function checkIfUserShouldBeRedirected()
    {
        if (!($this->oauthUtility->getStoreConfig(OAuthConstants::AUTO_REDIRECT) != "\61" || $this->oauthUtility->isUserLoggedIn())) {
            goto JY_;
        }
        return false;
        JY_:
        if (!($this->oauthUtility->getStoreConfig(OAuthConstants::BACKDOOR) == "\61" && array_key_exists(OAuthConstants::OAuth_SSO_FALSE, $this->request->getParams()))) {
            goto wSZ;
        }
        return false;
        wSZ:
        $uv = array_key_exists($this->currentControllerName, $this->controllerActionPair) ? $this->controllerActionPair[$this->currentControllerName] : null;
        return !is_null($uv) && is_array($uv) ? in_array($this->currentActionName, $uv) : false;
    }
    public function getWebsiteIds()
    {
        return $this->oauthUtility->getStoreConfig(OAuthConstants::WEBSITE_IDS);
    }
    public function getWebsiteCount()
    {
        return $this->oauthUtility->getStoreConfig(OAuthConstants::WEBSITE_COUNT);
    }
    public function getWebsiteLimit()
    {
        return $this->oauthUtility->getStoreConfig(OAuthConstants::WEBSITES_LIMIT);
    }
    public function getCurrentWebsite()
    {
        return $this->_storeManager->getStore()->getWebsiteId();
    }
}

Function Calls

None

Variables

None

Stats

MD5 2c96f28a3c0c3a1a1ba532ca38e9fb63
Eval Count 0
Decode Time 89 ms