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 OTP\Handler\Forms; if (defined("\101\x42\123\120\x41\124\x48")) { ..
Decoded Output download
<?php
namespace OTP\Handler\Forms;
if (defined("ABSPATH")) {
goto PSZ;
}
exit;
PSZ:
use OTP\Helper\FormSessionVars;
use OTP\Helper\MoConstants;
use OTP\Helper\MoMessages;
use OTP\Helper\MoPHPSessions;
use OTP\Helper\MoUtility;
use OTP\Helper\SessionUtils;
use OTP\Objects\FormHandler;
use OTP\Objects\IFormHandler;
use OTP\Objects\VerificationType;
use OTP\Objects\BaseMessages;
use OTP\Traits\Instance;
if (class_exists("YourOwnForm")) {
goto mcM;
}
class YourOwnForm extends FormHandler implements IFormHandler
{
use Instance;
private $check_validated_on_submit;
private $form_field_id;
private $form_submit_id;
private $validated;
protected function __construct()
{
$this->is_login_or_social_form = false;
$this->is_ajax_form = true;
$this->form_key = "YOUR_OWN_FORM";
$this->form_name = mo_("<span style='color:green' ><b>Can't Find your Form? Try me!</b></span>");
$this->form_session_var = FormSessionVars::CUSTOMFORM;
$this->form_details = maybe_unserialize(get_mo_option("custom_form_otp_enabled"));
$this->type_phone_tag = "mo_customForm_phone_enable";
$this->type_email_tag = "mo_customForm_email_enable";
$this->is_form_enabled = get_mo_option("custom_form_contact_enable");
$this->generate_otp_action = "miniorange-customForm-send-otp";
$this->validate_otp_action = "miniorange-customForm-verify-code";
$this->check_validated_on_submit = "miniorange-customForm-verify-submit";
$this->otp_type = get_mo_option("custom_form_enable_type");
$this->button_text = get_mo_option("custom_form_button_text");
$this->button_text = !MoUtility::is_blank($this->button_text) ? $this->button_text : mo_("Click Here to send OTP");
$this->validated = false;
parent::__construct();
$this->handle_form();
}
public function handle_form()
{
MoPHPSessions::check_session();
if ($this->is_form_enabled) {
goto xIE;
}
return;
xIE:
$this->form_field_id = $this->getFieldKeyDetails();
$this->form_submit_id = $this->getSubmitKeyDetails();
add_action("wp_enqueue_scripts", array($this, "mo_enqueue_form_script"));
add_action("login_enqueue_scripts", array($this, "mo_enqueue_form_script"));
add_action("wp_ajax_{$this->generate_otp_action}", array($this, "send_otp"));
add_action("wp_ajax_nopriv_{$this->generate_otp_action}", array($this, "send_otp"));
add_action("wp_ajax_{$this->validate_otp_action}", array($this, "processFormAndValidateOTP"));
add_action("wp_ajax_nopriv_{$this->validate_otp_action}", array($this, "processFormAndValidateOTP"));
add_action("wp_ajax_{$this->check_validated_on_submit}", array($this, "check_validated_on_submit"));
add_action("wp_ajax_nopriv_{$this->check_validated_on_submit}", array($this, "check_validated_on_submit"));
if (!SessionUtils::is_status_match($this->form_session_var, self::VALIDATED, $this->get_verification_type())) {
goto dxu;
}
$this->validated = true;
$this->unset_otp_session_variables();
return;
dxu:
}
public function mo_enqueue_form_script()
{
wp_register_script($this->form_session_var, MOV_URL . "includes/js/" . $this->form_session_var . ".min.js", array("jquery"), MOV_VERSION, true);
wp_localize_script($this->form_session_var, $this->form_session_var, array("siteURL" => wp_ajax_url(), "otpType" => $this->get_verification_type(), "formDetails" => $this->form_details, "buttontext" => $this->button_text, "imgURL" => MOV_LOADER_URL, "fieldText" => mo_("Enter OTP"), "gnonce" => wp_create_nonce($this->nonce), "nonceKey" => wp_create_nonce($this->nonce_key), "vnonce" => wp_create_nonce($this->nonce), "gaction" => $this->generate_otp_action, "vaction" => $this->validate_otp_action, "saction" => $this->check_validated_on_submit, "fieldSelector" => $this->form_field_id, "submitSelector" => $this->form_submit_id));
wp_enqueue_script($this->form_session_var);
wp_enqueue_style("mo_forms_css", MOV_FORM_CSS, array(), MOV_VERSION);
}
public function send_otp()
{
if (check_ajax_referer($this->nonce, "nonce", false)) {
goto sEr;
}
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::UNKNOWN_ERROR), MoConstants::ERROR_JSON_TYPE));
exit;
sEr:
$Dv = MoUtility::mo_sanitize_array($_POST);
MoPHPSessions::check_session();
if (SessionUtils::is_otp_initialized($this->form_session_var)) {
goto EhC;
}
MoUtility::initialize_transaction($this->form_session_var);
EhC:
if (!(MoUtility::sanitize_check("otpType", $Dv) === VerificationType::PHONE)) {
goto ojr;
}
$this->process_phone_and_send_otp($Dv);
ojr:
if (!(MoUtility::sanitize_check("otpType", $Dv) === VerificationType::EMAIL)) {
goto E9l;
}
$this->process_email_and_send_otp($Dv);
E9l:
}
public function check_validated_on_submit()
{
if (SessionUtils::is_otp_initialized($this->form_session_var) || $this->validated) {
goto cue;
}
if (!SessionUtils::is_otp_initialized($this->form_session_var) && !$this->validated) {
goto SbU;
}
goto tqX;
cue:
wp_send_json(MoUtility::create_json(self::VALIDATED, MoConstants::SUCCESS_JSON_TYPE));
goto tqX;
SbU:
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::PLEASE_VALIDATE), MoConstants::ERROR_JSON_TYPE));
tqX:
}
private function process_email_and_send_otp($Dv)
{
MoPHPSessions::check_session();
if (!MoUtility::sanitize_check("user_email", $Dv)) {
goto FT9;
}
$fv = sanitize_email($Dv["user_email"]);
SessionUtils::add_email_verified($this->form_session_var, $fv);
$this->send_challenge('', $fv, null, null, VerificationType::EMAIL);
goto if9;
FT9:
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::ENTER_EMAIL), MoConstants::ERROR_JSON_TYPE));
if9:
}
private function process_phone_and_send_otp($Dv)
{
if (!MoUtility::sanitize_check("user_phone", $Dv)) {
goto wHj;
}
$Ml = sanitize_text_field($Dv["user_phone"]);
SessionUtils::add_phone_verified($this->form_session_var, $Ml);
$this->send_challenge('', null, null, $Ml, VerificationType::PHONE);
goto Z2F;
wHj:
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::ENTER_PHONE), MoConstants::ERROR_JSON_TYPE));
Z2F:
}
public function processFormAndValidateOTP()
{
if (check_ajax_referer($this->nonce, "nonce", false)) {
goto oxQ;
}
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::UNKNOWN_ERROR), MoConstants::ERROR_JSON_TYPE));
exit;
oxQ:
$Dv = MoUtility::mo_sanitize_array($_POST);
MoPHPSessions::check_session();
$this->checkIfOTPSent();
$this->checkIntegrityAndValidateOTP($Dv);
}
private function checkIfOTPSent()
{
if (SessionUtils::is_otp_initialized($this->form_session_var)) {
goto UBx;
}
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::ENTER_VERIFY_CODE), MoConstants::ERROR_JSON_TYPE));
UBx:
}
private function checkIntegrityAndValidateOTP($Dv)
{
MoPHPSessions::check_session();
$this->checkIntegrity($Dv);
$this->validate_challenge(sanitize_text_field($Dv["otpType"]), null, sanitize_text_field($Dv["otp_token"]));
if (SessionUtils::is_status_match($this->form_session_var, self::VALIDATED, $Dv["otpType"])) {
goto z11;
}
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::CUSTOM_FORM_MESSAGE), MoConstants::ERROR_JSON_TYPE));
goto IYS;
z11:
if (!(VerificationType::PHONE === $Dv["otpType"])) {
goto Kbi;
}
SessionUtils::add_phone_submitted($this->form_session_var, sanitize_text_field($Dv["user_phone"]));
Kbi:
if (!(VerificationType::EMAIL === $Dv["otpType"])) {
goto lA4;
}
SessionUtils::add_email_submitted($this->form_session_var, sanitize_email($Dv["user_email"]));
lA4:
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::CUSTOM_FORM_MESSAGE), MoConstants::ERROR_JSON_TYPE));
IYS:
}
private function checkIntegrity($Dv)
{
if (!(VerificationType::PHONE === $Dv["otpType"])) {
goto zXR;
}
if (SessionUtils::is_phone_verified_match($this->form_session_var, sanitize_text_field($Dv["user_phone"]))) {
goto Lg5;
}
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::PHONE_MISMATCH), MoConstants::ERROR_JSON_TYPE));
Lg5:
zXR:
if (!(VerificationType::EMAIL === $Dv["otpType"])) {
goto DOJ;
}
if (SessionUtils::is_email_verified_match($this->form_session_var, sanitize_email($Dv["user_email"]))) {
goto s1H;
}
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::EMAIL_MISMATCH), MoConstants::ERROR_JSON_TYPE));
s1H:
DOJ:
}
public function handle_failed_verification($jT, $fv, $W5, $pw)
{
MoPHPSessions::check_session();
if (SessionUtils::is_otp_initialized($this->form_session_var)) {
goto NMg;
}
return;
NMg:
SessionUtils::add_status($this->form_session_var, self::VERIFICATION_FAILED, $pw);
}
public function handle_post_verification($UC, $jT, $fv, $Mi, $W5, $D3, $pw)
{
MoPHPSessions::check_session();
if (SessionUtils::is_otp_initialized($this->form_session_var)) {
goto Dtd;
}
return;
Dtd:
SessionUtils::add_status($this->form_session_var, self::VALIDATED, $pw);
}
public function unset_otp_session_variables()
{
MoPHPSessions::check_session();
SessionUtils::unset_session(array($this->form_session_var, $this->tx_session_id));
}
public function get_phone_number_selector($Up)
{
if (!($this->is_form_enabled() && $this->isPhoneEnabled())) {
goto owD;
}
array_push($Up, $this->form_field_id);
owD:
return $Up;
}
private function isPhoneEnabled()
{
return VerificationType::PHONE === $this->get_verification_type() ? true : false;
}
private function parseFormDetails($Dv)
{
$form = array();
if (array_key_exists("custom_form", $Dv)) {
goto Vmd;
}
return array();
Vmd:
$K3 = isset($Dv["mo_customer_validation_custom_form_enable_type"]) ? sanitize_text_field(wp_unslash($Dv["mo_customer_validation_custom_form_enable_type"])) : '';
$pw = $K3 === $this->type_phone_tag ? "phone" : "email";
foreach (array_filter($Dv["custom_form"]["form"]) as $Cu => $Xk) {
$form[$Xk] = array("submit_id" => sanitize_text_field($Dv["custom_form"][$pw]["submit_id"]), "field_id" => sanitize_text_field($Dv["custom_form"][$pw]["field_id"]));
bsJ:
}
Ult:
return $form;
}
public function handle_form_options()
{
if (!(!MoUtility::are_form_options_being_saved($this->get_form_option()) || !current_user_can("manage_options") || !check_admin_referer($this->admin_nonce))) {
goto s5E;
}
return;
s5E:
$Dv = MoUtility::mo_sanitize_array($_POST);
$form = $this->parseFormDetails($Dv);
$this->form_details = !empty($form) ? $form : '';
$this->is_form_enabled = $this->sanitize_form_post("custom_form_contact_enable");
$this->otp_type = $this->sanitize_form_post("custom_form_enable_type");
$this->button_text = $this->sanitize_form_post("custom_form_button_text");
if (!$this->basic_validation_check(BaseMessages::CUSTOM_CHOOSE)) {
goto qtm;
}
update_mo_option("custom_form_otp_enabled", maybe_serialize($this->form_details));
update_mo_option("custom_form_contact_enable", $this->is_form_enabled);
update_mo_option("custom_form_enable_type", $this->otp_type);
update_mo_option("custom_form_button_text", $this->button_text);
qtm:
}
public function getSubmitKeyDetails()
{
if (!empty($this->form_details)) {
goto A6R;
}
return;
A6R:
return stripcslashes($this->form_details[1]["submit_id"]);
}
public function getFieldKeyDetails()
{
if (!empty($this->form_details)) {
goto CHE;
}
return;
CHE:
return stripcslashes($this->form_details[1]["field_id"]);
}
}
mcM:
?>
Did this file decode correctly?
Original Code
<?php
namespace OTP\Handler\Forms;
if (defined("\101\x42\123\120\x41\124\x48")) {
goto PSZ;
}
exit;
PSZ:
use OTP\Helper\FormSessionVars;
use OTP\Helper\MoConstants;
use OTP\Helper\MoMessages;
use OTP\Helper\MoPHPSessions;
use OTP\Helper\MoUtility;
use OTP\Helper\SessionUtils;
use OTP\Objects\FormHandler;
use OTP\Objects\IFormHandler;
use OTP\Objects\VerificationType;
use OTP\Objects\BaseMessages;
use OTP\Traits\Instance;
if (class_exists("\131\157\165\x72\x4f\x77\x6e\x46\157\x72\155")) {
goto mcM;
}
class YourOwnForm extends FormHandler implements IFormHandler
{
use Instance;
private $check_validated_on_submit;
private $form_field_id;
private $form_submit_id;
private $validated;
protected function __construct()
{
$this->is_login_or_social_form = false;
$this->is_ajax_form = true;
$this->form_key = "\131\x4f\125\122\137\117\x57\x4e\x5f\x46\117\122\x4d";
$this->form_name = mo_("\74\x73\x70\x61\x6e\x20\163\164\171\154\145\x3d\x27\x63\157\x6c\x6f\x72\x3a\x67\x72\145\145\x6e\x27\x20\76\74\142\76\103\141\x6e\x27\x74\x20\x46\x69\156\x64\40\171\157\165\162\x20\x46\x6f\x72\x6d\77\40\x54\162\171\x20\155\145\x21\x3c\x2f\142\76\x3c\x2f\163\x70\141\156\x3e");
$this->form_session_var = FormSessionVars::CUSTOMFORM;
$this->form_details = maybe_unserialize(get_mo_option("\x63\165\x73\x74\157\x6d\137\x66\x6f\x72\x6d\137\x6f\x74\x70\137\145\x6e\141\x62\x6c\x65\144"));
$this->type_phone_tag = "\155\x6f\137\x63\x75\163\164\157\x6d\106\157\x72\155\x5f\160\150\x6f\156\x65\x5f\x65\x6e\141\x62\154\x65";
$this->type_email_tag = "\155\157\137\x63\x75\163\164\x6f\155\106\157\162\155\137\x65\155\x61\151\x6c\137\145\156\141\x62\154\x65";
$this->is_form_enabled = get_mo_option("\143\165\163\x74\157\155\x5f\146\157\162\x6d\137\x63\157\156\x74\x61\x63\164\137\x65\156\141\142\x6c\x65");
$this->generate_otp_action = "\155\151\156\x69\157\162\141\156\x67\x65\x2d\x63\165\163\164\x6f\155\x46\x6f\162\x6d\55\x73\x65\x6e\144\55\x6f\164\x70";
$this->validate_otp_action = "\155\151\156\x69\157\x72\141\156\x67\145\x2d\143\x75\x73\164\x6f\x6d\x46\157\x72\155\x2d\166\x65\162\x69\x66\x79\x2d\143\x6f\144\145";
$this->check_validated_on_submit = "\x6d\x69\156\151\157\x72\141\156\147\145\x2d\143\x75\163\x74\x6f\x6d\106\157\162\155\x2d\x76\145\162\151\x66\171\x2d\x73\x75\142\155\x69\x74";
$this->otp_type = get_mo_option("\143\x75\163\x74\157\155\x5f\x66\x6f\162\x6d\137\x65\156\x61\142\x6c\145\137\164\171\160\145");
$this->button_text = get_mo_option("\x63\165\163\164\157\x6d\137\x66\157\x72\155\137\x62\165\164\164\157\156\137\x74\145\x78\x74");
$this->button_text = !MoUtility::is_blank($this->button_text) ? $this->button_text : mo_("\103\154\151\x63\x6b\x20\110\x65\x72\145\x20\x74\157\x20\x73\x65\156\x64\x20\117\124\x50");
$this->validated = false;
parent::__construct();
$this->handle_form();
}
public function handle_form()
{
MoPHPSessions::check_session();
if ($this->is_form_enabled) {
goto xIE;
}
return;
xIE:
$this->form_field_id = $this->getFieldKeyDetails();
$this->form_submit_id = $this->getSubmitKeyDetails();
add_action("\x77\160\137\145\156\161\x75\x65\x75\x65\137\163\x63\x72\x69\x70\x74\x73", array($this, "\155\157\137\145\x6e\x71\165\x65\x75\145\137\x66\x6f\162\x6d\x5f\163\143\x72\151\160\164"));
add_action("\x6c\x6f\x67\x69\156\137\x65\x6e\161\x75\145\165\145\137\163\x63\x72\x69\x70\x74\x73", array($this, "\155\157\x5f\145\x6e\x71\x75\x65\x75\145\137\x66\x6f\x72\155\137\163\x63\162\x69\160\x74"));
add_action("\167\x70\137\141\x6a\x61\170\137{$this->generate_otp_action}", array($this, "\x73\145\156\144\137\157\x74\x70"));
add_action("\x77\x70\x5f\x61\152\141\x78\x5f\156\157\160\162\x69\166\x5f{$this->generate_otp_action}", array($this, "\163\145\156\144\137\x6f\x74\160"));
add_action("\x77\x70\137\x61\152\141\x78\x5f{$this->validate_otp_action}", array($this, "\x70\162\x6f\x63\x65\163\x73\x46\157\162\155\101\156\144\x56\141\x6c\x69\144\141\x74\145\x4f\x54\x50"));
add_action("\167\160\x5f\141\152\141\x78\137\x6e\x6f\160\162\151\166\137{$this->validate_otp_action}", array($this, "\160\x72\157\143\x65\163\x73\x46\157\162\x6d\101\x6e\144\126\x61\x6c\x69\x64\141\x74\x65\117\124\120"));
add_action("\167\x70\x5f\x61\x6a\141\x78\x5f{$this->check_validated_on_submit}", array($this, "\x63\x68\145\x63\153\x5f\166\141\x6c\151\144\141\164\x65\144\x5f\157\156\137\163\x75\x62\x6d\151\164"));
add_action("\x77\160\x5f\141\x6a\x61\170\x5f\x6e\157\160\x72\x69\x76\137{$this->check_validated_on_submit}", array($this, "\143\150\x65\x63\153\137\x76\141\154\x69\x64\141\164\145\144\137\157\156\x5f\x73\165\x62\155\x69\164"));
if (!SessionUtils::is_status_match($this->form_session_var, self::VALIDATED, $this->get_verification_type())) {
goto dxu;
}
$this->validated = true;
$this->unset_otp_session_variables();
return;
dxu:
}
public function mo_enqueue_form_script()
{
wp_register_script($this->form_session_var, MOV_URL . "\151\156\x63\154\x75\x64\x65\163\x2f\x6a\163\x2f" . $this->form_session_var . "\56\155\x69\x6e\x2e\152\163", array("\152\x71\x75\x65\162\x79"), MOV_VERSION, true);
wp_localize_script($this->form_session_var, $this->form_session_var, array("\x73\x69\x74\145\x55\122\114" => wp_ajax_url(), "\157\164\x70\x54\171\160\145" => $this->get_verification_type(), "\146\x6f\x72\155\x44\x65\164\141\x69\x6c\x73" => $this->form_details, "\142\165\x74\x74\x6f\x6e\x74\145\170\164" => $this->button_text, "\x69\x6d\x67\125\122\x4c" => MOV_LOADER_URL, "\x66\x69\145\x6c\x64\x54\x65\170\x74" => mo_("\105\x6e\164\145\x72\40\117\124\120"), "\147\x6e\157\156\143\145" => wp_create_nonce($this->nonce), "\156\157\156\x63\145\x4b\x65\171" => wp_create_nonce($this->nonce_key), "\x76\156\157\x6e\143\x65" => wp_create_nonce($this->nonce), "\147\x61\143\164\x69\157\x6e" => $this->generate_otp_action, "\x76\x61\143\x74\151\157\x6e" => $this->validate_otp_action, "\163\x61\143\x74\151\157\156" => $this->check_validated_on_submit, "\x66\151\145\x6c\144\x53\x65\x6c\x65\143\164\157\162" => $this->form_field_id, "\163\x75\142\x6d\x69\x74\123\x65\x6c\145\x63\164\x6f\162" => $this->form_submit_id));
wp_enqueue_script($this->form_session_var);
wp_enqueue_style("\155\157\x5f\146\x6f\x72\155\x73\x5f\x63\163\163", MOV_FORM_CSS, array(), MOV_VERSION);
}
public function send_otp()
{
if (check_ajax_referer($this->nonce, "\156\x6f\156\143\x65", false)) {
goto sEr;
}
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::UNKNOWN_ERROR), MoConstants::ERROR_JSON_TYPE));
exit;
sEr:
$Dv = MoUtility::mo_sanitize_array($_POST);
MoPHPSessions::check_session();
if (SessionUtils::is_otp_initialized($this->form_session_var)) {
goto EhC;
}
MoUtility::initialize_transaction($this->form_session_var);
EhC:
if (!(MoUtility::sanitize_check("\157\164\x70\124\171\160\x65", $Dv) === VerificationType::PHONE)) {
goto ojr;
}
$this->process_phone_and_send_otp($Dv);
ojr:
if (!(MoUtility::sanitize_check("\157\164\160\124\x79\x70\145", $Dv) === VerificationType::EMAIL)) {
goto E9l;
}
$this->process_email_and_send_otp($Dv);
E9l:
}
public function check_validated_on_submit()
{
if (SessionUtils::is_otp_initialized($this->form_session_var) || $this->validated) {
goto cue;
}
if (!SessionUtils::is_otp_initialized($this->form_session_var) && !$this->validated) {
goto SbU;
}
goto tqX;
cue:
wp_send_json(MoUtility::create_json(self::VALIDATED, MoConstants::SUCCESS_JSON_TYPE));
goto tqX;
SbU:
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::PLEASE_VALIDATE), MoConstants::ERROR_JSON_TYPE));
tqX:
}
private function process_email_and_send_otp($Dv)
{
MoPHPSessions::check_session();
if (!MoUtility::sanitize_check("\165\163\145\162\137\145\155\x61\151\154", $Dv)) {
goto FT9;
}
$fv = sanitize_email($Dv["\x75\163\x65\162\137\145\x6d\141\x69\154"]);
SessionUtils::add_email_verified($this->form_session_var, $fv);
$this->send_challenge('', $fv, null, null, VerificationType::EMAIL);
goto if9;
FT9:
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::ENTER_EMAIL), MoConstants::ERROR_JSON_TYPE));
if9:
}
private function process_phone_and_send_otp($Dv)
{
if (!MoUtility::sanitize_check("\x75\163\x65\162\137\160\x68\x6f\x6e\x65", $Dv)) {
goto wHj;
}
$Ml = sanitize_text_field($Dv["\x75\x73\145\162\x5f\160\150\157\x6e\x65"]);
SessionUtils::add_phone_verified($this->form_session_var, $Ml);
$this->send_challenge('', null, null, $Ml, VerificationType::PHONE);
goto Z2F;
wHj:
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::ENTER_PHONE), MoConstants::ERROR_JSON_TYPE));
Z2F:
}
public function processFormAndValidateOTP()
{
if (check_ajax_referer($this->nonce, "\x6e\x6f\x6e\x63\145", false)) {
goto oxQ;
}
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::UNKNOWN_ERROR), MoConstants::ERROR_JSON_TYPE));
exit;
oxQ:
$Dv = MoUtility::mo_sanitize_array($_POST);
MoPHPSessions::check_session();
$this->checkIfOTPSent();
$this->checkIntegrityAndValidateOTP($Dv);
}
private function checkIfOTPSent()
{
if (SessionUtils::is_otp_initialized($this->form_session_var)) {
goto UBx;
}
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::ENTER_VERIFY_CODE), MoConstants::ERROR_JSON_TYPE));
UBx:
}
private function checkIntegrityAndValidateOTP($Dv)
{
MoPHPSessions::check_session();
$this->checkIntegrity($Dv);
$this->validate_challenge(sanitize_text_field($Dv["\x6f\164\160\x54\x79\160\x65"]), null, sanitize_text_field($Dv["\157\164\160\137\x74\x6f\153\x65\156"]));
if (SessionUtils::is_status_match($this->form_session_var, self::VALIDATED, $Dv["\x6f\x74\x70\124\x79\x70\145"])) {
goto z11;
}
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::CUSTOM_FORM_MESSAGE), MoConstants::ERROR_JSON_TYPE));
goto IYS;
z11:
if (!(VerificationType::PHONE === $Dv["\157\164\160\124\x79\160\145"])) {
goto Kbi;
}
SessionUtils::add_phone_submitted($this->form_session_var, sanitize_text_field($Dv["\x75\x73\x65\x72\x5f\160\x68\x6f\x6e\145"]));
Kbi:
if (!(VerificationType::EMAIL === $Dv["\x6f\x74\160\x54\x79\x70\x65"])) {
goto lA4;
}
SessionUtils::add_email_submitted($this->form_session_var, sanitize_email($Dv["\165\163\x65\x72\137\x65\x6d\141\151\154"]));
lA4:
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::CUSTOM_FORM_MESSAGE), MoConstants::ERROR_JSON_TYPE));
IYS:
}
private function checkIntegrity($Dv)
{
if (!(VerificationType::PHONE === $Dv["\x6f\x74\x70\x54\x79\160\145"])) {
goto zXR;
}
if (SessionUtils::is_phone_verified_match($this->form_session_var, sanitize_text_field($Dv["\165\163\145\162\x5f\x70\150\x6f\156\x65"]))) {
goto Lg5;
}
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::PHONE_MISMATCH), MoConstants::ERROR_JSON_TYPE));
Lg5:
zXR:
if (!(VerificationType::EMAIL === $Dv["\157\164\160\124\171\x70\145"])) {
goto DOJ;
}
if (SessionUtils::is_email_verified_match($this->form_session_var, sanitize_email($Dv["\x75\163\x65\162\x5f\145\155\141\151\154"]))) {
goto s1H;
}
wp_send_json(MoUtility::create_json(MoMessages::showMessage(MoMessages::EMAIL_MISMATCH), MoConstants::ERROR_JSON_TYPE));
s1H:
DOJ:
}
public function handle_failed_verification($jT, $fv, $W5, $pw)
{
MoPHPSessions::check_session();
if (SessionUtils::is_otp_initialized($this->form_session_var)) {
goto NMg;
}
return;
NMg:
SessionUtils::add_status($this->form_session_var, self::VERIFICATION_FAILED, $pw);
}
public function handle_post_verification($UC, $jT, $fv, $Mi, $W5, $D3, $pw)
{
MoPHPSessions::check_session();
if (SessionUtils::is_otp_initialized($this->form_session_var)) {
goto Dtd;
}
return;
Dtd:
SessionUtils::add_status($this->form_session_var, self::VALIDATED, $pw);
}
public function unset_otp_session_variables()
{
MoPHPSessions::check_session();
SessionUtils::unset_session(array($this->form_session_var, $this->tx_session_id));
}
public function get_phone_number_selector($Up)
{
if (!($this->is_form_enabled() && $this->isPhoneEnabled())) {
goto owD;
}
array_push($Up, $this->form_field_id);
owD:
return $Up;
}
private function isPhoneEnabled()
{
return VerificationType::PHONE === $this->get_verification_type() ? true : false;
}
private function parseFormDetails($Dv)
{
$form = array();
if (array_key_exists("\143\x75\163\164\x6f\155\137\x66\x6f\162\x6d", $Dv)) {
goto Vmd;
}
return array();
Vmd:
$K3 = isset($Dv["\x6d\157\137\x63\165\163\x74\x6f\x6d\x65\x72\137\166\x61\154\x69\x64\x61\x74\151\x6f\x6e\x5f\x63\x75\x73\164\157\155\x5f\146\157\162\x6d\137\x65\156\x61\x62\154\145\x5f\164\x79\160\145"]) ? sanitize_text_field(wp_unslash($Dv["\155\157\x5f\x63\x75\163\x74\x6f\155\x65\162\x5f\166\141\x6c\x69\x64\141\x74\151\157\x6e\137\143\165\163\x74\x6f\155\137\146\157\x72\155\x5f\x65\156\x61\x62\154\145\137\164\171\x70\x65"])) : '';
$pw = $K3 === $this->type_phone_tag ? "\160\150\x6f\156\145" : "\145\x6d\141\151\154";
foreach (array_filter($Dv["\x63\x75\163\164\157\155\137\x66\x6f\162\155"]["\146\x6f\162\x6d"]) as $Cu => $Xk) {
$form[$Xk] = array("\x73\165\x62\x6d\151\164\137\151\144" => sanitize_text_field($Dv["\x63\165\163\x74\157\155\137\x66\x6f\162\155"][$pw]["\163\x75\x62\x6d\x69\x74\x5f\151\144"]), "\x66\x69\145\x6c\x64\137\x69\x64" => sanitize_text_field($Dv["\x63\x75\x73\x74\157\x6d\x5f\x66\157\162\155"][$pw]["\146\151\x65\154\144\x5f\151\144"]));
bsJ:
}
Ult:
return $form;
}
public function handle_form_options()
{
if (!(!MoUtility::are_form_options_being_saved($this->get_form_option()) || !current_user_can("\x6d\141\x6e\x61\x67\145\x5f\x6f\x70\164\151\157\156\163") || !check_admin_referer($this->admin_nonce))) {
goto s5E;
}
return;
s5E:
$Dv = MoUtility::mo_sanitize_array($_POST);
$form = $this->parseFormDetails($Dv);
$this->form_details = !empty($form) ? $form : '';
$this->is_form_enabled = $this->sanitize_form_post("\143\x75\x73\x74\157\x6d\137\x66\x6f\x72\x6d\137\143\x6f\156\x74\141\143\x74\x5f\145\x6e\x61\x62\x6c\145");
$this->otp_type = $this->sanitize_form_post("\x63\165\x73\164\157\x6d\x5f\146\157\162\155\x5f\145\156\141\142\154\145\x5f\x74\x79\x70\x65");
$this->button_text = $this->sanitize_form_post("\143\165\163\x74\x6f\x6d\x5f\x66\x6f\162\155\x5f\x62\x75\x74\164\x6f\156\137\x74\x65\x78\x74");
if (!$this->basic_validation_check(BaseMessages::CUSTOM_CHOOSE)) {
goto qtm;
}
update_mo_option("\143\165\163\164\x6f\155\x5f\x66\x6f\162\155\137\157\x74\x70\x5f\145\x6e\141\142\x6c\145\144", maybe_serialize($this->form_details));
update_mo_option("\143\x75\x73\164\157\x6d\137\x66\x6f\162\155\137\143\157\x6e\164\141\143\x74\137\x65\x6e\x61\x62\x6c\x65", $this->is_form_enabled);
update_mo_option("\x63\165\x73\x74\x6f\155\137\x66\x6f\x72\x6d\x5f\x65\156\141\x62\x6c\145\137\x74\x79\160\145", $this->otp_type);
update_mo_option("\x63\165\x73\164\x6f\x6d\x5f\146\x6f\x72\x6d\x5f\x62\165\164\x74\157\x6e\x5f\164\x65\170\164", $this->button_text);
qtm:
}
public function getSubmitKeyDetails()
{
if (!empty($this->form_details)) {
goto A6R;
}
return;
A6R:
return stripcslashes($this->form_details[1]["\x73\165\x62\155\151\164\x5f\151\x64"]);
}
public function getFieldKeyDetails()
{
if (!empty($this->form_details)) {
goto CHE;
}
return;
CHE:
return stripcslashes($this->form_details[1]["\146\x69\x65\x6c\x64\x5f\151\144"]);
}
}
mcM:
Function Calls
None |
Stats
MD5 | 78d3ab537f05e6c643b002ff99988cef |
Eval Count | 0 |
Decode Time | 67 ms |