/* Decoded by unphp.net */
get("rest_api_authentication_status");
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_support_request_flag", "customerSetupTab")->save();
$form["markup_library"] = array("#attached" => array("library" => array("rest_api_authentication/rest_api_authentication.main")));
if ($Wm == "PLUGIN_CONFIGURATION" && \Drupal::config("rest_api_authentication.settings")->get("rest_api_authentication_license_key") == NULL) {
goto Tp;
}
if ($Wm == "PLUGIN_CONFIGURATION") {
goto cJ;
}
goto fg;
Tp:
$form["markup_top_head"] = array("#markup" => "
");
$form["markup_14"] = array("#markup" => "
Login with miniOrange ");
$S_ = MiniorangeApiAuthConstants::INTRANET;
$form["markup_15"] = array("#markup" => "
Please log in the miniOrange account with which you
have purchased your license. Once you are logged in to your account, you need to enter your license key. You can find your license keys in your miniOrange dashboard under\xa License -> View License Key section
");
$form["rest_api_authentication_customer_setup_username"] = array("#type" => "textfield", "#title" => t("Email"), "#required" => true, "#attributes" => array("style" => "width:50%;"));
$form["rest_api_authentication_customer_setup_password"] = array("#type" => "password", "#title" => "Password", "#attributes" => array("style" => "width:50%;"));
$form["rest_api_authentication_customer_setup_button"] = array("#type" => "submit", "#button_type" => "primary", "#limit_validation_errors" => array(), "#value" => t("Login"), "#attributes" => array("style" => "margin-left:0px"));
if ($S_) {
goto kc;
}
$form["rest_api_authentication_customer_forgot_password_button"] = array("#type" => "submit", "#button_type" => "danger", "#attributes" => array("style" => "margin-left:0px", "onclick" => "this.form.target="_blank";"), "#submit" => array("::miniorange_reset_password"), "#limit_validation_errors" => array(), "#value" => t("Forgot Password"));
kc:
$form["create_account_markup_15"] = array("#markup" => "
If you do not have an account with us yet, please click on the link
here to create an account or you can reach out to us through the
Contact Us block on the right.
");
$form["miniorange_rest_api_client_support_div_cust2"] = array("#markup" => "
");
Utilities::AddSupportButton($form, $form_state);
return $form;
}
function miniorange_reset_password(array &$form, FormStateInterface $form_state)
{
$Ek = new TrustedRedirectResponse(MiniorangeApiAuthConstants::BASE_URL . "/moas/idp/resetpassword");
$form_state->setResponse($Ek);
}
public function submitForm(array &$form, FormStateInterface $form_state)
{
$S_ = MiniorangeApiAuthConstants::INTRANET;
$Mb = $form["rest_api_authentication_customer_setup_username"]["#value"];
$NN = '';
$vb = null;
if ($S_) {
goto CV;
}
$vb = $form["rest_api_authentication_customer_setup_password"]["#value"];
CV:
if (!$S_ && (empty($Mb) || empty($vb))) {
goto sM;
}
if ($S_ && empty($Mb)) {
goto ey;
}
goto qx;
sM:
\Drupal::messenger()->addMessage(t("The
Email and
Password> fields are mandatory."), "error");
return;
goto qx;
ey:
\Drupal::messenger()->addMessage(t("The
Email fields are mandatory."), "error");
return;
qx:
if (\Drupal::service("email.validator")->isValid($Mb)) {
goto yp;
}
\Drupal::messenger()->addMessage(t("The email address
" . $Mb . " is not valid."), "error");
return;
yp:
$x_ = new MiniorangeRestAPICustomer($Mb, $vb);
$BU = json_decode($x_->checkCustomer());
if ($BU->status == "CUSTOMER_NOT_FOUND") {
goto qr;
}
if ($BU->status == "CURL_ERROR") {
goto dW;
}
if (!$S_) {
goto In;
}
$Wm = "PLUGIN_CONFIGURATION";
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_customer_admin_email", $Mb)->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_customer_id", MiniorangeApiAuthConstants::CUSTOMER_ID)->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_status", $Wm)->save();
\Drupal::messenger()->addMessage(t("Successfully retrieved your account."));
goto dz;
In:
$Vo = $x_->getCustomerKeys();
if (isset($Vo) && !empty($Vo)) {
goto Lc;
}
\Drupal::messenger()->addMessage(t("Invalid credentials"), "error");
return;
goto DI;
Lc:
$Ve = json_decode($x_->getCustomerKeys());
if (!(json_last_error() == JSON_ERROR_NONE)) {
goto ue;
}
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_customer_id", $Ve->id)->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_customer_admin_token", $Ve->token)->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_customer_admin_email", $Mb)->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_customer_admin_phone", $NN)->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_customer_api_key", $Ve->apiKey)->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_customer_password", $vb)->save();
$Wm = "PLUGIN_CONFIGURATION";
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_status", $Wm)->save();
\Drupal::messenger()->addMessage(t("Successfully retrieved your account."));
ue:
DI:
dz:
goto gE;
qr:
\Drupal::messenger()->addMessage(t("Invalid credentials"), "error");
return;
goto gE;
dW:
\Drupal::messenger()->addMessage(t("cURL is not enabled. Please enable cURL"), "error");
gE:
}
public function rest_api_authentication_back(&$form, $form_state)
{
$Wm = "CUSTOMER_SETUP";
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_status", $Wm)->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->clear("rest_api_authentication_customer_admin_email")->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->clear("rest_api_authentication_customer_admin_phone")->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->clear("rest_api_authentication_customer_password")->save();
\Drupal::messenger()->addMessage(t("Login with your miniOrange Account"), "status");
}
function rest_api_authentication_validate_license_submit($form, &$form_state)
{
$k_ = str_replace(" ", '', $form["rest_api_authentication_license_key"]["#value"]);
if (!empty($k_)) {
goto hH;
}
\Drupal::messenger()->addMessage(t("The
License Key field is mandatory."), "error");
return;
hH:
$Mb = \Drupal::config("rest_api_authentication.settings")->get("rest_api_authentication_customer_admin_email");
$NN = \Drupal::config("rest_api_authentication.settings")->get("rest_api_authentication_customer_admin_phone");
$vb = \Drupal::config("rest_api_authentication.settings")->get("rest_api_authentications_customer_password");
$x_ = new MiniorangeRestAPICustomer($Mb, $vb);
$gJ = json_decode($x_->ccl(), true);
$PA = $gJ["licensePlan"];
if (is_array($gJ)) {
goto bp;
}
if (!(!isset($gJ["status"]) || empty($gJ["status"]) || !isset($gJ["licensePlan"]) || empty($gJ["licensePlan"]))) {
goto IX;
}
\Drupal::messenger()->addMessage(t("Error:Something went wrong while processing your request."), "error");
return;
IX:
bp:
if (!($gJ["status"] != "SUCCESS" || $gJ["licensePlan"] != Utilities::GetPlanName())) {
goto g2;
}
\Drupal::messenger()->addMessage(t("Invalid license! Please use a valid license to activate the module"), "error");
return;
g2:
$bB = $x_->verifyLicense($k_);
if (!(!is_array($bB) || empty($bB["status"]))) {
goto mb;
}
\Drupal::messenger()->addMessage(t("Invalid response received while activating the license key."), "error");
return;
mb:
if (strcasecmp($bB["status"], "SUCCESS") == 0) {
goto BD;
}
if (strcasecmp($bB->status, "FAILED") == 0) {
goto X_;
}
\Drupal::messenger()->addMessage(t("An error occurred while processing your request. Please Try again."), "error");
return;
goto zD;
X_:
if (strcasecmp($bB->message, "Code has Expired") == 0) {
goto Gy;
}
\Drupal::messenger()->addMessage(t("You have entered an invalid license key. Please enter a valid license key."), "error");
return;
goto Rs;
Gy:
\Drupal::messenger()->addMessage(t("License key you have entered has already been used. Please enter a key which has not been used before on any other instance or if you have exausted all your keys then buy more license from Licensing"), "error");
return;
Rs:
zD:
goto o6;
BD:
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_auth_licenseExpiry", $gJ["licenseExpiry"])->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_supportExpiry", $gJ["supportExpiry"])->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_license_key", $k_)->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_status", "PLUGIN_CONFIGURATION")->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_license_plan", $PA)->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_multi_site_plugin", isset($gJ["isMultiSitePluginRequested"]) ? $gJ["isMultiSitePluginRequested"] : false)->save();
\Drupal::messenger()->addMessage(t("Your license is verified. You can now setup the module."), "status");
$fL = \Drupal::config("rest_api_authentication.settings")->get("rest_api_authentication_customer_admin_token");
$fE = Utilities::check_fraud();
Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_customer_admin_fraud_check", Utilities::encrypt_data($fE, $fL))->save();
o6:
}
function rest_api_authentication_remove_account(&$form, $form_state)
{
global $base_url;
if (isset($_POST["value_check"]) && $_POST["value_check"] == "True") {
goto t8;
}
$BG = array();
$BG = $_POST;
$VD = $_POST["form_id"];
$Sj = $_POST["form_token"];
$pd = $_POST["op"];
$Kp = $_POST["form_build_id"];
global $base_url;
echo "
Confirmation \xa
\xa \xa\xa
\xa
\xa Are you sure you want to remove account..!!
\xa
Warning : If you remove your account, you will have to enter licence key again after login/sign in with the new account.
\xa
\xa
\xa
\xa ";
exit;
goto YJ;
t8:
if (!(\Drupal::config("rest_api_authentication.settings")->get("rest_api_authentication_license_key") != NULL)) {
goto NW;
}
$Wm = "CUSTOMER_SETUP";
$Mb = \Drupal::config("rest_api_authentication.settings")->get("rest_api_authentication_customer_admin_email");
$dH = new MiniorangeRestAPICustomer($Mb, NULL);
$Ek = json_decode($dH->updateStatus());
if (!($Ek->status == "SUCCESS")) {
goto x8;
}
$m5 = '';
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_customer_admin_email", NULL)->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_customer_id", $m5)->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_customer_api_key", $m5)->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_license_key", NULL)->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_customer_password", $m5)->save();
\Drupal::configFactory()->getEditable("rest_api_authentication.settings")->set("rest_api_authentication_status", $Wm)->save();
\Drupal::messenger()->addMessage(t("Your account has been removed successfully!"), "status");
$_POST["value_check"] = "False";
x8:
NW:
YJ:
}
}
?>