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\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 $Vz, \Psr\Log\LoggerInterface $yA, \MiniOrange\OAuth\Controller\Actions\ReadAuthorizationResponse $EF, \MiniOrange\OAuth\Helper\OAuthUtility $Dz, \MiniOrange\OAuth\Controller\Actions\AdminLoginAction $eS, \Magento\Framework\App\Request\Http $wl, \Magento\Framework\App\RequestInterface $tb, \MiniOrange\OAuth\Controller\Actions\ShowTestResultsAction $zB)
{
$this->messageManager = $Vz;
$this->logger = $yA;
$this->readAuthorizationResponse = $EF;
$this->{$Dz} = $Dz;
$this->adminLoginAction = $eS;
$this->currentControllerName = $wl->getControllerName();
$this->currentActionName = $wl->getActionName();
$this->request = $tb;
$this->testAction = $zB;
}
public function execute(Observer $H2)
{
$Ab = array_keys($this->request->getParams());
$vr = array_intersect($Ab, $this->requestParams);
try {
if (!$this->checkIfUserShouldBeRedirected()) {
goto enb;
}
$H2->getControllerAction()->getResponse()->setRedirect($this->oauthUtility->getSPInitiatedUrl());
enb:
} catch (\Exception $i0) {
$this->messageManager->addErrorMessage($i0->getMessage());
$this->logger->debug($i0->getMessage());
}
}
private function checkIfUserShouldBeRedirected()
{
if (!($this->oauthUtility->getStoreConfig(OAuthConstants::AUTO_REDIRECT) != "1" || $this->oauthUtility->isUserLoggedIn())) {
goto RQh;
}
return false;
RQh:
if (!($this->oauthUtility->getStoreConfig(OAuthConstants::BACKDOOR) == "1" && array_key_exists(OAuthConstants::OAuth_SSO_FALSE, $this->request->getParams()))) {
goto tyw;
}
return false;
tyw:
$h8 = array_key_exists($this->currentControllerName, $this->controllerActionPair) ? $this->controllerActionPair[$this->currentControllerName] : null;
return !is_null($h8) && is_array($h8) ? in_array($this->currentActionName, $h8) : false;
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace MiniOrange\OAuth\Observer;
use Magento\Framework\Event\ObserverInterface;
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("\157\160\x74\x69\157\156");
private $controllerActionPair = array("\141\x63\x63\x6f\165\x6e\x74" => array("\154\x6f\x67\x69\156", "\143\162\145\141\164\x65"), "\141\x75\x74\150" => array("\x6c\x6f\x67\151\x6e"));
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 $Vz, \Psr\Log\LoggerInterface $yA, \MiniOrange\OAuth\Controller\Actions\ReadAuthorizationResponse $EF, \MiniOrange\OAuth\Helper\OAuthUtility $Dz, \MiniOrange\OAuth\Controller\Actions\AdminLoginAction $eS, \Magento\Framework\App\Request\Http $wl, \Magento\Framework\App\RequestInterface $tb, \MiniOrange\OAuth\Controller\Actions\ShowTestResultsAction $zB)
{
$this->messageManager = $Vz;
$this->logger = $yA;
$this->readAuthorizationResponse = $EF;
$this->{$Dz} = $Dz;
$this->adminLoginAction = $eS;
$this->currentControllerName = $wl->getControllerName();
$this->currentActionName = $wl->getActionName();
$this->request = $tb;
$this->testAction = $zB;
}
public function execute(Observer $H2)
{
$Ab = array_keys($this->request->getParams());
$vr = array_intersect($Ab, $this->requestParams);
try {
if (!$this->checkIfUserShouldBeRedirected()) {
goto enb;
}
$H2->getControllerAction()->getResponse()->setRedirect($this->oauthUtility->getSPInitiatedUrl());
enb:
} catch (\Exception $i0) {
$this->messageManager->addErrorMessage($i0->getMessage());
$this->logger->debug($i0->getMessage());
}
}
private function checkIfUserShouldBeRedirected()
{
if (!($this->oauthUtility->getStoreConfig(OAuthConstants::AUTO_REDIRECT) != "\x31" || $this->oauthUtility->isUserLoggedIn())) {
goto RQh;
}
return false;
RQh:
if (!($this->oauthUtility->getStoreConfig(OAuthConstants::BACKDOOR) == "\61" && array_key_exists(OAuthConstants::OAuth_SSO_FALSE, $this->request->getParams()))) {
goto tyw;
}
return false;
tyw:
$h8 = array_key_exists($this->currentControllerName, $this->controllerActionPair) ? $this->controllerActionPair[$this->currentControllerName] : null;
return !is_null($h8) && is_array($h8) ? in_array($this->currentActionName, $h8) : false;
}
}
Function Calls
None |
Stats
MD5 | 54b40d8c837826ca36ff01623ba9192a |
Eval Count | 0 |
Decode Time | 47 ms |