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\Event\ObserverInt..
Decoded Output download
<?php
namespace MiniOrange\OAuth\Observer;
use Magento\Framework\Event\ObserverInterface;
use MiniOrange\OAuth\Helper\Exception\InvalidSignatureInResponseException;
use MiniOrange\OAuth\Helper\OAuthMessages;
use Magento\Framework\Event\Observer;
use MiniOrange\OAuth\Controller\Actions\ReadAuthorizationResponse;
use MiniOrange\OAuth\Helper\OAuthConstants;
class RedirectToIDPObserver 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 $requestInterface;
private $request;
public function __construct(\Magento\Framework\Message\ManagerInterface $hU, \Psr\Log\LoggerInterface $K6, \MiniOrange\OAuth\Controller\Actions\ReadAuthorizationResponse $gV, \MiniOrange\OAuth\Helper\OAuthUtility $hA, \MiniOrange\OAuth\Controller\Actions\AdminLoginAction $C0, \Magento\Framework\App\Request\Http $ef, \Magento\Framework\App\RequestInterface $JO, \MiniOrange\OAuth\Controller\Actions\ShowTestResultsAction $d2)
{
$this->messageManager = $hU;
$this->logger = $K6;
$this->readAuthorizationResponse = $gV;
$this->{$hA} = ${$hA};
$this->adminLoginAction = $C0;
$this->currentControllerName = $ef->getControllerName();
$this->currentActionName = $ef->getActionName();
$this->request = $JO;
$this->testAction = $d2;
}
public function execute(Observer $E9)
{
$wS = array_keys($this->request->getParams());
$N2 = array_intersect($wS, $this->requestParams);
try {
if (!$this->checkIfUserShouldBeRedirected()) {
goto EOP;
}
$E9->getControllerAction()->getResponse()->setRedirect($this->oauthUtility->getSPInitiatedUrl());
EOP:
} catch (\Exception $bZ) {
$this->messageManager->addErrorMessage($bZ->getMessage());
$this->logger->debug($bZ->getMessage());
}
}
private function checkIfUserShouldBeRedirected()
{
if (!($this->oauthUtility->getStoreConfig(OAuthConstants::AUTO_REDIRECT) != "1" || $this->oauthUtility->isUserLoggedIn())) {
goto Buc;
}
return false;
Buc:
if (!($this->oauthUtility->getStoreConfig(OAuthConstants::BACKDOOR) == "1" && array_key_exists(OAuthConstants::OAuth_SSO_FALSE, $this->request->getParams()))) {
goto IYk;
}
return false;
IYk:
$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;
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace MiniOrange\OAuth\Observer;
use Magento\Framework\Event\ObserverInterface;
use MiniOrange\OAuth\Helper\Exception\InvalidSignatureInResponseException;
use MiniOrange\OAuth\Helper\OAuthMessages;
use Magento\Framework\Event\Observer;
use MiniOrange\OAuth\Controller\Actions\ReadAuthorizationResponse;
use MiniOrange\OAuth\Helper\OAuthConstants;
class RedirectToIDPObserver implements ObserverInterface
{
private $requestParams = array("\x6f\x70\164\151\x6f\156");
private $controllerActionPair = array("\141\143\x63\157\165\x6e\164" => array("\154\x6f\x67\x69\156", "\x63\162\x65\x61\164\x65"), "\x61\165\x74\x68" => array("\x6c\157\147\151\156"));
private $messageManager;
private $logger;
private $readAuthorizationResponse;
private $oauthUtility;
private $adminLoginAction;
private $testAction;
private $currentControllerName;
private $currentActionName;
private $requestInterface;
private $request;
public function __construct(\Magento\Framework\Message\ManagerInterface $hU, \Psr\Log\LoggerInterface $K6, \MiniOrange\OAuth\Controller\Actions\ReadAuthorizationResponse $gV, \MiniOrange\OAuth\Helper\OAuthUtility $hA, \MiniOrange\OAuth\Controller\Actions\AdminLoginAction $C0, \Magento\Framework\App\Request\Http $ef, \Magento\Framework\App\RequestInterface $JO, \MiniOrange\OAuth\Controller\Actions\ShowTestResultsAction $d2)
{
$this->messageManager = $hU;
$this->logger = $K6;
$this->readAuthorizationResponse = $gV;
$this->{$hA} = ${$hA};
$this->adminLoginAction = $C0;
$this->currentControllerName = $ef->getControllerName();
$this->currentActionName = $ef->getActionName();
$this->request = $JO;
$this->testAction = $d2;
}
public function execute(Observer $E9)
{
$wS = array_keys($this->request->getParams());
$N2 = array_intersect($wS, $this->requestParams);
try {
if (!$this->checkIfUserShouldBeRedirected()) {
goto EOP;
}
$E9->getControllerAction()->getResponse()->setRedirect($this->oauthUtility->getSPInitiatedUrl());
EOP:
} catch (\Exception $bZ) {
$this->messageManager->addErrorMessage($bZ->getMessage());
$this->logger->debug($bZ->getMessage());
}
}
private function checkIfUserShouldBeRedirected()
{
if (!($this->oauthUtility->getStoreConfig(OAuthConstants::AUTO_REDIRECT) != "\61" || $this->oauthUtility->isUserLoggedIn())) {
goto Buc;
}
return false;
Buc:
if (!($this->oauthUtility->getStoreConfig(OAuthConstants::BACKDOOR) == "\61" && array_key_exists(OAuthConstants::OAuth_SSO_FALSE, $this->request->getParams()))) {
goto IYk;
}
return false;
IYk:
$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;
}
}
Function Calls
None |
Stats
MD5 | a437c6c8f86a3bb22dc82e90a64079a5 |
Eval Count | 0 |
Decode Time | 81 ms |