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\SAMLResponseException;
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 $B3, \Psr\Log\LoggerInterface $ag, \MiniOrange\OAuth\Controller\Actions\ReadAuthorizationResponse $l4, \MiniOrange\OAuth\Helper\OAuthUtility $AX, \MiniOrange\OAuth\Controller\Actions\AdminLoginAction $oM, \Magento\Framework\App\Request\Http $hE, \Magento\Framework\App\RequestInterface $CB, \MiniOrange\OAuth\Controller\Actions\ShowTestResultsAction $Rz)
{
$this->messageManager = $B3;
$this->logger = $ag;
$this->readAuthorizationResponse = $l4;
$this->{$AX} = ${$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 {
if (!$this->checkIfUserShouldBeRedirected()) {
goto MCh;
}
$jN->getControllerAction()->getResponse()->setRedirect($this->oauthUtility->getSPInitiatedUrl());
MCh:
} catch (\Exception $Rr) {
$this->messageManager->addErrorMessage($Rr->getMessage());
$this->logger->debug($Rr->getMessage());
}
}
private function checkIfUserShouldBeRedirected()
{
if (!($this->oauthUtility->getStoreConfig(OAuthConstants::AUTO_REDIRECT) != "1" || $this->oauthUtility->isUserLoggedIn())) {
goto kwA;
}
return FALSE;
kwA:
if (!($this->oauthUtility->getStoreConfig(OAuthConstants::BACKDOOR) == "1" && array_key_exists(OAuthConstants::OAuth_SSO_FALSE, $this->request->getParams()))) {
goto UOm;
}
return FALSE;
UOm:
$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\Event\ObserverInterface;
use MiniOrange\OAuth\Helper\Exception\SAMLResponseException;
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\160\164\x69\157\156");
private $controllerActionPair = array("\141\143\x63\x6f\x75\156\164" => array("\154\157\x67\151\156", "\143\162\145\x61\x74\x65"), "\x61\x75\x74\150" => array("\154\157\x67\x69\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 $B3, \Psr\Log\LoggerInterface $ag, \MiniOrange\OAuth\Controller\Actions\ReadAuthorizationResponse $l4, \MiniOrange\OAuth\Helper\OAuthUtility $AX, \MiniOrange\OAuth\Controller\Actions\AdminLoginAction $oM, \Magento\Framework\App\Request\Http $hE, \Magento\Framework\App\RequestInterface $CB, \MiniOrange\OAuth\Controller\Actions\ShowTestResultsAction $Rz)
{
$this->messageManager = $B3;
$this->logger = $ag;
$this->readAuthorizationResponse = $l4;
$this->{$AX} = ${$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 {
if (!$this->checkIfUserShouldBeRedirected()) {
goto MCh;
}
$jN->getControllerAction()->getResponse()->setRedirect($this->oauthUtility->getSPInitiatedUrl());
MCh:
} catch (\Exception $Rr) {
$this->messageManager->addErrorMessage($Rr->getMessage());
$this->logger->debug($Rr->getMessage());
}
}
private function checkIfUserShouldBeRedirected()
{
if (!($this->oauthUtility->getStoreConfig(OAuthConstants::AUTO_REDIRECT) != "\x31" || $this->oauthUtility->isUserLoggedIn())) {
goto kwA;
}
return FALSE;
kwA:
if (!($this->oauthUtility->getStoreConfig(OAuthConstants::BACKDOOR) == "\61" && array_key_exists(OAuthConstants::OAuth_SSO_FALSE, $this->request->getParams()))) {
goto UOm;
}
return FALSE;
UOm:
$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 |
Stats
MD5 | ec832fefd9a1891f53661ead1fad171f |
Eval Count | 0 |
Decode Time | 38 ms |