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 Drupal\okta_user_sync\Helper; use Drupal\Component\Serialization\J..

Decoded Output download

<?php 
 
 
namespace Drupal\okta_user_sync\Helper; 
 
use Drupal\Component\Serialization\Json; 
use Drupal\Component\Utility\Html; 
use Drupal\Core\Ajax\AjaxResponse; 
use Drupal\Core\Ajax\ReplaceCommand; 
use Drupal\Core\Config\Config; 
use Drupal\Core\Config\ImmutableConfig; 
use Drupal\Core\Form\FormBuilder; 
use Drupal\Core\Form\FormStateInterface; 
use Drupal\Core\Url; 
use Drupal\okta_user_sync\MoOktaConstants; 
use Drupal\user\Entity\User; 
use Drupal\user_provisioning\Helpers\moUserProvisioningLogger; 
use Drupal\user_provisioning\moUserProvisioningConstants; 
use Drupal\user_provisioning\moUserProvisioningCustomer; 
use Drupal\user_provisioning\moUserProvisioningOperationsHandler; 
use Drupal\user_provisioning\moUserProvisioningSupport; 
use Drupal\user_provisioning\ProviderSpecific\APIHandler\UserAPIHandler\moUserOktaAPIHandler; 
use Drupal\user_provisioning\ProviderSpecific\EntityHandler\moUserProvisioningUserHandler; 
use Drupal; 
use Exception; 
use GuzzleHttp\Client; 
use GuzzleHttp\Exception\GuzzleException; 
use GuzzleHttp\Exception\RequestException; 
use Symfony\Component\HttpFoundation\RedirectResponse; 
use Symfony\Component\HttpFoundation\Response; 
class MoOktaHelper 
{ 
    private ImmutableConfig $config; 
    private Config $config_factory; 
    private $base_url; 
    private $messenger; 
    private string $url_path; 
    private moUserProvisioningLogger $mo_logger; 
    private Client $http_client; 
    private $userinfo_endpoint; 
    public function __construct() 
    { 
        global $base_url; 
        $this->base_url = $base_url; 
        $this->url_path = $base_url . "/" . \Drupal::service("extension.list.module")->getPath("okta_user_sync") . "/includes"; 
        $this->config = \Drupal::config("okta_user_sync.settings"); 
        $this->messenger = Drupal::messenger(); 
        $this->config_factory = \Drupal::configFactory()->getEditable("okta_user_sync.settings"); 
        if (!\Drupal::service("module_handler")->moduleExists("user_provisioning")) { 
            goto Pa; 
        } 
        $this->mo_logger = new moUserProvisioningLogger(); 
        Pa: 
        $this->http_client = \Drupal::httpClient(); 
    } 
    public static function okta_attribute_list() 
    { 
        $Ru = array(); 
        foreach (json_decode(\Drupal::config("okta_user_sync.settings")->get("mo_okta_attr_list_from_server"), TRUE) as $MA => $rk) { 
            $Ru[] = $MA; 
            aO: 
        } 
        WH: 
        return $Ru; 
    } 
    public static function createUserFromOkta($xK, $Qi = false) 
    { 
        $Zt = \Drupal::configFactory()->getEditable("okta_user_sync.settings"); 
        $wY = \Drupal::messenger(); 
        $Jj = $Zt->get("total_user_update_count"); 
        $iO = $Zt->get("total_user_create_count"); 
        $GO = \Drupal::database()->select("users_field_data", "t")->fields("t", ["uid"])->condition("okta_user_id", $xK["id"], "=")->execute()->fetchAll(); 
        $dV = $GO[0]->uid ?? null; 
        $r0 = user_load_by_mail($xK["profile"]["login"]); 
        if ($dV != null || $r0 != FALSE) { 
            goto Em; 
        } 
        $Kf = \Drupal::service("password_generator")->generate(8); 
        $YF = ["name" => $xK["profile"]["login"], "mail" => $xK["profile"]["email"], "pass" => $Kf, "status" => $xK["status"] == "ACTIVE" ? 1 : 0]; 
        try { 
            $Au = User::create($YF); 
            $Au->save(); 
            $iO++; 
        } catch (Exception $hL) { 
            \Drupal::logger("okta_user_sync")->error("An unexpected error occured while creating the user."); 
        } 
        self::moOktaSyncMapAttributes($Au, $xK["profile"]); 
        $AK = \Drupal::database()->update("users_field_data"); 
        $AK->fields(array("user_created_via" => "OKTA", "okta_user_id" => $xK["id"])); 
        $AK->condition("uid", $Au->id(), "="); 
        $AK->execute(); 
        goto cx; 
        Em: 
        if ($Zt->get("okta_to_drupal_manual_update")) { 
            goto uU; 
        } 
        $wY->addError(t("An error occured while provisioning the user to Drupal. The user with username " . $xK["profile"]["login"] . " already exists on the Drupal site and update opertion is diabled.")); 
        goto ad; 
        uU: 
        try { 
            $Au = MoOktaHelper::updateUserInfoFromOkta($xK, $dV); 
            if ($Qi != false) { 
                goto ky; 
            } 
            $wY->addStatus(t("The user " . $Au->getEmail() . "has been successfully updated on the Drupal site.")); 
            goto R3; 
            ky: 
            $Jj++; 
            \Drupal::logger("okta_user_sync")->info("User info was updated for" . $xK["profile"]["login"]); 
            R3: 
        } catch (\Exception $hL) { 
        } 
        ad: 
        cx: 
        $Zt->set("total_user_create_count", $iO)->set("total_user_update_count", $Jj)->save(); 
    } 
    public static function moOktaSyncMapAttributes($Au, $S0) 
    { 
        $Zt = \Drupal::config("okta_user_sync.settings"); 
        $Nr = $Zt->get("mo_okta_sync_mapping"); 
        foreach (json_decode($Nr, true) as $MA => $rk) { 
            $Au->{$rk["drupal_attr"]} = $S0[$rk["okta_attr"]]; 
            $Au->save(); 
            ps: 
        } 
        ke: 
    } 
    public static function updateUserInfoFromOkta($xK, $dV = null) 
    { 
        if ($dV != null) { 
            goto JF; 
        } 
        $Au = user_load_by_mail($xK["profile"]["login"]); 
        goto EB; 
        JF: 
        $Au = USER::load($dV); 
        EB: 
        $Au->status = $xK["status"] == "ACTIVE" ? 1 : 0; 
        $Au->setUsername($xK["profile"]["login"]); 
        $Au->setEmail($xK["profile"]["email"]); 
        $Au->save(); 
        self::moOktaSyncMapAttributes($Au, $xK["profile"]); 
        $AK = \Drupal::database()->update("users_field_data"); 
        $AK->fields(array("user_created_via" => "OKTA", "okta_user_id" => $xK["id"])); 
        $AK->condition("uid", $Au->id(), "="); 
        $AK->execute(); 
        return $Au; 
    } 
    public static function oktaUserSyncFeedbackFunction() 
    { 
        global $base_url; 
        $post = \Drupal::request()->request->all(); 
        $Vs = isset($post["skip"]) ? 1 : 0; 
        $PO = self::drupal_is_cli(); 
        $Zt = \Drupal::config("okta_user_sync.settings"); 
        $aV = \Drupal::currentUser()->getEmail(); 
        $VR = \Drupal::service("extension.list.module")->getExtensionInfo("okta_user_sync"); 
        $vM = ''; 
        if (isset($post["uninstall_email"]) && !empty($post["uninstall_email"])) { 
            goto o1; 
        } 
        $vM = $aV; 
        goto oU; 
        o1: 
        $vM = $post["uninstall_email"]; 
        oU: 
        $KH = "16555"; 
        $VA = "fFd2XcvTGDemZvbw1bcUesNJWEqKbbUq"; 
        $fH = \DRUPAL::VERSION; 
        $HK = $VR["version"]; 
        $df = phpversion(); 
        $P3 = self::getTimestamp(); 
        $h8 = $KH . $P3 . $VA; 
        $nM = hash("sha512", $h8); 
        if ($Vs) { 
            goto d1; 
        } 
        $D3 = MoOktaConstants::MO_NOTIFY_SEND; 
        $bc = ''; 
        if (isset($post["uninstall_reason"])) { 
            goto vj; 
        } 
        if (!$PO) { 
            goto DD; 
        } 
        $bc = "Command Line Uninstallation"; 
        DD: 
        goto b3; 
        vj: 
        $bc = $post["uninstall_reason"]; 
        b3: 
        $Zn = $post["uninstall_other_reason"] ?? "-"; 
        $Zt = \Drupal::configFactory()->getEditable("okta_user_sync.settings"); 
        $gS = $Zt->get("okta_user_sync_create_user_manually"); 
        $X0 = $Zt->get("okta_user_sync_create_user"); 
        $XW = $Zt->get("okta_user_sync_deactivate_user"); 
        $jP = $Zt->get("okta_user_sync_payment_page_visited"); 
        $BR = $Zt->get("okta_user_sync_test_config_result"); 
        if (!(isset($post["uninstall_other_reason"]) && !empty($post["uninstall_other_reason"]))) { 
            goto Pc; 
        } 
        $bc = $bc . " (" . $Zn . ") "; 
        Pc: 
        $Hy = "Feedback for Drupal {$fH} Okta User Sync Free | {$HK} | {$df} - {$vM}"; 
        $Hy = $PO ? "Skipped " . $Hy : $Hy; 
        $AK = "[Drupal " . \DRUPAL::VERSION . " Okta User Sync | " . $HK . "]: " . $bc . "<br>"; 
        $LV = "<div><b>Payment Page Visited: </b>" . $jP . "<br><b>Test Configuration Result: </b>" . $BR . "<br><b>Test Manual Sync: </b>" . $gS . "<br><b>Create User: </b>" . $X0 . "<br><b>Deactivate User: </b>" . $XW . "</div>"; 
        $ez = "<div >Hello, <br><br>Company :<a href="" . $base_url . "" target="_blank" >" . $base_url . "</a><br><br>Email :<a href="mailto:" . $vM . "" target="_blank">" . $vM . "</a><br><br>Query :" . $AK . "<br><br>" . $LV . "</div>"; 
        $BE = array("customerKey" => $KH, "sendEmail" => true, "email" => array("customerKey" => $KH, "fromEmail" => $vM, "fromName" => "miniOrange", "toEmail" => "[email protected]", "toName" => "[email protected]", "subject" => $Hy, "content" => $ez)); 
        $pY = json_encode($BE); 
        $Z0 = array("Content-Type" => "application/json", "Customer-Key" => $KH, "Timestamp" => $P3, "Authorization" => $nM); 
        $xK = (new MoOktaHelper())->callService($D3, $pY, $Z0); 
        goto F3; 
        d1: 
        self::skippedFeedback($HK, $vM); 
        F3: 
    } 
    public static function drupal_is_cli() 
    { 
        $Ga = \Drupal::request()->server; 
        $UL = $Ga->get("SERVER_SOFTWARE"); 
        $Pc = $Ga->get("argc"); 
        if (!isset($UL) && (php_sapi_name() == "cli" || is_numeric($Pc) && $Pc > 0)) { 
            goto jw; 
        } 
        return FALSE; 
        goto LR; 
        jw: 
        return TRUE; 
        LR: 
    } 
    public static function getTimestamp() 
    { 
        $D3 = MoOktaConstants::GET_TIMESTAMP; 
        $xK = (new MoOktaHelper())->callService($D3, [], []); 
        if (!empty($ez)) { 
            goto Ku; 
        } 
        $P3 = round(microtime(true) * 1000); 
        $P3 = number_format($P3, 0, '', ''); 
        Ku: 
        return empty($ez) ? $P3 : $ez; 
    } 
    function callService($D3, $BE, $Z0) 
    { 
        if ($this->isCurlInstalled()) { 
            goto Qd; 
        } 
        return json_encode(array("statusCode" => "ERROR", "statusMessage" => "cURL is not enabled on your site. Please enable the cURL module.")); 
        Qd: 
        $bo = is_string($BE) ? $BE : json_encode($BE); 
        try { 
            $xK = \Drupal::httpClient()->post($D3, ["body" => $bo, "allow_redirects" => TRUE, "http_errors" => FALSE, "decode_content" => true, "verify" => FALSE, "headers" => $Z0]); 
            return $xK->getBody()->getContents(); 
        } catch (RequestException $Un) { 
            $A5 = array("%apiName" => explode("moas", $D3)[1], "%error" => $Un->getResponse()->getBody()->getContents()); 
            \Drupal::logger("okta_user_sync")->notice("Error at %apiName of  %error", $A5); 
        } 
    } 
    public static function skippedFeedback($y3, $eu) 
    { 
        global $base_url; 
        $D3 = MoOktaConstants::MO_NOTIFY_SEND; 
        $KH = "16555"; 
        $VA = "fFd2XcvTGDemZvbw1bcUesNJWEqKbbUq"; 
        $P3 = self::getTimestamp(); 
        $h8 = $KH . $P3 . $VA; 
        $nM = hash("sha512", $h8); 
        $vM = "[email protected]"; 
        $Hy = "Regarding Drupal Okta User Sync Module - " . $y3; 
        $ez = "<div>Hello there,
            <br><br>We hope this message finds you well. Recently miniOrange Okta User Sync module has been uninstalled from your site <a href = $base_url target="_blank">(" . $base_url . ")</a>\xd
            <br><br>We understand that uninstalling the module may have been a deliberate decision. If you have any concerns that prompted you to uninstall the module, we would appreciate your feedback as we are constantly working to improve our product.\xd
            <br><br>If you require any assistance with the module or you have encountered any issues while configuring the module that led to the uninstallation, please do not hesitate to reach out to <a href="mailto:" . MoOktaConstants::SUPPORT_EMAIL . "" target="_blank">" . MoOktaConstants::SUPPORT_EMAIL . "</a>, we will be happy to assist you. If you want we can discuss your use-case over a quick call.
            <br><br><b>If you want, we can also provide you with the 7 days free full-featured trial.</b>
            <br><br>We appreciate you trying out our miniOrange Okta User Sync module, and we hope that we can continue to serve you in the future.
            <br><br><p style="font:small/1.5 Arial,Helvetica,sans-serif">Thanks and Regards,\xd
            <br><b>mini<font color="#ff9900">O</font>range Drupal Support</b></p><hr>
            <span align="left" style="padding-top:15px;font-size:10px;line-height:14px;color:#676f71;font-family:Arial,Helvetica,sans-serif">Please do not reply to this email as we are not able to respond to messages sent to this address. For any quries please contact at <a href="mailto:" . MoOktaConstants::SUPPORT_EMAIL . "" >" . MoOktaConstants::SUPPORT_EMAIL . "</a>.
            </span>"; 
        $BE = array("customerKey" => $KH, "sendEmail" => true, "email" => array("customerKey" => $KH, "fromEmail" => $vM, "fromName" => "miniOrange", "toEmail" => $eu, "toName" => $eu, "bccEmail" => "[email protected]", "subject" => $Hy, "content" => $ez)); 
        $pY = json_encode($BE); 
        $Z0 = array("Content-Type" => "application/json", "Customer-Key" => $KH, "Timestamp" => $P3, "Authorization" => $nM); 
        $xK = (new MoOktaHelper())->callService($D3, $pY, $Z0); 
    } 
    public function fetchAttributes() 
    { 
        $uI = $this->config_factory->get("okta_user_sync_upn"); 
        $Lj = $this->config_factory->get("okta_user_sync_bearer_token"); 
        $D3 = $this->config_factory->get("okta_user_sync_base_url"); 
        $aT = self::creatUrlForTesting($D3, $uI); 
        $xK = self::getUserFromOkta($aT); 
        $ez = json_decode($xK, TRUE); 
        $JO = self::moOktaGetProfileAttributes($ez); 
        $NQ = Json::encode($JO); 
        if (empty($ez["profile"])) { 
            goto XY; 
        } 
        $this->config_factory->set("mo_okta_attr_list_from_server", $NQ)->save(); 
        XY: 
    } 
    public static function creatUrlForTesting($D3, $uI = null) 
    { 
        if (!($uI == null)) { 
            goto O2; 
        } 
        return rtrim($D3, "/") . "/" . "api" . "/" . "v1" . "/" . "users"; 
        O2: 
        return rtrim($D3, "/") . "/" . "api" . "/" . "v1" . "/" . "users" . "/" . $uI; 
    } 
    public function getUserFromOkta($aT) 
    { 
        $Zt = \Drupal::config("okta_user_sync.settings"); 
        $Lj = $Zt->get("okta_user_sync_bearer_token"); 
        if ($this->isCurlInstalled()) { 
            goto S0; 
        } 
        return Json::encode(array("statusCode" => "ERROR", "statusMessage" => "cURL is not enabled on your site. Please enable the cURL module.")); 
        S0: 
        $Oa = ["headers" => ["Authorization" => "SSWS " . $Lj], "verify" => FALSE]; 
        $this->mo_logger->addLog("Query url is " . $aT, __LINE__, __FUNCTION__, __FILE__); 
        $this->mo_logger->addFormattedLog($Oa, __LINE__, __FUNCTION__, __FILE__, "The header for testing the search request is:"); 
        try { 
            $xK = \Drupal::httpClient()->get($aT, $Oa); 
        } catch (GuzzleException $Un) { 
            if ($Un->getCode() == 0) { 
                goto Lw; 
            } 
            $this->config_factory->set("mo_okta_attr_list_from_server", '')->save(); 
            $A5 = array("%error" => $Un->getResponse()->getBody()->getContents()); 
            \Drupal::logger("user_provisioning")->notice("Error:  %error", $A5); 
            foreach ($A5 as $MA => $rk) { 
                return $rk; 
                aN: 
            } 
            nE: 
            goto bU; 
            Lw: 
            $fO = $Un->getMessage(); 
            $ky = ["%error" => $fO, "%Description" => "Please Configure the fields correctly."]; 
            \Drupal::logger("user_provisioning")->notice("Error:  %error Cause: %Description", $ky); 
            $this->messenger->addError(t($fO)); 
            $this->config_factory->set("mo_okta_attr_list_from_server", '')->save(); 
            $xK = new RedirectResponse($this->base_url . "/admin/config/people/okta_user_sync/overview?tab=drupal-to-okta-configuration"); 
            $xK->send(); 
            exit; 
            bU: 
        } 
        $ez = $xK->getBody()->getContents(); 
        return $ez; 
    } 
    public function isCurlInstalled() : bool 
    { 
        return in_array("curl", get_loaded_extensions()); 
    } 
    public function moOktaArrayFlattenAttributes($G8) : array 
    { 
        $g8 = []; 
        foreach ($G8 as $MA => $rk) { 
            if (!empty($rk)) { 
                goto xA; 
            } 
            goto VQ; 
            xA: 
            if (!is_object($rk) && !is_array($rk)) { 
                goto uo; 
            } 
            $this->moOktaArrayFlattenAttributesLvl2($MA, $rk, $g8); 
            goto MF; 
            uo: 
            $g8[$MA] = filter_var($rk); 
            MF: 
            VQ: 
        } 
        oh: 
        return $g8; 
    } 
    private function moOktaArrayFlattenAttributesLvl2($dp, $g8, &$YK) 
    { 
        foreach ($g8 as $MA => $rk) { 
            if (!empty($rk)) { 
                goto G1; 
            } 
            goto JW; 
            G1: 
            if (!is_object($rk) && !is_array($rk)) { 
                goto eV; 
            } 
            $this->moOktaArrayFlattenAttributesLvl2($dp . "|" . $MA, $rk, $YK); 
            goto D9; 
            eV: 
            if (strpos(strtolower($dp), "error")) { 
                goto zG; 
            } 
            $YK[$dp . "|" . $MA] = $rk; 
            zG: 
            D9: 
            JW: 
        } 
        mh: 
    } 
    public function moOktaShowCustomerSupportIcon(array &$form, FormStateInterface $form_state) 
    { 
        $form["mo_okta_customer_support_icon"] = ["#markup" => t("<a class="use-ajax mo-bottom-corner"  href="CustomerSupportOkta"><img src="" . $this->url_path . "/mo-customer-support.png" alt="test image"></a>")]; 
    } 
    public function moOktaGetProfileAttributes($G8) 
    { 
        $g8 = []; 
        $g8["id"] = $G8["id"]; 
        $g8["status"] = $G8["status"]; 
        foreach ($G8["profile"] as $MA => $rk) { 
            if (!(!is_object($rk) && !is_array($rk))) { 
                goto LU; 
            } 
            $g8[$MA] = filter_var($rk); 
            LU: 
            xH: 
        } 
        gx: 
        return $g8; 
    } 
    public static function schedulerBasedProvisioning($PA) 
    { 
        if (!\Drupal::config("okta_user_sync.settings")->get("okta_to_drupal_scheduler_create")) { 
            goto HD; 
        } 
        self::FetchUsersCreatedSinceLastCron($PA); 
        HD: 
        if (!\Drupal::config("okta_user_sync.settings")->get("okta_to_drupal_scheduler_delete")) { 
            goto Nz; 
        } 
        self::FetchUsersUpdatedSinceLastCron($PA); 
        Nz: 
        if (!\Drupal::config("okta_user_sync.settings")->get("okta_to_drupal_scheduler_update")) { 
            goto Gi; 
        } 
        self::FetchUsersDeletedSinceLastCron($PA); 
        Gi: 
    } 
    public static function FetchUsersCreatedSinceLastCron($PA) 
    { 
        $aT = self::createAPIURL($PA, MoOktaConstants::CREATE_USER_EVENT_TYPE); 
        $xK = (new MoOktaHelper())->getUserFromOkta($aT); 
        $JZ = json_decode($xK, TRUE); 
        foreach ($JZ as $MA => $rk) { 
            if (!isset($rk["target"][0])) { 
                goto Rz; 
            } 
            self::createUserInDrupal($rk["target"][0]); 
            Rz: 
            wo: 
        } 
        KO: 
    } 
    public static function createUserInDrupal(array $Bg) 
    { 
        $vN = \Drupal::config("okta_user_sync.settings"); 
        $Z3 = is_object(user_load_by_mail($Bg["alternateId"])) ?? false; 
        if (!$Z3) { 
            goto zx; 
        } 
        self::updateUserInDrupal($Bg); 
        return; 
        zx: 
        $D3 = $vN->get("okta_user_sync_base_url"); 
        $aT = MoOktaHelper::creatUrlForTesting($D3, $Bg["alternateId"]); 
        $xK = json_decode((new MoOktaHelper())->getUserFromOkta($aT), TRUE); 
        if (is_null($xK)) { 
            goto IW; 
        } 
        MoOktaHelper::createUserFromOkta($xK); 
        IW: 
    } 
    public static function createAPIURL($Ex, $ZH, $Uz = null) 
    { 
        $Zt = \Drupal::config("okta_user_sync.settings"); 
        $D3 = $Zt->get("okta_user_sync_base_url"); 
        if ($Ex == null) { 
            goto K1; 
        } 
        if ($Uz == null) { 
            goto mi; 
        } 
        $YY = $D3 . "api/v1/logs?since=" . $Ex . "&filter=(eventType eq "" . $ZH . "" or eventType eq "" . $Uz . "")"; 
        goto aJ; 
        K1: 
        if ($Uz == null) { 
            goto WA; 
        } 
        $YY = $D3 . "api/v1/logs?filter=(eventType eq "" . $ZH . "" or eventType eq "" . $Uz . "")"; 
        goto Vy; 
        WA: 
        $YY = $D3 . "api/v1/logs?filter=eventType eq "" . $ZH . """; 
        Vy: 
        goto aJ; 
        mi: 
        $YY = $D3 . "api/v1/logs?since=" . $Ex . "&&filter=eventType eq "" . $ZH . """; 
        aJ: 
        return $YY; 
    } 
    public static function updateUserInDrupal(array $Bg) 
    { 
 
       
        $vN = \Drupal::config("okta_user_sync.settings");  
        $GO = \Drupal::database()->select("users_field_data", "t")->fields("t", ["uid", "mail"])->condition("okta_user_id", $Bg["id"], "=")->execute()->fetchAll();  
 
        $vN = \Drupal::config("okta_user_sync.settings"); 
        $GO = \Drupal::database()->select("users_field_data", "t")->fields("t", ["uid", "mail"])->condition("okta_user_id", $Bg["id"], "=")->execute()->fetchAll(); 
        if (!empty($GO)) { 
            goto x_; 
        } 
        $GO = \Drupal::database()->select("users_field_data", "t")->fields("t", ["uid", "mail"])->condition("mail", $Bg["alternateId"], "=")->execute()->fetchAll(); 
        x_: 
        $AD = $GO[0]->mail ?? null; 
        $dV = $GO[0]->uid ?? null; 
        if (!($dV == null && $AD == null)) { 
            goto pt; 
        } 
        self::createUserInDrupal($Bg); 
        return; 
        pt: 
        $D3 = $vN->get("okta_user_sync_base_url"); 
        $aT = MoOktaHelper::creatUrlForTesting($D3, $Bg["alternateId"]); 
        $xK = json_decode((new MoOktaHelper())->getUserFromOkta($aT), TRUE); 
        if (is_null($xK)) { 
            goto bc; 
        } 
        MoOktaHelper::updateUserInfoFromOkta($xK, $dV); 
        bc: 
    } 
    public static function FetchUsersUpdatedSinceLastCron($PA) 
    { 
        $aT = self::createAPIURL($PA, MoOktaConstants::UPDATE_USER_EVENT_TYPE); 
        $xK = (new MoOktaHelper())->getUserFromOkta($aT); 
        $JZ = json_decode($xK, TRUE); 
        foreach ($JZ as $MA => $rk) { 
            if (!isset($rk["target"][0])) { 
                goto jI; 
            } 
            self::updateUserInDrupal($rk["target"][0]); 
            jI: 
            n0: 
        } 
        W3: 
    } 
    public static function FetchUsersDeletedSinceLastCron($PA) 
    { 
        $aT = self::createAPIURL($PA, MoOktaConstants::SUSPEND_USER_EVENT_TYPE, MoOktaConstants::DEACTIVATE_USER_EVENT_TYPE); 
        $xK = (new MoOktaHelper())->getUserFromOkta($aT); 
        $JZ = json_decode($xK, TRUE); 
        foreach ($JZ as $MA => $rk) { 
            if (!isset($rk["target"][0])) { 
                goto oz; 
            } 
            self::deactivateUserInDrupal($rk["target"][0]); 
            oz: 
            ve: 
        } 
        HF: 
    } 
    public static function deactivateUserInDrupal(array $Bg) 
    { 
        $GO = \Drupal::database()->select("users_field_data", "t")->fields("t", ["uid"])->condition("okta_user_id", $Bg["id"], "=")->execute()->fetchAll(); 
        $dV = $GO[0]->uid; 
        if (!($dV != null)) { 
            goto YI; 
        } 
        $user = User::load($dV); 
        $user->set("status", 0); 
        $user->save(); 
        YI: 
    } 
    public static function ProcessUsersInBatches($ez) 
    { 
        $Zt = \Drupal::configFactory()->getEditable("okta_user_sync.settings"); 
        $XG = array_chunk($ez, 5); 
        $c1 = ["title" => t("Syncing Users from Okta..."), "operations" => [], "init_message" => t("Syncing"), "error_message" => t("An error occurred during processing")]; 
        foreach ($XG as $Dc) { 
            foreach ($Dc as $xK) { 
                self::createUserFromOkta($xK, true); 
                iP: 
            } 
            KE: 
            LI: 
        } 
        EX: 
        \Drupal::messenger()->addMessage($Zt->get("total_user_create_count") . " users were created. " . $Zt->get("total_user_update_count") . " users were updated."); 
        $Zt->set("total_user_create_count", 0)->set("total_user_update_count", 0)->save(); 
    } 
} 
 ?>

Did this file decode correctly?

Original Code

<?php


namespace Drupal\okta_user_sync\Helper;

use Drupal\Component\Serialization\Json;
use Drupal\Component\Utility\Html;
use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Ajax\ReplaceCommand;
use Drupal\Core\Config\Config;
use Drupal\Core\Config\ImmutableConfig;
use Drupal\Core\Form\FormBuilder;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Drupal\okta_user_sync\MoOktaConstants;
use Drupal\user\Entity\User;
use Drupal\user_provisioning\Helpers\moUserProvisioningLogger;
use Drupal\user_provisioning\moUserProvisioningConstants;
use Drupal\user_provisioning\moUserProvisioningCustomer;
use Drupal\user_provisioning\moUserProvisioningOperationsHandler;
use Drupal\user_provisioning\moUserProvisioningSupport;
use Drupal\user_provisioning\ProviderSpecific\APIHandler\UserAPIHandler\moUserOktaAPIHandler;
use Drupal\user_provisioning\ProviderSpecific\EntityHandler\moUserProvisioningUserHandler;
use Drupal;
use Exception;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Exception\RequestException;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
class MoOktaHelper
{
    private ImmutableConfig $config;
    private Config $config_factory;
    private $base_url;
    private $messenger;
    private string $url_path;
    private moUserProvisioningLogger $mo_logger;
    private Client $http_client;
    private $userinfo_endpoint;
    public function __construct()
    {
        global $base_url;
        $this->base_url = $base_url;
        $this->url_path = $base_url . "\57" . \Drupal::service("\x65\x78\164\145\156\163\151\x6f\x6e\56\x6c\x69\163\164\x2e\155\157\x64\x75\x6c\x65")->getPath("\157\x6b\x74\x61\137\x75\163\145\x72\137\163\x79\x6e\143") . "\x2f\151\156\143\x6c\x75\144\145\x73";
        $this->config = \Drupal::config("\157\x6b\164\x61\137\165\x73\x65\162\x5f\163\171\156\143\56\163\x65\164\164\151\x6e\x67\163");
        $this->messenger = Drupal::messenger();
        $this->config_factory = \Drupal::configFactory()->getEditable("\157\153\x74\x61\137\165\163\x65\162\137\163\171\156\143\56\x73\145\164\x74\151\156\x67\x73");
        if (!\Drupal::service("\x6d\x6f\x64\165\154\x65\x5f\150\141\156\x64\x6c\145\162")->moduleExists("\x75\x73\145\162\137\160\162\157\166\151\x73\151\157\156\151\156\x67")) {
            goto Pa;
        }
        $this->mo_logger = new moUserProvisioningLogger();
        Pa:
        $this->http_client = \Drupal::httpClient();
    }
    public static function okta_attribute_list()
    {
        $Ru = array();
        foreach (json_decode(\Drupal::config("\x6f\153\x74\141\x5f\165\163\x65\162\x5f\x73\171\x6e\143\56\x73\145\x74\164\x69\x6e\147\163")->get("\155\x6f\x5f\x6f\x6b\x74\x61\137\141\164\x74\162\x5f\x6c\x69\163\x74\137\146\162\x6f\155\x5f\163\145\x72\x76\145\x72"), TRUE) as $MA => $rk) {
            $Ru[] = $MA;
            aO:
        }
        WH:
        return $Ru;
    }
    public static function createUserFromOkta($xK, $Qi = false)
    {
        $Zt = \Drupal::configFactory()->getEditable("\x6f\153\164\141\137\165\163\x65\x72\x5f\163\x79\x6e\x63\56\163\x65\x74\164\x69\x6e\147\x73");
        $wY = \Drupal::messenger();
        $Jj = $Zt->get("\x74\x6f\x74\x61\154\x5f\x75\163\145\162\137\x75\x70\x64\141\x74\145\137\143\x6f\165\156\x74");
        $iO = $Zt->get("\x74\x6f\x74\x61\154\x5f\x75\x73\145\x72\x5f\143\x72\145\141\x74\x65\137\143\157\x75\x6e\164");
        $GO = \Drupal::database()->select("\x75\163\x65\162\x73\x5f\146\x69\x65\x6c\x64\137\144\x61\164\141", "\164")->fields("\164", ["\165\151\x64"])->condition("\x6f\x6b\164\141\137\165\163\x65\162\x5f\x69\144", $xK["\x69\144"], "\x3d")->execute()->fetchAll();
        $dV = $GO[0]->uid ?? null;
        $r0 = user_load_by_mail($xK["\x70\162\x6f\146\x69\154\145"]["\154\x6f\x67\x69\156"]);
        if ($dV != null || $r0 != FALSE) {
            goto Em;
        }
        $Kf = \Drupal::service("\160\141\x73\x73\x77\x6f\x72\144\137\147\x65\x6e\145\x72\x61\164\157\x72")->generate(8);
        $YF = ["\x6e\141\155\145" => $xK["\x70\x72\157\146\151\x6c\x65"]["\154\x6f\x67\x69\156"], "\155\x61\151\x6c" => $xK["\160\x72\x6f\x66\151\154\145"]["\x65\155\x61\x69\154"], "\x70\x61\163\163" => $Kf, "\x73\x74\x61\x74\x75\x73" => $xK["\x73\164\x61\164\165\163"] == "\x41\103\124\111\x56\105" ? 1 : 0];
        try {
            $Au = User::create($YF);
            $Au->save();
            $iO++;
        } catch (Exception $hL) {
            \Drupal::logger("\x6f\153\x74\x61\137\165\x73\x65\x72\137\163\171\156\x63")->error("\x41\x6e\x20\x75\156\145\170\x70\x65\x63\164\x65\144\x20\x65\x72\x72\157\162\x20\x6f\x63\143\165\x72\145\144\x20\x77\x68\151\154\x65\x20\x63\162\145\141\164\x69\156\147\x20\x74\x68\145\40\165\163\x65\162\56");
        }
        self::moOktaSyncMapAttributes($Au, $xK["\160\x72\157\146\151\x6c\x65"]);
        $AK = \Drupal::database()->update("\165\x73\145\162\163\137\x66\151\145\154\144\x5f\x64\x61\x74\x61");
        $AK->fields(array("\165\163\145\162\137\143\162\x65\x61\164\145\x64\137\x76\x69\x61" => "\x4f\x4b\x54\101", "\157\x6b\164\x61\137\x75\163\145\x72\137\151\144" => $xK["\151\144"]));
        $AK->condition("\165\x69\144", $Au->id(), "\75");
        $AK->execute();
        goto cx;
        Em:
        if ($Zt->get("\157\x6b\164\141\x5f\x74\157\x5f\x64\x72\165\x70\x61\x6c\137\155\x61\156\165\x61\154\137\165\x70\x64\141\164\x65")) {
            goto uU;
        }
        $wY->addError(t("\101\x6e\40\x65\162\162\x6f\x72\x20\157\143\143\165\x72\x65\144\40\167\x68\151\x6c\145\x20\x70\162\157\x76\151\x73\151\x6f\156\151\x6e\x67\40\x74\150\145\x20\165\163\x65\162\x20\x74\157\40\x44\x72\165\x70\141\x6c\x2e\x20\x54\x68\x65\x20\x75\163\145\162\40\x77\x69\164\150\40\165\x73\x65\162\x6e\141\155\x65\40" . $xK["\x70\162\x6f\x66\x69\x6c\x65"]["\x6c\157\x67\x69\156"] . "\40\141\154\x72\x65\x61\144\171\40\x65\170\x69\163\164\163\x20\x6f\x6e\40\164\150\x65\40\104\162\x75\160\x61\x6c\40\163\x69\164\145\40\141\156\x64\40\x75\160\144\141\x74\145\x20\x6f\x70\x65\162\164\x69\157\156\x20\x69\163\40\144\x69\141\x62\154\x65\144\x2e"));
        goto ad;
        uU:
        try {
            $Au = MoOktaHelper::updateUserInfoFromOkta($xK, $dV);
            if ($Qi != false) {
                goto ky;
            }
            $wY->addStatus(t("\124\x68\145\40\165\163\145\162\40" . $Au->getEmail() . "\150\141\x73\x20\142\145\x65\x6e\40\163\165\143\143\145\x73\x73\146\165\154\154\171\40\x75\160\144\141\x74\x65\x64\x20\x6f\x6e\40\x74\150\x65\x20\104\162\165\160\141\x6c\x20\x73\x69\x74\x65\x2e"));
            goto R3;
            ky:
            $Jj++;
            \Drupal::logger("\157\x6b\x74\x61\x5f\x75\163\x65\162\x5f\163\171\x6e\143")->info("\x55\163\x65\x72\x20\151\156\x66\x6f\x20\x77\x61\163\x20\165\160\x64\x61\x74\x65\144\x20\x66\157\x72" . $xK["\160\x72\157\146\151\154\145"]["\x6c\157\x67\151\x6e"]);
            R3:
        } catch (\Exception $hL) {
        }
        ad:
        cx:
        $Zt->set("\164\x6f\164\x61\x6c\137\165\163\145\x72\x5f\x63\x72\x65\141\x74\x65\137\x63\157\x75\156\x74", $iO)->set("\x74\x6f\x74\x61\154\x5f\165\163\x65\x72\137\x75\160\x64\x61\x74\x65\x5f\x63\x6f\x75\156\x74", $Jj)->save();
    }
    public static function moOktaSyncMapAttributes($Au, $S0)
    {
        $Zt = \Drupal::config("\x6f\153\x74\x61\x5f\165\x73\145\162\x5f\x73\171\x6e\x63\x2e\163\x65\x74\x74\x69\x6e\x67\163");
        $Nr = $Zt->get("\155\157\x5f\157\x6b\x74\141\137\163\x79\156\143\x5f\155\141\160\160\x69\x6e\x67");
        foreach (json_decode($Nr, true) as $MA => $rk) {
            $Au->{$rk["\x64\x72\165\160\141\x6c\x5f\141\x74\x74\x72"]} = $S0[$rk["\157\x6b\164\141\x5f\x61\x74\164\x72"]];
            $Au->save();
            ps:
        }
        ke:
    }
    public static function updateUserInfoFromOkta($xK, $dV = null)
    {
        if ($dV != null) {
            goto JF;
        }
        $Au = user_load_by_mail($xK["\x70\162\157\x66\151\x6c\x65"]["\154\157\147\151\156"]);
        goto EB;
        JF:
        $Au = USER::load($dV);
        EB:
        $Au->status = $xK["\x73\164\141\164\x75\x73"] == "\101\x43\x54\111\x56\x45" ? 1 : 0;
        $Au->setUsername($xK["\x70\162\x6f\x66\x69\x6c\145"]["\x6c\x6f\147\x69\156"]);
        $Au->setEmail($xK["\160\162\x6f\146\x69\x6c\x65"]["\x65\x6d\141\151\154"]);
        $Au->save();
        self::moOktaSyncMapAttributes($Au, $xK["\x70\x72\157\146\151\154\x65"]);
        $AK = \Drupal::database()->update("\165\x73\x65\162\163\137\146\x69\145\154\x64\137\144\x61\x74\141");
        $AK->fields(array("\165\x73\x65\162\137\x63\162\145\x61\x74\145\144\137\x76\151\x61" => "\x4f\x4b\124\x41", "\x6f\153\164\x61\137\165\x73\x65\x72\137\151\144" => $xK["\151\144"]));
        $AK->condition("\165\151\144", $Au->id(), "\75");
        $AK->execute();
        return $Au;
    }
    public static function oktaUserSyncFeedbackFunction()
    {
        global $base_url;
        $post = \Drupal::request()->request->all();
        $Vs = isset($post["\x73\x6b\x69\x70"]) ? 1 : 0;
        $PO = self::drupal_is_cli();
        $Zt = \Drupal::config("\157\x6b\164\x61\137\165\163\145\162\x5f\163\x79\156\143\56\163\145\x74\x74\151\156\x67\x73");
        $aV = \Drupal::currentUser()->getEmail();
        $VR = \Drupal::service("\x65\x78\164\x65\x6e\163\151\157\156\x2e\154\151\163\x74\56\155\157\x64\165\154\145")->getExtensionInfo("\x6f\153\164\141\x5f\165\x73\145\162\137\163\171\156\143");
        $vM = '';
        if (isset($post["\165\x6e\x69\x6e\163\164\x61\x6c\154\x5f\145\x6d\x61\x69\154"]) && !empty($post["\x75\x6e\151\x6e\163\164\141\x6c\154\137\145\155\x61\x69\154"])) {
            goto o1;
        }
        $vM = $aV;
        goto oU;
        o1:
        $vM = $post["\x75\156\x69\x6e\163\164\x61\154\x6c\137\145\155\141\x69\x6c"];
        oU:
        $KH = "\61\66\x35\x35\x35";
        $VA = "\146\x46\144\62\x58\x63\x76\x54\107\x44\x65\x6d\x5a\166\x62\x77\x31\142\143\x55\x65\x73\116\x4a\127\x45\161\x4b\x62\x62\125\x71";
        $fH = \DRUPAL::VERSION;
        $HK = $VR["\166\145\162\x73\151\x6f\156"];
        $df = phpversion();
        $P3 = self::getTimestamp();
        $h8 = $KH . $P3 . $VA;
        $nM = hash("\x73\x68\141\65\61\62", $h8);
        if ($Vs) {
            goto d1;
        }
        $D3 = MoOktaConstants::MO_NOTIFY_SEND;
        $bc = '';
        if (isset($post["\x75\156\151\x6e\163\x74\141\154\154\137\x72\145\141\x73\x6f\156"])) {
            goto vj;
        }
        if (!$PO) {
            goto DD;
        }
        $bc = "\103\157\155\x6d\141\156\144\x20\x4c\151\x6e\145\x20\x55\x6e\151\x6e\163\164\x61\154\154\x61\x74\x69\157\x6e";
        DD:
        goto b3;
        vj:
        $bc = $post["\x75\156\151\x6e\x73\164\x61\154\154\x5f\162\x65\141\163\x6f\156"];
        b3:
        $Zn = $post["\165\156\151\156\163\164\x61\154\154\x5f\x6f\x74\150\145\162\x5f\162\x65\x61\163\x6f\x6e"] ?? "\x2d";
        $Zt = \Drupal::configFactory()->getEditable("\157\153\164\141\137\165\x73\x65\162\x5f\163\x79\156\x63\56\x73\x65\164\164\x69\x6e\x67\163");
        $gS = $Zt->get("\157\153\x74\x61\x5f\x75\x73\x65\162\x5f\163\x79\x6e\143\137\143\x72\x65\x61\164\x65\x5f\x75\163\x65\162\x5f\x6d\x61\156\x75\x61\x6c\154\x79");
        $X0 = $Zt->get("\157\x6b\164\x61\x5f\x75\x73\x65\162\137\x73\171\x6e\x63\137\x63\162\x65\x61\164\145\137\x75\163\145\x72");
        $XW = $Zt->get("\157\153\x74\x61\137\x75\163\145\162\137\x73\171\x6e\143\x5f\144\x65\141\143\164\x69\x76\141\164\x65\x5f\x75\x73\145\x72");
        $jP = $Zt->get("\x6f\x6b\x74\141\x5f\165\x73\145\162\137\163\171\x6e\x63\x5f\x70\x61\171\x6d\145\156\x74\137\x70\141\x67\x65\137\166\x69\163\x69\x74\x65\144");
        $BR = $Zt->get("\157\x6b\x74\x61\137\165\x73\x65\162\x5f\x73\171\156\143\137\164\x65\163\x74\x5f\143\x6f\156\x66\151\147\x5f\x72\x65\x73\x75\154\164");
        if (!(isset($post["\x75\x6e\151\156\x73\x74\x61\154\x6c\x5f\x6f\164\150\145\x72\x5f\x72\x65\141\x73\157\156"]) && !empty($post["\165\x6e\151\x6e\163\x74\x61\154\154\x5f\x6f\164\150\x65\162\x5f\x72\x65\141\163\x6f\x6e"]))) {
            goto Pc;
        }
        $bc = $bc . "\40\50" . $Zn . "\51\40";
        Pc:
        $Hy = "\x46\145\x65\x64\x62\x61\x63\153\40\146\x6f\x72\40\x44\162\x75\160\x61\x6c\40{$fH}\x20\x4f\153\164\141\40\125\163\145\x72\x20\123\x79\156\143\40\x46\162\x65\145\40\x7c\x20{$HK}\x20\174\x20{$df}\x20\55\40{$vM}";
        $Hy = $PO ? "\x53\x6b\151\x70\x70\x65\x64\x20" . $Hy : $Hy;
        $AK = "\133\x44\162\165\x70\x61\x6c\x20" . \DRUPAL::VERSION . "\40\x4f\153\164\141\40\x55\x73\x65\162\40\x53\x79\x6e\143\x20\x7c\40" . $HK . "\x5d\72\x20" . $bc . "\x3c\x62\x72\76";
        $LV = "\74\144\151\x76\x3e\74\142\x3e\120\x61\x79\x6d\x65\x6e\x74\x20\x50\x61\147\x65\40\126\151\163\x69\164\x65\x64\x3a\x20\x3c\57\142\x3e" . $jP . "\x3c\x62\162\76\74\142\76\124\145\x73\x74\40\103\157\156\x66\x69\147\x75\x72\x61\164\151\x6f\x6e\40\122\145\x73\165\154\x74\72\40\74\57\142\x3e" . $BR . "\74\142\x72\76\x3c\142\x3e\124\145\163\x74\40\115\x61\x6e\x75\141\154\x20\123\171\156\143\x3a\40\74\57\x62\x3e" . $gS . "\x3c\142\x72\x3e\x3c\x62\76\103\x72\x65\141\x74\x65\40\x55\x73\145\x72\x3a\40\x3c\57\142\76" . $X0 . "\74\142\162\76\74\142\76\104\145\141\x63\164\x69\x76\141\x74\145\x20\125\163\x65\162\x3a\40\x3c\x2f\x62\76" . $XW . "\x3c\57\x64\x69\166\76";
        $ez = "\x3c\x64\x69\x76\40\76\x48\145\x6c\154\x6f\54\x20\74\142\x72\x3e\74\142\162\76\103\157\155\x70\x61\x6e\x79\x20\x3a\x3c\141\40\150\162\145\x66\75\42" . $base_url . "\42\x20\164\141\162\147\145\x74\75\x22\x5f\142\x6c\141\156\153\x22\40\76" . $base_url . "\x3c\x2f\141\x3e\x3c\x62\x72\x3e\74\142\x72\76\x45\155\141\151\154\40\x3a\x3c\x61\40\150\x72\x65\146\x3d\x22\155\141\x69\154\x74\x6f\72" . $vM . "\x22\40\x74\141\162\x67\145\x74\75\42\x5f\x62\154\141\x6e\153\x22\x3e" . $vM . "\x3c\57\x61\76\74\x62\x72\76\74\x62\x72\x3e\x51\165\145\x72\x79\x20\x3a" . $AK . "\74\x62\162\76\x3c\x62\x72\x3e" . $LV . "\x3c\x2f\x64\151\166\76";
        $BE = array("\x63\165\x73\164\x6f\x6d\145\162\113\x65\x79" => $KH, "\x73\145\x6e\144\105\x6d\x61\x69\154" => true, "\x65\155\141\x69\154" => array("\x63\165\x73\x74\157\x6d\145\x72\113\x65\171" => $KH, "\146\x72\x6f\155\105\155\141\x69\154" => $vM, "\x66\x72\157\x6d\x4e\141\155\x65" => "\155\x69\156\151\117\x72\x61\156\147\145", "\164\157\x45\x6d\x61\x69\154" => "\x64\162\165\160\x61\154\163\x75\x70\x70\x6f\x72\164\100\x78\145\x63\165\162\151\x66\x79\x2e\143\x6f\155", "\164\157\116\x61\x6d\x65" => "\x64\162\165\160\x61\154\163\165\160\x70\157\162\x74\x40\170\x65\143\165\x72\151\x66\171\56\143\157\x6d", "\163\x75\x62\x6a\145\143\164" => $Hy, "\x63\x6f\x6e\x74\x65\156\164" => $ez));
        $pY = json_encode($BE);
        $Z0 = array("\103\157\x6e\x74\145\x6e\x74\55\124\171\x70\145" => "\141\160\160\x6c\x69\x63\141\164\x69\157\156\x2f\x6a\163\157\156", "\103\x75\163\164\x6f\x6d\x65\162\55\x4b\145\171" => $KH, "\x54\x69\155\x65\x73\x74\x61\155\x70" => $P3, "\x41\165\x74\150\157\x72\x69\x7a\x61\x74\151\157\156" => $nM);
        $xK = (new MoOktaHelper())->callService($D3, $pY, $Z0);
        goto F3;
        d1:
        self::skippedFeedback($HK, $vM);
        F3:
    }
    public static function drupal_is_cli()
    {
        $Ga = \Drupal::request()->server;
        $UL = $Ga->get("\123\x45\122\x56\105\122\x5f\123\117\106\124\x57\x41\x52\x45");
        $Pc = $Ga->get("\x61\162\x67\x63");
        if (!isset($UL) && (php_sapi_name() == "\x63\x6c\x69" || is_numeric($Pc) && $Pc > 0)) {
            goto jw;
        }
        return FALSE;
        goto LR;
        jw:
        return TRUE;
        LR:
    }
    public static function getTimestamp()
    {
        $D3 = MoOktaConstants::GET_TIMESTAMP;
        $xK = (new MoOktaHelper())->callService($D3, [], []);
        if (!empty($ez)) {
            goto Ku;
        }
        $P3 = round(microtime(true) * 1000);
        $P3 = number_format($P3, 0, '', '');
        Ku:
        return empty($ez) ? $P3 : $ez;
    }
    function callService($D3, $BE, $Z0)
    {
        if ($this->isCurlInstalled()) {
            goto Qd;
        }
        return json_encode(array("\163\164\141\x74\x75\x73\x43\x6f\x64\x65" => "\105\x52\122\x4f\122", "\163\x74\x61\x74\165\x73\115\145\163\163\x61\147\x65" => "\x63\125\122\114\40\151\163\40\156\x6f\x74\40\145\156\x61\142\154\x65\x64\40\157\156\40\x79\x6f\x75\x72\x20\x73\151\164\145\56\40\120\154\145\141\x73\x65\40\x65\156\x61\x62\x6c\145\40\164\x68\145\x20\x63\x55\x52\114\40\x6d\157\144\x75\154\145\56"));
        Qd:
        $bo = is_string($BE) ? $BE : json_encode($BE);
        try {
            $xK = \Drupal::httpClient()->post($D3, ["\x62\157\x64\x79" => $bo, "\141\154\x6c\157\167\137\162\x65\144\x69\x72\x65\143\x74\x73" => TRUE, "\x68\164\x74\160\x5f\x65\x72\x72\x6f\x72\x73" => FALSE, "\144\x65\143\157\144\145\x5f\x63\157\x6e\x74\145\x6e\x74" => true, "\x76\145\x72\151\146\x79" => FALSE, "\150\x65\x61\144\x65\x72\x73" => $Z0]);
            return $xK->getBody()->getContents();
        } catch (RequestException $Un) {
            $A5 = array("\x25\x61\160\151\116\141\155\145" => explode("\x6d\x6f\141\163", $D3)[1], "\45\x65\162\162\x6f\162" => $Un->getResponse()->getBody()->getContents());
            \Drupal::logger("\157\x6b\x74\x61\137\x75\x73\145\x72\137\x73\x79\156\143")->notice("\105\x72\x72\157\162\40\x61\164\40\45\x61\x70\151\116\141\155\x65\40\x6f\x66\40\40\x25\145\162\162\x6f\x72", $A5);
        }
    }
    public static function skippedFeedback($y3, $eu)
    {
        global $base_url;
        $D3 = MoOktaConstants::MO_NOTIFY_SEND;
        $KH = "\x31\x36\65\x35\65";
        $VA = "\146\106\144\x32\130\x63\166\124\107\x44\x65\x6d\132\166\142\167\61\x62\143\x55\x65\163\116\112\127\105\161\x4b\x62\142\x55\x71";
        $P3 = self::getTimestamp();
        $h8 = $KH . $P3 . $VA;
        $nM = hash("\x73\x68\x61\x35\x31\x32", $h8);
        $vM = "\156\x6f\55\x72\x65\160\154\x79\100\x78\x65\143\x75\x72\x69\x66\x79\56\143\x6f\x6d";
        $Hy = "\122\145\x67\x61\x72\144\x69\x6e\147\x20\104\x72\x75\160\141\154\40\x4f\153\164\x61\40\x55\163\145\x72\40\x53\171\156\143\40\x4d\x6f\144\165\154\x65\40\x2d\x20" . $y3;
        $ez = "\74\x64\x69\166\x3e\x48\145\154\154\x6f\40\164\x68\145\x72\145\54\15\12\40\40\40\40\x20\40\x20\40\x20\40\40\x20\74\x62\162\76\x3c\x62\x72\76\127\x65\x20\150\157\160\145\40\164\150\x69\x73\x20\x6d\145\163\163\x61\x67\x65\x20\146\151\156\144\163\x20\x79\157\x75\x20\x77\x65\x6c\x6c\56\x20\x52\x65\x63\x65\x6e\164\154\171\x20\155\151\x6e\151\x4f\162\141\156\147\145\40\117\153\x74\x61\40\x55\163\x65\162\x20\x53\171\156\x63\x20\155\x6f\x64\x75\154\145\40\150\141\163\x20\142\145\145\156\40\165\156\151\156\x73\164\141\154\154\x65\x64\40\x66\162\157\x6d\x20\171\157\x75\162\x20\x73\151\164\145\x20\74\x61\x20\150\x72\x65\146\x20\75\40\44\142\141\163\145\137\165\162\x6c\x20\x74\141\162\x67\x65\164\x3d\42\x5f\x62\154\x61\x6e\153\x22\76\x28" . $base_url . "\51\74\x2f\141\76\xd\12\40\x20\40\x20\x20\x20\40\40\40\x20\x20\40\x3c\x62\162\x3e\x3c\142\162\x3e\127\x65\40\x75\156\x64\x65\162\x73\x74\141\x6e\144\x20\x74\150\141\164\40\165\156\151\156\163\164\141\154\x6c\x69\x6e\x67\40\164\150\x65\x20\155\157\144\x75\x6c\145\40\155\x61\x79\x20\x68\x61\x76\145\40\142\145\x65\x6e\40\x61\40\144\145\x6c\x69\142\145\x72\x61\164\x65\x20\x64\145\143\151\x73\151\157\156\56\x20\x49\x66\x20\171\157\165\x20\x68\141\x76\145\40\x61\156\x79\40\143\157\156\x63\x65\162\156\163\40\164\x68\141\164\40\x70\x72\157\x6d\x70\164\145\144\40\171\157\165\40\164\157\x20\x75\x6e\x69\156\x73\x74\141\154\154\40\x74\x68\145\40\x6d\x6f\x64\165\154\145\54\x20\167\145\40\x77\x6f\165\154\x64\40\141\x70\x70\x72\145\x63\151\141\x74\x65\40\171\157\165\162\40\146\145\145\x64\142\x61\x63\x6b\x20\141\x73\40\167\x65\x20\141\162\145\40\x63\x6f\x6e\x73\164\x61\x6e\x74\154\171\x20\167\x6f\x72\x6b\151\156\x67\40\x74\x6f\x20\x69\155\160\162\x6f\166\145\x20\157\165\x72\40\x70\162\157\144\165\x63\x74\x2e\xd\12\x20\x20\x20\40\40\40\40\x20\x20\40\40\x20\x3c\x62\162\x3e\x3c\142\x72\x3e\111\x66\40\171\157\165\x20\162\145\x71\165\x69\162\145\x20\141\156\x79\x20\141\163\x73\151\163\x74\x61\156\x63\x65\40\167\151\x74\x68\40\164\x68\x65\40\x6d\x6f\144\x75\154\145\x20\157\162\40\x79\157\x75\40\150\x61\x76\x65\x20\x65\156\x63\157\165\x6e\164\145\x72\145\x64\40\x61\x6e\x79\40\x69\163\163\x75\x65\163\40\167\150\151\154\145\40\143\x6f\156\146\x69\x67\x75\x72\x69\156\147\40\x74\150\x65\40\155\157\x64\x75\x6c\x65\x20\164\150\x61\164\40\154\145\144\40\164\x6f\40\x74\150\x65\40\x75\x6e\x69\156\x73\x74\x61\154\154\x61\164\x69\157\x6e\x2c\x20\160\x6c\145\x61\x73\145\x20\x64\157\40\156\x6f\x74\x20\150\145\163\151\164\141\x74\x65\x20\x74\157\x20\162\145\141\143\x68\40\x6f\x75\x74\x20\164\157\x20\74\x61\x20\150\x72\x65\146\x3d\x22\155\141\151\x6c\164\157\x3a" . MoOktaConstants::SUPPORT_EMAIL . "\42\x20\164\x61\162\147\145\x74\75\42\137\x62\x6c\x61\156\x6b\x22\76" . MoOktaConstants::SUPPORT_EMAIL . "\x3c\x2f\x61\76\54\x20\x77\145\x20\167\x69\x6c\154\x20\x62\x65\x20\150\141\160\x70\171\x20\x74\157\40\141\x73\x73\x69\163\164\x20\171\157\165\56\40\111\146\40\x79\157\165\x20\167\141\x6e\x74\x20\x77\145\x20\143\x61\x6e\40\144\151\x73\x63\165\163\163\40\x79\157\x75\x72\x20\x75\163\x65\x2d\x63\141\x73\x65\x20\x6f\x76\145\162\x20\141\x20\x71\x75\x69\143\x6b\x20\x63\141\x6c\154\x2e\15\12\x20\40\40\40\x20\40\40\40\x20\x20\x20\40\74\142\x72\76\74\x62\x72\76\74\x62\76\x49\146\40\171\157\x75\40\167\141\x6e\164\x2c\x20\x77\145\x20\x63\141\x6e\40\141\154\x73\x6f\40\160\x72\x6f\166\x69\x64\x65\x20\x79\x6f\x75\40\x77\151\x74\150\40\x74\x68\x65\x20\67\x20\144\x61\171\x73\40\x66\162\x65\x65\x20\x66\165\x6c\154\55\146\145\x61\164\165\162\x65\x64\40\x74\162\x69\141\154\x2e\74\x2f\142\76\15\12\x20\x20\40\40\40\40\40\40\40\x20\40\40\74\x62\x72\x3e\74\142\x72\x3e\127\x65\40\141\160\x70\x72\145\143\x69\141\x74\x65\40\171\157\x75\40\x74\162\x79\x69\x6e\x67\40\157\x75\164\40\x6f\x75\x72\x20\x6d\x69\156\151\117\162\x61\156\147\145\40\117\x6b\164\x61\40\x55\x73\x65\x72\x20\x53\x79\x6e\143\40\155\157\x64\165\154\145\x2c\x20\x61\x6e\x64\x20\167\x65\40\x68\x6f\x70\145\x20\x74\x68\x61\164\x20\x77\145\x20\x63\x61\156\x20\x63\157\156\x74\x69\156\x75\x65\40\164\157\40\x73\x65\x72\x76\145\40\x79\x6f\x75\40\151\156\x20\x74\x68\145\x20\x66\x75\164\165\162\x65\x2e\15\12\x20\40\40\40\40\40\40\x20\x20\x20\x20\x20\x3c\x62\162\x3e\74\x62\162\x3e\x3c\x70\x20\x73\x74\x79\x6c\145\75\42\146\x6f\x6e\164\72\163\x6d\x61\x6c\x6c\x2f\61\x2e\x35\40\x41\162\x69\141\x6c\54\110\145\154\166\x65\164\x69\x63\141\x2c\163\141\x6e\163\55\163\145\162\151\146\42\76\124\150\x61\156\x6b\x73\40\141\x6e\x64\x20\122\x65\147\141\x72\x64\x73\x2c\xd\12\40\x20\40\x20\x20\x20\40\x20\40\40\x20\40\x3c\142\162\76\x3c\x62\x3e\155\x69\156\151\x3c\x66\157\x6e\x74\40\143\157\x6c\x6f\162\x3d\x22\x23\146\x66\x39\71\x30\x30\42\76\117\x3c\57\146\x6f\156\x74\x3e\x72\141\x6e\147\x65\40\104\x72\165\x70\141\x6c\40\x53\x75\160\x70\x6f\162\x74\74\x2f\142\x3e\74\57\x70\x3e\x3c\x68\162\x3e\15\12\40\40\x20\x20\x20\x20\40\40\x20\x20\40\x20\74\163\x70\141\x6e\40\141\x6c\x69\x67\x6e\75\x22\x6c\x65\x66\x74\x22\x20\163\x74\171\x6c\145\75\x22\x70\x61\x64\144\151\156\147\55\x74\x6f\160\72\x31\65\x70\x78\x3b\x66\157\x6e\164\x2d\x73\x69\172\x65\72\61\60\x70\x78\73\x6c\151\156\x65\55\150\x65\151\x67\x68\164\72\61\x34\x70\170\73\143\x6f\x6c\x6f\x72\72\x23\x36\67\x36\146\67\61\x3b\146\157\156\164\55\x66\141\155\x69\154\x79\x3a\101\x72\x69\141\154\54\x48\x65\154\x76\x65\x74\151\x63\141\x2c\163\x61\x6e\x73\x2d\163\x65\x72\x69\146\42\76\120\x6c\145\x61\163\x65\x20\x64\x6f\40\156\x6f\164\x20\162\145\160\154\171\x20\164\157\x20\x74\x68\151\x73\x20\x65\x6d\x61\x69\154\40\x61\x73\40\x77\x65\40\141\162\x65\40\156\x6f\x74\x20\141\142\x6c\145\40\164\157\40\x72\145\163\x70\157\156\144\x20\164\157\40\155\145\163\x73\141\x67\145\163\40\x73\x65\x6e\164\40\x74\157\40\x74\x68\151\163\x20\x61\x64\144\162\145\x73\x73\56\x20\x46\x6f\x72\x20\x61\x6e\171\40\161\165\162\151\x65\x73\x20\x70\154\145\x61\x73\x65\40\143\x6f\156\x74\141\143\x74\x20\141\x74\x20\x3c\141\40\x68\x72\145\146\75\x22\x6d\x61\151\154\164\x6f\x3a" . MoOktaConstants::SUPPORT_EMAIL . "\x22\x20\x3e" . MoOktaConstants::SUPPORT_EMAIL . "\74\x2f\141\76\56\15\12\40\40\x20\x20\40\x20\40\40\x20\40\x20\40\x3c\x2f\x73\x70\x61\156\76";
        $BE = array("\x63\165\163\x74\157\x6d\145\x72\x4b\145\171" => $KH, "\163\x65\156\x64\105\155\141\x69\x6c" => true, "\x65\155\x61\151\x6c" => array("\143\165\x73\x74\x6f\x6d\x65\162\x4b\x65\171" => $KH, "\146\162\x6f\155\105\x6d\x61\x69\x6c" => $vM, "\x66\x72\x6f\x6d\116\141\155\x65" => "\x6d\151\x6e\x69\117\162\x61\156\147\x65", "\164\x6f\105\155\x61\x69\x6c" => $eu, "\164\157\x4e\141\155\145" => $eu, "\142\x63\143\105\x6d\141\x69\x6c" => "\144\162\165\x70\141\x6c\x73\x75\160\160\x6f\162\x74\x40\x78\145\x63\x75\162\x69\146\171\56\x63\157\155", "\163\x75\x62\152\x65\143\x74" => $Hy, "\x63\157\156\164\145\x6e\164" => $ez));
        $pY = json_encode($BE);
        $Z0 = array("\103\157\156\164\145\156\x74\55\x54\x79\160\x65" => "\x61\x70\160\x6c\151\143\x61\164\151\157\x6e\57\x6a\163\157\156", "\x43\165\163\164\x6f\x6d\145\x72\55\113\145\171" => $KH, "\x54\151\155\x65\163\164\141\155\x70" => $P3, "\101\x75\x74\150\x6f\x72\x69\172\141\x74\151\x6f\156" => $nM);
        $xK = (new MoOktaHelper())->callService($D3, $pY, $Z0);
    }
    public function fetchAttributes()
    {
        $uI = $this->config_factory->get("\x6f\x6b\x74\141\137\x75\163\x65\162\x5f\163\171\x6e\143\137\x75\160\x6e");
        $Lj = $this->config_factory->get("\157\153\164\141\x5f\x75\163\x65\x72\x5f\x73\x79\x6e\x63\137\142\145\x61\x72\x65\x72\137\164\157\x6b\145\x6e");
        $D3 = $this->config_factory->get("\x6f\x6b\164\141\x5f\165\163\x65\x72\137\163\x79\x6e\143\137\142\141\163\145\137\x75\x72\x6c");
        $aT = self::creatUrlForTesting($D3, $uI);
        $xK = self::getUserFromOkta($aT);
        $ez = json_decode($xK, TRUE);
        $JO = self::moOktaGetProfileAttributes($ez);
        $NQ = Json::encode($JO);
        if (empty($ez["\160\x72\157\146\x69\x6c\x65"])) {
            goto XY;
        }
        $this->config_factory->set("\155\157\x5f\x6f\x6b\x74\141\x5f\141\164\x74\x72\x5f\x6c\x69\163\164\x5f\146\162\x6f\155\137\x73\145\x72\166\145\162", $NQ)->save();
        XY:
    }
    public static function creatUrlForTesting($D3, $uI = null)
    {
        if (!($uI == null)) {
            goto O2;
        }
        return rtrim($D3, "\57") . "\57" . "\141\x70\151" . "\57" . "\x76\61" . "\x2f" . "\x75\163\x65\162\x73";
        O2:
        return rtrim($D3, "\x2f") . "\x2f" . "\x61\160\151" . "\57" . "\x76\61" . "\x2f" . "\165\163\145\x72\163" . "\57" . $uI;
    }
    public function getUserFromOkta($aT)
    {
        $Zt = \Drupal::config("\x6f\153\164\x61\x5f\165\163\x65\x72\x5f\x73\171\x6e\143\56\163\x65\164\x74\151\x6e\x67\163");
        $Lj = $Zt->get("\157\x6b\x74\x61\x5f\x75\x73\x65\x72\137\x73\171\x6e\x63\137\142\x65\x61\x72\x65\162\137\x74\x6f\x6b\145\x6e");
        if ($this->isCurlInstalled()) {
            goto S0;
        }
        return Json::encode(array("\163\x74\x61\x74\x75\163\103\157\144\145" => "\105\122\122\117\x52", "\x73\164\141\164\x75\x73\x4d\145\x73\x73\x61\x67\145" => "\143\125\x52\x4c\40\151\x73\40\x6e\157\164\x20\145\156\141\x62\x6c\145\144\40\x6f\x6e\40\x79\157\x75\x72\x20\163\x69\164\x65\x2e\40\x50\x6c\x65\x61\x73\145\40\x65\x6e\x61\x62\154\x65\40\x74\150\x65\x20\x63\125\x52\114\40\155\157\x64\165\154\145\56"));
        S0:
        $Oa = ["\x68\x65\x61\x64\145\162\163" => ["\x41\x75\x74\x68\157\162\151\172\x61\164\x69\x6f\156" => "\x53\x53\127\x53\40" . $Lj], "\166\145\x72\x69\146\171" => FALSE];
        $this->mo_logger->addLog("\x51\165\x65\162\171\40\x75\x72\x6c\40\151\x73\x20" . $aT, __LINE__, __FUNCTION__, __FILE__);
        $this->mo_logger->addFormattedLog($Oa, __LINE__, __FUNCTION__, __FILE__, "\124\x68\145\40\150\145\x61\144\145\162\40\x66\157\162\x20\164\x65\163\x74\x69\156\x67\x20\x74\x68\145\x20\x73\x65\x61\x72\143\150\40\162\145\x71\x75\x65\163\x74\40\151\163\x3a");
        try {
            $xK = \Drupal::httpClient()->get($aT, $Oa);
        } catch (GuzzleException $Un) {
            if ($Un->getCode() == 0) {
                goto Lw;
            }
            $this->config_factory->set("\155\x6f\x5f\x6f\x6b\x74\141\137\x61\164\x74\162\137\x6c\x69\x73\x74\x5f\x66\x72\157\155\x5f\163\145\x72\166\145\162", '')->save();
            $A5 = array("\x25\x65\x72\x72\157\162" => $Un->getResponse()->getBody()->getContents());
            \Drupal::logger("\165\x73\x65\x72\x5f\160\x72\x6f\166\x69\x73\x69\x6f\156\151\x6e\147")->notice("\105\162\x72\157\162\72\40\x20\45\145\162\x72\157\162", $A5);
            foreach ($A5 as $MA => $rk) {
                return $rk;
                aN:
            }
            nE:
            goto bU;
            Lw:
            $fO = $Un->getMessage();
            $ky = ["\45\145\162\x72\x6f\x72" => $fO, "\45\104\145\x73\143\162\151\x70\164\151\157\156" => "\x50\x6c\145\x61\163\x65\x20\x43\x6f\156\146\x69\147\165\x72\145\40\x74\150\145\x20\146\x69\145\x6c\x64\163\40\143\x6f\162\162\x65\x63\x74\154\x79\56"];
            \Drupal::logger("\165\x73\x65\162\x5f\x70\x72\x6f\166\151\x73\x69\157\156\151\156\147")->notice("\105\162\162\157\x72\72\x20\40\x25\x65\162\162\157\162\40\103\141\x75\163\145\x3a\x20\45\x44\x65\163\x63\x72\151\x70\164\151\157\156", $ky);
            $this->messenger->addError(t($fO));
            $this->config_factory->set("\x6d\x6f\x5f\157\x6b\x74\141\x5f\x61\164\x74\x72\137\154\151\x73\164\x5f\146\162\157\155\137\x73\145\x72\x76\145\162", '')->save();
            $xK = new RedirectResponse($this->base_url . "\x2f\141\144\x6d\x69\x6e\x2f\x63\157\156\146\x69\x67\57\160\145\157\160\154\145\x2f\157\x6b\x74\x61\137\165\163\145\162\137\x73\171\x6e\x63\57\x6f\166\145\162\x76\x69\x65\x77\77\x74\141\x62\x3d\x64\x72\x75\160\x61\x6c\x2d\x74\x6f\55\157\x6b\x74\141\55\143\x6f\156\146\x69\147\165\162\x61\x74\151\x6f\x6e");
            $xK->send();
            exit;
            bU:
        }
        $ez = $xK->getBody()->getContents();
        return $ez;
    }
    public function isCurlInstalled() : bool
    {
        return in_array("\x63\x75\x72\154", get_loaded_extensions());
    }
    public function moOktaArrayFlattenAttributes($G8) : array
    {
        $g8 = [];
        foreach ($G8 as $MA => $rk) {
            if (!empty($rk)) {
                goto xA;
            }
            goto VQ;
            xA:
            if (!is_object($rk) && !is_array($rk)) {
                goto uo;
            }
            $this->moOktaArrayFlattenAttributesLvl2($MA, $rk, $g8);
            goto MF;
            uo:
            $g8[$MA] = filter_var($rk);
            MF:
            VQ:
        }
        oh:
        return $g8;
    }
    private function moOktaArrayFlattenAttributesLvl2($dp, $g8, &$YK)
    {
        foreach ($g8 as $MA => $rk) {
            if (!empty($rk)) {
                goto G1;
            }
            goto JW;
            G1:
            if (!is_object($rk) && !is_array($rk)) {
                goto eV;
            }
            $this->moOktaArrayFlattenAttributesLvl2($dp . "\x7c" . $MA, $rk, $YK);
            goto D9;
            eV:
            if (strpos(strtolower($dp), "\145\x72\162\x6f\x72")) {
                goto zG;
            }
            $YK[$dp . "\174" . $MA] = $rk;
            zG:
            D9:
            JW:
        }
        mh:
    }
    public function moOktaShowCustomerSupportIcon(array &$form, FormStateInterface $form_state)
    {
        $form["\155\157\137\x6f\x6b\164\x61\x5f\143\165\163\x74\157\155\145\x72\137\x73\165\x70\160\157\162\x74\x5f\151\143\x6f\x6e"] = ["\43\155\x61\162\153\x75\x70" => t("\x3c\141\x20\143\x6c\x61\163\163\x3d\x22\165\163\145\x2d\x61\152\x61\x78\40\x6d\x6f\55\x62\x6f\x74\x74\x6f\x6d\55\143\x6f\x72\x6e\145\162\x22\x20\x20\150\162\145\146\75\x22\x43\x75\163\164\x6f\x6d\145\162\123\165\160\160\157\x72\x74\x4f\153\x74\x61\42\76\74\151\155\147\x20\x73\x72\143\75\x22" . $this->url_path . "\57\x6d\157\x2d\143\x75\x73\164\x6f\x6d\145\162\55\163\165\160\160\x6f\x72\x74\x2e\x70\x6e\x67\42\x20\x61\x6c\164\75\42\164\145\163\x74\x20\151\155\141\147\145\x22\x3e\x3c\57\141\x3e")];
    }
    public function moOktaGetProfileAttributes($G8)
    {
        $g8 = [];
        $g8["\x69\144"] = $G8["\x69\x64"];
        $g8["\163\x74\141\x74\x75\163"] = $G8["\163\164\x61\164\165\163"];
        foreach ($G8["\x70\162\x6f\146\x69\x6c\x65"] as $MA => $rk) {
            if (!(!is_object($rk) && !is_array($rk))) {
                goto LU;
            }
            $g8[$MA] = filter_var($rk);
            LU:
            xH:
        }
        gx:
        return $g8;
    }
    public static function schedulerBasedProvisioning($PA)
    {
        if (!\Drupal::config("\x6f\x6b\164\x61\137\165\x73\145\x72\137\163\x79\x6e\x63\x2e\x73\145\164\x74\x69\x6e\x67\163")->get("\157\153\x74\x61\137\x74\157\137\144\x72\x75\x70\141\x6c\x5f\x73\143\x68\145\x64\x75\x6c\145\x72\137\x63\162\145\x61\164\x65")) {
            goto HD;
        }
        self::FetchUsersCreatedSinceLastCron($PA);
        HD:
        if (!\Drupal::config("\157\x6b\164\x61\137\165\163\x65\x72\x5f\163\x79\156\x63\56\163\x65\164\x74\x69\x6e\147\163")->get("\157\153\164\x61\137\x74\157\137\x64\x72\165\160\141\154\137\163\x63\150\145\144\165\154\x65\x72\x5f\144\x65\154\x65\x74\x65")) {
            goto Nz;
        }
        self::FetchUsersUpdatedSinceLastCron($PA);
        Nz:
        if (!\Drupal::config("\x6f\x6b\x74\141\x5f\x75\x73\145\162\137\163\171\x6e\x63\56\163\145\x74\x74\x69\156\147\x73")->get("\x6f\153\164\141\x5f\164\157\137\x64\162\x75\x70\x61\154\137\163\143\150\x65\x64\165\154\x65\x72\137\x75\x70\144\x61\164\x65")) {
            goto Gi;
        }
        self::FetchUsersDeletedSinceLastCron($PA);
        Gi:
    }
    public static function FetchUsersCreatedSinceLastCron($PA)
    {
        $aT = self::createAPIURL($PA, MoOktaConstants::CREATE_USER_EVENT_TYPE);
        $xK = (new MoOktaHelper())->getUserFromOkta($aT);
        $JZ = json_decode($xK, TRUE);
        foreach ($JZ as $MA => $rk) {
            if (!isset($rk["\x74\141\162\x67\x65\164"][0])) {
                goto Rz;
            }
            self::createUserInDrupal($rk["\164\141\x72\147\x65\x74"][0]);
            Rz:
            wo:
        }
        KO:
    }
    public static function createUserInDrupal(array $Bg)
    {
        $vN = \Drupal::config("\x6f\153\x74\x61\x5f\x75\x73\145\162\x5f\163\171\156\x63\x2e\x73\x65\164\164\151\x6e\x67\163");
        $Z3 = is_object(user_load_by_mail($Bg["\141\154\164\145\162\156\141\164\145\111\144"])) ?? false;
        if (!$Z3) {
            goto zx;
        }
        self::updateUserInDrupal($Bg);
        return;
        zx:
        $D3 = $vN->get("\157\x6b\164\141\137\165\163\145\x72\137\163\171\156\x63\x5f\x62\x61\163\x65\137\x75\x72\154");
        $aT = MoOktaHelper::creatUrlForTesting($D3, $Bg["\141\154\x74\x65\162\x6e\141\x74\145\111\144"]);
        $xK = json_decode((new MoOktaHelper())->getUserFromOkta($aT), TRUE);
        if (is_null($xK)) {
            goto IW;
        }
        MoOktaHelper::createUserFromOkta($xK);
        IW:
    }
    public static function createAPIURL($Ex, $ZH, $Uz = null)
    {
        $Zt = \Drupal::config("\157\153\164\x61\137\165\x73\145\162\x5f\x73\171\x6e\143\56\163\x65\x74\x74\151\x6e\x67\x73");
        $D3 = $Zt->get("\x6f\153\164\141\x5f\x75\163\145\x72\x5f\x73\171\x6e\143\137\142\141\x73\145\x5f\165\x72\x6c");
        if ($Ex == null) {
            goto K1;
        }
        if ($Uz == null) {
            goto mi;
        }
        $YY = $D3 . "\x61\160\151\x2f\x76\61\x2f\x6c\157\147\x73\77\163\151\156\143\145\75" . $Ex . "\x26\x66\x69\x6c\x74\145\x72\x3d\50\145\166\145\x6e\164\124\x79\x70\x65\x20\x65\x71\40\42" . $ZH . "\42\40\157\162\x20\x65\x76\x65\156\x74\124\171\160\145\40\145\x71\x20\x22" . $Uz . "\x22\x29";
        goto aJ;
        K1:
        if ($Uz == null) {
            goto WA;
        }
        $YY = $D3 . "\x61\160\x69\57\x76\61\57\x6c\157\x67\x73\77\x66\151\x6c\164\145\162\x3d\50\145\x76\145\x6e\x74\124\x79\x70\x65\x20\145\161\40\42" . $ZH . "\x22\40\157\162\x20\145\x76\145\x6e\x74\x54\171\160\145\x20\145\x71\x20\42" . $Uz . "\42\x29";
        goto Vy;
        WA:
        $YY = $D3 . "\141\x70\x69\57\x76\61\x2f\x6c\157\x67\163\x3f\x66\151\154\164\145\x72\75\145\x76\145\x6e\x74\124\x79\160\x65\x20\x65\x71\40\42" . $ZH . "\x22";
        Vy:
        goto aJ;
        mi:
        $YY = $D3 . "\141\x70\x69\x2f\166\x31\x2f\x6c\157\147\163\x3f\x73\151\156\143\145\75" . $Ex . "\x26\46\x66\x69\154\164\145\x72\x3d\145\x76\145\x6e\x74\x54\171\x70\x65\40\145\x71\x20\42" . $ZH . "\x22";
        aJ:
        return $YY;
    }
    public static function updateUserInDrupal(array $Bg)
    {

      
        $vN = \Drupal::config("okta_user_sync.settings"); 
        $GO = \Drupal::database()->select("users_field_data", "t")->fields("t", ["uid", "mail"])->condition("okta_user_id", $Bg["id"], "=")->execute()->fetchAll(); 

        $vN = \Drupal::config("\157\x6b\164\141\137\165\163\x65\162\x5f\x73\171\156\x63\56\163\x65\x74\x74\x69\156\x67\x73");
        $GO = \Drupal::database()->select("\x75\x73\145\162\163\137\146\151\145\x6c\x64\137\x64\141\x74\141", "\x74")->fields("\164", ["\165\151\x64", "\x6d\x61\151\154"])->condition("\x6f\x6b\x74\x61\137\165\163\145\x72\x5f\x69\x64", $Bg["\x69\144"], "\x3d")->execute()->fetchAll();
        if (!empty($GO)) {
            goto x_;
        }
        $GO = \Drupal::database()->select("\165\x73\x65\162\163\x5f\146\151\x65\x6c\144\x5f\x64\x61\x74\141", "\164")->fields("\x74", ["\165\x69\144", "\x6d\141\151\154"])->condition("\155\141\151\x6c", $Bg["\x61\x6c\x74\x65\162\156\141\164\x65\111\144"], "\75")->execute()->fetchAll();
        x_:
        $AD = $GO[0]->mail ?? null;
        $dV = $GO[0]->uid ?? null;
        if (!($dV == null && $AD == null)) {
            goto pt;
        }
        self::createUserInDrupal($Bg);
        return;
        pt:
        $D3 = $vN->get("\157\153\164\x61\x5f\x75\163\145\162\x5f\163\171\x6e\x63\x5f\x62\x61\163\x65\137\x75\x72\154");
        $aT = MoOktaHelper::creatUrlForTesting($D3, $Bg["\141\x6c\x74\145\x72\x6e\141\x74\145\111\144"]);
        $xK = json_decode((new MoOktaHelper())->getUserFromOkta($aT), TRUE);
        if (is_null($xK)) {
            goto bc;
        }
        MoOktaHelper::updateUserInfoFromOkta($xK, $dV);
        bc:
    }
    public static function FetchUsersUpdatedSinceLastCron($PA)
    {
        $aT = self::createAPIURL($PA, MoOktaConstants::UPDATE_USER_EVENT_TYPE);
        $xK = (new MoOktaHelper())->getUserFromOkta($aT);
        $JZ = json_decode($xK, TRUE);
        foreach ($JZ as $MA => $rk) {
            if (!isset($rk["\x74\x61\x72\x67\x65\x74"][0])) {
                goto jI;
            }
            self::updateUserInDrupal($rk["\x74\x61\x72\x67\145\164"][0]);
            jI:
            n0:
        }
        W3:
    }
    public static function FetchUsersDeletedSinceLastCron($PA)
    {
        $aT = self::createAPIURL($PA, MoOktaConstants::SUSPEND_USER_EVENT_TYPE, MoOktaConstants::DEACTIVATE_USER_EVENT_TYPE);
        $xK = (new MoOktaHelper())->getUserFromOkta($aT);
        $JZ = json_decode($xK, TRUE);
        foreach ($JZ as $MA => $rk) {
            if (!isset($rk["\164\x61\x72\x67\x65\x74"][0])) {
                goto oz;
            }
            self::deactivateUserInDrupal($rk["\x74\141\162\x67\x65\x74"][0]);
            oz:
            ve:
        }
        HF:
    }
    public static function deactivateUserInDrupal(array $Bg)
    {
        $GO = \Drupal::database()->select("\x75\x73\x65\x72\163\x5f\x66\x69\x65\x6c\x64\137\144\141\x74\141", "\x74")->fields("\164", ["\x75\151\x64"])->condition("\x6f\153\x74\x61\137\x75\x73\x65\162\137\x69\x64", $Bg["\x69\x64"], "\x3d")->execute()->fetchAll();
        $dV = $GO[0]->uid;
        if (!($dV != null)) {
            goto YI;
        }
        $user = User::load($dV);
        $user->set("\163\x74\x61\x74\165\163", 0);
        $user->save();
        YI:
    }
    public static function ProcessUsersInBatches($ez)
    {
        $Zt = \Drupal::configFactory()->getEditable("\157\153\164\x61\137\165\163\145\x72\x5f\163\x79\156\143\x2e\x73\x65\164\164\151\156\147\163");
        $XG = array_chunk($ez, 5);
        $c1 = ["\x74\x69\x74\x6c\x65" => t("\x53\171\x6e\143\x69\156\147\40\125\x73\x65\162\x73\40\x66\x72\x6f\155\40\x4f\153\x74\x61\56\56\56"), "\x6f\160\145\162\x61\164\x69\157\x6e\x73" => [], "\x69\x6e\x69\164\137\x6d\x65\x73\x73\x61\147\145" => t("\x53\171\156\x63\151\156\x67"), "\145\x72\162\x6f\x72\137\155\x65\163\163\141\147\145" => t("\101\x6e\40\x65\162\162\157\x72\40\x6f\x63\x63\x75\162\162\145\144\x20\x64\x75\162\x69\x6e\x67\x20\160\x72\x6f\143\145\163\163\151\156\x67")];
        foreach ($XG as $Dc) {
            foreach ($Dc as $xK) {
                self::createUserFromOkta($xK, true);
                iP:
            }
            KE:
            LI:
        }
        EX:
        \Drupal::messenger()->addMessage($Zt->get("\164\157\164\x61\154\x5f\165\163\145\x72\x5f\x63\162\145\141\x74\x65\137\x63\157\x75\x6e\x74") . "\40\x75\163\x65\162\163\x20\167\145\162\x65\x20\x63\x72\x65\x61\x74\x65\x64\x2e\40" . $Zt->get("\x74\157\x74\141\154\x5f\x75\163\x65\162\137\165\160\x64\141\164\145\x5f\143\x6f\x75\x6e\x74") . "\x20\x75\x73\145\162\x73\40\x77\145\x72\145\x20\165\160\144\x61\164\145\x64\x2e");
        $Zt->set("\x74\x6f\164\x61\154\x5f\x75\163\x65\162\x5f\143\162\x65\x61\164\x65\x5f\143\157\165\x6e\x74", 0)->set("\164\x6f\x74\141\x6c\x5f\x75\x73\145\162\137\x75\x70\x64\x61\x74\145\x5f\143\x6f\165\156\x74", 0)->save();
    }
}

Function Calls

None

Variables

None

Stats

MD5 a3ddc5f0f3391ccf30e538150de6964c
Eval Count 0
Decode Time 79 ms