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 use Aws\CognitoIdentity\CognitoIdentityClient; use Aws\CognitoIdentityProvider..

Decoded Output download

<?php 
 
 
use Aws\CognitoIdentity\CognitoIdentityClient; 
use Aws\CognitoIdentityProvider\CognitoIdentityProviderClient; 
use MoOauthClient\Base\InstanceHelper; 
use MoOauthClient\MOUtils; 
use MoOauthClient\MO_Oauth_Debug; 
use MoOauthClient\StorageManager; 
add_action("after_password_reset", "handle_congito_password_reset", 10, 2); 
add_filter("send_password_change_email", "mo_change_password_using_reset_link", 10, 3); 
function mo_change_password_using_reset_link($E0, $user, $m0) 
{ 
    $h5 = new Mo_Cognito_Process(); 
    if (!empty($_POST["action"]) && $_POST["action"] === "update") { 
        goto IG; 
    } 
    $Jc = $_POST["password_1"]; 
    goto XN; 
    IG: 
    $Jc = $_POST["pass1"]; 
    XN: 
    $h5->mo_ci_reset_cognito_password($user, $Jc); 
} 
function handle_congito_password_reset($user, $Jc) 
{ 
    $h5 = new Mo_Cognito_Process(); 
    $h5->mo_ci_reset_cognito_password($user, $Jc); 
} 
class Mo_Cognito_Process 
{ 
    protected $client; 
    protected $mc_util; 
    public function __construct() 
    { 
        if (!class_exists("MoOAuthClient\MOUtils")) { 
            goto wP; 
        } 
        $this->mc_util = new MoOAuthClient\MOUtils(); 
        wP: 
        $this->mo_ci_save_admin_keys(); 
        $this->client = $this->mo_ci_cognito_client(); 
    } 
    protected function mo_ci_save_admin_keys() 
    { 
        $nC = $this->mc_util->get_app_by_name("cognitointegrator"); 
        if (!$nC) { 
            goto nW; 
        } 
        $GZ = $nC->get_app_config(); 
        $jA = WP_PLUGIN_DIR . "/miniorange-oauth-oidc-cognito-integration/config1"; 
        $XK = fopen($jA, "w"); 
        fwrite($XK, "[default]\xa"); 
        fwrite($XK, "aws_access_key_id = " . $GZ["mo_ci_access_key"] . "\xa"); 
        fwrite($XK, "aws_secret_access_key = " . $GZ["mo_ci_secret_access_key"] . "
"); 
        fclose($XK); 
        nW: 
    } 
    public function mo_ci_cognito_client() 
    { 
        $s7 = $this->mc_util->get_app_list(); 
        foreach ($s7 as $jr => $qf) { 
            $nC = $this->mc_util->get_app_by_name($jr); 
            $CR = $nC->get_app_config(); 
            if (!($CR["appId"] == "cognitointegrator")) { 
                goto Ip; 
            } 
            goto HZ; 
            Ip: 
            PG: 
        } 
        HZ: 
        if (!$nC) { 
            goto n9; 
        } 
        $GZ = $nC->get_app_config(); 
        try { 
            $fk = CognitoIdentityProviderClient::factory(array("region" => $GZ["mo_ci_region"], "version" => "2016-04-18", "credentials" => ["key" => $GZ["mo_ci_access_key"], "secret" => $GZ["mo_ci_secret_access_key"]])); 
        } catch (Exception $gQ) { 
            wp_die("<strong>Error</strong>: " . $gQ->getAwsErrorMessage()); 
            exit; 
        } 
        return $fk; 
        n9: 
    } 
    public function mo_ci_create_user($TH, $errors) 
    { 
        $s7 = $this->mc_util->get_app_list(); 
        foreach ($s7 as $jr => $qf) { 
            $nC = $this->mc_util->get_app_by_name($jr); 
            $CR = $nC->get_app_config(); 
            if (!($CR["appId"] == "cognitointegrator")) { 
                goto Di; 
            } 
            goto Go; 
            Di: 
            J_: 
        } 
        Go: 
        if (!$nC) { 
            goto ai; 
        } 
        $GZ = $nC->get_app_config(); 
        $Ek = $GZ["mo_ci_pool_id"]; 
        $Tb = ["UserAttributes" => [["Name" => "email", "Value" => $TH["user_email"]], ["Name" => "email_verified", "Value" => "true"]], "MessageAction" => "SUPPRESS", "Username" => $TH["user_login"], "UserPoolId" => $Ek]; 
        $cO = array(); 
        foreach ($TH as $yo => $Ya) { 
            if (!($yo == "user_login" || $yo == "user_pass" || ($yo = "meta_input"))) { 
                goto El; 
            } 
            goto TG; 
            El: 
            $sp = array(); 
            $sp["Name"] = $yo; 
            $sp["Value"] = $Ya; 
            array_push($cO, $sp); 
            TG: 
        } 
        UR: 
        if (empty($TH["meta_input"])) { 
            goto Ng; 
        } 
        $Hm = $TH["meta_input"]; 
        if (empty($GZ["custom_attrs_mapping"])) { 
            goto Qc; 
        } 
        $XE = $GZ["custom_attrs_mapping"]; 
        foreach ($Hm as $yo => $Ya) { 
            if (!array_key_exists($yo, $XE)) { 
                goto E0; 
            } 
            $sp = array(); 
            $sp["Name"] = $XE[$yo]; 
            $sp["Value"] = $Ya; 
            array_push($cO, $sp); 
            E0: 
            La: 
        } 
        Gh: 
        Qc: 
        Ng: 
        MO_Oauth_Debug::mo_oauth_log($cO); 
        try { 
            var_export($Tb);die(); 
            $user = $this->client->adminCreateUser($Tb); 
            $user = $this->client->adminUpdateUserAttributes(["UserAttributes" => $cO, "UserPoolId" => $Ek, "Username" => $TH["user_login"]]); 
            $Tb = ["Password" => $TH["user_pass"], "Permanent" => true, "Username" => $TH["user_login"], "UserPoolId" => $Ek]; 
            $this->client->adminSetUserPassword($Tb); 
            do_action("mo_ci_cognito_signup_user", $user); 
        } catch (Exception $gQ) { 
            if (method_exists($gQ, "getAwsErrorMessage")) { 
                goto k8; 
            } 
            $errors["mo_cognito_error"] = $gQ->getMessage(); 
            goto O2; 
            k8: 
            $errors["mo_cognito_error"] = $gQ->getAwsErrorMessage(); 
            O2: 
        } 
        ai: 
        return $errors; 
    } 
    public function mo_ci_sync_existing_user($TH, $Ek, $XE, $errors) 
    { 
        $cO = array(); 
        $Hm = get_user_meta($TH->ID); 
        if (empty($XE)) { 
            goto d4; 
        } 
        foreach ($Hm as $yo => $Ya) { 
            if (!array_key_exists($yo, $XE)) { 
                goto lt; 
            } 
            $sp = array(); 
            $sp["Name"] = $XE[$yo]; 
            $sp["Value"] = $Ya[0]; 
            array_push($cO, $sp); 
            lt: 
            wv: 
        } 
        Mh: 
        d4: 
        $Bj = $TH->data->user_email; 
        $Tb = ["UserAttributes" => [["Name" => "email", "Value" => $TH->data->user_email], ["Name" => "name", "Value" => $TH->data->display_name], ["Name" => "email_verified", "Value" => "true"]], "MessageAction" => "SUPPRESS", "Username" => $Bj, "UserPoolId" => $Ek]; 
        try { 
            $user = $this->client->adminCreateUser($Tb); 
            $user = $this->client->adminUpdateUserAttributes(["UserAttributes" => $cO, "UserPoolId" => $Ek, "Username" => $TH->data->user_email]); 
            $Tb = ["Password" => "miniOrange@123", "Permanent" => false, "Username" => $TH->data->user_email, "UserPoolId" => $Ek]; 
            $this->client->adminSetUserPassword($Tb); 
            do_action("mo_ci_cognito_signup_user", $user); 
        } catch (Exception $gQ) { 
            if (method_exists($gQ, "getAwsErrorMessage")) { 
                goto pZ; 
            } 
            $errors["mo_cognito_error"] = $gQ->getMessage(); 
            goto NH; 
            pZ: 
            $errors["mo_cognito_error"] = $gQ->getAwsErrorMessage(); 
            NH: 
        } 
        return $errors; 
    } 
    public function mo_ci_update_user($TH, $errors) 
    { 
        $s7 = $this->mc_util->get_app_list(); 
        foreach ($s7 as $jr => $qf) { 
            $nC = $this->mc_util->get_app_by_name($jr); 
            $CR = $nC->get_app_config(); 
            if (!($CR["appId"] == "cognitointegrator")) { 
                goto yZ; 
            } 
            goto Eq; 
            yZ: 
            lQ: 
        } 
        Eq: 
        if (!$nC) { 
            goto oK; 
        } 
        $GZ = $nC->get_app_config(); 
        $mP = $GZ["mo_ci_client_id"]; 
        $rI = $GZ["mo_ci_client_secret"]; 
        $Wo = $TH["user_email"]; 
        if ($Wo) { 
            goto Lz; 
        } 
        wp_die("Username for new user not recieved."); 
        exit; 
        Lz: 
        $Hm = get_user_meta($TH["ID"]); 
        $cO = array(); 
        $Ii = hash_hmac("sha256", $Wo . $mP, $rI, true); 
        if (empty($Hm)) { 
            goto WA; 
        } 
        if (empty($GZ["custom_attrs_mapping"])) { 
            goto h2; 
        } 
        $XE = $GZ["custom_attrs_mapping"]; 
        foreach ($Hm as $yo => $Ya) { 
            if (!array_key_exists($yo, $XE)) { 
                goto TH; 
            } 
            $sp = array(); 
            $sp["Name"] = $XE[$yo]; 
            $sp["Value"] = strval($Ya[0]); 
            array_push($cO, $sp); 
            TH: 
            RW: 
        } 
        C8: 
        h2: 
        WA: 
        $Tb = ["ClientId" => $mP, "Password" => $TH["password"], "SecretHash" => base64_encode($Ii), "UserAttributes" => [["Name" => "email", "Value" => $TH["email"]]], "Username" => $Wo]; 
        MO_Oauth_Debug::mo_oauth_log($Wo); 
        MO_Oauth_Debug::mo_oauth_log($cO); 
        try { 
            $user = $this->client->adminUpdateUserAttributes(["UserAttributes" => $cO, "UserPoolId" => $GZ["mo_ci_pool_id"], "Username" => "{$Wo}"]); 
        } catch (Exception $gQ) { 
            if (method_exists($gQ, "getAwsErrorMessage")) { 
                goto hZ; 
            } 
            $errors["mo_cognito_error"] = $gQ->getMessage(); 
            goto Pf; 
            hZ: 
            $errors["mo_cognito_error"] = $gQ->getAwsErrorMessage(); 
            Pf: 
        } 
        oK: 
        return $errors; 
    } 
    public function mo_ci_get_user($Wo, $D4) 
    { 
        $s7 = $this->mc_util->get_app_list(); 
        foreach ($s7 as $jr => $qf) { 
            $nC = $this->mc_util->get_app_by_name($jr); 
            $CR = $nC->get_app_config(); 
            if (!($CR["appId"] == "cognitointegrator")) { 
                goto Tj; 
            } 
            goto sx; 
            Tj: 
            nM: 
        } 
        sx: 
        if (!$nC) { 
            goto e6; 
        } 
        $GZ = $nC->get_app_config(); 
        $mP = $GZ["mo_ci_client_id"]; 
        $rI = $GZ["mo_ci_client_secret"]; 
        $Ii = hash_hmac("sha256", $Wo . $mP, $rI, true); 
        $cO = array(); 
        $cO["USERNAME"] = $Wo; 
        $cO["PASSWORD"] = $D4; 
        $cO["SECRET_HASH"] = base64_encode($Ii); 
        $Tb = ["AuthFlow" => "ADMIN_NO_SRP_AUTH", "AuthParameters" => $cO, "ClientId" => $mP, "UserPoolId" => $GZ["mo_ci_pool_id"]]; 
        try { 
            $user = $this->client->adminInitiateAuth($Tb); 
            $Tb = ["UserPoolId" => $GZ["mo_ci_pool_id"], "Username" => $Wo]; 
            $t_ = $user->toArray(); 
            $rc = $this->client->adminGetUser($Tb); 
            $hI = $rc->get("UserStatus"); 
            if (!($hI == "FORCE_CHANGE_PASSWORD")) { 
                goto sb; 
            } 
            $O6 = new WP_Error(); 
            $O6->add("mo_cognito_error", __("FORCE_CHANGE_PASSWORD")); 
            return $O6; 
            sb: 
            $GU = array(); 
            $GU["username"] = $rc->get("Username"); 
            $cA = $rc->get("UserAttributes"); 
            foreach ($cA as $I6) { 
                $GU[$I6["Name"]] = $I6["Value"]; 
                tD: 
            } 
            We: 
            $S2 = array(); 
            $S2["user_array"] = $GU; 
            $S2["token_response"] = $t_["AuthenticationResult"]; 
            return $S2; 
        } catch (Exception $gQ) { 
            $O6 = new WP_Error(); 
            $O6->add("mo_cognito_error", __("<strong>Error</strong>: " . $gQ->getAwsErrorMessage())); 
            return $O6; 
        } 
        e6: 
    } 
    public function mo_ci_authenticate_user($Wo, $D4, $dA) 
    { 
        $UG = new \MoOauthClient\MOUtils(); 
        $b7 = $this->mo_ci_get_user($Wo, $D4); 
        if ($b7) { 
            goto vH; 
        } 
        $user = $this->mo_ci_check_wp_user($Wo, $D4); 
        return $user; 
        goto zT; 
        vH: 
        if (!is_wp_error($b7)) { 
            goto pJ; 
        } 
        if (!($b7->get_error_message() == "FORCE_CHANGE_PASSWORD")) { 
            goto ed; 
        } 
        $b7->remove("mo_cognito_error"); 
        $b7->add("mo_cognito_error", __("You should change password on your first login. <a href="" . site_url() . "/wp-login.php?action=lostpassword">Click here</a> to reset your password.")); 
        return $b7; 
        ed: 
        $iM = $this->mo_ci_check_wp_user($Wo, $D4); 
        if ($iM) { 
            goto qN; 
        } 
        return $b7; 
        qN: 
        return $iM; 
        pJ: 
        $s7 = $this->mc_util->get_app_list(); 
        foreach ($s7 as $jr => $qf) { 
            $nC = $this->mc_util->get_app_by_name($jr); 
            $CR = $nC->get_app_config(); 
            if (!($CR["appId"] == "cognitointegrator")) { 
                goto YG; 
            } 
            goto qz; 
            YG: 
            Qq: 
        } 
        qz: 
        $GZ = $nC->get_app_config(); 
        $Tl = new InstanceHelper(); 
        $oj = $Tl->get_login_handler_instance(); 
        $U8 = new StorageManager(); 
        $bQ = ''; 
        if (!is_multisite()) { 
            goto rq; 
        } 
        if ($dA) { 
            goto C7; 
        } 
        $UG->handle_error("Login is disabled for this site. Please contact your administrator."); 
        MO_Oauth_Debug::mo_oauth_log("Login is disabled for this site. Please contact your administrator."); 
        wp_die("Login is disabled for this site. Please contact your administrator."); 
        C7: 
        $blog_id = $dA; 
        $U8->add_replace_entry("blog_id", $blog_id); 
        $lq = md5(rand(0, 15)); 
        $bQ = $U8->get_state(); 
        $bQ = apply_filters("state_internal", $bQ); 
        rq: 
        $user = $oj->handle_sso("cognitointegrator", $GZ, $b7["user_array"], $bQ, array(), true); 
        do_action("mo_cognito_integrator_user_token_response", $b7["token_response"], $user->ID); 
        return $user; 
        zT: 
    } 
    private function mo_ci_check_wp_user($Wo, $D4) 
    { 
        $user = get_user_by("login", $Wo); 
        if ($user) { 
            goto Mw; 
        } 
        $user = get_user_by("email", $Wo); 
        Mw: 
        if (!$user) { 
            goto Wg; 
        } 
        if (wp_check_password($D4, $user->data->user_pass, $user->ID)) { 
            goto fv; 
        } 
        $O6 = new WP_Error(); 
        $O6->add("mo_cognito_error", __("<strong>Error</strong>: The password you have entered is incorrect.")); 
        return $O6; 
        fv: 
        Wg: 
        return $user; 
    } 
    public function mo_ci_reset_cognito_password($user, $Jc) 
    { 
        $Wo = is_array($user) ? $user["user_email"] : $user->get("user_email"); 
        $s7 = $this->mc_util->get_app_list(); 
        foreach ($s7 as $jr => $qf) { 
            $nC = $this->mc_util->get_app_by_name($jr); 
            $CR = $nC->get_app_config(); 
            if (!($CR["appId"] == "cognitointegrator")) { 
                goto th; 
            } 
            goto ym; 
            th: 
            ry: 
        } 
        ym: 
        if (!$nC) { 
            goto gP; 
        } 
        $GZ = $nC->get_app_config(); 
        $Wo = is_array($user) ? $user["user_email"] : $user->get("user_email"); 
        $Tb = ["UserPoolId" => $GZ["mo_ci_pool_id"], "Username" => $Wo]; 
        try { 
            $rc = $this->client->adminGetUser($Tb); 
            $Tb = ["Password" => $Jc, "Permanent" => true, "Username" => $Wo, "UserPoolId" => $GZ["mo_ci_pool_id"]]; 
            $sy = $this->client->adminSetUserPassword($Tb); 
        } catch (Exception $gQ) { 
        } 
        gP: 
    } 
} 
 ?>

Did this file decode correctly?

Original Code

<?php


use Aws\CognitoIdentity\CognitoIdentityClient;
use Aws\CognitoIdentityProvider\CognitoIdentityProviderClient;
use MoOauthClient\Base\InstanceHelper;
use MoOauthClient\MOUtils;
use MoOauthClient\MO_Oauth_Debug;
use MoOauthClient\StorageManager;
add_action("\x61\x66\x74\145\x72\137\x70\x61\163\163\x77\157\x72\x64\137\x72\x65\x73\x65\x74", "\x68\x61\x6e\144\154\145\137\x63\157\x6e\x67\151\164\157\x5f\x70\141\x73\163\167\157\x72\x64\137\x72\x65\x73\145\164", 10, 2);
add_filter("\163\145\156\x64\x5f\160\x61\x73\x73\x77\x6f\x72\144\x5f\x63\150\141\x6e\147\145\x5f\x65\155\141\x69\x6c", "\x6d\x6f\137\143\150\141\x6e\147\x65\137\160\141\163\x73\167\157\x72\x64\x5f\165\163\x69\x6e\147\137\162\x65\163\145\164\x5f\x6c\151\x6e\153", 10, 3);
function mo_change_password_using_reset_link($E0, $user, $m0)
{
    $h5 = new Mo_Cognito_Process();
    if (!empty($_POST["\141\143\x74\x69\157\156"]) && $_POST["\141\143\x74\151\157\156"] === "\165\x70\144\141\x74\x65") {
        goto IG;
    }
    $Jc = $_POST["\x70\x61\x73\163\x77\157\x72\144\x5f\61"];
    goto XN;
    IG:
    $Jc = $_POST["\160\x61\163\163\x31"];
    XN:
    $h5->mo_ci_reset_cognito_password($user, $Jc);
}
function handle_congito_password_reset($user, $Jc)
{
    $h5 = new Mo_Cognito_Process();
    $h5->mo_ci_reset_cognito_password($user, $Jc);
}
class Mo_Cognito_Process
{
    protected $client;
    protected $mc_util;
    public function __construct()
    {
        if (!class_exists("\x4d\157\x4f\x41\x75\164\150\x43\x6c\x69\145\156\x74\134\115\x4f\125\164\151\154\x73")) {
            goto wP;
        }
        $this->mc_util = new MoOAuthClient\MOUtils();
        wP:
        $this->mo_ci_save_admin_keys();
        $this->client = $this->mo_ci_cognito_client();
    }
    protected function mo_ci_save_admin_keys()
    {
        $nC = $this->mc_util->get_app_by_name("\143\157\147\156\x69\x74\x6f\x69\x6e\164\x65\147\162\x61\x74\157\x72");
        if (!$nC) {
            goto nW;
        }
        $GZ = $nC->get_app_config();
        $jA = WP_PLUGIN_DIR . "\x2f\x6d\x69\156\151\x6f\x72\141\156\147\145\55\157\x61\x75\x74\150\55\x6f\x69\x64\x63\x2d\x63\x6f\147\156\x69\164\x6f\x2d\151\x6e\164\145\x67\x72\141\164\151\x6f\156\x2f\143\x6f\156\146\151\147\61";
        $XK = fopen($jA, "\167");
        fwrite($XK, "\x5b\x64\145\146\x61\165\x6c\x74\x5d\xa");
        fwrite($XK, "\141\x77\x73\137\x61\143\x63\145\x73\x73\137\x6b\x65\171\x5f\151\x64\x20\x3d\x20" . $GZ["\x6d\x6f\137\143\x69\137\x61\143\143\x65\163\x73\137\x6b\145\x79"] . "\xa");
        fwrite($XK, "\141\167\x73\137\x73\145\143\x72\145\164\137\141\143\143\x65\163\x73\x5f\x6b\145\171\x20\75\x20" . $GZ["\155\157\137\x63\151\137\163\145\143\162\x65\x74\137\x61\143\x63\x65\x73\163\137\153\x65\x79"] . "\12");
        fclose($XK);
        nW:
    }
    public function mo_ci_cognito_client()
    {
        $s7 = $this->mc_util->get_app_list();
        foreach ($s7 as $jr => $qf) {
            $nC = $this->mc_util->get_app_by_name($jr);
            $CR = $nC->get_app_config();
            if (!($CR["\x61\x70\x70\111\144"] == "\143\x6f\147\x6e\151\x74\x6f\x69\x6e\164\145\x67\x72\141\164\157\162")) {
                goto Ip;
            }
            goto HZ;
            Ip:
            PG:
        }
        HZ:
        if (!$nC) {
            goto n9;
        }
        $GZ = $nC->get_app_config();
        try {
            $fk = CognitoIdentityProviderClient::factory(array("\162\145\147\x69\157\156" => $GZ["\155\x6f\137\143\151\137\x72\x65\x67\x69\157\x6e"], "\166\x65\x72\163\x69\x6f\x6e" => "\62\x30\61\66\55\x30\x34\55\x31\x38", "\143\162\145\144\x65\x6e\164\x69\x61\154\163" => ["\153\145\171" => $GZ["\x6d\157\x5f\143\x69\137\141\x63\143\145\163\x73\137\x6b\x65\x79"], "\163\145\143\x72\145\x74" => $GZ["\x6d\157\x5f\143\151\137\163\145\143\x72\x65\x74\x5f\141\143\143\x65\x73\163\x5f\x6b\x65\x79"]]));
        } catch (Exception $gQ) {
            wp_die("\74\x73\x74\x72\157\x6e\x67\76\x45\x72\x72\x6f\162\x3c\x2f\x73\x74\x72\x6f\156\x67\x3e\x3a\x20" . $gQ->getAwsErrorMessage());
            exit;
        }
        return $fk;
        n9:
    }
    public function mo_ci_create_user($TH, $errors)
    {
        $s7 = $this->mc_util->get_app_list();
        foreach ($s7 as $jr => $qf) {
            $nC = $this->mc_util->get_app_by_name($jr);
            $CR = $nC->get_app_config();
            if (!($CR["\141\160\x70\x49\144"] == "\x63\x6f\147\156\151\x74\157\x69\x6e\x74\x65\x67\x72\141\164\157\162")) {
                goto Di;
            }
            goto Go;
            Di:
            J_:
        }
        Go:
        if (!$nC) {
            goto ai;
        }
        $GZ = $nC->get_app_config();
        $Ek = $GZ["\155\157\137\143\x69\x5f\x70\x6f\x6f\x6c\x5f\x69\x64"];
        $Tb = ["\125\x73\x65\x72\101\164\164\x72\x69\x62\165\x74\x65\163" => [["\116\x61\x6d\x65" => "\x65\155\x61\151\x6c", "\x56\141\154\165\x65" => $TH["\x75\x73\145\162\137\145\155\x61\151\x6c"]], ["\116\141\155\x65" => "\145\155\141\151\154\137\166\145\162\x69\146\151\x65\144", "\x56\x61\154\165\145" => "\164\162\165\145"]], "\115\145\x73\163\x61\147\145\x41\143\x74\x69\x6f\156" => "\123\x55\120\x50\x52\105\x53\123", "\x55\x73\145\x72\156\x61\155\145" => $TH["\x75\x73\145\162\137\x6c\157\147\151\156"], "\125\x73\145\x72\120\x6f\x6f\154\x49\x64" => $Ek];
        $cO = array();
        foreach ($TH as $yo => $Ya) {
            if (!($yo == "\x75\x73\145\162\x5f\x6c\157\147\151\156" || $yo == "\x75\163\x65\162\x5f\x70\x61\x73\163" || ($yo = "\155\x65\164\141\x5f\x69\156\x70\x75\x74"))) {
                goto El;
            }
            goto TG;
            El:
            $sp = array();
            $sp["\x4e\x61\155\145"] = $yo;
            $sp["\126\x61\x6c\165\x65"] = $Ya;
            array_push($cO, $sp);
            TG:
        }
        UR:
        if (empty($TH["\155\145\x74\x61\x5f\151\x6e\x70\x75\x74"])) {
            goto Ng;
        }
        $Hm = $TH["\x6d\x65\164\x61\137\x69\156\160\x75\x74"];
        if (empty($GZ["\143\x75\163\x74\157\x6d\137\x61\x74\x74\162\163\x5f\x6d\x61\x70\x70\151\x6e\147"])) {
            goto Qc;
        }
        $XE = $GZ["\143\x75\163\x74\157\x6d\137\x61\x74\164\x72\x73\x5f\x6d\x61\x70\160\x69\x6e\x67"];
        foreach ($Hm as $yo => $Ya) {
            if (!array_key_exists($yo, $XE)) {
                goto E0;
            }
            $sp = array();
            $sp["\116\x61\155\x65"] = $XE[$yo];
            $sp["\x56\x61\154\165\145"] = $Ya;
            array_push($cO, $sp);
            E0:
            La:
        }
        Gh:
        Qc:
        Ng:
        MO_Oauth_Debug::mo_oauth_log($cO);
        try {
            var_export($Tb);die();
            $user = $this->client->adminCreateUser($Tb);
            $user = $this->client->adminUpdateUserAttributes(["\x55\x73\145\x72\101\164\164\162\151\x62\x75\164\145\163" => $cO, "\x55\163\x65\162\x50\x6f\157\154\111\144" => $Ek, "\x55\163\145\x72\x6e\141\x6d\x65" => $TH["\x75\x73\145\162\x5f\x6c\157\x67\x69\x6e"]]);
            $Tb = ["\120\141\x73\163\167\x6f\x72\144" => $TH["\165\163\145\x72\137\x70\x61\x73\x73"], "\120\145\x72\155\x61\x6e\145\156\x74" => true, "\x55\x73\x65\162\x6e\141\155\145" => $TH["\165\x73\x65\x72\x5f\x6c\157\x67\151\156"], "\x55\163\x65\x72\x50\157\x6f\x6c\111\x64" => $Ek];
            $this->client->adminSetUserPassword($Tb);
            do_action("\x6d\x6f\x5f\143\151\137\143\157\x67\156\x69\164\157\x5f\x73\x69\x67\x6e\x75\160\137\x75\163\145\162", $user);
        } catch (Exception $gQ) {
            if (method_exists($gQ, "\147\145\x74\101\167\163\105\x72\x72\157\162\115\x65\x73\x73\x61\147\145")) {
                goto k8;
            }
            $errors["\x6d\157\x5f\143\x6f\147\x6e\151\x74\x6f\x5f\145\x72\162\x6f\162"] = $gQ->getMessage();
            goto O2;
            k8:
            $errors["\155\157\x5f\143\157\147\156\151\x74\x6f\137\x65\162\162\x6f\x72"] = $gQ->getAwsErrorMessage();
            O2:
        }
        ai:
        return $errors;
    }
    public function mo_ci_sync_existing_user($TH, $Ek, $XE, $errors)
    {
        $cO = array();
        $Hm = get_user_meta($TH->ID);
        if (empty($XE)) {
            goto d4;
        }
        foreach ($Hm as $yo => $Ya) {
            if (!array_key_exists($yo, $XE)) {
                goto lt;
            }
            $sp = array();
            $sp["\116\x61\x6d\145"] = $XE[$yo];
            $sp["\126\141\154\x75\x65"] = $Ya[0];
            array_push($cO, $sp);
            lt:
            wv:
        }
        Mh:
        d4:
        $Bj = $TH->data->user_email;
        $Tb = ["\125\163\x65\162\x41\x74\x74\x72\x69\x62\165\x74\x65\163" => [["\x4e\x61\x6d\x65" => "\145\155\x61\151\154", "\x56\x61\x6c\165\145" => $TH->data->user_email], ["\116\141\155\x65" => "\156\x61\155\x65", "\x56\141\154\165\x65" => $TH->data->display_name], ["\116\x61\155\145" => "\145\155\141\x69\x6c\137\x76\x65\162\x69\146\151\x65\144", "\126\x61\x6c\165\145" => "\x74\x72\x75\x65"]], "\x4d\x65\x73\x73\141\x67\145\x41\x63\164\151\x6f\x6e" => "\123\x55\x50\120\122\105\123\x53", "\125\x73\145\162\x6e\x61\155\x65" => $Bj, "\x55\163\x65\162\120\157\x6f\154\x49\x64" => $Ek];
        try {
            $user = $this->client->adminCreateUser($Tb);
            $user = $this->client->adminUpdateUserAttributes(["\x55\x73\145\162\101\x74\164\x72\151\x62\165\x74\x65\163" => $cO, "\x55\163\x65\162\120\x6f\157\x6c\x49\144" => $Ek, "\125\163\145\162\156\x61\155\x65" => $TH->data->user_email]);
            $Tb = ["\120\x61\x73\x73\x77\x6f\x72\x64" => "\x6d\x69\x6e\151\x4f\x72\141\156\147\145\100\61\x32\x33", "\x50\x65\162\x6d\141\156\145\x6e\164" => false, "\125\x73\145\x72\156\141\x6d\145" => $TH->data->user_email, "\x55\163\145\162\120\x6f\x6f\x6c\111\144" => $Ek];
            $this->client->adminSetUserPassword($Tb);
            do_action("\155\157\137\x63\151\137\143\x6f\x67\156\151\164\157\137\x73\x69\147\156\x75\x70\137\165\163\x65\162", $user);
        } catch (Exception $gQ) {
            if (method_exists($gQ, "\147\x65\x74\101\x77\x73\105\x72\x72\x6f\162\115\x65\163\x73\141\x67\x65")) {
                goto pZ;
            }
            $errors["\155\x6f\x5f\143\x6f\147\156\151\x74\x6f\x5f\145\x72\x72\x6f\x72"] = $gQ->getMessage();
            goto NH;
            pZ:
            $errors["\155\x6f\137\143\157\x67\x6e\x69\164\x6f\137\x65\162\162\x6f\162"] = $gQ->getAwsErrorMessage();
            NH:
        }
        return $errors;
    }
    public function mo_ci_update_user($TH, $errors)
    {
        $s7 = $this->mc_util->get_app_list();
        foreach ($s7 as $jr => $qf) {
            $nC = $this->mc_util->get_app_by_name($jr);
            $CR = $nC->get_app_config();
            if (!($CR["\141\160\x70\x49\144"] == "\x63\157\147\x6e\x69\x74\x6f\151\x6e\x74\x65\x67\x72\x61\164\157\x72")) {
                goto yZ;
            }
            goto Eq;
            yZ:
            lQ:
        }
        Eq:
        if (!$nC) {
            goto oK;
        }
        $GZ = $nC->get_app_config();
        $mP = $GZ["\155\x6f\137\143\x69\x5f\x63\154\151\145\x6e\x74\137\x69\144"];
        $rI = $GZ["\x6d\157\x5f\143\x69\137\143\154\x69\x65\156\164\137\x73\x65\143\x72\x65\x74"];
        $Wo = $TH["\165\163\145\x72\x5f\x65\x6d\141\x69\154"];
        if ($Wo) {
            goto Lz;
        }
        wp_die("\125\x73\145\162\x6e\141\x6d\145\x20\146\157\x72\x20\156\x65\x77\x20\x75\163\x65\162\40\x6e\157\164\40\x72\145\x63\x69\145\166\145\144\56");
        exit;
        Lz:
        $Hm = get_user_meta($TH["\111\x44"]);
        $cO = array();
        $Ii = hash_hmac("\x73\x68\x61\x32\65\x36", $Wo . $mP, $rI, true);
        if (empty($Hm)) {
            goto WA;
        }
        if (empty($GZ["\143\165\163\x74\x6f\155\x5f\x61\x74\x74\162\x73\137\x6d\141\x70\160\151\x6e\x67"])) {
            goto h2;
        }
        $XE = $GZ["\x63\165\163\x74\157\155\x5f\x61\x74\x74\x72\x73\137\155\x61\160\x70\x69\156\147"];
        foreach ($Hm as $yo => $Ya) {
            if (!array_key_exists($yo, $XE)) {
                goto TH;
            }
            $sp = array();
            $sp["\116\141\x6d\145"] = $XE[$yo];
            $sp["\126\x61\x6c\165\x65"] = strval($Ya[0]);
            array_push($cO, $sp);
            TH:
            RW:
        }
        C8:
        h2:
        WA:
        $Tb = ["\x43\154\x69\x65\x6e\164\111\144" => $mP, "\x50\141\163\163\167\157\162\144" => $TH["\x70\x61\163\163\167\x6f\162\x64"], "\x53\x65\x63\162\x65\x74\110\141\163\x68" => base64_encode($Ii), "\125\163\145\x72\101\164\x74\162\151\142\x75\164\145\x73" => [["\116\141\155\x65" => "\145\155\x61\x69\154", "\126\x61\x6c\165\x65" => $TH["\x65\155\x61\151\154"]]], "\125\x73\x65\x72\156\x61\x6d\145" => $Wo];
        MO_Oauth_Debug::mo_oauth_log($Wo);
        MO_Oauth_Debug::mo_oauth_log($cO);
        try {
            $user = $this->client->adminUpdateUserAttributes(["\125\x73\145\x72\x41\x74\164\x72\x69\x62\165\164\x65\163" => $cO, "\x55\x73\145\162\x50\x6f\x6f\154\111\x64" => $GZ["\x6d\157\x5f\143\x69\x5f\x70\x6f\x6f\x6c\137\151\144"], "\125\x73\145\162\x6e\141\x6d\x65" => "{$Wo}"]);
        } catch (Exception $gQ) {
            if (method_exists($gQ, "\147\x65\x74\x41\167\x73\105\162\162\157\162\x4d\145\163\x73\x61\147\x65")) {
                goto hZ;
            }
            $errors["\155\157\x5f\143\157\x67\x6e\151\164\157\x5f\145\x72\x72\157\162"] = $gQ->getMessage();
            goto Pf;
            hZ:
            $errors["\155\x6f\x5f\143\157\x67\156\x69\x74\157\137\145\162\162\x6f\162"] = $gQ->getAwsErrorMessage();
            Pf:
        }
        oK:
        return $errors;
    }
    public function mo_ci_get_user($Wo, $D4)
    {
        $s7 = $this->mc_util->get_app_list();
        foreach ($s7 as $jr => $qf) {
            $nC = $this->mc_util->get_app_by_name($jr);
            $CR = $nC->get_app_config();
            if (!($CR["\141\160\160\x49\144"] == "\143\157\147\156\x69\x74\x6f\151\x6e\x74\145\x67\162\x61\164\x6f\x72")) {
                goto Tj;
            }
            goto sx;
            Tj:
            nM:
        }
        sx:
        if (!$nC) {
            goto e6;
        }
        $GZ = $nC->get_app_config();
        $mP = $GZ["\x6d\157\137\x63\151\137\x63\x6c\x69\x65\156\164\137\151\x64"];
        $rI = $GZ["\x6d\157\137\143\151\x5f\143\154\x69\x65\x6e\x74\137\x73\x65\x63\x72\x65\164"];
        $Ii = hash_hmac("\x73\x68\x61\x32\65\66", $Wo . $mP, $rI, true);
        $cO = array();
        $cO["\x55\123\x45\122\x4e\x41\115\x45"] = $Wo;
        $cO["\x50\x41\x53\123\x57\x4f\122\x44"] = $D4;
        $cO["\x53\105\103\x52\x45\124\x5f\x48\x41\123\x48"] = base64_encode($Ii);
        $Tb = ["\x41\165\x74\150\x46\154\157\x77" => "\x41\104\115\x49\x4e\x5f\x4e\x4f\x5f\x53\122\x50\137\x41\125\124\110", "\x41\165\x74\x68\120\x61\x72\x61\155\145\x74\x65\x72\x73" => $cO, "\x43\154\x69\x65\x6e\x74\x49\144" => $mP, "\x55\x73\145\162\120\157\x6f\x6c\x49\x64" => $GZ["\155\157\137\x63\151\137\x70\x6f\157\x6c\x5f\x69\x64"]];
        try {
            $user = $this->client->adminInitiateAuth($Tb);
            $Tb = ["\x55\x73\x65\162\x50\x6f\157\x6c\111\x64" => $GZ["\x6d\157\x5f\143\x69\137\160\x6f\157\154\137\x69\x64"], "\x55\163\x65\x72\x6e\141\x6d\x65" => $Wo];
            $t_ = $user->toArray();
            $rc = $this->client->adminGetUser($Tb);
            $hI = $rc->get("\125\x73\x65\162\123\x74\141\x74\x75\163");
            if (!($hI == "\x46\x4f\x52\x43\105\x5f\103\110\101\116\107\x45\137\120\101\x53\123\x57\x4f\122\x44")) {
                goto sb;
            }
            $O6 = new WP_Error();
            $O6->add("\155\x6f\x5f\143\x6f\147\156\x69\164\157\137\145\162\162\157\162", __("\106\117\122\103\105\x5f\x43\110\101\116\x47\x45\137\x50\101\x53\x53\x57\x4f\122\x44"));
            return $O6;
            sb:
            $GU = array();
            $GU["\165\163\x65\x72\156\x61\x6d\x65"] = $rc->get("\x55\x73\145\162\x6e\x61\155\145");
            $cA = $rc->get("\125\x73\145\x72\101\x74\x74\162\x69\x62\165\164\145\163");
            foreach ($cA as $I6) {
                $GU[$I6["\x4e\x61\155\145"]] = $I6["\126\141\154\165\x65"];
                tD:
            }
            We:
            $S2 = array();
            $S2["\x75\163\x65\162\137\141\162\162\x61\171"] = $GU;
            $S2["\x74\x6f\153\x65\156\x5f\x72\x65\163\160\157\x6e\x73\145"] = $t_["\101\x75\164\150\x65\x6e\x74\151\x63\x61\164\x69\157\x6e\x52\145\x73\165\x6c\x74"];
            return $S2;
        } catch (Exception $gQ) {
            $O6 = new WP_Error();
            $O6->add("\x6d\x6f\137\143\x6f\x67\156\151\164\x6f\137\145\x72\162\x6f\x72", __("\74\x73\164\x72\x6f\156\x67\x3e\105\x72\162\157\x72\74\57\x73\x74\162\157\156\147\76\72\40" . $gQ->getAwsErrorMessage()));
            return $O6;
        }
        e6:
    }
    public function mo_ci_authenticate_user($Wo, $D4, $dA)
    {
        $UG = new \MoOauthClient\MOUtils();
        $b7 = $this->mo_ci_get_user($Wo, $D4);
        if ($b7) {
            goto vH;
        }
        $user = $this->mo_ci_check_wp_user($Wo, $D4);
        return $user;
        goto zT;
        vH:
        if (!is_wp_error($b7)) {
            goto pJ;
        }
        if (!($b7->get_error_message() == "\106\x4f\122\103\x45\137\x43\x48\101\x4e\107\105\137\x50\x41\x53\123\x57\x4f\x52\x44")) {
            goto ed;
        }
        $b7->remove("\x6d\157\137\143\157\x67\x6e\x69\x74\x6f\137\145\162\162\157\162");
        $b7->add("\155\x6f\137\143\x6f\147\x6e\151\x74\x6f\137\145\x72\x72\157\x72", __("\x59\157\x75\40\163\x68\x6f\x75\x6c\x64\x20\x63\150\141\x6e\147\x65\40\x70\141\x73\163\x77\x6f\162\x64\x20\x6f\x6e\40\171\x6f\165\x72\x20\x66\x69\162\163\x74\40\154\x6f\x67\x69\x6e\x2e\x20\74\x61\40\150\162\145\x66\x3d\x22" . site_url() . "\57\167\x70\x2d\x6c\157\x67\151\x6e\56\160\x68\x70\77\x61\143\164\151\157\156\x3d\x6c\x6f\163\x74\x70\x61\x73\x73\167\x6f\162\x64\x22\76\x43\x6c\x69\143\x6b\40\150\145\x72\145\74\57\x61\x3e\40\164\157\40\162\x65\163\145\x74\x20\171\157\x75\162\40\160\x61\163\163\x77\157\x72\144\x2e"));
        return $b7;
        ed:
        $iM = $this->mo_ci_check_wp_user($Wo, $D4);
        if ($iM) {
            goto qN;
        }
        return $b7;
        qN:
        return $iM;
        pJ:
        $s7 = $this->mc_util->get_app_list();
        foreach ($s7 as $jr => $qf) {
            $nC = $this->mc_util->get_app_by_name($jr);
            $CR = $nC->get_app_config();
            if (!($CR["\x61\x70\x70\x49\x64"] == "\143\157\x67\156\x69\x74\x6f\151\156\164\145\x67\162\x61\x74\157\162")) {
                goto YG;
            }
            goto qz;
            YG:
            Qq:
        }
        qz:
        $GZ = $nC->get_app_config();
        $Tl = new InstanceHelper();
        $oj = $Tl->get_login_handler_instance();
        $U8 = new StorageManager();
        $bQ = '';
        if (!is_multisite()) {
            goto rq;
        }
        if ($dA) {
            goto C7;
        }
        $UG->handle_error("\x4c\x6f\147\151\x6e\40\x69\x73\40\144\151\163\x61\142\x6c\145\144\x20\146\157\x72\40\x74\150\151\163\x20\163\x69\x74\145\x2e\40\x50\x6c\145\141\x73\x65\x20\x63\157\156\x74\x61\143\164\x20\171\x6f\165\162\40\x61\x64\x6d\x69\x6e\x69\163\x74\162\x61\x74\x6f\162\56");
        MO_Oauth_Debug::mo_oauth_log("\x4c\x6f\x67\151\156\x20\x69\x73\x20\x64\x69\x73\141\x62\154\145\144\40\146\157\162\40\164\150\151\x73\40\163\x69\x74\145\56\x20\x50\x6c\145\x61\163\145\x20\x63\157\156\164\x61\x63\x74\40\x79\157\165\162\40\x61\x64\x6d\x69\x6e\x69\163\164\162\141\164\x6f\162\x2e");
        wp_die("\x4c\x6f\x67\x69\156\40\151\163\40\144\x69\163\x61\x62\x6c\x65\x64\x20\x66\x6f\162\40\164\150\151\163\40\163\x69\164\145\56\40\x50\154\x65\x61\163\145\x20\x63\x6f\156\164\141\143\x74\40\171\157\x75\162\x20\x61\x64\x6d\x69\156\x69\163\164\162\141\x74\157\x72\x2e");
        C7:
        $blog_id = $dA;
        $U8->add_replace_entry("\x62\154\157\147\x5f\151\144", $blog_id);
        $lq = md5(rand(0, 15));
        $bQ = $U8->get_state();
        $bQ = apply_filters("\163\x74\141\164\145\137\151\x6e\164\145\162\156\x61\x6c", $bQ);
        rq:
        $user = $oj->handle_sso("\x63\157\147\x6e\151\164\x6f\151\156\164\145\x67\x72\141\164\x6f\x72", $GZ, $b7["\x75\x73\x65\162\x5f\x61\x72\162\141\x79"], $bQ, array(), true);
        do_action("\x6d\157\x5f\x63\157\147\156\x69\164\157\137\x69\x6e\164\x65\147\162\x61\x74\x6f\x72\x5f\165\163\145\x72\x5f\164\157\x6b\145\156\x5f\x72\145\163\160\x6f\x6e\163\x65", $b7["\x74\x6f\153\145\x6e\x5f\162\145\163\x70\157\x6e\163\145"], $user->ID);
        return $user;
        zT:
    }
    private function mo_ci_check_wp_user($Wo, $D4)
    {
        $user = get_user_by("\x6c\x6f\x67\x69\x6e", $Wo);
        if ($user) {
            goto Mw;
        }
        $user = get_user_by("\145\155\x61\x69\154", $Wo);
        Mw:
        if (!$user) {
            goto Wg;
        }
        if (wp_check_password($D4, $user->data->user_pass, $user->ID)) {
            goto fv;
        }
        $O6 = new WP_Error();
        $O6->add("\155\x6f\137\143\x6f\x67\x6e\151\x74\x6f\x5f\145\162\x72\x6f\162", __("\74\163\x74\x72\x6f\x6e\147\76\105\162\x72\157\x72\x3c\x2f\163\164\x72\157\156\x67\x3e\x3a\x20\x54\150\x65\x20\x70\x61\163\163\x77\157\162\x64\40\171\157\x75\40\x68\x61\166\145\x20\145\156\164\145\x72\x65\144\40\x69\163\x20\x69\156\x63\x6f\x72\x72\x65\143\x74\x2e"));
        return $O6;
        fv:
        Wg:
        return $user;
    }
    public function mo_ci_reset_cognito_password($user, $Jc)
    {
        $Wo = is_array($user) ? $user["\165\x73\x65\162\137\x65\x6d\x61\x69\x6c"] : $user->get("\165\163\145\x72\137\145\155\x61\151\x6c");
        $s7 = $this->mc_util->get_app_list();
        foreach ($s7 as $jr => $qf) {
            $nC = $this->mc_util->get_app_by_name($jr);
            $CR = $nC->get_app_config();
            if (!($CR["\141\x70\160\111\144"] == "\143\157\147\156\x69\x74\x6f\151\156\164\x65\147\x72\x61\x74\157\162")) {
                goto th;
            }
            goto ym;
            th:
            ry:
        }
        ym:
        if (!$nC) {
            goto gP;
        }
        $GZ = $nC->get_app_config();
        $Wo = is_array($user) ? $user["\x75\163\x65\x72\137\x65\x6d\x61\151\x6c"] : $user->get("\x75\163\x65\162\137\x65\x6d\141\x69\154");
        $Tb = ["\x55\x73\145\x72\120\157\x6f\154\x49\x64" => $GZ["\x6d\157\x5f\143\151\137\160\157\x6f\154\137\151\x64"], "\x55\x73\145\x72\156\x61\x6d\x65" => $Wo];
        try {
            $rc = $this->client->adminGetUser($Tb);
            $Tb = ["\x50\x61\x73\x73\167\x6f\162\x64" => $Jc, "\120\x65\162\155\141\156\145\156\x74" => true, "\x55\163\x65\162\x6e\141\x6d\x65" => $Wo, "\125\x73\x65\x72\120\x6f\157\x6c\111\x64" => $GZ["\x6d\x6f\x5f\x63\x69\137\160\157\157\x6c\137\x69\144"]];
            $sy = $this->client->adminSetUserPassword($Tb);
        } catch (Exception $gQ) {
        }
        gP:
    }
}

Function Calls

None

Variables

None

Stats

MD5 0997c4a4d5c5c0d80bd59107723520fc
Eval Count 0
Decode Time 53 ms