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; include_once "\x61\165\164\157\154\x6f\x61\144\x2e\160..

Decoded Output download

<?php 
 
 
namespace MiniOrange; 
 
include_once "autoload.php"; 
use MiniOrange\Classes\Actions\ProcessResponseAction; 
use MiniOrange\Classes\Actions\ProcessUserAction; 
use MiniOrange\Classes\Actions\ReadResponseAction; 
use MiniOrange\Classes\Actions\TestResultActions; 
use MiniOrange\Helper\Constants; 
use MiniOrange\Helper\Messages; 
use MiniOrange\Helper\Utilities; 
use MiniOrange\Helper\PluginSettings; 
final class SSO 
{ 
    public function __construct() 
    { 
        $X0 = PluginSettings::getPluginSettings(); 
        if (array_key_exists("SAMLResponse", $_REQUEST) && !empty($_REQUEST["SAMLResponse"])) { 
            goto QS; 
        } 
        Utilities::showErrorMessage(Messages::MISSING_SAML_RESPONSE); 
        goto L8; 
        QS: 
        try { 
            $w8 = array_key_exists("RelayState", $_REQUEST) ? $_REQUEST["RelayState"] : "/"; 
            $yH = ReadResponseAction::execute(); 
            $Ob = new ProcessResponseAction($yH); 
            $Ob->execute(); 
            $Gm = current(current($yH->getAssertions())->getNameId()); 
            $zz = current($yH->getAssertions())->getAttributes(); 
            $zz["NameID"] = array("0" => $Gm); 
            $Yu = current($yH->getAssertions())->getSessionIndex(); 
            $t6 = $X0->getCustomAttributeMapping(); 
            if (strcasecmp($w8, Constants::TEST_RELAYSTATE) == 0) { 
                goto Mx; 
            } 
            (new ProcessUserAction($zz, $w8, $Yu))->execute(); 
            if (!isset($_SESSION)) { 
                session_name("ShopSession"); 
                session_start(); 
                goto w5; 
            } 
            w5: 
            $_SESSION["mo_NameID"] = $zz["NameID"]; 
            $vr = $zz[$X0->getSamlAmEmail()]; 
            $co = $zz[$X0->getSamlAmUsername()]; 
            $tS = array("EMAIL" => $vr[0], "Username" => $co[0]); 
            if (!(is_array($t6) && !empty($t6))) { 
                goto fc; 
            } 
            foreach ($t6 as $lZ => $oB) { 
                if (!array_key_exists($oB, $zz)) { 
                    goto iB; 
                } 
                if (count($zz[$oB]) == 1) { 
                    goto ul; 
                } 
                $tS[$lZ] = $zz[$oB]; 
                goto Q0; 
                ul: 
                $tS[$lZ] = $zz[$oB][0]; 
                Q0: 
                iB: 
                j8: 
            } 
            g_: 
            fc: 
            if (!(is_array($tS) && !empty($tS))) { 
                goto uf; 
            } 
            $_SESSION["mo_attributes"] = serialize($tS); 
            uf: 
            $IO = $X0->getApplicationUrl(); 
            if (!empty($IO)) { 
                goto Mr; 
            } 
            header("Location: " . $w8); 
            exit; 
            goto wF; 
            Mr: 
            header("Location: " . $IO); 
            exit; 
            wF: 
            goto CE; 
            Mx: 
            (new TestResultActions($zz))->execute(); 
            CE: 
        } catch (\Exception $Rv) { 
            if (strcasecmp($w8, Constants::TEST_RELAYSTATE) == 0) { 
                goto zH; 
            } 
            Utilities::showErrorMessage($Rv->getMessage()); 
            goto G5; 
            zH: 
            (new TestResultActions(array(), $Rv))->execute(); 
            G5: 
        } 
        L8: 
    } 
} 
new SSO(); 
 ?>

Did this file decode correctly?

Original Code

<?php


namespace MiniOrange;

include_once "\x61\165\164\157\154\x6f\x61\144\x2e\160\150\x70";
use MiniOrange\Classes\Actions\ProcessResponseAction;
use MiniOrange\Classes\Actions\ProcessUserAction;
use MiniOrange\Classes\Actions\ReadResponseAction;
use MiniOrange\Classes\Actions\TestResultActions;
use MiniOrange\Helper\Constants;
use MiniOrange\Helper\Messages;
use MiniOrange\Helper\Utilities;
use MiniOrange\Helper\PluginSettings;
final class SSO
{
    public function __construct()
    {
        $X0 = PluginSettings::getPluginSettings();
        if (array_key_exists("\123\x41\x4d\x4c\x52\x65\163\160\x6f\156\163\x65", $_REQUEST) && !empty($_REQUEST["\x53\x41\115\114\x52\x65\163\x70\157\156\x73\145"])) {
            goto QS;
        }
        Utilities::showErrorMessage(Messages::MISSING_SAML_RESPONSE);
        goto L8;
        QS:
        try {
            $w8 = array_key_exists("\122\145\154\x61\171\x53\x74\141\164\145", $_REQUEST) ? $_REQUEST["\122\x65\x6c\x61\171\123\164\141\x74\x65"] : "\57";
            $yH = ReadResponseAction::execute();
            $Ob = new ProcessResponseAction($yH);
            $Ob->execute();
            $Gm = current(current($yH->getAssertions())->getNameId());
            $zz = current($yH->getAssertions())->getAttributes();
            $zz["\x4e\x61\x6d\x65\x49\x44"] = array("\x30" => $Gm);
            $Yu = current($yH->getAssertions())->getSessionIndex();
            $t6 = $X0->getCustomAttributeMapping();
            if (strcasecmp($w8, Constants::TEST_RELAYSTATE) == 0) {
                goto Mx;
            }
            (new ProcessUserAction($zz, $w8, $Yu))->execute();
            if (!isset($_SESSION)) {
                session_name("ShopSession");
                session_start();
                goto w5;
            }
            w5:
            $_SESSION["\155\157\137\116\141\155\145\x49\104"] = $zz["\x4e\x61\x6d\x65\111\104"];
            $vr = $zz[$X0->getSamlAmEmail()];
            $co = $zz[$X0->getSamlAmUsername()];
            $tS = array("\x45\115\101\111\x4c" => $vr[0], "\x55\x73\145\x72\156\x61\x6d\x65" => $co[0]);
            if (!(is_array($t6) && !empty($t6))) {
                goto fc;
            }
            foreach ($t6 as $lZ => $oB) {
                if (!array_key_exists($oB, $zz)) {
                    goto iB;
                }
                if (count($zz[$oB]) == 1) {
                    goto ul;
                }
                $tS[$lZ] = $zz[$oB];
                goto Q0;
                ul:
                $tS[$lZ] = $zz[$oB][0];
                Q0:
                iB:
                j8:
            }
            g_:
            fc:
            if (!(is_array($tS) && !empty($tS))) {
                goto uf;
            }
            $_SESSION["\155\157\137\x61\164\x74\162\x69\x62\x75\164\x65\163"] = serialize($tS);
            uf:
            $IO = $X0->getApplicationUrl();
            if (!empty($IO)) {
                goto Mr;
            }
            header("\114\157\x63\141\x74\151\157\156\x3a\40" . $w8);
            exit;
            goto wF;
            Mr:
            header("\x4c\x6f\143\x61\164\151\x6f\x6e\72\40" . $IO);
            exit;
            wF:
            goto CE;
            Mx:
            (new TestResultActions($zz))->execute();
            CE:
        } catch (\Exception $Rv) {
            if (strcasecmp($w8, Constants::TEST_RELAYSTATE) == 0) {
                goto zH;
            }
            Utilities::showErrorMessage($Rv->getMessage());
            goto G5;
            zH:
            (new TestResultActions(array(), $Rv))->execute();
            G5:
        }
        L8:
    }
}
new SSO();

Function Calls

None

Variables

None

Stats

MD5 edb78c6bb8c21f2f1a7601d9a0f6a118
Eval Count 0
Decode Time 54 ms