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 Magento\Customer\Model\Se..

Decoded Output download

<?php 
 
 
namespace MiniOrange\OAuth\Controller\Actions; 
 
use Magento\Customer\Model\Session; 
use Magento\Framework\App\Action\Context; 
use Magento\Framework\App\Action\HttpPostActionInterface; 
use Magento\Framework\App\ResponseFactory; 
use Magento\Customer\Model\Account\Redirect as AccountRedirect; 
use MiniOrange\OAuth\Helper\OAuthUtility; 
use Magento\Framework\Stdlib\CookieManagerInterface; 
use Magento\Framework\Stdlib\Cookie\CookieMetadataFactory; 
class CustomerLoginAction extends BaseAction implements HttpPostActionInterface 
{ 
    private $user; 
    private $customerSession; 
    private $responseFactory; 
    private $relayState; 
	private $storeManager; 
	private $storeRepository; 
	private $customerHelper; 
	/** 
     * @var AccountRedirect 
     */ 
    protected $accountRedirect; 
	protected $cookieManager; 
	protected $cookieMetadataFactory; 
	 
    public function __construct(Context $St, OAuthUtility $AX, Session $p3, ResponseFactory $kA, 
		\Magento\Store\Model\StoreManagerInterface $storeManager, 
		\Magento\Store\Api\StoreRepositoryInterface $storeRepository, 
		AccountRedirect $accountRedirect, 
		\Zoleo\Customer\Helper\Helper $customerHelper, 
		CookieManagerInterface $cookieManager, 
		CookieMetadataFactory $cookieMetadataFactory) 
    { 
        $this->customerSession = $p3; 
        $this->responseFactory = $kA; 
		$this->storeManager = $storeManager; 
		$this->storeRepository = $storeRepository; 
		$this->customerHelper = $customerHelper; 
		$this->accountRedirect = $accountRedirect; 
		$this->cookieManager = $cookieManager; 
		$this->cookieMetadataFactory = $cookieMetadataFactory; 
        parent::__construct($St, $AX); 
    } 
    public function execute() 
    { 
        $this->oauthUtility->log_debug("CustomerLoginAction: execute"); 
        if (isset($this->relayState)) { 
            goto NU; 
        } 
        $this->relayState = $this->oauthUtility->getBaseUrl() . "customer/account"; 
         
		NU: 
        $this->customerSession->setCustomerAsLoggedIn($this->user); 
        return $this->getResponse()->setRedirect($this->oauthUtility->getUrl($this->relayState))->sendResponse(); 
    } 
    public function setUser($user) 
    { 
        $this->oauthUtility->log_debug("CustomerLoginAction: setUser"); 
        $this->user = $user; 
        return $this; 
    } 
    public function setRelayState($sP) 
    { 
		$zoleoLoginReferrer = $this->cookieManager->getCookie('zoleo_login_referrer', null);	 
        $this->oauthUtility->log_debug("account redirect cookie: ".$zoleoLoginReferrer); 
		 
		$this->oauthUtility->log_debug("CustomerLoginAction: setRelayState", $sP); 
        $this->oauthUtility->log_debug("relaystate:".$sP); 
		$this->relayState = $sP; 
         
		$customerWebsite = $this->customerHelper->getCustomerWebsite(); 
		$this->oauthUtility->log_debug("customer website: ".$customerWebsite); 
		if($customerWebsite == "") { 
			//Do nothing customer can access any website 
			$this->relayState = $this->oauthUtility->getBaseUrl()."customerprofile"; 
		} 
		else { 
			$currentWebsiteId = $this->storeManager->getWebsite()->getId(); 
			$isWebsiteLocked = $this->customerHelper->getWebsiteLocked(); 
			$storeUrl = $this->oauthUtility->getBaseUrl(); 
			if($currentWebsiteId != $customerWebsite) { 
				$storeUrl = $this->customerHelper->getStoreUrlByWebsiteId($customerWebsite); 
				/*$this->relayState = $storeUrl . "customer/account"; 
				if(isset($zoleoLoginReferrer) && $zoleoLoginReferrer != '') { 
					$this->relayState = $storeUrl.$zoleoLoginReferrer; 
					$cookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata() 
						->setPath('/'); 
					$this->cookieManager->deleteCookie('zoleo_login_referrer',$cookieMetadata); 
				}*/ 
			} 
			/*else { 
				$storeUrl = $this->oauthUtility->getBaseUrl(); 
				if(isset($zoleoLoginReferrer) && $zoleoLoginReferrer != '') { 
					$this->relayState = $this->oauthUtility->getBaseUrl().$zoleoLoginReferrer; 
					$cookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata() 
						->setPath('/'); 
					$this->cookieManager->deleteCookie('zoleo_login_referrer',$cookieMetadata); 
				} 
			}*/ 
			$this->relayState = $storeUrl . "customer/account"; 
			if($isWebsiteLocked != '1') { 
				$this->relayState = $storeUrl . "activate/"; 
			} 
			else { 
				if(isset($zoleoLoginReferrer) && $zoleoLoginReferrer != '') { 
					$this->relayState = $storeUrl.$zoleoLoginReferrer; 
					$cookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata() 
						->setPath('/'); 
					$this->cookieManager->deleteCookie('zoleo_login_referrer',$cookieMetadata); 
				} 
			} 
			$redirectUrl = $this->accountRedirect->getRedirectCookie(); 
			$this->oauthUtility->log_debug("account redirect redirectUrl: ".$redirectUrl); 
			$this->oauthUtility->log_debug("account redirect redirectUrl 1: ".$this->_redirect->getRefererUrl()); 
			$this->oauthUtility->log_debug("account redirect redirectUrl 1: ".$this->_redirect->getRedirectUrl()); 
		} 
		$this->oauthUtility->log_debug("relaystate 1:".$this->relayState); 
		 
		return $this; 
    } 
} 
 ?>

Did this file decode correctly?

Original Code

<?php


namespace MiniOrange\OAuth\Controller\Actions;

use Magento\Customer\Model\Session;
use Magento\Framework\App\Action\Context;
use Magento\Framework\App\Action\HttpPostActionInterface;
use Magento\Framework\App\ResponseFactory;
use Magento\Customer\Model\Account\Redirect as AccountRedirect;
use MiniOrange\OAuth\Helper\OAuthUtility;
use Magento\Framework\Stdlib\CookieManagerInterface;
use Magento\Framework\Stdlib\Cookie\CookieMetadataFactory;
class CustomerLoginAction extends BaseAction implements HttpPostActionInterface
{
    private $user;
    private $customerSession;
    private $responseFactory;
    private $relayState;
	private $storeManager;
	private $storeRepository;
	private $customerHelper;
	/**
     * @var AccountRedirect
     */
    protected $accountRedirect;
	protected $cookieManager;
	protected $cookieMetadataFactory;
	
    public function __construct(Context $St, OAuthUtility $AX, Session $p3, ResponseFactory $kA,
		\Magento\Store\Model\StoreManagerInterface $storeManager,
		\Magento\Store\Api\StoreRepositoryInterface $storeRepository,
		AccountRedirect $accountRedirect,
		\Zoleo\Customer\Helper\Helper $customerHelper,
		CookieManagerInterface $cookieManager,
		CookieMetadataFactory $cookieMetadataFactory)
    {
        $this->customerSession = $p3;
        $this->responseFactory = $kA;
		$this->storeManager = $storeManager;
		$this->storeRepository = $storeRepository;
		$this->customerHelper = $customerHelper;
		$this->accountRedirect = $accountRedirect;
		$this->cookieManager = $cookieManager;
		$this->cookieMetadataFactory = $cookieMetadataFactory;
        parent::__construct($St, $AX);
    }
    public function execute()
    {
        $this->oauthUtility->log_debug("\x43\x75\x73\164\157\155\x65\162\114\157\x67\x69\x6e\x41\x63\x74\151\x6f\x6e\x3a\40\x65\170\x65\x63\x75\x74\145");
        if (isset($this->relayState)) {
            goto NU;
        }
        $this->relayState = $this->oauthUtility->getBaseUrl() . "\143\165\163\164\157\155\x65\x72\x2f\141\x63\143\157\x75\x6e\164";
        
		NU:
        $this->customerSession->setCustomerAsLoggedIn($this->user);
        return $this->getResponse()->setRedirect($this->oauthUtility->getUrl($this->relayState))->sendResponse();
    }
    public function setUser($user)
    {
        $this->oauthUtility->log_debug("\x43\165\163\164\157\155\145\x72\x4c\x6f\147\151\x6e\101\143\164\151\157\156\x3a\x20\163\x65\164\x55\163\x65\162");
        $this->user = $user;
        return $this;
    }
    public function setRelayState($sP)
    {
		$zoleoLoginReferrer = $this->cookieManager->getCookie('zoleo_login_referrer', null);	
        $this->oauthUtility->log_debug("account redirect cookie: ".$zoleoLoginReferrer);
		
		$this->oauthUtility->log_debug("\x43\165\x73\164\x6f\155\145\x72\x4c\x6f\x67\x69\x6e\101\143\164\151\x6f\x6e\x3a\x20\x73\145\x74\x52\145\154\141\171\123\164\x61\x74\145", $sP);
        $this->oauthUtility->log_debug("relaystate:".$sP);
		$this->relayState = $sP;
        
		$customerWebsite = $this->customerHelper->getCustomerWebsite();
		$this->oauthUtility->log_debug("customer website: ".$customerWebsite);
		if($customerWebsite == "") {
			//Do nothing customer can access any website
			$this->relayState = $this->oauthUtility->getBaseUrl()."customerprofile";
		}
		else {
			$currentWebsiteId = $this->storeManager->getWebsite()->getId();
			$isWebsiteLocked = $this->customerHelper->getWebsiteLocked();
			$storeUrl = $this->oauthUtility->getBaseUrl();
			if($currentWebsiteId != $customerWebsite) {
				$storeUrl = $this->customerHelper->getStoreUrlByWebsiteId($customerWebsite);
				/*$this->relayState = $storeUrl . "\x63\x75\x73\164\157\x6d\145\x72\x2f\x61\143\143\x6f\x75\156\164";
				if(isset($zoleoLoginReferrer) && $zoleoLoginReferrer != '') {
					$this->relayState = $storeUrl.$zoleoLoginReferrer;
					$cookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata()
						->setPath('/');
					$this->cookieManager->deleteCookie('zoleo_login_referrer',$cookieMetadata);
				}*/
			}
			/*else {
				$storeUrl = $this->oauthUtility->getBaseUrl();
				if(isset($zoleoLoginReferrer) && $zoleoLoginReferrer != '') {
					$this->relayState = $this->oauthUtility->getBaseUrl().$zoleoLoginReferrer;
					$cookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata()
						->setPath('/');
					$this->cookieManager->deleteCookie('zoleo_login_referrer',$cookieMetadata);
				}
			}*/
			$this->relayState = $storeUrl . "\x63\x75\x73\164\157\x6d\145\x72\x2f\x61\143\143\x6f\x75\156\164";
			if($isWebsiteLocked != '1') {
				$this->relayState = $storeUrl . "activate/";
			}
			else {
				if(isset($zoleoLoginReferrer) && $zoleoLoginReferrer != '') {
					$this->relayState = $storeUrl.$zoleoLoginReferrer;
					$cookieMetadata = $this->cookieMetadataFactory->createPublicCookieMetadata()
						->setPath('/');
					$this->cookieManager->deleteCookie('zoleo_login_referrer',$cookieMetadata);
				}
			}
			$redirectUrl = $this->accountRedirect->getRedirectCookie();
			$this->oauthUtility->log_debug("account redirect redirectUrl: ".$redirectUrl);
			$this->oauthUtility->log_debug("account redirect redirectUrl 1: ".$this->_redirect->getRefererUrl());
			$this->oauthUtility->log_debug("account redirect redirectUrl 1: ".$this->_redirect->getRedirectUrl());
		}
		$this->oauthUtility->log_debug("relaystate 1:".$this->relayState);
		
		return $this;
    }
}

Function Calls

None

Variables

None

Stats

MD5 b0d8ae781f2fc4c9e06b0102e25f553b
Eval Count 0
Decode Time 74 ms