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\Form; use Drupal; use Drupal\Component\Seri..
Decoded Output download
<?php
namespace Drupal\okta_user_sync\Form;
use Drupal;
use Drupal\Component\Serialization\Json;
use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Ajax\ReplaceCommand;
use Drupal\Core\Config\Config;
use Drupal\Core\Config\ImmutableConfig;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\okta_user_sync\Helper\MoOktaHelper;
use Drupal\user_provisioning\Helpers\moUserProvisioningLogger;
use GuzzleHttp\Exception\GuzzleException;
class MoReviewOktaConfiguration extends FormBase
{
protected $messenger;
private $base_url;
private ImmutableConfig $config;
private Config $config_factory;
private moUserProvisioningLogger $mo_logger;
public function __construct()
{
global $base_url;
$this->base_url = $base_url;
$this->config = \Drupal::config("okta_user_sync.settings");
$this->config_factory = \Drupal::configFactory()->getEditable("okta_user_sync.settings");
$this->messenger = \Drupal::messenger();
$this->mo_logger = new moUserProvisioningLogger();
}
public function getFormId()
{
return "review_okta_configuration_popup";
}
public function buildForm(array $form, FormStateInterface $form_state)
{
$form["#prefix"] = "<div id="review_okta_configuration">";
$form["#suffix"] = "</div>";
$form["status_messages"] = ["#type" => "status_messages", "#weight" => -10];
$form["markup_library"] = array("#attached" => array("library" => array("okta_user_sync/okta_user_sync.admin", "okta_user_sync/okta_user_sync.close_review_okta_configuration")));
$form["mo_con_okta_header_style"] = ["#markup" => t("<div class="mo_okta_header_container_step1">")];
$ML = new MoOktaOverview();
$ML->oktaConfigurationTable($form, $form_state, "summary");
if (!(!empty($this->config->get("okta_user_sync_base_url")) && !empty($this->config->get("okta_user_sync_bearer_token")) && !empty($this->config->get("okta_user_sync_upn")))) {
goto ao;
}
$GO = $this->testAttributesFromOkta();
$form["okta_test_config_result"] = $GO;
ao:
$form["attribute_table_div_close"] = array("#markup" => "</div>");
$form["actions"] = array("#type" => "actions");
$form["actions"]["send"] = ["#type" => "submit", "#value" => $this->t("Save and Test Configuration"), "#attributes" => ["class" => ["use-ajax", "button--primary"]], "#ajax" => ["callback" => [$this, "saveReviewOktaConfig"], "event" => "click"]];
$form["#attached"]["library"][] = "core/drupal.dialog.ajax";
return $form;
}
private function testAttributesFromOkta()
{
$wo = '';
if (!($this->config->get("mo_okta_attr_list_from_server") != '')) {
goto lL;
}
$wo = Json::decode($this->config->get("mo_okta_attr_list_from_server"));
lL:
$form["mo_okta_summary_configuration"]["okta_configuration_display_test_data"] = array("#type" => "details", "#title" => $this->t("Test Configuration Result"), "#open" => isset($wo["errorCode"]), "#prefix" => "<div id="test_config_result">");
$Fi = '';
if ($wo != '') {
goto UL;
}
$Fi = $this->t("<div style="font-family:Calibre,serif;padding:0 3%;">\xd\xa <div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;">
ERROR\xd\xa </div><div style="color: #a94442;font-size:14pt; margin-bottom:20px;">");
goto Zq;
UL:
$Fi = isset($wo["errorCode"]) ? $this->t("<div style="font-family:Calibre,serif;padding:0 3%;">\xd\xa <div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;">\xd\xa ERROR
</div><div style="color: #a94442;font-size:14pt; margin-bottom:20px;">") : $this->t("<div style="font-family:Calibre,serif;padding:0 3%;"><div style="width:95%;color: #3c763d;background-color: #dff0d8;padding: 2%;margin-bottom: 20px;text-align: center;border: 1px solid #AEDB9A;font-size: 18pt;">
\xa SUCCESS\xd
</div>");
Zq:
$form["mo_okta_summary_configuration"]["okta_configuration_display_test_data"]["header_message"] = ["#markup" => $Fi];
$form["mo_okta_summary_configuration"]["okta_configuration_display_test_data"]["okta_configuration_show_test_data"] = ["#type" => "table", "#responsive" => true, "#attributes" => ["style" => "border-collapse: separate;", "class" => ["mo_okta_test_data"]]];
if (!($wo != null)) {
goto WL;
}
foreach ($wo as $MA => $rk) {
$ql = new MoOktaOverview();
$ru = $ql->oktaTestConfigurationData($MA, $rk);
$form["mo_okta_summary_configuration"]["okta_configuration_display_test_data"]["okta_configuration_show_test_data"][$MA] = $ru;
G0:
}
eo:
WL:
return $form;
}
public function saveReviewOktaConfig(array $form, FormStateInterface $form_state)
{
$CB = $form_state->getValues()["mo_summary_okta_configuration_table"];
$A0 = ["Okta Portal URL:" => "okta_user_sync_base_url", "Okta Bearer Token:" => "okta_user_sync_bearer_token", "Test Your Configuration<br>Enter user email:" => "okta_user_sync_upn"];
foreach ($A0 as $MA => $rk) {
$this->config_factory->set($rk, $CB[$MA][$rk])->save();
Ct:
}
oC:
$Lj = $this->config_factory->get("okta_user_sync_bearer_token");
$GF = $this->config_factory->get("okta_user_sync_base_url");
Drupal::configFactory()->getEditable("user_provisioning.settings")->set("mo_user_provisioning_configured_application", "okta")->set("mo_provider_specific_provisioning_base_url", $GF)->set("mo_provider_specific_provisioning_api_token", $Lj)->save();
self::fetchAttributesFromOkta($form, $form_state);
$wo = Json::decode($this->config->get("mo_okta_attr_list_from_server"));
foreach ($A0 as $MA => $rk) {
$form["mo_okta_summary_configuration"]["mo_summary_okta_configuration_table"][$MA][$rk]["#value"] = $CB[$MA][$rk];
Dm:
}
Ry:
if (!($wo == '')) {
goto KV;
}
$form["okta_test_config_result"] = null;
KV:
if ($wo != '') {
goto NP;
}
$this->messenger->addError("Something went wrong. Please check your configurations.");
goto Ux;
NP:
if (isset($wo["errorCode"])) {
goto yJ;
}
$this->messenger->addstatus(t("Test Configuration successful. You can check the complete list of attributes received from Okta by clicking on the link <a href="#test_config_result">HERE</a>."));
goto yM;
yJ:
$this->messenger->addError(t("An error occurred while performing test configuration. Please refer to <a href="#test_config_result">Test Configuration Result</a> for more information."));
yM:
Ux:
$xK = new AjaxResponse();
$GO = $this->testAttributesFromOkta();
$xK->addCommand(new ReplaceCommand("#review_okta_configuration", $form));
$xK->addCommand(new ReplaceCommand("#test_config_result", $GO));
return $xK;
}
public function fetchAttributesFromOkta(array &$form, FormStateInterface $form_state)
{
$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");
$B6 = new MoOktaHelper();
$aT = $B6->creatUrlForTesting($D3, $uI);
$xK = self::getUserFromOktaInPopup($Lj, $aT, $form);
$ez = json_decode($xK, TRUE);
if ($ez != null) {
goto uA;
}
if (!is_null($this->config->get("mo_okta_attr_list_from_server"))) {
goto WB;
}
$this->config_factory->set("mo_okta_attr_list_from_server", '')->save();
WB:
goto z1;
uA:
$JO = $B6->moOktaGetProfileAttributes($ez);
$NQ = Json::encode($JO);
if (empty($ez["profile"])) {
goto t_;
}
$this->config_factory->set("mo_okta_attr_list_from_server", $NQ)->save();
t_:
z1:
}
public function getUserFromOktaInPopup($Lj, $aT, array &$form)
{
$B6 = new MoOktaHelper();
if ($B6->isCurlInstalled()) {
goto Vo;
}
return Json::encode(array("statusCode" => "ERROR", "statusMessage" => "cURL is not enabled on your site. Please enable the cURL module."));
Vo:
$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 XB;
}
$A5 = array("%error" => $Un->getResponse()->getBody()->getContents());
\Drupal::logger("user_provisioning")->notice("Error: %error", $A5);
foreach ($A5 as $MA => $rk) {
return $rk;
ys:
}
Q_:
goto Uj;
XB:
$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));
if (!is_null($this->config->get("mo_okta_attr_list_from_server"))) {
goto EZ;
}
$this->config_factory->set("mo_okta_attr_list_from_server", '')->save();
EZ:
$xK = new AjaxResponse();
$GO = $this->testAttributesFromOkta();
$xK->addCommand(new ReplaceCommand("#review_okta_configuration", $form));
$xK->addCommand(new ReplaceCommand("#test_config_result", $GO));
return $xK;
Uj:
}
$ez = $xK->getBody()->getContents();
return $ez;
}
public function submitForm(array &$form, FormStateInterface $form_state)
{
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Drupal\okta_user_sync\Form;
use Drupal;
use Drupal\Component\Serialization\Json;
use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Ajax\ReplaceCommand;
use Drupal\Core\Config\Config;
use Drupal\Core\Config\ImmutableConfig;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\okta_user_sync\Helper\MoOktaHelper;
use Drupal\user_provisioning\Helpers\moUserProvisioningLogger;
use GuzzleHttp\Exception\GuzzleException;
class MoReviewOktaConfiguration extends FormBase
{
protected $messenger;
private $base_url;
private ImmutableConfig $config;
private Config $config_factory;
private moUserProvisioningLogger $mo_logger;
public function __construct()
{
global $base_url;
$this->base_url = $base_url;
$this->config = \Drupal::config("\157\x6b\164\141\x5f\165\x73\x65\162\137\x73\171\156\x63\x2e\x73\x65\x74\164\151\x6e\147\163");
$this->config_factory = \Drupal::configFactory()->getEditable("\157\x6b\164\x61\x5f\165\x73\145\162\x5f\x73\x79\x6e\143\56\163\145\164\x74\151\x6e\147\x73");
$this->messenger = \Drupal::messenger();
$this->mo_logger = new moUserProvisioningLogger();
}
public function getFormId()
{
return "\x72\x65\x76\151\x65\x77\137\x6f\x6b\x74\x61\x5f\143\x6f\156\x66\151\x67\x75\x72\141\164\151\x6f\156\x5f\160\x6f\160\x75\160";
}
public function buildForm(array $form, FormStateInterface $form_state)
{
$form["\43\160\162\x65\x66\151\x78"] = "\x3c\x64\151\x76\x20\x69\x64\75\x22\x72\145\166\151\x65\167\x5f\x6f\x6b\x74\141\137\x63\157\156\x66\x69\147\165\162\141\x74\x69\x6f\x6e\x22\76";
$form["\x23\x73\x75\x66\146\x69\x78"] = "\x3c\x2f\x64\151\x76\76";
$form["\163\164\141\x74\165\163\x5f\155\145\x73\163\141\x67\145\163"] = ["\x23\164\171\160\145" => "\x73\164\x61\x74\x75\x73\x5f\x6d\x65\x73\x73\x61\x67\145\163", "\43\x77\145\151\x67\150\164" => -10];
$form["\x6d\141\x72\x6b\165\160\137\154\x69\x62\x72\141\x72\171"] = array("\43\141\164\164\x61\143\x68\145\144" => array("\154\x69\142\x72\141\162\171" => array("\157\153\164\141\137\165\x73\145\x72\x5f\163\171\x6e\x63\57\x6f\153\164\x61\x5f\165\163\x65\162\137\163\171\156\x63\x2e\x61\x64\x6d\x69\x6e", "\x6f\153\164\x61\x5f\x75\163\x65\162\x5f\x73\171\x6e\143\57\157\x6b\x74\141\x5f\x75\x73\145\x72\137\x73\171\156\x63\x2e\143\154\157\x73\145\x5f\162\145\x76\x69\x65\167\137\x6f\153\164\141\137\143\x6f\156\x66\x69\147\x75\x72\141\164\151\x6f\156")));
$form["\155\157\137\143\157\156\x5f\x6f\x6b\164\x61\x5f\x68\x65\141\144\x65\x72\137\163\x74\171\154\145"] = ["\43\x6d\141\x72\153\x75\160" => t("\74\144\151\166\x20\143\x6c\141\163\163\x3d\x22\155\157\137\157\153\x74\141\x5f\150\145\141\x64\145\162\x5f\x63\x6f\x6e\164\x61\x69\156\x65\x72\137\163\x74\x65\160\x31\42\x3e")];
$ML = new MoOktaOverview();
$ML->oktaConfigurationTable($form, $form_state, "\163\x75\x6d\155\x61\x72\x79");
if (!(!empty($this->config->get("\x6f\153\x74\x61\137\165\x73\145\x72\x5f\163\x79\x6e\x63\x5f\142\x61\163\x65\137\x75\162\x6c")) && !empty($this->config->get("\157\x6b\x74\141\137\x75\163\145\x72\137\x73\x79\156\143\x5f\142\x65\141\162\x65\162\137\164\x6f\153\x65\x6e")) && !empty($this->config->get("\x6f\x6b\164\x61\x5f\165\x73\145\162\137\163\171\156\x63\137\165\160\156")))) {
goto ao;
}
$GO = $this->testAttributesFromOkta();
$form["\x6f\x6b\x74\x61\x5f\x74\x65\x73\x74\137\x63\157\156\146\151\x67\137\x72\x65\x73\x75\x6c\164"] = $GO;
ao:
$form["\141\x74\x74\x72\151\x62\165\x74\145\137\164\x61\142\x6c\x65\137\144\151\166\137\143\x6c\157\x73\x65"] = array("\43\x6d\x61\162\153\165\160" => "\74\57\144\x69\x76\x3e");
$form["\x61\x63\164\x69\x6f\156\x73"] = array("\43\x74\171\x70\x65" => "\x61\x63\x74\151\x6f\156\x73");
$form["\x61\x63\164\151\x6f\x6e\x73"]["\x73\145\156\x64"] = ["\43\164\171\160\145" => "\163\165\x62\155\151\164", "\43\166\141\154\165\145" => $this->t("\123\141\x76\145\x20\141\x6e\144\40\x54\145\x73\x74\40\103\x6f\156\146\x69\x67\165\x72\x61\x74\151\157\x6e"), "\43\141\x74\x74\162\x69\142\x75\x74\145\163" => ["\143\x6c\141\x73\x73" => ["\x75\x73\x65\x2d\x61\152\141\x78", "\x62\165\x74\x74\157\156\x2d\x2d\x70\162\x69\155\x61\x72\x79"]], "\43\141\152\x61\170" => ["\x63\x61\x6c\x6c\x62\x61\x63\153" => [$this, "\x73\141\x76\145\122\145\166\x69\145\167\x4f\x6b\x74\x61\103\157\x6e\146\151\x67"], "\145\166\145\x6e\x74" => "\x63\154\x69\x63\x6b"]];
$form["\x23\141\x74\164\141\x63\x68\x65\x64"]["\154\151\x62\162\141\162\x79"][] = "\143\157\162\145\57\144\x72\165\160\x61\x6c\x2e\144\151\x61\154\x6f\147\x2e\x61\152\141\170";
return $form;
}
private function testAttributesFromOkta()
{
$wo = '';
if (!($this->config->get("\155\157\x5f\x6f\x6b\164\141\x5f\x61\x74\x74\x72\137\x6c\151\x73\x74\137\x66\162\157\x6d\x5f\163\x65\x72\x76\x65\162") != '')) {
goto lL;
}
$wo = Json::decode($this->config->get("\x6d\157\x5f\157\153\164\x61\137\141\164\164\x72\137\154\151\x73\x74\x5f\146\162\x6f\155\x5f\163\x65\162\166\x65\162"));
lL:
$form["\x6d\157\137\157\153\164\141\x5f\163\165\x6d\x6d\141\x72\171\137\x63\x6f\156\x66\151\x67\x75\162\x61\x74\151\x6f\x6e"]["\157\153\x74\x61\x5f\x63\x6f\156\x66\151\x67\x75\162\141\164\x69\157\x6e\x5f\x64\151\163\x70\154\141\x79\x5f\x74\x65\x73\x74\137\144\141\164\141"] = array("\43\x74\171\x70\145" => "\x64\145\x74\x61\151\154\163", "\43\x74\x69\x74\154\x65" => $this->t("\124\145\x73\164\x20\x43\157\x6e\x66\151\x67\165\x72\x61\x74\151\x6f\156\x20\x52\x65\x73\165\154\x74"), "\43\x6f\160\145\156" => isset($wo["\x65\x72\162\x6f\x72\x43\157\x64\145"]), "\43\160\x72\x65\146\x69\x78" => "\74\x64\151\x76\40\151\144\x3d\x22\x74\145\163\164\x5f\143\x6f\x6e\146\151\x67\137\162\x65\163\x75\x6c\x74\x22\76");
$Fi = '';
if ($wo != '') {
goto UL;
}
$Fi = $this->t("\x3c\x64\151\166\40\163\164\x79\x6c\x65\75\x22\x66\157\x6e\x74\55\x66\x61\x6d\151\154\x79\72\103\x61\x6c\x69\x62\x72\x65\x2c\163\145\162\x69\146\x3b\160\x61\144\144\x69\x6e\x67\72\60\x20\x33\45\x3b\x22\76\xd\xa\x20\x20\x20\x20\40\x20\40\40\40\40\40\40\x20\40\40\40\74\144\151\166\x20\163\164\x79\154\x65\x3d\x22\143\x6f\154\x6f\x72\72\40\x23\141\x39\x34\64\64\x32\x3b\142\141\143\x6b\x67\162\x6f\165\156\x64\x2d\x63\x6f\x6c\157\162\x3a\x20\43\x66\x32\144\x65\x64\145\x3b\160\141\x64\x64\x69\156\147\x3a\40\x31\x35\x70\x78\73\155\141\x72\147\x69\x6e\x2d\142\x6f\x74\164\157\155\72\40\x32\x30\x70\170\x3b\x74\145\x78\164\x2d\x61\154\x69\147\x6e\x3a\143\145\x6e\164\x65\162\73\142\x6f\x72\x64\x65\162\72\x31\x70\170\40\163\x6f\x6c\151\x64\x20\x23\x45\x36\102\63\x42\x32\x3b\146\157\x6e\164\55\163\151\172\x65\72\x31\70\160\164\x3b\x22\x3e\15\12\40\40\40\40\x20\40\40\40\40\40\40\x20\x20\x20\x20\x20\x20\x20\40\40\x45\122\x52\x4f\x52\xd\xa\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\40\x20\40\40\x20\74\x2f\144\x69\166\76\x3c\144\151\166\40\x73\x74\171\154\x65\x3d\x22\143\157\154\x6f\162\72\x20\x23\141\71\x34\x34\x34\x32\x3b\146\x6f\x6e\x74\55\163\x69\172\145\72\61\64\160\x74\73\40\x6d\x61\162\147\151\x6e\x2d\142\157\x74\164\x6f\x6d\72\62\x30\x70\170\73\x22\76");
goto Zq;
UL:
$Fi = isset($wo["\x65\x72\162\x6f\x72\x43\x6f\x64\145"]) ? $this->t("\x3c\144\x69\166\x20\x73\164\171\x6c\x65\75\x22\x66\x6f\x6e\x74\55\x66\x61\x6d\x69\x6c\171\x3a\x43\141\154\x69\x62\162\x65\x2c\x73\x65\162\151\146\x3b\x70\141\x64\144\151\x6e\147\x3a\x30\x20\63\45\73\x22\76\xd\xa\x20\x20\40\x20\40\x20\40\x20\x20\x20\x20\40\x20\40\40\40\x3c\144\x69\x76\40\163\x74\171\154\x65\x3d\42\x63\x6f\154\157\162\x3a\40\x23\x61\71\64\x34\64\62\x3b\x62\x61\143\153\x67\162\157\x75\x6e\x64\55\143\x6f\154\157\x72\72\40\x23\146\62\144\x65\144\145\x3b\160\141\x64\x64\x69\x6e\x67\72\x20\61\65\x70\170\73\155\141\162\x67\151\x6e\x2d\x62\157\164\164\x6f\x6d\x3a\x20\x32\60\160\x78\73\164\145\170\x74\55\x61\154\151\147\156\x3a\x63\145\x6e\164\145\162\x3b\x62\157\162\x64\145\x72\x3a\61\x70\x78\x20\x73\157\x6c\151\x64\40\x23\105\x36\102\x33\x42\x32\x3b\146\157\x6e\164\55\x73\151\172\145\72\61\70\x70\164\73\x22\x3e\xd\xa\40\x20\40\40\40\x20\40\x20\40\x20\x20\40\40\x20\40\40\x20\x20\40\x20\105\x52\x52\x4f\x52\15\12\40\40\40\x20\40\40\40\40\40\40\40\x20\40\x20\40\40\74\x2f\144\151\x76\76\x3c\144\x69\166\x20\163\164\171\x6c\145\75\42\x63\x6f\x6c\157\162\72\x20\43\141\x39\64\64\64\x32\x3b\146\157\156\x74\x2d\x73\151\x7a\x65\x3a\x31\64\x70\164\73\40\155\x61\x72\147\x69\x6e\55\142\157\164\164\x6f\x6d\x3a\62\x30\x70\170\x3b\42\76") : $this->t("\x3c\144\151\x76\40\x73\x74\x79\154\x65\75\x22\146\x6f\156\x74\55\x66\141\155\x69\154\171\x3a\x43\x61\154\x69\142\x72\x65\x2c\x73\145\x72\151\x66\x3b\160\141\x64\x64\x69\156\147\72\60\40\63\45\x3b\x22\76\74\144\x69\166\x20\x73\164\x79\154\145\x3d\42\x77\151\x64\164\x68\x3a\71\x35\x25\73\x63\157\154\x6f\162\72\40\x23\x33\x63\x37\x36\63\x64\73\x62\x61\143\x6b\147\x72\x6f\x75\x6e\x64\x2d\x63\157\x6c\157\x72\x3a\40\43\x64\x66\x66\x30\144\x38\x3b\160\x61\x64\144\151\156\x67\x3a\x20\x32\x25\73\155\x61\x72\147\x69\x6e\55\x62\x6f\x74\x74\157\x6d\x3a\40\62\x30\160\170\73\164\x65\x78\164\x2d\x61\154\151\x67\156\72\40\x63\145\x6e\x74\x65\x72\73\x62\157\x72\x64\145\162\72\40\x31\160\x78\x20\x73\x6f\x6c\x69\x64\40\43\x41\x45\104\102\71\x41\73\146\x6f\x6e\x74\55\163\x69\172\x65\72\40\61\x38\160\x74\x3b\42\x3e\15\xa\x20\40\x20\x20\40\x20\40\x20\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\123\125\103\x43\105\123\x53\xd\12\x20\x20\40\x20\x20\40\x20\x20\x20\40\x20\40\40\40\x20\x20\74\x2f\x64\x69\x76\x3e");
Zq:
$form["\x6d\x6f\137\x6f\x6b\x74\x61\x5f\163\165\x6d\x6d\x61\162\x79\137\143\157\156\x66\x69\147\x75\162\141\x74\151\x6f\156"]["\157\x6b\164\141\137\143\157\x6e\146\x69\147\x75\x72\141\164\151\157\x6e\137\x64\x69\163\x70\x6c\x61\x79\x5f\164\145\x73\164\x5f\144\141\164\x61"]["\150\x65\x61\x64\145\162\x5f\x6d\145\163\163\141\x67\x65"] = ["\x23\155\141\162\x6b\x75\160" => $Fi];
$form["\x6d\157\137\x6f\153\x74\x61\137\163\165\x6d\155\141\x72\171\137\x63\x6f\x6e\146\x69\x67\165\x72\141\164\151\157\x6e"]["\x6f\153\x74\141\x5f\143\157\x6e\x66\x69\x67\165\x72\x61\x74\151\157\156\137\x64\151\x73\160\154\x61\x79\137\x74\145\x73\164\137\144\141\164\x61"]["\157\153\x74\141\137\x63\157\x6e\146\x69\x67\x75\162\x61\x74\x69\157\156\137\x73\x68\157\167\x5f\x74\x65\x73\x74\x5f\x64\x61\164\x61"] = ["\x23\x74\x79\160\145" => "\164\141\x62\154\x65", "\x23\162\145\163\160\157\x6e\x73\151\166\x65" => true, "\x23\x61\x74\x74\x72\151\x62\x75\x74\145\x73" => ["\x73\164\x79\154\x65" => "\142\157\x72\144\145\x72\55\x63\157\x6c\154\141\x70\163\x65\72\40\163\x65\x70\141\162\141\164\145\x3b", "\143\x6c\x61\x73\163" => ["\155\157\x5f\157\153\164\141\x5f\164\x65\x73\x74\x5f\144\141\164\141"]]];
if (!($wo != null)) {
goto WL;
}
foreach ($wo as $MA => $rk) {
$ql = new MoOktaOverview();
$ru = $ql->oktaTestConfigurationData($MA, $rk);
$form["\155\157\x5f\x6f\x6b\x74\141\x5f\x73\165\x6d\x6d\141\162\171\x5f\x63\x6f\156\x66\x69\147\x75\x72\x61\164\151\x6f\156"]["\157\x6b\x74\x61\x5f\x63\x6f\x6e\146\151\x67\165\162\141\164\151\157\x6e\137\x64\151\163\160\154\141\171\x5f\x74\x65\163\164\137\x64\x61\x74\x61"]["\157\153\x74\141\x5f\143\157\x6e\x66\x69\x67\x75\x72\x61\164\x69\x6f\x6e\137\163\x68\x6f\167\x5f\x74\x65\163\164\x5f\144\141\164\141"][$MA] = $ru;
G0:
}
eo:
WL:
return $form;
}
public function saveReviewOktaConfig(array $form, FormStateInterface $form_state)
{
$CB = $form_state->getValues()["\155\x6f\x5f\163\165\155\x6d\141\x72\171\x5f\157\x6b\164\141\x5f\143\157\x6e\146\x69\x67\x75\x72\141\164\151\157\156\x5f\164\141\142\154\x65"];
$A0 = ["\x4f\153\x74\x61\x20\x50\x6f\162\164\x61\154\40\x55\x52\114\x3a" => "\157\x6b\x74\x61\x5f\x75\x73\x65\x72\x5f\x73\x79\156\143\137\x62\x61\x73\145\x5f\165\x72\x6c", "\117\x6b\164\x61\40\x42\x65\x61\162\145\x72\x20\x54\157\153\x65\156\x3a" => "\157\x6b\164\141\x5f\165\163\x65\x72\x5f\163\x79\156\143\x5f\142\145\141\x72\x65\162\x5f\164\157\153\x65\156", "\x54\145\163\164\40\x59\x6f\x75\x72\40\x43\x6f\x6e\x66\x69\147\x75\162\x61\164\151\157\x6e\74\x62\x72\x3e\x45\x6e\x74\x65\162\x20\165\x73\x65\x72\x20\145\x6d\x61\x69\154\72" => "\157\x6b\x74\141\137\x75\x73\x65\162\137\x73\171\156\x63\137\165\160\x6e"];
foreach ($A0 as $MA => $rk) {
$this->config_factory->set($rk, $CB[$MA][$rk])->save();
Ct:
}
oC:
$Lj = $this->config_factory->get("\157\x6b\x74\141\x5f\x75\x73\x65\x72\137\x73\171\156\x63\x5f\x62\145\x61\162\145\162\137\164\157\x6b\x65\x6e");
$GF = $this->config_factory->get("\157\153\x74\141\137\165\x73\x65\x72\137\163\171\156\x63\137\142\141\x73\145\x5f\x75\x72\x6c");
Drupal::configFactory()->getEditable("\165\x73\x65\x72\137\x70\162\157\x76\151\x73\x69\x6f\x6e\151\x6e\x67\56\163\145\x74\164\x69\156\147\163")->set("\x6d\x6f\x5f\165\x73\145\162\137\x70\162\x6f\166\x69\163\x69\157\x6e\x69\x6e\147\137\143\x6f\156\146\151\x67\165\162\x65\x64\x5f\x61\x70\x70\154\x69\143\x61\x74\x69\x6f\x6e", "\x6f\x6b\164\x61")->set("\155\x6f\137\x70\x72\157\x76\151\144\145\162\137\163\160\x65\143\151\146\151\143\137\160\162\157\166\151\x73\x69\157\x6e\151\x6e\x67\137\142\141\163\x65\137\165\162\154", $GF)->set("\155\x6f\x5f\160\162\157\166\x69\144\145\x72\x5f\x73\x70\145\x63\x69\146\151\x63\137\160\162\157\x76\151\x73\x69\x6f\x6e\151\156\x67\137\x61\x70\x69\x5f\x74\x6f\153\145\156", $Lj)->save();
self::fetchAttributesFromOkta($form, $form_state);
$wo = Json::decode($this->config->get("\155\157\137\157\153\x74\141\137\x61\164\164\x72\x5f\x6c\151\x73\x74\137\x66\162\x6f\155\x5f\163\x65\x72\166\x65\x72"));
foreach ($A0 as $MA => $rk) {
$form["\x6d\x6f\137\157\153\164\141\137\x73\x75\155\x6d\141\162\171\137\143\157\156\x66\x69\x67\x75\x72\141\164\x69\157\x6e"]["\155\x6f\x5f\163\x75\155\155\x61\x72\x79\x5f\x6f\x6b\x74\x61\x5f\143\157\156\146\151\147\x75\162\141\x74\151\x6f\156\137\164\141\142\x6c\x65"][$MA][$rk]["\x23\166\141\154\x75\145"] = $CB[$MA][$rk];
Dm:
}
Ry:
if (!($wo == '')) {
goto KV;
}
$form["\x6f\153\x74\x61\x5f\x74\145\x73\x74\x5f\x63\x6f\156\x66\151\x67\137\x72\145\163\165\x6c\x74"] = null;
KV:
if ($wo != '') {
goto NP;
}
$this->messenger->addError("\123\x6f\155\145\x74\x68\151\156\147\x20\x77\145\x6e\x74\x20\x77\162\157\156\147\x2e\x20\x50\154\x65\x61\163\145\x20\x63\x68\145\143\153\40\171\x6f\165\162\x20\x63\x6f\156\146\151\147\x75\x72\141\x74\151\157\156\163\x2e");
goto Ux;
NP:
if (isset($wo["\145\162\x72\157\162\103\157\144\x65"])) {
goto yJ;
}
$this->messenger->addstatus(t("\124\145\x73\164\40\103\157\156\x66\x69\x67\x75\162\141\164\x69\x6f\x6e\40\163\x75\143\x63\145\163\163\146\165\x6c\56\40\x59\x6f\165\40\143\141\156\40\x63\x68\145\x63\x6b\x20\x74\150\x65\40\143\157\x6d\x70\154\145\x74\x65\40\154\151\163\164\40\x6f\x66\40\141\x74\x74\162\151\142\x75\x74\x65\163\40\x72\x65\143\145\151\x76\x65\144\40\146\162\x6f\155\40\117\153\164\141\x20\142\171\x20\143\x6c\x69\143\153\x69\x6e\147\40\x6f\x6e\40\x74\150\145\40\x6c\x69\x6e\x6b\40\x3c\141\x20\150\162\145\146\75\x22\x23\164\x65\163\x74\x5f\x63\x6f\156\146\x69\x67\x5f\162\x65\163\165\154\164\42\76\110\x45\122\105\x3c\57\x61\x3e\x2e"));
goto yM;
yJ:
$this->messenger->addError(t("\101\156\x20\145\162\x72\157\162\x20\157\x63\143\x75\x72\162\145\x64\x20\167\150\x69\x6c\145\40\160\145\162\x66\x6f\162\x6d\x69\156\147\x20\x74\145\163\164\40\143\157\156\x66\x69\147\165\162\x61\x74\x69\x6f\156\x2e\40\x50\x6c\145\x61\x73\145\40\162\x65\146\145\x72\x20\x74\x6f\40\74\x61\x20\150\x72\x65\146\x3d\x22\43\164\145\163\164\137\143\157\x6e\146\151\147\137\162\x65\x73\165\154\x74\x22\76\x54\145\163\164\40\x43\157\156\146\x69\147\x75\162\x61\164\151\x6f\156\40\122\x65\x73\x75\154\x74\x3c\x2f\141\x3e\40\146\157\162\x20\155\x6f\162\x65\40\x69\x6e\146\x6f\x72\x6d\141\164\151\157\156\x2e"));
yM:
Ux:
$xK = new AjaxResponse();
$GO = $this->testAttributesFromOkta();
$xK->addCommand(new ReplaceCommand("\x23\162\x65\x76\x69\x65\x77\x5f\157\x6b\x74\x61\x5f\143\x6f\x6e\146\151\147\165\162\x61\164\151\157\156", $form));
$xK->addCommand(new ReplaceCommand("\x23\164\145\x73\x74\137\x63\x6f\156\x66\x69\147\x5f\162\145\163\165\154\x74", $GO));
return $xK;
}
public function fetchAttributesFromOkta(array &$form, FormStateInterface $form_state)
{
$uI = $this->config_factory->get("\157\153\164\141\137\165\163\145\162\137\x73\x79\156\143\137\165\x70\x6e");
$Lj = $this->config_factory->get("\157\x6b\x74\x61\137\165\163\x65\x72\137\163\171\156\143\137\142\x65\x61\162\145\162\137\164\157\x6b\145\x6e");
$D3 = $this->config_factory->get("\x6f\153\x74\x61\137\x75\x73\145\162\x5f\x73\x79\x6e\x63\x5f\x62\141\x73\x65\137\x75\x72\x6c");
$B6 = new MoOktaHelper();
$aT = $B6->creatUrlForTesting($D3, $uI);
$xK = self::getUserFromOktaInPopup($Lj, $aT, $form);
$ez = json_decode($xK, TRUE);
if ($ez != null) {
goto uA;
}
if (!is_null($this->config->get("\155\x6f\137\157\153\x74\x61\137\141\x74\x74\162\137\154\151\163\164\137\146\162\x6f\x6d\137\x73\x65\162\x76\x65\162"))) {
goto WB;
}
$this->config_factory->set("\155\x6f\x5f\x6f\x6b\x74\141\x5f\x61\164\164\162\x5f\154\151\x73\x74\137\x66\162\157\x6d\137\x73\145\162\166\x65\162", '')->save();
WB:
goto z1;
uA:
$JO = $B6->moOktaGetProfileAttributes($ez);
$NQ = Json::encode($JO);
if (empty($ez["\x70\162\x6f\146\x69\154\145"])) {
goto t_;
}
$this->config_factory->set("\x6d\157\x5f\x6f\153\164\x61\x5f\141\164\x74\162\x5f\x6c\151\x73\164\x5f\x66\162\x6f\x6d\x5f\163\145\x72\166\x65\162", $NQ)->save();
t_:
z1:
}
public function getUserFromOktaInPopup($Lj, $aT, array &$form)
{
$B6 = new MoOktaHelper();
if ($B6->isCurlInstalled()) {
goto Vo;
}
return Json::encode(array("\163\164\x61\x74\165\x73\103\x6f\x64\x65" => "\x45\122\122\117\122", "\163\164\141\x74\x75\x73\x4d\145\163\163\x61\x67\145" => "\x63\x55\x52\x4c\x20\x69\x73\x20\x6e\x6f\164\x20\145\x6e\x61\x62\x6c\145\x64\40\x6f\x6e\x20\x79\157\165\162\x20\163\151\164\x65\x2e\40\120\x6c\x65\x61\163\x65\40\145\156\x61\142\x6c\x65\40\164\x68\145\40\143\125\x52\x4c\40\155\157\144\x75\154\x65\56"));
Vo:
$Oa = ["\x68\x65\141\x64\x65\162\163" => ["\101\165\164\x68\157\162\x69\172\141\x74\x69\x6f\156" => "\123\x53\x57\x53\40" . $Lj], "\166\x65\x72\151\146\x79" => FALSE];
$this->mo_logger->addLog("\121\165\x65\162\171\40\165\x72\154\x20\x69\163\x20" . $aT, __LINE__, __FUNCTION__, __FILE__);
$this->mo_logger->addFormattedLog($Oa, __LINE__, __FUNCTION__, __FILE__, "\x54\150\x65\40\x68\x65\x61\144\x65\x72\x20\146\x6f\162\40\164\145\163\x74\x69\156\x67\x20\x74\150\145\x20\x73\x65\141\x72\x63\150\x20\162\145\x71\x75\145\x73\164\40\151\163\72");
try {
$xK = \Drupal::httpClient()->get($aT, $Oa);
} catch (GuzzleException $Un) {
if ($Un->getCode() == 0) {
goto XB;
}
$A5 = array("\x25\145\162\162\x6f\x72" => $Un->getResponse()->getBody()->getContents());
\Drupal::logger("\165\x73\x65\x72\137\x70\162\157\x76\x69\x73\151\157\x6e\x69\x6e\147")->notice("\105\x72\x72\x6f\x72\x3a\40\x20\45\145\x72\x72\x6f\x72", $A5);
foreach ($A5 as $MA => $rk) {
return $rk;
ys:
}
Q_:
goto Uj;
XB:
$fO = $Un->getMessage();
$ky = ["\x25\x65\162\162\157\162" => $fO, "\45\104\145\x73\143\x72\151\160\x74\151\157\156" => "\x50\x6c\x65\x61\x73\x65\40\103\157\156\x66\151\147\x75\162\x65\x20\x74\x68\145\x20\x66\x69\145\154\144\x73\40\x63\157\162\162\x65\x63\x74\154\x79\x2e"];
\Drupal::logger("\165\163\145\162\137\x70\x72\157\166\151\x73\151\157\x6e\151\156\x67")->notice("\x45\162\x72\157\x72\x3a\x20\40\x25\x65\x72\162\157\162\x20\103\x61\165\x73\x65\72\x20\x25\x44\145\x73\x63\x72\x69\160\x74\x69\x6f\x6e", $ky);
$this->messenger->addError(t($fO));
if (!is_null($this->config->get("\x6d\x6f\x5f\157\x6b\164\x61\x5f\141\164\164\x72\x5f\x6c\x69\163\x74\137\x66\x72\x6f\155\137\163\145\162\166\145\162"))) {
goto EZ;
}
$this->config_factory->set("\x6d\157\137\x6f\153\164\x61\137\x61\164\x74\x72\137\x6c\x69\163\164\137\146\x72\x6f\155\x5f\163\145\162\x76\x65\x72", '')->save();
EZ:
$xK = new AjaxResponse();
$GO = $this->testAttributesFromOkta();
$xK->addCommand(new ReplaceCommand("\x23\x72\x65\166\x69\145\x77\137\157\x6b\164\141\x5f\143\x6f\156\146\x69\x67\165\162\x61\x74\x69\x6f\x6e", $form));
$xK->addCommand(new ReplaceCommand("\43\164\x65\x73\164\137\x63\157\x6e\146\x69\147\137\x72\x65\163\165\154\164", $GO));
return $xK;
Uj:
}
$ez = $xK->getBody()->getContents();
return $ez;
}
public function submitForm(array &$form, FormStateInterface $form_state)
{
}
}
Function Calls
None |
Stats
MD5 | 95d9db2182ffc355aaa5444e1e31f999 |
Eval Count | 0 |
Decode Time | 49 ms |