Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php use MoOauthClient\LoginHandler; use MoOauthClient\MOUtils; use MoOauthClient\..
Decoded Output download
<?php
use MoOauthClient\LoginHandler;
use MoOauthClient\MOUtils;
use MoOauthClient\MO_Oauth_Debug;
require "mo_cognito_integrator_process.php";
remove_filter("authenticate", "wp_authenticate_username_password", 20, 3);
remove_filter("authenticate", "wp_authenticate_email_password", 20, 3);
add_filter("authenticate", "mo_ci_access_wp_login_fields", 1, 3);
add_action("user_register", "mo_ci_sync_registered_user", 10, 2);
add_action("init", "mo_ci_test_config", 2, 0);
add_action("profile_update", "mo_ci_profile_update", 10, 3);
function mo_ci_is_subsite_enabled()
{
$aj = new \MoOauthClient\MOUtils();
if (is_multisite()) {
goto tr;
}
return true;
goto Vx;
tr:
$blog_id = get_current_blog_id();
$en = $aj->mo_oauth_client_get_option("mo_oauth_c3Vic2l0ZXNzZWxlY3RlZA");
$Hf = array();
if (!isset($en)) {
goto uw;
}
$Hf = json_decode($aj->mooauthdecrypt($en), true);
uw:
$Qd = false;
$WW = $aj->mo_oauth_client_get_option("mo_oauth_isMultiSitePluginRequested");
if (!(is_array($Hf) && in_array($blog_id, $Hf))) {
goto io;
}
$Qd = true;
io:
if (!(is_multisite() && $WW && ($WW && !$Qd) && $aj->mo_oauth_client_get_option("noOfSubSites") < 1000)) {
goto GL;
}
return false;
GL:
return $blog_id;
Vx:
}
function mo_ci_sync_registered_user($JP, $jZ)
{
$Eb = mo_ci_is_subsite_enabled();
if (!($Eb && class_exists("MoOAuthClient\MOUtils"))) {
goto tq;
}
$aj = new MoOAuthClient\MOUtils();
$Tg = $aj->get_app_list();
foreach ($Tg as $Qb => $pP) {
$pw = $aj->get_app_by_name($Qb);
$V1 = $pw->get_app_config();
if (!($V1["appId"] == "cognitointegrator")) {
goto xJ;
}
goto ro;
xJ:
zs:
}
ro:
tq:
if (!$pw) {
goto il;
}
$NY = $pw->get_app_config();
if (!$NY["mo_ci_register_user_checkbox"]) {
goto YL;
}
if ($NY["mo_ci_pool_type"] == "username") {
goto AU;
}
$jZ["user_login"] = empty($jZ["user_email"]) ? '' : $jZ["user_email"];
goto rE;
AU:
$jZ["user_login"] = empty($jZ["user_login"]) ? '' : $jZ["user_login"];
rE:
$iQ = new Mo_Cognito_Process();
$errors = $iQ->mo_ci_create_user($jZ, array());
if (empty($errors)) {
goto Fv;
}
$errors = "Error in Cognito Integrator flow:-" . $errors["mo_cognito_error"];
MO_Oauth_Debug::mo_oauth_log($errors);
Fv:
YL:
il:
}
function mo_ci_test_config()
{
if (!class_exists("MoOAuthClient\MOUtils")) {
goto pl;
}
$aj = new MoOAuthClient\MOUtils();
pl:
if (!(isset($_POST["option"]) and $_POST["option"] == "mo_ci_test_config")) {
goto d0;
}
$jE = isset($_POST["mo_ci_test_username"]) ? $_POST["mo_ci_test_username"] : '';
$QA = isset($_POST["mo_ci_test_password"]) ? $_POST["mo_ci_test_password"] : '';
if (!(empty($jE) || empty($QA))) {
goto V2;
}
wp_die("Username and Password are required to test the configuration.");
V2:
$iQ = new Mo_Cognito_Process();
$rt = $iQ->mo_ci_get_user($jE, $QA);
if (is_wp_error($rt)) {
goto LO;
}
$user = $rt["user_array"];
$Z3 = new LoginHandler();
$NE = [];
$Cv = $Z3->dropdownattrmapping('', $user, $NE);
$aj->mo_oauth_client_update_option("mo_oauth_attr_name_listcognitointegrator", $Cv);
$Z3->render_test_config_output($user, false);
exit;
goto oj;
LO:
$WO = $rt->get_error_message();
if (!($WO == "FORCE_CHANGE_PASSWORD")) {
goto Ze;
}
$WO = "You should change password on your first login.";
Ze:
wp_die($WO);
oj:
d0:
}
function mo_ci_clear_login_error($errors, $kX)
{
return new WP_Error();
}
function mo_ci_access_wp_login_fields($user, $jE, $QA)
{
if (!("POST" !== (isset($_SERVER["REQUEST_METHOD"]) ? sanitize_text_field(wp_unslash($_SERVER["REQUEST_METHOD"])) : ''))) {
goto PM;
}
add_filter("wp_login_errors", "mo_ci_clear_login_error", 0, 2);
return $user;
PM:
if (!(empty($jE) || empty($QA))) {
goto vW;
}
$WO = new WP_Error();
if (empty($jE)) {
goto JJ;
}
if (!empty($QA)) {
goto R9;
}
$WO->add("empty_password", __("<strong>ERROR</strong>:Password feild is empty."));
R9:
goto Hw;
JJ:
$WO->add("empty_username", __("<strong>ERROR</strong>:Username/Email feild is empty."));
Hw:
return $WO;
vW:
$Eb = mo_ci_is_subsite_enabled();
$iQ = new Mo_Cognito_Process();
$user = $iQ->mo_ci_authenticate_user($jE, $QA, $Eb);
return $user;
}
function mo_ci_profile_update($JP, $mq, $E0)
{
MO_Oauth_Debug::mo_oauth_log($E0);
if (!class_exists("MoOAuthClient\MOUtils")) {
goto rD;
}
$aj = new MoOAuthClient\MOUtils();
$Tg = $aj->get_app_list();
foreach ($Tg as $Qb => $pP) {
$pw = $aj->get_app_by_name($Qb);
$V1 = $pw->get_app_config();
if (!($V1["appId"] == "cognitointegrator")) {
goto VF;
}
goto m3;
VF:
rH:
}
m3:
rD:
if (!$pw) {
goto BO;
}
$NY = $pw->get_app_config();
if (!is_user_logged_in()) {
goto Bo;
}
$iQ = new Mo_Cognito_Process();
$errors = $iQ->mo_ci_update_user($E0, array());
if (empty($errors)) {
goto um;
}
MO_Oauth_Debug::mo_oauth_log($errors);
um:
Bo:
BO:
}
function mo_ci_custom_login_form($jE, $QA, $R9 = false)
{
$Eb = mo_ci_is_subsite_enabled();
$iQ = new Mo_Cognito_Process();
$user = $iQ->mo_ci_authenticate_user($jE, $QA, $Eb);
if (!isset($user->errors)) {
goto fh;
}
$kM = $user->errors["mo_cognito_error"];
$kM = $kM[0];
MO_Oauth_Debug::mo_oauth_log($kM);
return $kM;
fh:
if (!($R9 === false)) {
goto SL;
}
wp_set_auth_cookie($user->data->ID, true);
wp_safe_redirect(home_url());
exit;
SL:
return $user;
}
function mo_ci_custom_registeration_form($jZ = array(), $R9 = false)
{
$user = wp_insert_user($jZ);
if (!is_wp_error($user)) {
goto PU;
}
if (!isset($user->errors["existing_user_login"])) {
goto M1;
}
$kM = $user->errors["existing_user_login"];
MO_Oauth_Debug::mo_oauth_log($kM[0]);
return $kM[0];
M1:
PU:
if (!($R9 === false)) {
goto yo;
}
wp_set_auth_cookie($user, true);
wp_safe_redirect(home_url());
exit;
yo:
return $user;
}
function mo_ci_custom_registeration_form_testing()
{
$jZ = array("user_pass" => "Shihan@143", "user_login" => "naveeniyer", "user_email" => "[email protected]", "first_name" => "naveenidle", "meta_input" => array("address" => "sanjay", "school" => "PICT"));
$user = mo_ci_custom_registeration_form($jZ, false);
}
function mo_ci_custom_login_form_func()
{
$user = mo_ci_custom_login_form("sayrita", "Shihan@143", false);
}
?>
Did this file decode correctly?
Original Code
<?php
use MoOauthClient\LoginHandler;
use MoOauthClient\MOUtils;
use MoOauthClient\MO_Oauth_Debug;
require "\155\x6f\137\143\x6f\147\156\151\164\157\137\x69\156\x74\145\x67\162\x61\164\x6f\162\137\160\162\157\x63\x65\x73\x73\56\x70\x68\x70";
remove_filter("\141\165\x74\150\x65\x6e\x74\x69\143\141\x74\145", "\167\160\x5f\x61\x75\164\x68\x65\x6e\164\151\x63\x61\164\x65\137\165\x73\x65\x72\156\141\x6d\145\137\x70\x61\x73\x73\167\x6f\162\144", 20, 3);
remove_filter("\x61\x75\x74\150\x65\156\164\x69\143\x61\164\145", "\x77\x70\x5f\141\x75\x74\150\x65\x6e\x74\151\x63\x61\164\145\x5f\145\155\141\x69\154\137\x70\141\163\x73\167\x6f\162\144", 20, 3);
add_filter("\x61\165\x74\150\x65\156\x74\x69\x63\141\164\x65", "\x6d\157\x5f\143\151\137\x61\x63\143\x65\163\163\137\167\160\x5f\x6c\x6f\147\x69\x6e\x5f\146\151\145\x6c\144\x73", 1, 3);
add_action("\165\163\145\x72\137\162\145\x67\x69\x73\164\x65\x72", "\155\x6f\137\143\151\x5f\x73\x79\156\143\x5f\x72\145\147\151\x73\x74\145\x72\145\x64\137\x75\x73\x65\x72", 10, 2);
add_action("\151\x6e\151\164", "\x6d\x6f\137\143\151\137\x74\x65\x73\x74\x5f\143\x6f\156\146\151\x67", 2, 0);
add_action("\x70\x72\x6f\146\x69\154\x65\137\x75\160\144\x61\164\145", "\x6d\x6f\x5f\143\151\x5f\160\162\157\146\151\154\145\137\x75\160\x64\x61\x74\145", 10, 3);
function mo_ci_is_subsite_enabled()
{
$aj = new \MoOauthClient\MOUtils();
if (is_multisite()) {
goto tr;
}
return true;
goto Vx;
tr:
$blog_id = get_current_blog_id();
$en = $aj->mo_oauth_client_get_option("\155\157\x5f\157\141\165\x74\x68\137\x63\x33\x56\x69\x63\62\x6c\x30\x5a\x58\x4e\172\x5a\x57\x78\154\131\63\122\x6c\x5a\101");
$Hf = array();
if (!isset($en)) {
goto uw;
}
$Hf = json_decode($aj->mooauthdecrypt($en), true);
uw:
$Qd = false;
$WW = $aj->mo_oauth_client_get_option("\x6d\157\137\157\x61\165\164\150\x5f\x69\x73\x4d\165\x6c\x74\x69\x53\x69\164\x65\x50\154\165\147\151\x6e\122\x65\161\165\145\163\x74\145\144");
if (!(is_array($Hf) && in_array($blog_id, $Hf))) {
goto io;
}
$Qd = true;
io:
if (!(is_multisite() && $WW && ($WW && !$Qd) && $aj->mo_oauth_client_get_option("\x6e\x6f\x4f\146\123\x75\x62\x53\151\164\x65\x73") < 1000)) {
goto GL;
}
return false;
GL:
return $blog_id;
Vx:
}
function mo_ci_sync_registered_user($JP, $jZ)
{
$Eb = mo_ci_is_subsite_enabled();
if (!($Eb && class_exists("\x4d\x6f\117\x41\x75\x74\150\103\x6c\151\145\x6e\x74\134\115\x4f\x55\164\x69\154\163"))) {
goto tq;
}
$aj = new MoOAuthClient\MOUtils();
$Tg = $aj->get_app_list();
foreach ($Tg as $Qb => $pP) {
$pw = $aj->get_app_by_name($Qb);
$V1 = $pw->get_app_config();
if (!($V1["\141\160\x70\x49\144"] == "\x63\x6f\x67\156\151\x74\x6f\x69\x6e\x74\145\147\162\x61\164\x6f\x72")) {
goto xJ;
}
goto ro;
xJ:
zs:
}
ro:
tq:
if (!$pw) {
goto il;
}
$NY = $pw->get_app_config();
if (!$NY["\155\x6f\137\143\151\x5f\x72\145\147\151\163\164\145\x72\137\165\163\145\162\x5f\143\x68\x65\x63\x6b\x62\x6f\x78"]) {
goto YL;
}
if ($NY["\155\x6f\x5f\x63\x69\x5f\x70\157\157\154\137\x74\x79\160\x65"] == "\165\163\145\x72\156\141\155\x65") {
goto AU;
}
$jZ["\165\163\145\162\x5f\x6c\157\x67\x69\x6e"] = empty($jZ["\x75\163\x65\162\x5f\145\x6d\x61\x69\154"]) ? '' : $jZ["\x75\x73\x65\x72\137\145\x6d\x61\151\154"];
goto rE;
AU:
$jZ["\x75\163\145\162\137\x6c\157\147\151\x6e"] = empty($jZ["\x75\x73\145\162\x5f\154\x6f\147\151\156"]) ? '' : $jZ["\x75\163\145\x72\x5f\154\157\147\151\156"];
rE:
$iQ = new Mo_Cognito_Process();
$errors = $iQ->mo_ci_create_user($jZ, array());
if (empty($errors)) {
goto Fv;
}
$errors = "\x45\x72\162\157\x72\x20\151\156\x20\103\x6f\147\156\151\x74\157\40\111\x6e\164\145\147\x72\141\x74\157\162\x20\146\154\x6f\167\x3a\x2d" . $errors["\155\x6f\137\x63\x6f\147\156\151\x74\157\x5f\145\x72\x72\x6f\162"];
MO_Oauth_Debug::mo_oauth_log($errors);
Fv:
YL:
il:
}
function mo_ci_test_config()
{
if (!class_exists("\115\x6f\117\x41\x75\x74\x68\x43\x6c\151\145\156\164\x5c\x4d\117\125\164\151\x6c\x73")) {
goto pl;
}
$aj = new MoOAuthClient\MOUtils();
pl:
if (!(isset($_POST["\157\x70\x74\151\x6f\x6e"]) and $_POST["\157\160\x74\x69\157\156"] == "\155\x6f\x5f\143\151\137\x74\x65\x73\164\137\x63\x6f\156\x66\151\147")) {
goto d0;
}
$jE = isset($_POST["\155\157\x5f\143\151\x5f\164\145\163\164\137\x75\x73\x65\162\156\x61\x6d\145"]) ? $_POST["\x6d\157\137\x63\151\137\164\145\x73\x74\x5f\x75\163\x65\162\x6e\141\x6d\145"] : '';
$QA = isset($_POST["\155\157\x5f\143\x69\137\164\145\x73\x74\137\x70\141\163\x73\167\157\162\144"]) ? $_POST["\155\157\x5f\143\151\x5f\164\x65\x73\164\x5f\x70\x61\x73\x73\x77\157\162\x64"] : '';
if (!(empty($jE) || empty($QA))) {
goto V2;
}
wp_die("\x55\163\x65\162\156\x61\x6d\x65\40\x61\156\144\40\x50\x61\x73\x73\167\x6f\x72\x64\40\x61\x72\x65\40\x72\x65\x71\x75\151\162\145\x64\40\164\x6f\40\x74\145\163\164\x20\x74\150\x65\x20\143\157\156\146\x69\147\165\x72\x61\x74\x69\x6f\x6e\x2e");
V2:
$iQ = new Mo_Cognito_Process();
$rt = $iQ->mo_ci_get_user($jE, $QA);
if (is_wp_error($rt)) {
goto LO;
}
$user = $rt["\x75\163\x65\x72\137\x61\x72\x72\141\x79"];
$Z3 = new LoginHandler();
$NE = [];
$Cv = $Z3->dropdownattrmapping('', $user, $NE);
$aj->mo_oauth_client_update_option("\155\157\137\157\141\x75\164\x68\137\x61\x74\x74\x72\137\156\x61\155\x65\137\154\x69\163\x74\143\x6f\x67\x6e\151\x74\157\151\156\x74\x65\x67\x72\x61\164\x6f\x72", $Cv);
$Z3->render_test_config_output($user, false);
exit;
goto oj;
LO:
$WO = $rt->get_error_message();
if (!($WO == "\x46\x4f\122\103\105\x5f\x43\110\101\116\107\x45\x5f\120\101\x53\x53\x57\117\x52\104")) {
goto Ze;
}
$WO = "\131\157\x75\40\x73\x68\x6f\x75\x6c\144\x20\x63\x68\x61\156\x67\x65\x20\x70\141\163\x73\167\x6f\162\x64\x20\x6f\156\40\171\157\165\162\40\146\151\162\163\164\40\x6c\x6f\x67\151\x6e\56";
Ze:
wp_die($WO);
oj:
d0:
}
function mo_ci_clear_login_error($errors, $kX)
{
return new WP_Error();
}
function mo_ci_access_wp_login_fields($user, $jE, $QA)
{
if (!("\x50\117\123\124" !== (isset($_SERVER["\122\105\121\x55\105\x53\124\137\x4d\x45\124\110\x4f\x44"]) ? sanitize_text_field(wp_unslash($_SERVER["\x52\105\x51\x55\105\x53\124\137\115\x45\124\110\x4f\104"])) : ''))) {
goto PM;
}
add_filter("\167\x70\x5f\x6c\157\x67\151\x6e\x5f\145\x72\162\157\162\x73", "\x6d\157\x5f\143\151\x5f\143\x6c\145\141\162\x5f\x6c\x6f\x67\x69\156\x5f\145\x72\x72\157\162", 0, 2);
return $user;
PM:
if (!(empty($jE) || empty($QA))) {
goto vW;
}
$WO = new WP_Error();
if (empty($jE)) {
goto JJ;
}
if (!empty($QA)) {
goto R9;
}
$WO->add("\x65\x6d\160\x74\x79\x5f\160\x61\163\163\167\x6f\x72\144", __("\x3c\x73\x74\162\157\x6e\x67\76\105\122\122\x4f\x52\74\57\x73\164\x72\157\156\x67\x3e\x3a\x50\x61\163\x73\x77\x6f\x72\144\40\x66\145\x69\x6c\144\x20\x69\x73\x20\145\x6d\x70\164\x79\56"));
R9:
goto Hw;
JJ:
$WO->add("\x65\x6d\x70\164\x79\x5f\x75\x73\x65\162\x6e\141\155\x65", __("\74\163\164\162\157\x6e\x67\76\105\x52\x52\x4f\x52\74\x2f\163\x74\162\157\156\147\x3e\x3a\125\x73\x65\x72\x6e\141\155\145\57\105\x6d\141\151\x6c\40\x66\145\x69\x6c\144\x20\x69\x73\40\145\x6d\160\164\x79\x2e"));
Hw:
return $WO;
vW:
$Eb = mo_ci_is_subsite_enabled();
$iQ = new Mo_Cognito_Process();
$user = $iQ->mo_ci_authenticate_user($jE, $QA, $Eb);
return $user;
}
function mo_ci_profile_update($JP, $mq, $E0)
{
MO_Oauth_Debug::mo_oauth_log($E0);
if (!class_exists("\x4d\x6f\117\101\x75\x74\x68\103\x6c\x69\x65\x6e\164\x5c\115\117\x55\164\x69\x6c\163")) {
goto rD;
}
$aj = new MoOAuthClient\MOUtils();
$Tg = $aj->get_app_list();
foreach ($Tg as $Qb => $pP) {
$pw = $aj->get_app_by_name($Qb);
$V1 = $pw->get_app_config();
if (!($V1["\141\x70\160\111\144"] == "\x63\x6f\147\x6e\x69\x74\x6f\151\156\x74\x65\147\162\141\x74\x6f\x72")) {
goto VF;
}
goto m3;
VF:
rH:
}
m3:
rD:
if (!$pw) {
goto BO;
}
$NY = $pw->get_app_config();
if (!is_user_logged_in()) {
goto Bo;
}
$iQ = new Mo_Cognito_Process();
$errors = $iQ->mo_ci_update_user($E0, array());
if (empty($errors)) {
goto um;
}
MO_Oauth_Debug::mo_oauth_log($errors);
um:
Bo:
BO:
}
function mo_ci_custom_login_form($jE, $QA, $R9 = false)
{
$Eb = mo_ci_is_subsite_enabled();
$iQ = new Mo_Cognito_Process();
$user = $iQ->mo_ci_authenticate_user($jE, $QA, $Eb);
if (!isset($user->errors)) {
goto fh;
}
$kM = $user->errors["\x6d\x6f\x5f\143\x6f\x67\x6e\151\x74\157\x5f\145\162\x72\x6f\x72"];
$kM = $kM[0];
MO_Oauth_Debug::mo_oauth_log($kM);
return $kM;
fh:
if (!($R9 === false)) {
goto SL;
}
wp_set_auth_cookie($user->data->ID, true);
wp_safe_redirect(home_url());
exit;
SL:
return $user;
}
function mo_ci_custom_registeration_form($jZ = array(), $R9 = false)
{
$user = wp_insert_user($jZ);
if (!is_wp_error($user)) {
goto PU;
}
if (!isset($user->errors["\145\x78\151\163\x74\151\156\147\x5f\x75\163\145\162\x5f\154\157\147\151\156"])) {
goto M1;
}
$kM = $user->errors["\145\170\x69\x73\x74\151\x6e\x67\x5f\x75\x73\x65\162\x5f\x6c\x6f\x67\151\156"];
MO_Oauth_Debug::mo_oauth_log($kM[0]);
return $kM[0];
M1:
PU:
if (!($R9 === false)) {
goto yo;
}
wp_set_auth_cookie($user, true);
wp_safe_redirect(home_url());
exit;
yo:
return $user;
}
function mo_ci_custom_registeration_form_testing()
{
$jZ = array("\x75\163\145\162\137\x70\141\x73\163" => "\x53\x68\x69\150\x61\x6e\100\x31\x34\63", "\165\x73\x65\162\137\154\x6f\x67\151\156" => "\x6e\141\x76\x65\x65\x6e\151\x79\145\x72", "\165\x73\145\162\137\x65\155\141\x69\x6c" => "\x6e\141\x76\145\x65\156\100\155\x62\x62\163\x2e\143\x6f\155", "\146\x69\162\x73\164\137\156\x61\155\145" => "\156\x61\x76\145\145\156\151\144\154\x65", "\x6d\145\x74\x61\x5f\151\x6e\160\x75\x74" => array("\141\x64\x64\162\x65\163\x73" => "\163\x61\x6e\x6a\x61\x79", "\163\x63\x68\x6f\157\154" => "\120\x49\x43\x54"));
$user = mo_ci_custom_registeration_form($jZ, false);
}
function mo_ci_custom_login_form_func()
{
$user = mo_ci_custom_login_form("\163\x61\x79\162\151\164\141", "\x53\x68\x69\x68\x61\156\x40\x31\x34\63", false);
}
Function Calls
None |
Stats
MD5 | 3d44ffefcf14df8918db56d2e4370bcd |
Eval Count | 0 |
Decode Time | 44 ms |