Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
function mo_saml_login_user($P2, $Ou, $hP, $rV, $fS, $H2, $Na, $bK, $fC = '', $Be = '', $j..
Decoded Output download
<? function mo_saml_login_user($P2, $Ou, $hP, $rV, $fS, $H2, $Na, $bK, $fC = '', $Be = '', $jG = null)
{
do_action("mo_abr_filter_login", $jG);
$rV = mo_saml_sanitize_username($rV);
if (get_site_option("mo_saml_disable_role_mapping")) {
goto Gy1;
}
check_if_user_allowed_to_login_due_to_role_restriction($fS);
Gy1:
$Eq = get_site_option("mo_saml_sp_base_url");
mo_saml_restrict_users_based_on_domain($P2);
if (!empty($H2)) {
goto nfA;
}
$H2["DEFAULT"]["default_role"] = "subscriber";
$H2["DEFAULT"]["dont_allow_unlisted_user"] = '';
$H2["DEFAULT"]["dont_create_user"] = '';
$H2["DEFAULT"]["keep_existing_users_role"] = '';
$H2["DEFAULT"]["mo_saml_dont_allow_user_tologin_create_with_given_groups"] = '';
$H2["DEFAULT"]["mo_saml_restrict_users_with_groups"] = '';
nfA:
global $wpdb;
$pp = get_current_blog_id();
$ew = "unchecked";
if (!empty($Eq)) {
goto fWa;
}
$Eq = get_network_site_url();
fWa:
if (email_exists($P2) || username_exists($rV)) {
goto TmX;
}
$EJ = Utilities::get_active_sites();
$M4 = get_site_option("mo_apply_role_mapping_for_sites");
if (!get_site_option("mo_saml_disable_role_mapping")) {
goto bDf;
}
$Kq = wp_generate_password(12, false);
$Q3 = wpmu_create_user($rV, $Kq, $P2);
goto jkf;
bDf:
$Q3 = mo_saml_assign_roles_to_new_user($EJ, $M4, $H2, $fS, $rV, $P2);
jkf:
switch_to_blog($pp);
if (!empty($Q3)) {
goto N2q;
}
if (!get_site_option("mo_saml_disable_role_mapping")) {
goto dB6;
}
wp_die("We could not sign you in. Please contact administrator", "Login Failed!");
goto uya;
dB6:
$wy = get_site_option("mo_saml_account_creation_disabled_msg");
if (!empty($wy)) {
goto ACw;
}
$wy = "We could not sign you in. Please contact your Administrator.";
ACw:
wp_die($wy, "Error: Not a WordPress Member");
uya:
N2q:
$user = get_user_by("id", $Q3);
mo_saml_map_basic_attributes($user, $Ou, $hP, $jG);
mo_saml_map_custom_attributes($Q3, $jG);
$Ti = mo_saml_get_redirect_url($Eq, $Na);
do_action("miniorange_post_authenticate_user_login", $user, null, $Ti, true);
mo_saml_set_auth_cookie($user, $fC, $Be, true);
do_action("mo_saml_attributes", $rV, $P2, $Ou, $hP, $fS, null, true);
goto drb;
TmX:
if (email_exists($P2)) {
goto z9L;
}
$user = get_user_by("login", $rV);
goto SX7;
z9L:
$user = get_user_by("email", $P2);
SX7:
$Q3 = $user->ID;
if (!(!empty($P2) and strcasecmp($P2, $user->user_email) != 0)) {
goto FT0;
}
$Q3 = wp_update_user(array("ID" => $Q3, "user_email" => $P2));
FT0:
mo_saml_map_basic_attributes($user, $Ou, $hP, $jG);
mo_saml_map_custom_attributes($Q3, $jG);
$EJ = Utilities::get_active_sites();
$M4 = get_site_option("mo_apply_role_mapping_for_sites");
if (get_site_option("mo_saml_disable_role_mapping")) {
goto wUS;
}
foreach ($EJ as $blog_id) {
switch_to_blog($blog_id);
$user = get_user_by("id", $Q3);
$wE = '';
if ($M4) {
goto HoA;
}
$wE = $blog_id;
goto fYX;
HoA:
$wE = 0;
fYX:
if (empty($H2)) {
goto uY4;
}
if (!empty($H2[$wE])) {
goto i05;
}
if (!empty($H2["DEFAULT"])) {
goto R7Y;
}
$or = "subscriber";
$pO = '';
$ew = '';
$bb = '';
goto oyt;
R7Y:
$or = !empty($H2["DEFAULT"]["default_role"]) ? $H2["DEFAULT"]["default_role"] : "subscriber";
$pO = !empty($H2["DEFAULT"]["dont_allow_unlisted_user"]) ? $H2["DEFAULT"]["dont_allow_unlisted_user"] : '';
$ew = !empty($H2["DEFAULT"]["dont_create_user"]) ? $H2["DEFAULT"]["dont_create_user"] : '';
$bb = !empty($H2["DEFAULT"]["keep_existing_users_role"]) ? $H2["DEFAULT"]["keep_existing_users_role"] : '';
oyt:
goto g9S;
i05:
$or = !empty($H2[$wE]["default_role"]) ? $H2[$wE]["default_role"] : '';
$pO = !empty($H2[$wE]["dont_allow_unlisted_user"]) ? $H2[$wE]["dont_allow_unlisted_user"] : '';
$ew = !empty($H2[$wE]["dont_create_user"]) ? $H2[$wE]["dont_create_user"] : '';
$bb = !empty($H2[$wE]["keep_existing_users_role"]) ? $H2[$wE]["keep_existing_users_role"] : '';
g9S:
uY4:
if (!is_user_member_of_blog($Q3, $blog_id)) {
goto Hs3;
}
if (!empty($bb) && $bb == "checked") {
goto Rmr;
}
$dO = assign_roles_to_user($user, $H2, $blog_id, $fS, $wE);
goto ELc;
Rmr:
$dO = false;
ELc:
if (is_administrator_user($user)) {
goto QrA;
}
if (!empty($bb) && $bb == "checked") {
goto RwH;
}
if ($dO !== true && !empty($pO) && $pO == "checked") {
goto SG5;
}
if ($dO !== true && !empty($or) && $or !== "false") {
goto REv;
}
if ($dO !== true && is_user_member_of_blog($Q3, $blog_id)) {
goto PiB;
}
goto T6B;
RwH:
goto T6B;
SG5:
$Q3 = wp_update_user(array("ID" => $Q3, "role" => false));
goto T6B;
REv:
$Q3 = wp_update_user(array("ID" => $Q3, "role" => $or));
goto T6B;
PiB:
$hI = get_site_option("default_role");
$Q3 = wp_update_user(array("ID" => $Q3, "role" => $hI));
T6B:
QrA:
goto AEX;
Hs3:
$mj = TRUE;
$wa = get_site_option("saml_sso_settings");
if (!empty($wa[$blog_id])) {
goto bvP;
}
$wa[$blog_id] = $wa["DEFAULT"];
bvP:
if (empty($H2)) {
goto Pwz;
}
if (!empty($H2[$wE])) {
goto bUO;
}
if (empty($H2["DEFAULT"])) {
goto Rln;
}
$q8 = get_saml_roles_to_assign($H2, $wE, $fS);
if (!(empty($q8) && strcmp($H2["DEFAULT"]["dont_create_user"], "checked") == 0)) {
goto mkC;
}
$mj = FALSE;
mkC:
Rln:
goto HxE;
bUO:
$q8 = get_saml_roles_to_assign($H2, $wE, $fS);
if (!(empty($q8) && strcmp($H2[$wE]["dont_create_user"], "checked") == 0)) {
goto S9C;
}
$mj = FALSE;
S9C:
HxE:
Pwz:
if (!$mj) {
goto MrD;
}
add_user_to_blog($blog_id, $Q3, false);
$dO = assign_roles_to_user($user, $H2, $blog_id, $fS, $wE);
if ($dO !== true && !empty($pO) && $pO == "checked") {
goto vj0;
}
if ($dO !== true && !empty($or) && $or !== "false") {
goto BnK;
}
if ($dO !== true) {
goto rMT;
}
goto ZrP;
vj0:
$Q3 = wp_update_user(array("ID" => $Q3, "role" => false));
goto ZrP;
BnK:
$Q3 = wp_update_user(array("ID" => $Q3, "role" => $or));
goto ZrP;
rMT:
$hI = get_site_option("default_role");
$Q3 = wp_update_user(array("ID" => $Q3, "role" => $hI));
ZrP:
MrD:
AEX:
B3Y:
}
cbb:
wUS:
switch_to_blog($pp);
if ($Q3) {
goto L0a;
}
wp_die("Invalid user. Please try again.");
L0a:
$user = get_user_by("id", $Q3);
mo_saml_set_auth_cookie($user, $fC, $Be, true);
do_action("mo_saml_attributes", $rV, $P2, $Ou, $hP, $fS);
drb:
mo_saml_post_login_redirection($Eq, $Na);
} ?>
Did this file decode correctly?
Original Code
function mo_saml_login_user($P2, $Ou, $hP, $rV, $fS, $H2, $Na, $bK, $fC = '', $Be = '', $jG = null)
{
do_action("\x6d\157\137\141\142\162\x5f\146\x69\x6c\164\145\162\x5f\154\157\x67\x69\x6e", $jG);
$rV = mo_saml_sanitize_username($rV);
if (get_site_option("\155\x6f\137\163\x61\155\154\137\144\x69\163\141\x62\154\x65\137\162\157\x6c\145\x5f\x6d\141\x70\160\x69\156\x67")) {
goto Gy1;
}
check_if_user_allowed_to_login_due_to_role_restriction($fS);
Gy1:
$Eq = get_site_option("\155\157\137\163\141\x6d\154\137\163\160\137\x62\x61\163\x65\137\x75\x72\x6c");
mo_saml_restrict_users_based_on_domain($P2);
if (!empty($H2)) {
goto nfA;
}
$H2["\104\105\x46\x41\125\x4c\x54"]["\x64\x65\146\141\x75\154\x74\x5f\162\157\154\145"] = "\163\165\142\x73\x63\162\151\142\145\162";
$H2["\x44\105\106\101\x55\114\x54"]["\x64\157\156\x74\x5f\141\x6c\x6c\x6f\167\x5f\165\156\154\151\x73\x74\x65\144\137\x75\163\x65\x72"] = '';
$H2["\104\105\x46\x41\125\114\x54"]["\x64\x6f\156\x74\137\143\162\x65\x61\x74\145\x5f\165\x73\145\x72"] = '';
$H2["\104\x45\x46\101\x55\x4c\x54"]["\153\145\145\160\137\145\x78\x69\163\164\151\x6e\147\x5f\x75\x73\145\162\163\137\x72\x6f\154\x65"] = '';
$H2["\x44\105\x46\x41\x55\114\x54"]["\155\x6f\137\x73\141\155\x6c\x5f\144\157\156\164\x5f\141\154\x6c\157\x77\x5f\165\x73\x65\x72\137\x74\157\154\157\x67\x69\156\x5f\143\162\145\141\x74\145\137\x77\151\x74\x68\137\147\151\166\145\156\137\147\x72\x6f\x75\x70\163"] = '';
$H2["\x44\105\x46\101\125\114\x54"]["\x6d\x6f\x5f\x73\x61\155\x6c\x5f\162\145\x73\164\x72\x69\143\x74\x5f\x75\163\x65\x72\x73\137\167\151\x74\x68\137\x67\x72\x6f\165\x70\163"] = '';
nfA:
global $wpdb;
$pp = get_current_blog_id();
$ew = "\x75\x6e\x63\150\145\x63\x6b\145\x64";
if (!empty($Eq)) {
goto fWa;
}
$Eq = get_network_site_url();
fWa:
if (email_exists($P2) || username_exists($rV)) {
goto TmX;
}
$EJ = Utilities::get_active_sites();
$M4 = get_site_option("\x6d\157\x5f\x61\x70\160\154\x79\137\x72\x6f\154\145\137\155\141\x70\x70\151\x6e\x67\137\146\x6f\x72\137\x73\151\164\x65\x73");
if (!get_site_option("\155\157\x5f\163\141\155\154\137\x64\151\x73\141\x62\154\145\137\x72\157\x6c\x65\137\155\141\160\x70\151\156\x67")) {
goto bDf;
}
$Kq = wp_generate_password(12, false);
$Q3 = wpmu_create_user($rV, $Kq, $P2);
goto jkf;
bDf:
$Q3 = mo_saml_assign_roles_to_new_user($EJ, $M4, $H2, $fS, $rV, $P2);
jkf:
switch_to_blog($pp);
if (!empty($Q3)) {
goto N2q;
}
if (!get_site_option("\x6d\157\137\163\141\155\x6c\x5f\144\151\x73\141\x62\x6c\x65\x5f\x72\157\154\x65\137\155\141\160\160\x69\156\x67")) {
goto dB6;
}
wp_die("\127\145\40\x63\x6f\165\x6c\144\40\156\157\164\x20\x73\x69\147\x6e\x20\171\x6f\165\x20\151\x6e\x2e\x20\x50\154\x65\x61\163\145\x20\x63\157\x6e\164\141\143\x74\40\x61\144\155\x69\156\151\x73\164\x72\x61\164\x6f\162", "\x4c\157\147\151\156\x20\x46\141\x69\x6c\145\144\x21");
goto uya;
dB6:
$wy = get_site_option("\x6d\x6f\137\163\x61\x6d\x6c\x5f\x61\x63\143\x6f\x75\x6e\x74\137\x63\162\x65\x61\164\151\x6f\156\x5f\x64\151\x73\141\x62\x6c\x65\x64\x5f\155\163\x67");
if (!empty($wy)) {
goto ACw;
}
$wy = "\x57\145\40\x63\x6f\x75\154\144\x20\x6e\x6f\x74\x20\x73\151\147\x6e\x20\x79\x6f\x75\40\x69\x6e\x2e\x20\120\154\145\141\163\145\40\x63\x6f\x6e\x74\x61\x63\164\x20\171\x6f\x75\162\40\x41\x64\155\x69\156\x69\x73\x74\x72\141\x74\x6f\x72\x2e";
ACw:
wp_die($wy, "\x45\x72\x72\157\x72\x3a\40\x4e\157\x74\x20\141\40\127\157\162\144\120\x72\x65\x73\x73\x20\115\x65\155\x62\145\162");
uya:
N2q:
$user = get_user_by("\x69\144", $Q3);
mo_saml_map_basic_attributes($user, $Ou, $hP, $jG);
mo_saml_map_custom_attributes($Q3, $jG);
$Ti = mo_saml_get_redirect_url($Eq, $Na);
do_action("\x6d\x69\156\x69\157\162\141\156\x67\145\137\x70\x6f\163\x74\137\141\165\x74\150\145\x6e\x74\x69\143\x61\164\145\x5f\165\163\145\x72\137\x6c\x6f\x67\x69\156", $user, null, $Ti, true);
mo_saml_set_auth_cookie($user, $fC, $Be, true);
do_action("\155\157\137\163\x61\155\154\137\141\x74\164\x72\x69\142\165\x74\x65\x73", $rV, $P2, $Ou, $hP, $fS, null, true);
goto drb;
TmX:
if (email_exists($P2)) {
goto z9L;
}
$user = get_user_by("\x6c\157\147\x69\x6e", $rV);
goto SX7;
z9L:
$user = get_user_by("\x65\155\x61\151\154", $P2);
SX7:
$Q3 = $user->ID;
if (!(!empty($P2) and strcasecmp($P2, $user->user_email) != 0)) {
goto FT0;
}
$Q3 = wp_update_user(array("\111\x44" => $Q3, "\165\x73\x65\x72\137\145\155\x61\x69\x6c" => $P2));
FT0:
mo_saml_map_basic_attributes($user, $Ou, $hP, $jG);
mo_saml_map_custom_attributes($Q3, $jG);
$EJ = Utilities::get_active_sites();
$M4 = get_site_option("\155\x6f\x5f\141\160\160\154\x79\137\162\157\x6c\145\137\x6d\141\160\160\x69\x6e\x67\x5f\x66\x6f\x72\137\x73\151\164\x65\163");
if (get_site_option("\155\x6f\137\x73\x61\x6d\x6c\137\x64\151\163\x61\142\x6c\x65\x5f\162\157\154\145\137\155\x61\x70\x70\151\156\147")) {
goto wUS;
}
foreach ($EJ as $blog_id) {
switch_to_blog($blog_id);
$user = get_user_by("\151\144", $Q3);
$wE = '';
if ($M4) {
goto HoA;
}
$wE = $blog_id;
goto fYX;
HoA:
$wE = 0;
fYX:
if (empty($H2)) {
goto uY4;
}
if (!empty($H2[$wE])) {
goto i05;
}
if (!empty($H2["\104\105\x46\101\x55\114\x54"])) {
goto R7Y;
}
$or = "\163\165\x62\x73\143\162\x69\x62\x65\x72";
$pO = '';
$ew = '';
$bb = '';
goto oyt;
R7Y:
$or = !empty($H2["\x44\105\106\101\x55\x4c\x54"]["\x64\x65\x66\141\x75\x6c\x74\137\162\x6f\154\145"]) ? $H2["\104\105\x46\101\125\x4c\x54"]["\144\145\146\141\165\154\164\137\162\157\x6c\x65"] : "\163\165\142\163\x63\162\151\142\x65\162";
$pO = !empty($H2["\104\x45\106\101\x55\x4c\x54"]["\144\x6f\156\x74\137\141\154\x6c\x6f\x77\137\x75\x6e\154\x69\x73\164\145\144\x5f\x75\x73\145\x72"]) ? $H2["\104\x45\x46\x41\x55\x4c\x54"]["\x64\x6f\156\x74\x5f\141\154\154\157\x77\137\x75\x6e\154\x69\163\164\145\144\x5f\165\x73\x65\x72"] : '';
$ew = !empty($H2["\104\x45\106\101\125\114\x54"]["\144\157\156\x74\x5f\x63\x72\145\141\164\x65\137\165\x73\145\162"]) ? $H2["\104\x45\106\101\125\x4c\x54"]["\x64\x6f\x6e\x74\x5f\x63\162\x65\141\164\145\x5f\165\x73\145\x72"] : '';
$bb = !empty($H2["\x44\x45\106\x41\125\114\124"]["\x6b\145\x65\160\x5f\x65\170\x69\x73\164\151\x6e\x67\137\165\x73\x65\x72\163\137\x72\157\154\145"]) ? $H2["\104\x45\106\101\125\x4c\x54"]["\153\x65\x65\160\137\145\x78\x69\x73\x74\151\x6e\x67\x5f\x75\x73\x65\x72\163\137\x72\x6f\x6c\x65"] : '';
oyt:
goto g9S;
i05:
$or = !empty($H2[$wE]["\144\x65\146\x61\x75\x6c\164\137\162\157\x6c\x65"]) ? $H2[$wE]["\x64\x65\146\141\x75\154\x74\137\162\157\154\145"] : '';
$pO = !empty($H2[$wE]["\144\x6f\156\x74\x5f\x61\154\154\x6f\x77\x5f\x75\156\154\x69\163\x74\x65\x64\137\x75\x73\x65\x72"]) ? $H2[$wE]["\144\x6f\x6e\164\x5f\141\154\x6c\x6f\x77\137\165\156\154\x69\x73\164\145\x64\x5f\165\x73\x65\x72"] : '';
$ew = !empty($H2[$wE]["\144\x6f\156\164\137\x63\162\145\x61\x74\x65\x5f\165\163\145\x72"]) ? $H2[$wE]["\144\157\x6e\x74\x5f\x63\x72\x65\x61\x74\145\x5f\x75\x73\x65\x72"] : '';
$bb = !empty($H2[$wE]["\153\145\x65\160\137\x65\x78\x69\x73\164\151\x6e\x67\137\165\163\x65\x72\x73\137\162\157\x6c\145"]) ? $H2[$wE]["\x6b\145\x65\160\137\145\x78\151\x73\164\151\156\x67\x5f\165\163\145\162\163\137\162\x6f\154\x65"] : '';
g9S:
uY4:
if (!is_user_member_of_blog($Q3, $blog_id)) {
goto Hs3;
}
if (!empty($bb) && $bb == "\143\x68\x65\143\x6b\x65\x64") {
goto Rmr;
}
$dO = assign_roles_to_user($user, $H2, $blog_id, $fS, $wE);
goto ELc;
Rmr:
$dO = false;
ELc:
if (is_administrator_user($user)) {
goto QrA;
}
if (!empty($bb) && $bb == "\x63\x68\x65\x63\x6b\145\x64") {
goto RwH;
}
if ($dO !== true && !empty($pO) && $pO == "\143\150\145\x63\x6b\145\x64") {
goto SG5;
}
if ($dO !== true && !empty($or) && $or !== "\x66\x61\154\x73\145") {
goto REv;
}
if ($dO !== true && is_user_member_of_blog($Q3, $blog_id)) {
goto PiB;
}
goto T6B;
RwH:
goto T6B;
SG5:
$Q3 = wp_update_user(array("\x49\x44" => $Q3, "\162\157\154\145" => false));
goto T6B;
REv:
$Q3 = wp_update_user(array("\x49\104" => $Q3, "\x72\x6f\154\x65" => $or));
goto T6B;
PiB:
$hI = get_site_option("\144\145\146\x61\x75\154\164\x5f\x72\157\x6c\x65");
$Q3 = wp_update_user(array("\111\104" => $Q3, "\162\157\x6c\145" => $hI));
T6B:
QrA:
goto AEX;
Hs3:
$mj = TRUE;
$wa = get_site_option("\163\141\155\x6c\137\163\x73\x6f\137\163\x65\164\164\151\156\147\x73");
if (!empty($wa[$blog_id])) {
goto bvP;
}
$wa[$blog_id] = $wa["\104\x45\106\x41\125\114\x54"];
bvP:
if (empty($H2)) {
goto Pwz;
}
if (!empty($H2[$wE])) {
goto bUO;
}
if (empty($H2["\104\105\106\101\x55\114\124"])) {
goto Rln;
}
$q8 = get_saml_roles_to_assign($H2, $wE, $fS);
if (!(empty($q8) && strcmp($H2["\104\x45\106\x41\125\114\124"]["\144\x6f\x6e\x74\137\143\162\x65\141\164\145\x5f\165\163\145\162"], "\x63\x68\x65\x63\153\x65\x64") == 0)) {
goto mkC;
}
$mj = FALSE;
mkC:
Rln:
goto HxE;
bUO:
$q8 = get_saml_roles_to_assign($H2, $wE, $fS);
if (!(empty($q8) && strcmp($H2[$wE]["\144\157\x6e\x74\x5f\143\x72\x65\x61\x74\x65\x5f\165\163\x65\162"], "\x63\x68\145\143\x6b\x65\x64") == 0)) {
goto S9C;
}
$mj = FALSE;
S9C:
HxE:
Pwz:
if (!$mj) {
goto MrD;
}
add_user_to_blog($blog_id, $Q3, false);
$dO = assign_roles_to_user($user, $H2, $blog_id, $fS, $wE);
if ($dO !== true && !empty($pO) && $pO == "\143\x68\145\143\153\145\144") {
goto vj0;
}
if ($dO !== true && !empty($or) && $or !== "\146\141\x6c\163\x65") {
goto BnK;
}
if ($dO !== true) {
goto rMT;
}
goto ZrP;
vj0:
$Q3 = wp_update_user(array("\111\104" => $Q3, "\162\x6f\154\x65" => false));
goto ZrP;
BnK:
$Q3 = wp_update_user(array("\111\104" => $Q3, "\x72\x6f\154\x65" => $or));
goto ZrP;
rMT:
$hI = get_site_option("\144\x65\x66\141\165\154\164\137\162\x6f\154\145");
$Q3 = wp_update_user(array("\111\x44" => $Q3, "\162\157\x6c\x65" => $hI));
ZrP:
MrD:
AEX:
B3Y:
}
cbb:
wUS:
switch_to_blog($pp);
if ($Q3) {
goto L0a;
}
wp_die("\111\156\166\x61\154\151\144\x20\165\x73\x65\162\x2e\x20\x50\154\145\141\163\x65\x20\x74\162\x79\x20\x61\x67\141\151\156\56");
L0a:
$user = get_user_by("\151\144", $Q3);
mo_saml_set_auth_cookie($user, $fC, $Be, true);
do_action("\x6d\157\x5f\x73\141\155\154\x5f\x61\x74\x74\x72\151\142\165\x74\x65\x73", $rV, $P2, $Ou, $hP, $fS);
drb:
mo_saml_post_login_redirection($Eq, $Na);
}
Function Calls
None |
Stats
MD5 | ead7d35a81d7128b5df15c4d6f1ea436 |
Eval Count | 0 |
Decode Time | 45 ms |