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()
{
$UG = new \MoOauthClient\MOUtils();
if (is_multisite()) {
goto py;
}
return true;
goto wT;
py:
$blog_id = get_current_blog_id();
$iy = $UG->mo_oauth_client_get_option("mo_oauth_c3Vic2l0ZXNzZWxlY3RlZA");
$DM = array();
if (!isset($iy)) {
goto dD;
}
$DM = json_decode($UG->mooauthdecrypt($iy), true);
dD:
$eC = false;
$Vx = $UG->mo_oauth_client_get_option("mo_oauth_isMultiSitePluginRequested");
if (!(is_array($DM) && in_array($blog_id, $DM))) {
goto Ba;
}
$eC = true;
Ba:
if (!(is_multisite() && $Vx && ($Vx && !$eC) && $UG->mo_oauth_client_get_option("noOfSubSites") < 1000)) {
goto nF;
}
return false;
nF:
return $blog_id;
wT:
}
function mo_ci_sync_registered_user($D2, $m0)
{
$dA = mo_ci_is_subsite_enabled();
if (!($dA && class_exists("MoOAuthClient\MOUtils"))) {
goto vu;
}
$UG = new MoOAuthClient\MOUtils();
$s7 = $UG->get_app_list();
foreach ($s7 as $jr => $qf) {
$nC = $UG->get_app_by_name($jr);
$CR = $nC->get_app_config();
if (!($CR["appId"] == "cognitointegrator")) {
goto HV;
}
goto N6;
HV:
hC:
}
N6:
vu:
if (!$nC) {
goto VR;
}
$GZ = $nC->get_app_config();
if (!$GZ["mo_ci_register_user_checkbox"]) {
goto MB;
}
if ($GZ["mo_ci_pool_type"] == "username") {
goto SF;
}
$m0["user_login"] = empty($m0["user_email"]) ? '' : $m0["user_email"];
goto nC;
SF:
$m0["user_login"] = empty($m0["user_login"]) ? '' : $m0["user_login"];
nC:
$fk = new Mo_Cognito_Process();
$errors = $fk->mo_ci_create_user($m0, array());
if (empty($errors)) {
goto Xv;
}
$errors = "Error in Cognito Integrator flow:-" . $errors["mo_cognito_error"];
MO_Oauth_Debug::mo_oauth_log($errors);
Xv:
MB:
VR:
}
function mo_ci_test_config()
{
if (!class_exists("MoOAuthClient\MOUtils")) {
goto RB;
}
$UG = new MoOAuthClient\MOUtils();
RB:
if (!(isset($_POST["option"]) and $_POST["option"] == "mo_ci_test_config")) {
goto oE;
}
$Wo = isset($_POST["mo_ci_test_username"]) ? $_POST["mo_ci_test_username"] : '';
$D4 = isset($_POST["mo_ci_test_password"]) ? $_POST["mo_ci_test_password"] : '';
if (!(empty($Wo) || empty($D4))) {
goto g_;
}
wp_die("Username and Password are required to test the configuration.");
g_:
$fk = new Mo_Cognito_Process();
$b7 = $fk->mo_ci_get_user($Wo, $D4);
if (is_wp_error($b7)) {
goto cu;
}
$user = $b7["user_array"];
$bi = new LoginHandler();
$J1 = [];
$CB = $bi->dropdownattrmapping('', $user, $J1);
$UG->mo_oauth_client_update_option("mo_oauth_attr_name_listcognitointegrator", $CB);
$bi->render_test_config_output($user, false);
exit;
goto WD;
cu:
$O6 = $b7->get_error_message();
if (!($O6 == "FORCE_CHANGE_PASSWORD")) {
goto iu;
}
$O6 = "You should change password on your first login.";
iu:
wp_die($O6);
WD:
oE:
}
function mo_ci_clear_login_error($errors, $u6)
{
return new WP_Error();
}
function mo_ci_access_wp_login_fields($user, $Wo, $D4)
{
if (!("POST" !== (isset($_SERVER["REQUEST_METHOD"]) ? sanitize_text_field(wp_unslash($_SERVER["REQUEST_METHOD"])) : ''))) {
goto Kt;
}
add_filter("wp_login_errors", "mo_ci_clear_login_error", 0, 2);
return $user;
Kt:
if (!(empty($Wo) || empty($D4))) {
goto A1;
}
$O6 = new WP_Error();
if (empty($Wo)) {
goto Z6;
}
if (!empty($D4)) {
goto pw;
}
$O6->add("empty_password", __("<strong>ERROR</strong>:Password feild is empty."));
pw:
goto ix;
Z6:
$O6->add("empty_username", __("<strong>ERROR</strong>:Username/Email feild is empty."));
ix:
return $O6;
A1:
$dA = mo_ci_is_subsite_enabled();
$fk = new Mo_Cognito_Process();
$user = $fk->mo_ci_authenticate_user($Wo, $D4, $dA);
return $user;
}
function mo_ci_profile_update($D2, $W2, $nG)
{
MO_Oauth_Debug::mo_oauth_log($nG);
if (!class_exists("MoOAuthClient\MOUtils")) {
goto oG;
}
$UG = new MoOAuthClient\MOUtils();
$s7 = $UG->get_app_list();
foreach ($s7 as $jr => $qf) {
$nC = $UG->get_app_by_name($jr);
$CR = $nC->get_app_config();
if (!($CR["appId"] == "cognitointegrator")) {
goto NT;
}
goto qC;
NT:
Sa:
}
qC:
oG:
if (!$nC) {
goto ug;
}
$GZ = $nC->get_app_config();
if (!is_user_logged_in()) {
goto dw;
}
$fk = new Mo_Cognito_Process();
$errors = $fk->mo_ci_update_user($nG, array());
if (empty($errors)) {
goto Wp;
}
MO_Oauth_Debug::mo_oauth_log($errors);
Wp:
dw:
ug:
}
function mo_ci_custom_login_form($Wo, $D4, $Q_ = false)
{
$dA = mo_ci_is_subsite_enabled();
$fk = new Mo_Cognito_Process();
$user = $fk->mo_ci_authenticate_user($Wo, $D4, $dA);
if (!isset($user->errors)) {
goto RM;
}
$l8 = $user->errors["mo_cognito_error"];
$l8 = $l8[0];
MO_Oauth_Debug::mo_oauth_log($l8);
return $l8;
RM:
if (!($Q_ === false)) {
goto hU;
}
wp_set_auth_cookie($user->data->ID, true);
wp_safe_redirect(home_url());
exit;
hU:
return $user;
}
function mo_ci_custom_registeration_form($m0 = array(), $Q_ = false)
{
$user = wp_insert_user($m0);
if (!is_wp_error($user)) {
goto lu;
}
if (!isset($user->errors["existing_user_login"])) {
goto C2;
}
$l8 = $user->errors["existing_user_login"];
MO_Oauth_Debug::mo_oauth_log($l8[0]);
return $l8[0];
C2:
lu:
if (!($Q_ === false)) {
goto PT;
}
wp_set_auth_cookie($user, true);
wp_safe_redirect(home_url());
exit;
PT:
return $user;
}
function mo_ci_custom_registeration_form_testing()
{
$m0 = 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($m0, 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 "\x6d\x6f\137\x63\157\147\156\151\164\157\x5f\151\x6e\x74\145\147\x72\141\164\157\162\x5f\160\162\157\x63\x65\163\x73\x2e\x70\x68\160";
remove_filter("\x61\x75\164\x68\145\x6e\164\151\143\141\x74\x65", "\x77\160\x5f\141\165\164\x68\x65\156\x74\151\143\141\164\x65\x5f\165\x73\x65\162\156\x61\155\145\137\160\x61\163\x73\x77\x6f\162\144", 20, 3);
remove_filter("\x61\165\164\150\145\156\164\151\x63\141\x74\145", "\x77\160\137\141\165\164\x68\145\156\164\151\143\x61\164\x65\x5f\145\x6d\141\x69\x6c\x5f\x70\x61\x73\x73\167\157\x72\x64", 20, 3);
add_filter("\x61\165\x74\150\145\156\164\x69\143\x61\164\145", "\x6d\x6f\137\143\x69\137\x61\x63\x63\x65\163\x73\x5f\167\x70\137\154\157\147\151\156\x5f\146\x69\145\154\144\x73", 1, 3);
add_action("\x75\x73\145\162\x5f\162\x65\147\x69\163\164\145\x72", "\x6d\157\x5f\143\151\137\163\171\156\x63\x5f\x72\145\147\151\163\x74\x65\x72\145\x64\137\x75\x73\x65\162", 10, 2);
add_action("\151\156\x69\x74", "\x6d\157\137\x63\151\137\164\145\x73\164\137\x63\157\156\146\x69\147", 2, 0);
add_action("\160\162\x6f\146\x69\154\145\137\x75\160\144\x61\164\x65", "\x6d\157\x5f\143\x69\137\x70\162\157\x66\151\x6c\145\x5f\x75\x70\144\x61\x74\145", 10, 3);
function mo_ci_is_subsite_enabled()
{
$UG = new \MoOauthClient\MOUtils();
if (is_multisite()) {
goto py;
}
return true;
goto wT;
py:
$blog_id = get_current_blog_id();
$iy = $UG->mo_oauth_client_get_option("\155\x6f\x5f\x6f\141\165\164\150\137\x63\63\126\151\143\x32\154\x30\x5a\130\x4e\172\132\127\170\154\x59\63\122\154\132\101");
$DM = array();
if (!isset($iy)) {
goto dD;
}
$DM = json_decode($UG->mooauthdecrypt($iy), true);
dD:
$eC = false;
$Vx = $UG->mo_oauth_client_get_option("\155\x6f\137\157\141\165\164\x68\137\151\163\x4d\165\154\x74\x69\x53\x69\x74\x65\120\x6c\165\147\x69\x6e\122\x65\x71\x75\x65\x73\164\x65\144");
if (!(is_array($DM) && in_array($blog_id, $DM))) {
goto Ba;
}
$eC = true;
Ba:
if (!(is_multisite() && $Vx && ($Vx && !$eC) && $UG->mo_oauth_client_get_option("\x6e\x6f\117\146\123\x75\x62\x53\151\x74\x65\x73") < 1000)) {
goto nF;
}
return false;
nF:
return $blog_id;
wT:
}
function mo_ci_sync_registered_user($D2, $m0)
{
$dA = mo_ci_is_subsite_enabled();
if (!($dA && class_exists("\115\157\117\x41\x75\x74\x68\103\154\x69\x65\x6e\164\x5c\115\x4f\125\x74\x69\x6c\163"))) {
goto vu;
}
$UG = new MoOAuthClient\MOUtils();
$s7 = $UG->get_app_list();
foreach ($s7 as $jr => $qf) {
$nC = $UG->get_app_by_name($jr);
$CR = $nC->get_app_config();
if (!($CR["\141\x70\160\111\x64"] == "\143\157\147\156\x69\x74\x6f\151\156\x74\145\x67\x72\141\x74\x6f\162")) {
goto HV;
}
goto N6;
HV:
hC:
}
N6:
vu:
if (!$nC) {
goto VR;
}
$GZ = $nC->get_app_config();
if (!$GZ["\155\157\137\x63\151\137\162\145\147\151\x73\x74\x65\162\137\x75\x73\145\x72\137\143\150\x65\143\x6b\142\157\170"]) {
goto MB;
}
if ($GZ["\x6d\157\x5f\143\x69\x5f\x70\x6f\157\x6c\137\164\171\x70\x65"] == "\165\163\x65\x72\156\141\155\145") {
goto SF;
}
$m0["\x75\163\x65\x72\x5f\x6c\x6f\147\x69\x6e"] = empty($m0["\165\x73\x65\x72\x5f\145\x6d\141\151\x6c"]) ? '' : $m0["\165\x73\x65\x72\x5f\145\155\x61\x69\154"];
goto nC;
SF:
$m0["\165\x73\145\162\x5f\x6c\157\x67\151\156"] = empty($m0["\165\163\145\162\x5f\x6c\x6f\x67\151\156"]) ? '' : $m0["\x75\x73\x65\x72\137\x6c\157\x67\x69\x6e"];
nC:
$fk = new Mo_Cognito_Process();
$errors = $fk->mo_ci_create_user($m0, array());
if (empty($errors)) {
goto Xv;
}
$errors = "\x45\162\162\x6f\x72\40\x69\156\x20\x43\157\x67\x6e\x69\x74\x6f\40\111\156\164\145\x67\x72\x61\x74\157\162\40\x66\x6c\157\x77\x3a\55" . $errors["\x6d\x6f\x5f\143\x6f\147\156\151\164\x6f\x5f\x65\162\162\x6f\x72"];
MO_Oauth_Debug::mo_oauth_log($errors);
Xv:
MB:
VR:
}
function mo_ci_test_config()
{
if (!class_exists("\115\x6f\x4f\x41\165\164\x68\103\154\x69\x65\156\x74\x5c\115\117\x55\164\151\154\163")) {
goto RB;
}
$UG = new MoOAuthClient\MOUtils();
RB:
if (!(isset($_POST["\157\160\164\151\157\x6e"]) and $_POST["\x6f\160\164\x69\x6f\156"] == "\155\x6f\137\143\151\137\x74\145\163\x74\137\x63\x6f\x6e\x66\151\x67")) {
goto oE;
}
$Wo = isset($_POST["\155\157\137\143\x69\x5f\x74\x65\x73\x74\137\x75\163\145\162\156\141\155\145"]) ? $_POST["\x6d\x6f\x5f\143\x69\137\164\145\163\x74\x5f\165\163\x65\162\156\141\x6d\x65"] : '';
$D4 = isset($_POST["\x6d\157\x5f\x63\151\137\x74\145\x73\x74\x5f\x70\141\x73\163\x77\x6f\162\144"]) ? $_POST["\155\157\x5f\143\x69\x5f\x74\145\163\x74\137\x70\x61\163\163\x77\157\162\x64"] : '';
if (!(empty($Wo) || empty($D4))) {
goto g_;
}
wp_die("\125\x73\x65\x72\x6e\141\x6d\145\40\x61\156\x64\x20\120\141\163\x73\167\x6f\162\x64\x20\x61\162\145\x20\x72\x65\x71\x75\151\x72\145\144\x20\x74\x6f\x20\x74\145\x73\164\x20\x74\x68\145\40\143\x6f\x6e\x66\x69\x67\165\162\x61\x74\x69\x6f\x6e\x2e");
g_:
$fk = new Mo_Cognito_Process();
$b7 = $fk->mo_ci_get_user($Wo, $D4);
if (is_wp_error($b7)) {
goto cu;
}
$user = $b7["\x75\x73\145\x72\x5f\x61\162\162\x61\x79"];
$bi = new LoginHandler();
$J1 = [];
$CB = $bi->dropdownattrmapping('', $user, $J1);
$UG->mo_oauth_client_update_option("\x6d\x6f\137\157\141\165\x74\x68\x5f\141\164\164\x72\137\156\141\x6d\x65\x5f\154\151\x73\x74\x63\157\147\x6e\x69\x74\157\x69\x6e\x74\x65\147\162\x61\164\x6f\x72", $CB);
$bi->render_test_config_output($user, false);
exit;
goto WD;
cu:
$O6 = $b7->get_error_message();
if (!($O6 == "\x46\x4f\122\x43\x45\137\103\x48\101\x4e\107\x45\x5f\x50\101\x53\x53\x57\x4f\122\x44")) {
goto iu;
}
$O6 = "\x59\x6f\x75\x20\x73\x68\x6f\165\x6c\x64\x20\x63\x68\x61\156\x67\145\x20\160\x61\163\163\x77\x6f\x72\x64\x20\157\156\40\171\x6f\x75\162\x20\x66\151\162\x73\x74\40\154\x6f\x67\151\156\56";
iu:
wp_die($O6);
WD:
oE:
}
function mo_ci_clear_login_error($errors, $u6)
{
return new WP_Error();
}
function mo_ci_access_wp_login_fields($user, $Wo, $D4)
{
if (!("\x50\x4f\x53\x54" !== (isset($_SERVER["\x52\x45\121\125\x45\123\x54\137\x4d\105\x54\110\117\x44"]) ? sanitize_text_field(wp_unslash($_SERVER["\122\105\x51\125\105\x53\x54\x5f\x4d\x45\x54\x48\117\x44"])) : ''))) {
goto Kt;
}
add_filter("\x77\x70\x5f\154\x6f\x67\151\156\x5f\145\162\x72\x6f\162\x73", "\x6d\x6f\x5f\143\x69\137\x63\x6c\145\141\x72\x5f\154\x6f\x67\151\156\x5f\x65\162\x72\x6f\162", 0, 2);
return $user;
Kt:
if (!(empty($Wo) || empty($D4))) {
goto A1;
}
$O6 = new WP_Error();
if (empty($Wo)) {
goto Z6;
}
if (!empty($D4)) {
goto pw;
}
$O6->add("\145\155\160\x74\171\x5f\x70\x61\x73\x73\x77\157\162\144", __("\74\x73\164\162\157\x6e\x67\76\105\122\x52\x4f\122\74\x2f\x73\164\162\x6f\x6e\147\x3e\72\x50\x61\163\x73\x77\x6f\162\144\x20\146\x65\x69\x6c\x64\40\x69\163\x20\x65\x6d\x70\164\x79\56"));
pw:
goto ix;
Z6:
$O6->add("\145\x6d\x70\164\x79\x5f\165\x73\145\x72\x6e\x61\155\x65", __("\74\x73\164\x72\157\x6e\147\76\105\x52\122\x4f\x52\x3c\57\163\164\162\x6f\x6e\x67\x3e\x3a\125\x73\145\162\156\x61\x6d\x65\x2f\x45\x6d\141\151\154\40\x66\x65\x69\154\144\x20\x69\163\x20\145\x6d\160\164\x79\56"));
ix:
return $O6;
A1:
$dA = mo_ci_is_subsite_enabled();
$fk = new Mo_Cognito_Process();
$user = $fk->mo_ci_authenticate_user($Wo, $D4, $dA);
return $user;
}
function mo_ci_profile_update($D2, $W2, $nG)
{
MO_Oauth_Debug::mo_oauth_log($nG);
if (!class_exists("\115\x6f\117\x41\165\x74\150\103\154\151\145\156\x74\134\115\117\125\164\151\x6c\x73")) {
goto oG;
}
$UG = new MoOAuthClient\MOUtils();
$s7 = $UG->get_app_list();
foreach ($s7 as $jr => $qf) {
$nC = $UG->get_app_by_name($jr);
$CR = $nC->get_app_config();
if (!($CR["\x61\160\x70\x49\144"] == "\x63\157\147\x6e\x69\164\157\151\156\164\x65\147\x72\x61\164\157\x72")) {
goto NT;
}
goto qC;
NT:
Sa:
}
qC:
oG:
if (!$nC) {
goto ug;
}
$GZ = $nC->get_app_config();
if (!is_user_logged_in()) {
goto dw;
}
$fk = new Mo_Cognito_Process();
$errors = $fk->mo_ci_update_user($nG, array());
if (empty($errors)) {
goto Wp;
}
MO_Oauth_Debug::mo_oauth_log($errors);
Wp:
dw:
ug:
}
function mo_ci_custom_login_form($Wo, $D4, $Q_ = false)
{
$dA = mo_ci_is_subsite_enabled();
$fk = new Mo_Cognito_Process();
$user = $fk->mo_ci_authenticate_user($Wo, $D4, $dA);
if (!isset($user->errors)) {
goto RM;
}
$l8 = $user->errors["\x6d\x6f\137\x63\157\x67\x6e\151\x74\x6f\x5f\145\162\162\x6f\162"];
$l8 = $l8[0];
MO_Oauth_Debug::mo_oauth_log($l8);
return $l8;
RM:
if (!($Q_ === false)) {
goto hU;
}
wp_set_auth_cookie($user->data->ID, true);
wp_safe_redirect(home_url());
exit;
hU:
return $user;
}
function mo_ci_custom_registeration_form($m0 = array(), $Q_ = false)
{
$user = wp_insert_user($m0);
if (!is_wp_error($user)) {
goto lu;
}
if (!isset($user->errors["\145\x78\151\163\164\x69\156\x67\x5f\165\163\145\162\x5f\x6c\x6f\147\x69\156"])) {
goto C2;
}
$l8 = $user->errors["\145\170\x69\x73\x74\x69\156\x67\x5f\165\x73\145\162\x5f\x6c\157\x67\151\x6e"];
MO_Oauth_Debug::mo_oauth_log($l8[0]);
return $l8[0];
C2:
lu:
if (!($Q_ === false)) {
goto PT;
}
wp_set_auth_cookie($user, true);
wp_safe_redirect(home_url());
exit;
PT:
return $user;
}
function mo_ci_custom_registeration_form_testing()
{
$m0 = array("\x75\x73\x65\x72\137\160\141\x73\x73" => "\123\x68\151\150\141\x6e\x40\61\x34\x33", "\x75\163\x65\162\137\x6c\x6f\147\x69\156" => "\156\141\166\x65\x65\156\151\171\145\162", "\x75\x73\x65\162\137\x65\155\141\x69\154" => "\x6e\141\x76\x65\145\156\100\x6d\142\142\x73\56\143\x6f\x6d", "\x66\151\x72\163\164\x5f\x6e\141\155\145" => "\156\x61\166\145\145\156\151\144\x6c\x65", "\155\x65\x74\141\137\151\156\x70\165\x74" => array("\141\x64\x64\x72\145\x73\x73" => "\163\x61\156\152\141\171", "\x73\143\150\157\x6f\154" => "\x50\x49\103\x54"));
$user = mo_ci_custom_registeration_form($m0, false);
}
function mo_ci_custom_login_form_func()
{
$user = mo_ci_custom_login_form("\x73\x61\171\162\151\164\x61", "\123\x68\151\150\141\156\x40\x31\x34\x33", false);
}
Function Calls
None |
Stats
MD5 | d01f14785ca1ff039e7f567d3c679ec0 |
Eval Count | 0 |
Decode Time | 68 ms |