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 require_once "\143\x6c\x61\163\163\55\154\144\141\160\x2d\141\165\x74\x68\x2d\x..
Decoded Output download
<?php
require_once "class-ldap-auth-response.php";
class Mo_Ldap_Local_Config
{
function ping_ldap_server($RW)
{
delete_option("mo_ldap_local_server_url_status");
delete_option("mo_ldap_local_service_account_status");
if (Mo_Ldap_Local_Util::is_extension_installed("ldap")) {
goto kQ;
}
return "LDAP_ERROR";
kQ:
$wQ = ldap_connect($RW);
if (!$wQ) {
goto MN;
}
ldap_set_option($wQ, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($wQ, LDAP_OPT_REFERRALS, 0);
if (!get_option("mo_ldap_local_use_tls")) {
goto Rm;
}
ldap_start_tls($wQ);
Rm:
$wL = @ldap_bind($wQ);
if (!$wL) {
goto DC;
}
add_option("mo_ldap_local_server_url_status", "VALID", '', "no");
return "SUCCESS";
DC:
MN:
add_option("mo_ldap_local_server_url_status", "INVALID", '', "no");
return "ERROR";
}
function ldap_login($G6, $ah)
{
$G6 = stripcslashes($G6);
$ah = stripcslashes($ah);
$j8 = null;
if (Mo_Ldap_Local_Util::is_extension_installed("ldap")) {
goto jm;
}
$TF = new Mo_Ldap_Auth_Response();
$TF->status = false;
$TF->statusMessage = "LDAP_ERROR";
$TF->userDn = '';
return $TF;
jm:
if (Mo_Ldap_Local_Util::is_extension_installed("openssl")) {
goto nZ;
}
$TF = new Mo_Ldap_Auth_Response();
$TF->status = false;
$TF->statusMessage = "OPENSSL_ERROR";
$TF->userDn = '';
return $TF;
nZ:
$wQ = $this->getConnection();
if ($wQ) {
goto sV;
}
$TF = new Mo_Ldap_Auth_Response();
$TF->status = false;
$TF->statusMessage = "ERROR";
$TF->userDn = '';
return $TF;
goto Y6;
sV:
$kA = get_option("mo_ldap_local_search_filter") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_search_filter")) : '';
$Am = get_option("mo_ldap_local_search_base") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_search_base")) : '';
$Cw = get_option("mo_ldap_local_server_dn") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_dn")) : '';
$DD = get_option("mo_ldap_local_server_password") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_password")) : '';
$Ko = strtolower(get_option("mo_ldap_local_fname_attribute"));
$KX = strtolower(get_option("mo_ldap_local_lname_attribute"));
$bN = strtolower(get_option("mo_ldap_local_email_attribute"));
$eJ = strtolower(get_option("mo_ldap_local_phone_attribute"));
$La = strtolower(get_option("mo_ldap_local_nickname_attribute"));
$Y7 = array($Ko, $KX, $bN, $La, $eJ);
$G2 = wp_load_alloptions();
foreach ($G2 as $Zh => $Kq) {
if (strpos($Zh, "mo_ldap_local_custom_attribute_") === false) {
goto QI;
}
array_push($Y7, $Kq);
goto ah;
QI:
ah:
z0:
}
jL:
$kA = str_replace("?", $G6, $kA);
$Hx = explode(";", $Am);
$hf = null;
$W3 = null;
$W6 = null;
if (!get_option("mo_ldap_local_use_tls")) {
goto Qq;
}
ldap_start_tls($wQ);
Qq:
$BP = @ldap_bind($wQ, $Cw, $DD);
$Su = ldap_error($wQ);
if (!(strtolower($Su) != "success")) {
goto vf;
}
$TF = new Mo_Ldap_Auth_Response();
$TF->status = false;
$TF->statusMessage = "LDAP_NOT_RESPONDING";
$TF->userDn = '';
return $TF;
vf:
$GG = 0;
k2:
if (!($GG < sizeof($Hx))) {
goto Hy;
}
if (ldap_search($wQ, $Hx[$GG], $kA, $Y7)) {
goto bt;
}
$TF = new Mo_Ldap_Auth_Response();
$TF->status = false;
$TF->statusMessage = "ERROR";
$TF->userDn = '';
return $TF;
goto Cb;
bt:
$hf = ldap_search($wQ, $Hx[$GG], $kA, $Y7);
Cb:
$W6 = ldap_first_entry($wQ, $hf);
$W3 = ldap_get_entries($wQ, $hf);
if (!$W6) {
goto lE;
}
goto Hy;
lE:
b4:
$GG++;
goto k2;
Hy:
if ($W6) {
goto ui;
}
$TF = new Mo_Ldap_Auth_Response();
$TF->status = false;
$TF->statusMessage = "USER_NOT_EXIST";
$TF->userDn = '';
return $TF;
goto dD;
ui:
$Uh = ldap_get_dn($wQ, $W6);
dD:
$hm = $this->authenticate($Uh, $ah);
if (!($hm->statusMessage == "SUCCESS")) {
goto Kn;
}
$hl = array();
$hF = array();
unset($Y7[0]);
unset($Y7[1]);
unset($Y7[2]);
foreach ($Y7 as $ai) {
if (isset($W3[0][strtolower($ai)]["count"]) && $W3[0][strtolower($ai)]["count"] > 1) {
goto Cn;
}
$hl["mo_ldap_local_custom_attribute_" . $ai] = $W3[0][strtolower($ai)][0];
goto Ak;
Cn:
$y5 = array();
$GG = 0;
FK:
if (!($GG < $W3[0][strtolower($ai)]["count"])) {
goto cO;
}
array_push($y5, $W3[0][strtolower($ai)][$GG]);
pZ:
$GG++;
goto FK;
cO:
$hl["mo_ldap_local_custom_attribute_" . $ai] = $y5;
Ak:
Wb:
}
df:
$hm->attributeList = $hl;
$hF["mail"] = $W3[0][$bN][0];
$hF["fname"] = $W3[0][$Ko][0];
$hF["lname"] = $W3[0][$KX][0];
$hF["nickname"] = $W3[0][$La][0];
if (!isset($W3[0][$eJ])) {
goto im;
}
$hF["phone"] = $W3[0][$eJ][0];
im:
$hm->profileAttributesList = $hF;
Kn:
return $hm;
Y6:
}
function test_connection()
{
if (!Mo_Ldap_Local_Util::is_extension_installed("ldap")) {
goto q7;
}
if (Mo_Ldap_Local_Util::is_extension_installed("openssl")) {
goto sU;
}
return json_encode(array("statusCode" => "OPENSSL_ERROR", "statusMessage" => "<a target="_blank" href="http://php.net/manual/en/openssl.installation.php">PHP OpenSSL extension</a> is not installed or disabled. Please enable it."));
sU:
goto x6;
q7:
return json_encode(array("statusCode" => "LDAP_ERROR", "statusMessage" => "<a target="_blank" href="http://php.net/manual/en/ldap.installation.php">PHP LDAP extension</a> is not installed or disabled. Please enable it."));
x6:
delete_option("mo_ldap_local_server_url_status");
delete_option("mo_ldap_local_service_account_status");
$Bt = get_option("mo_ldap_local_server_url") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_url")) : '';
$Pf = $this->ping_ldap_server($Bt);
if (!($Pf == "ERROR")) {
goto Hj;
}
add_option("mo_ldap_local_server_url_status", "INVALID", '', "no");
return json_encode(array("statusCode" => "PING_ERROR", "statusMessage" => $ml . "Cannot connect to LDAP Server. Make sure you have entered server url in format <b>ldap://server_address:port</b> and if there is a firewall, please open the firewall to allow incoming requests to your LDAP from your wordpress IP and port 389. Also check troubleshooting or contact us using support below."));
Hj:
add_option("mo_ldap_local_server_url_status", "VALID", '', "no");
$wQ = $this->getConnection();
if ($wQ) {
goto le;
}
add_option("mo_ldap_local_service_account_status", "INVALID", '', "no");
return json_encode(array("statusCode" => "ERROR", "statusMessage" => $ml . "Invalid service account credentials. Make sure you have entered correct Service Account DN and password."));
goto vx;
le:
$Cw = get_option("mo_ldap_local_server_dn") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_dn")) : '';
$DD = get_option("mo_ldap_local_server_password") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_password")) : '';
if (!get_option("mo_ldap_local_use_tls")) {
goto E4;
}
ldap_start_tls($wQ);
E4:
$wL = @ldap_bind($wQ, $Cw, $DD);
if ($wL) {
goto aY;
}
add_option("mo_ldap_local_service_account_status", "INVALID", '', "no");
return json_encode(array("statusCode" => "ERROR", "statusMessage" => $ml . "Invalid service account credentials. Make sure you have entered correct Service Account DN and password."));
goto My;
aY:
add_option("mo_ldap_local_service_account_status", "VALID", '', "no");
return json_encode(array("statusCode" => "SUCCESS", "statusMessage" => "Connection was established successfully. Please test authentication to verify LDAP User Mapping Configuration."));
My:
vx:
}
function test_authentication($G6, $ah, $TD)
{
if (!Mo_Ldap_Local_Util::is_extension_installed("ldap")) {
goto T4;
}
if (Mo_Ldap_Local_Util::is_extension_installed("openssl")) {
goto sA;
}
return json_encode(array("statusCode" => "OPENSSL_ERROR", "statusMessage" => "<a target="_blank" href="http://php.net/manual/en/openssl.installation.php">PHP OpenSSL extension</a> is not installed or disabled. Please enable it."));
sA:
goto C9;
T4:
return json_encode(array("statusCode" => "LDAP_ERROR", "statusMessage" => "<a target="_blank" href="http://php.net/manual/en/ldap.installation.php">PHP LDAP extension</a> is not installed or disabled. Please enable it."));
C9:
if (!(get_option("mo_ldap_local_server_url_status") && get_option("mo_ldap_local_server_url_status") == "INVALID")) {
goto lT;
}
delete_option("mo_ldap_local_server_url_status");
delete_option("mo_ldap_local_service_account_status");
add_option("mo_ldap_local_server_url_status", "INVALID", '', "no");
return json_encode(array("statusCode" => "PING_ERROR", "statusMessage" => "Cannot connect to LDAP Server. Make sure you have entered server url in format <b>ldap://server_address:port</b> and if there is a firewall, please open the firewall to allow incoming requests to your LDAP from your wordpress IP and port 389. Also check troubleshooting or contact us using support below."));
lT:
if (Mo_Ldap_Local_Util::check_empty_or_null($TD)) {
goto p_;
}
return json_encode(array("statusCode" => "SUCCESS", "statusMessage" => ''));
goto hK;
p_:
delete_option("mo_ldap_local_user_mapping_status");
delete_option("mo_ldap_local_username_status");
$TF = $this->ldap_login($G6, $ah);
if ($TF->statusMessage == "SUCCESS") {
goto jA;
}
if ($TF->statusMessage == "USER_NOT_EXIST") {
goto MP;
}
add_option("mo_ldap_local_user_mapping_status", "VALID", '', "no");
add_option("mo_ldap_local_username_status", "INVALID", '', "no");
return json_encode(array("statusCode" => "ERROR", "statusMessage" => "Invalid Password. Please check your password and try again."));
goto ux;
MP:
add_option("mo_ldap_local_user_mapping_status", "INVALID", '', "no");
add_option("mo_ldap_local_username_status", "INVALID", '', "no");
return json_encode(array("statusCode" => "USER_NOT_EXIST", "statusMessage" => "Cannot find user <b>" . $G6 . "</b> in the directory.<br>Possible reasons:<br>1. The <b>search base</b> URL is typed incorrectly. Please verify if that search base is present.<br>2. User is not present in that search base. The user may be present in the directory but in some other tree and you may have entered a tree where this users is not present.<br>3. <b>Search filter</b> is incorrect - User is present in the search base but the username is mapped to a different attribute in the search filter. E.g. you may be logging in with username and may have mapped it to the email attribute. So this wont work. Please make sure that the right attribute is mentioned in the search filter (with which you want the mapping to happen).<br> 4. User is actually not present in the search base. Please make sure that the user is present and test with the right user."));
ux:
goto l5;
jA:
add_option("mo_ldap_local_server_url_status", "VALID", '', "no");
add_option("mo_ldap_local_service_account_status", "VALID", '', "no");
add_option("mo_ldap_local_user_mapping_status", "VALID", '', "no");
add_option("mo_ldap_local_username_status", "VALID", '', "no");
return json_encode(array("statusCode" => "SUCCESS", "statusMessage" => "You have successfully configured your LDAP settings."));
l5:
hK:
}
function getConnection()
{
if (Mo_Ldap_Local_Util::is_extension_installed("openssl")) {
goto LG;
}
return null;
LG:
$Bt = get_option("mo_ldap_local_server_url") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_url")) : '';
$wQ = ldap_connect($Bt);
if (!(version_compare(PHP_VERSION, "5.3.0") >= 0)) {
goto ac;
}
ldap_set_option($wQ, LDAP_OPT_NETWORK_TIMEOUT, 5);
ac:
ldap_set_option($wQ, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($wQ, LDAP_OPT_REFERRALS, 0);
return $wQ;
}
function authenticate($Uh, $ah)
{
if (Mo_Ldap_Local_Util::is_extension_installed("openssl")) {
goto Sa;
}
return false;
Sa:
$Bt = get_option("mo_ldap_local_server_url") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_url")) : '';
$wQ = ldap_connect($Bt);
if (!(version_compare(PHP_VERSION, "5.3.0") >= 0)) {
goto Ja;
}
ldap_set_option(null, LDAP_OPT_NETWORK_TIMEOUT, 5);
Ja:
ldap_set_option($wQ, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($wQ, LDAP_OPT_REFERRALS, 0);
if (!get_option("mo_ldap_local_use_tls")) {
goto NZ;
}
ldap_start_tls($wQ);
NZ:
$wL = @ldap_bind($wQ, $Uh, $ah);
if ($wL) {
goto sS;
}
$TF = new Mo_Ldap_Auth_Response();
$TF->status = false;
$TF->userDn = $Uh;
goto iz;
sS:
$V3 = ldap_search($wQ, $Uh);
$TF = new Mo_Ldap_Auth_Response();
$TF->status = true;
$TF->statusMessage = "SUCCESS";
$TF->userDn = $Uh;
return $TF;
iz:
$TF = new Mo_Ldap_Auth_Response();
$TF->status = false;
$TF->statusMessage = "ERROR";
$TF->userDn = $Uh;
return $TF;
}
function get_user_ldap_info($G6)
{
if (Mo_Ldap_Local_Util::is_extension_installed("openssl")) {
goto iL;
}
return null;
iL:
$r6 = get_option("mo_ldap_local_server_url") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_url")) : '';
$Cw = get_option("mo_ldap_local_server_dn") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_dn")) : '';
$DD = get_option("mo_ldap_local_server_password") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_password")) : '';
$iK = get_option("mo_ldap_local_search_base") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_search_base")) : '';
$Io = get_option("mo_ldap_local_search_filter") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_search_filter")) : '';
$Xi = ldap_connect($r6);
if ($Xi) {
goto la;
}
$W6 = false;
goto Pa;
la:
ldap_set_option($Xi, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($Xi, LDAP_OPT_REFERRALS, 0);
if (!get_option("mo_ldap_local_use_tls")) {
goto GA;
}
ldap_start_tls($Xi);
GA:
$wL = @ldap_bind($Xi, $Cw, $DD);
if ($wL) {
goto o7;
}
$W6 = false;
goto rz;
o7:
$kA = str_replace("?", $G6, $Io);
$eX = ldap_search($Xi, $iK, $kA);
$W6 = ldap_get_entries($Xi, $eX);
if (!is_null($W6)) {
goto ks;
}
$W6 = false;
ks:
rz:
Pa:
if (!($W6 != false)) {
goto sZ;
}
$W6 = $W6[0];
sZ:
ldap_close($Xi);
return $W6;
}
function modify_user_info_in_ldap($xU, $Mh)
{
if (Mo_Ldap_Local_Util::is_extension_installed("openssl")) {
goto Ed;
}
return null;
Ed:
$Bt = get_option("mo_ldap_local_server_url") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_url")) : '';
if (!(version_compare(PHP_VERSION, "5.3.0") >= 0)) {
goto s3;
}
ldap_set_option(null, LDAP_OPT_NETWORK_TIMEOUT, 5);
s3:
$wQ = ldap_connect($Bt);
$ig = get_user_meta($xU->ID, "mo_ldap_user_dn", true);
if ($wQ) {
goto JF;
}
echo "Could not get connection";
die(0);
goto aP;
JF:
$bN = get_option("mo_ldap_local_email_attribute");
$Ko = get_option("mo_ldap_local_fname_attribute");
$KX = get_option("mo_ldap_local_lname_attribute");
$IE = array();
if (Mo_Ldap_Local_Util::check_empty_or_null($xU->first_name)) {
goto OV;
}
$IE[$Ko] = $xU->first_name;
OV:
if (Mo_Ldap_Local_Util::check_empty_or_null($xU->last_name)) {
goto BQ;
}
$IE[$KX] = $xU->last_name;
BQ:
if (Mo_Ldap_Local_Util::check_empty_or_null($xU->user_email)) {
goto sB;
}
$IE[$bN] = $xU->user_email;
sB:
foreach ($Mh as $ai => $Kq) {
if (Mo_Ldap_Local_Util::check_empty_or_null($Kq)) {
goto kh;
}
$IE[$ai] = $Kq;
kh:
vB:
}
QJ:
ldap_set_option($wQ, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($wQ, LDAP_OPT_REFERRALS, 0);
$Cw = get_option("mo_ldap_local_server_dn") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_dn")) : '';
$DD = get_option("mo_ldap_local_server_password") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_password")) : '';
if (!get_option("mo_ldap_local_use_tls")) {
goto CG;
}
ldap_start_tls($wQ);
CG:
$wL = @ldap_bind($wQ, $Cw, $DD);
if ($wL) {
goto eT;
}
echo "Could not be done";
die;
goto un;
eT:
ldap_modify($wQ, $ig, $IE);
un:
aP:
}
function add_user($xU)
{
if (Mo_Ldap_Local_Util::is_extension_installed("openssl")) {
goto Et;
}
return null;
Et:
$Bt = get_option("mo_ldap_local_server_url") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_url")) : '';
if (!(version_compare(PHP_VERSION, "5.3.0") >= 0)) {
goto vz;
}
ldap_set_option(null, LDAP_OPT_NETWORK_TIMEOUT, 5);
vz:
$wQ = ldap_connect($Bt);
if ($wQ) {
goto ur;
}
echo "Could not get connection";
die;
goto Nh;
ur:
$K4 = get_option("mo_ldap_local_new_user_location");
$bI = "cn=" . $xU->user_login . "," . $K4;
$bN = get_option("mo_ldap_local_email_attribute");
$Ko = get_option("mo_ldap_local_fname_attribute");
$KX = get_option("mo_ldap_local_lname_attribute");
$PU = get_option("mo_ldap_local_objectclass_attribute");
$IE = array();
$IE["cn"] = $xU->user_login;
$IE[$Ko] = $xU->first_name;
$IE[$KX] = $xU->last_name;
$IE[$bN] = $xU->user_email;
$IE["objectClass"] = $PU;
ldap_set_option($wQ, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($wQ, LDAP_OPT_REFERRALS, 0);
$Cw = get_option("mo_ldap_local_server_dn") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_dn")) : '';
$DD = get_option("mo_ldap_local_server_password") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_password")) : '';
if (!get_option("mo_ldap_local_use_tls")) {
goto zp;
}
ldap_start_tls($wQ);
zp:
$wL = @ldap_bind($wQ, $Cw, $DD);
if ($wL) {
goto sn;
}
echo "Could not be done";
die;
goto ki;
sn:
ldap_add($wQ, $bI, $IE);
ki:
Nh:
}
function test_attribute_configuration($G6)
{
if (Mo_Ldap_Local_Util::is_extension_installed("openssl")) {
goto lm;
}
return null;
lm:
$r6 = get_option("mo_ldap_local_server_url") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_url")) : '';
$Cw = get_option("mo_ldap_local_server_dn") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_dn")) : '';
$DD = get_option("mo_ldap_local_server_password") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_password")) : '';
$Am = get_option("mo_ldap_local_search_base") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_search_base")) : '';
$Hx = explode(";", $Am);
$Io = get_option("mo_ldap_local_search_filter") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_search_filter")) : '';
$Io = str_replace("?", $G6, $Io);
$bN = strtolower(get_option("mo_ldap_local_email_attribute"));
$eJ = strtolower(get_option("mo_ldap_local_phone_attribute"));
$Al = strtolower(get_option("mo_ldap_local_fname_attribute"));
$YG = strtolower(get_option("mo_ldap_local_lname_attribute"));
$La = strtolower(get_option("mo_ldap_local_nickname_attribute"));
$Y7 = array($bN, $eJ, $Al, $YG, $La);
$G2 = wp_load_alloptions();
foreach ($G2 as $Zh => $Kq) {
if (strpos($Zh, "mo_ldap_local_custom_attribute_") === false) {
goto gz;
}
array_push($Y7, $Kq);
goto Hf;
gz:
Hf:
UA:
}
nV:
if (!(version_compare(PHP_VERSION, "5.3.0") >= 0)) {
goto y5;
}
ldap_set_option(null, LDAP_OPT_NETWORK_TIMEOUT, 5);
y5:
$wQ = ldap_connect($r6);
if ($wQ) {
goto fQ;
}
$W6 = false;
goto zu;
fQ:
ldap_set_option($wQ, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($wQ, LDAP_OPT_REFERRALS, 0);
if (!get_option("mo_ldap_local_use_tls")) {
goto ax;
}
ldap_start_tls($wQ);
ax:
$BP = @ldap_bind($wQ, $Cw, $DD);
if (!$BP) {
goto re;
}
$GG = 0;
qw:
if (!($GG < sizeof($Hx))) {
goto fJ;
}
if (!ldap_search($wQ, $Hx[$GG], $Io, $Y7)) {
goto k0;
}
$hf = ldap_search($wQ, $Hx[$GG], $Io, $Y7);
k0:
$W6 = ldap_first_entry($wQ, $hf);
$W3 = ldap_get_entries($wQ, $hf);
if ($W6) {
goto j_;
}
goto dx;
j_:
$V6 = ldap_get_dn($wQ, $W6);
goto fJ;
dx:
oV:
$GG++;
goto qw;
fJ:
re:
?>
<style>
table { border-collapse: collapse; width: 100%; }
table, th, td { border: 1px solid black;}
td{padding:5px;}
</style>
<h2>Attribute Mapping Test : </h2>
<div style="font-family:Calibri;padding:0 3%;">
<?php
if (!empty($V6)) {
goto B0;
}
?>
<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;">TEST FAILED</div>
<div style="color: #a94442;font-size:14pt; margin-bottom:20px;">WARNING: Some Attributes Did Not Match.</div>
<div style="display:block;text-align:center;margin-bottom:4%;"><img style="width:15%;"src="<?php
echo plugin_dir_url(__FILE__) . "includes/images/wrong.png";
?>
"/></div>
<?php
goto Ys;
B0:
?>
<div style="color: #3c763d;background-color: #dff0d8; padding:2%;margin-bottom:20px;text-align:center; border:1px solid #AEDB9A; font-size:18pt;">TEST SUCCESSFUL</div>
<div style="display:block;text-align:center;margin-bottom:4%;"><img style="width:15%;"src="<?php
echo plugin_dir_url(__FILE__) . "includes/images/green_check.png";
?>
"/></div>
<?php
Ys:
?>
<table>
<tr>
<td style='font-weight:bold;border:2px solid #949090;padding:2%;'>User DN</td>
<td style='padding:2%;border:2px solid #949090; word-wrap:break-word;'><?php
echo isset($V6) ? $V6 : "<b style="color:red;">No such attribute found.</b>";
?>
</td>
</tr>
<?php
foreach ($Y7 as $ai) {
?>
<tr>
<td style='font-weight:bold;border:2px solid #949090;padding:2%;'><?php
echo $ai;
?>
</td>
<td style='padding:2%;border:2px solid #949090; word-wrap:break-word;'>
<?php
if (isset($W3[0][$ai][0])) {
goto Lh;
}
echo "<b style="color:red;">No such attribute found.</b>";
goto Md;
Lh:
if (isset($W3[0][$ai]["count"])) {
goto NG;
}
echo $W3[0][$ai][0];
goto RD;
NG:
$GG = 0;
P_:
if (!($GG < $W3[0][$ai]["count"])) {
goto wt;
}
echo $W3[0][$ai][$GG] . "<br>";
AZ:
$GG++;
goto P_;
wt:
RD:
Md:
?>
</td>
</tr>
<?php
ud:
}
d1:
?>
</table>
<div style="margin:3%;display:block;text-align:center;"><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"/></div>
<?php
die;
zu:
}
function update_password($xU, $zL)
{
if (Mo_Ldap_Local_Util::is_extension_installed("openssl")) {
goto Sj;
}
return null;
Sj:
$Bt = get_option("mo_ldap_local_server_url") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_url")) : '';
if (!(version_compare(PHP_VERSION, "5.3.0") >= 0)) {
goto pW;
}
ldap_set_option(null, LDAP_OPT_NETWORK_TIMEOUT, 5);
pW:
$wQ = ldap_connect($Bt);
if (!$wQ) {
goto zW;
}
$Cw = get_option("mo_ldap_local_server_dn") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_dn")) : '';
$DD = get_option("mo_ldap_local_server_password") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_password")) : '';
$ig = get_user_meta($xU->ID, "mo_ldap_user_dn", true);
if (!get_option("mo_ldap_local_use_tls")) {
goto js;
}
ldap_start_tls($wQ);
js:
$wL = @ldap_bind($wQ, $Cw, $DD);
if ($wL) {
goto jb;
}
echo "Could not be done";
die;
goto An;
jb:
$aQ = null;
$zL = """ . $zL . """;
$qj = strlen($zL);
$GG = 0;
EF:
if (!($GG < $qj)) {
goto Ng;
}
$aQ .= "[{$zL[$GG]}]";
RI:
$GG++;
goto EF;
Ng:
$zL = $aQ;
$pM["unicodepwd"] = $zL;
$yO = ldap_mod_replace($wQ, $ig, $pM);
if ($yO) {
goto br;
}
echo "There was a problem!";
goto SL;
br:
echo "User modified!";
SL:
die;
An:
zW:
}
function fetch_user_attributes($user)
{
error_log("fetch_user_attributes base plugin");
$Am = get_option("mo_ldap_local_search_base") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_search_base")) : '';
$Io = get_option("mo_ldap_local_search_filter") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_search_filter")) : '';
$Io = str_replace("?", $user->user_login, $Io);
$wQ = self::getConnection();
if (!(version_compare(PHP_VERSION, "5.3.0") >= 0)) {
goto PE;
}
ldap_set_option(null, LDAP_OPT_NETWORK_TIMEOUT, 5);
PE:
ldap_set_option($wQ, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($wQ, LDAP_OPT_REFERRALS, 0);
$Cw = get_option("mo_ldap_local_server_dn") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_dn")) : '';
$DD = get_option("mo_ldap_local_server_password") ? Mo_Ldap_Local_Util::decrypt(get_option("mo_ldap_local_server_password")) : '';
$wL = @ldap_bind($wQ, $Cw, $DD);
$Ko = strtolower(get_option("mo_ldap_local_fname_attribute"));
$KX = strtolower(get_option("mo_ldap_local_lname_attribute"));
$bN = strtolower(get_option("mo_ldap_local_email_attribute"));
$eJ = strtolower(get_option("mo_ldap_local_phone_attribute"));
$La = strtolower(get_option("mo_ldap_local_nickname_attribute"));
$Y7 = array($Ko, $KX, $bN, $La, $eJ);
$G2 = wp_load_alloptions();
foreach ($G2 as $Zh => $Kq) {
if (strpos($Zh, "mo_ldap_local_custom_attribute_") === false) {
goto MQ;
}
array_push($Y7, $Kq);
goto K0;
MQ:
K0:
Ii:
}
Z5:
if ($wL) {
goto sb;
}
$zc = "Could not connect to LDAP";
error_log($zc, "Bind ERROR" . ldap_errno($wQ));
sb:
$V3 = ldap_search($wQ, $Am, $Io, $Y7);
if ($V3) {
goto R_s;
}
error_log("User not " . $user->user_login . " Found in LDAP");
goto tn3;
R_s:
error_log("User " . $user->user_login . " Found in LDAP. Updating information");
$W6 = ldap_first_entry($wQ, $V3);
$GR = ldap_get_entries($wQ, $V3);
if (!$W6) {
goto Lr;
}
$Uh = ldap_get_dn($wQ, $W6);
update_user_meta($user->ID, "mo_ldap_user_dn", $Uh, false);
Lr:
remove_all_actions("profile_update");
$IE = array();
$IE["ID"] = $user->ID;
if (!isset($GR[0]["givenname"])) {
goto rM;
}
$IE["first_name"] = $GR[0]["givenname"][0];
rM:
if (!isset($GR[0]["sn"])) {
goto Jf;
}
$IE["last_name"] = $GR[0]["sn"][0];
Jf:
if (!isset($GR[0]["mail"])) {
goto wvi;
}
$IE["user_email"] = $GR[0]["mail"][0];
wvi:
error_log("Update Data for user " . $user->user_login . ":" . print_r($IE, TRUE));
$mV = wp_update_user($IE);
if (is_wp_error($mV)) {
goto Bud;
}
error_log("Updated User with ID: " . $mV . ", username: " . $user->user_login);
goto lEM;
Bud:
$Rh = $mV->get_error_code();
$fp = $mV->get_error_message($Rh);
error_log("Error updating user " . $user->user_login . ": Code: " . $Rh . ": Reason: " . $fp);
lEM:
if (!isset($GR[0][$eJ])) {
goto T5X;
}
update_user_meta($user->ID, "mo_ldap_user_phone", $GR[0][$eJ][0]);
T5X:
unset($Y7[0]);
unset($Y7[1]);
unset($Y7[2]);
$hl = array();
foreach ($Y7 as $ai) {
if (isset($GR[0][strtolower($ai)]["count"]) && $GR[0][strtolower($ai)]["count"] > 1) {
goto y5k;
}
$hl["mo_ldap_local_custom_attribute_" . $ai] = $GR[0][strtolower($ai)][0];
goto PPK;
y5k:
$y5 = array();
$GG = 0;
fah:
if (!($GG < $GR[0][strtolower($ai)]["count"])) {
goto T6f;
}
array_push($y5, $GR[0][strtolower($ai)][$GG]);
ykZ:
$GG++;
goto fah;
T6f:
$hl["mo_ldap_local_custom_attribute_" . $ai] = $y5;
PPK:
OqP:
}
fi5:
$Mh = $hl;
foreach ($Mh as $ai => $Kq) {
update_user_meta($user->ID, $ai, $Kq);
Nu6:
}
R_j:
do_action("mo_ldap_buddypress", $Mh, $user);
do_action("mo_ldap_profile_picture_mapping", $user);
tn3:
ldap_close($wQ);
}
}
?>
Did this file decode correctly?
Original Code
<?php
require_once "\143\x6c\x61\163\163\55\154\144\141\160\x2d\141\165\x74\x68\x2d\x72\145\163\x70\157\156\x73\x65\x2e\160\x68\160";
class Mo_Ldap_Local_Config
{
function ping_ldap_server($RW)
{
delete_option("\x6d\x6f\137\x6c\144\x61\160\x5f\x6c\x6f\x63\x61\x6c\x5f\163\x65\x72\166\x65\162\137\x75\x72\154\137\x73\164\141\x74\165\163");
delete_option("\155\157\137\154\x64\x61\160\137\154\157\143\x61\x6c\137\163\145\162\166\x69\x63\145\137\x61\x63\143\157\165\156\x74\x5f\163\164\x61\x74\x75\163");
if (Mo_Ldap_Local_Util::is_extension_installed("\x6c\144\x61\x70")) {
goto kQ;
}
return "\114\x44\x41\x50\137\105\122\x52\117\122";
kQ:
$wQ = ldap_connect($RW);
if (!$wQ) {
goto MN;
}
ldap_set_option($wQ, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($wQ, LDAP_OPT_REFERRALS, 0);
if (!get_option("\155\x6f\x5f\x6c\144\x61\x70\137\154\157\143\x61\x6c\x5f\x75\x73\145\x5f\x74\154\163")) {
goto Rm;
}
ldap_start_tls($wQ);
Rm:
$wL = @ldap_bind($wQ);
if (!$wL) {
goto DC;
}
add_option("\x6d\x6f\x5f\154\x64\141\x70\137\x6c\157\143\x61\x6c\137\163\x65\162\166\145\162\x5f\x75\x72\154\137\163\x74\141\164\x75\x73", "\x56\x41\114\x49\x44", '', "\156\x6f");
return "\x53\125\103\103\105\123\123";
DC:
MN:
add_option("\155\x6f\137\x6c\x64\x61\160\137\x6c\157\143\141\154\x5f\163\x65\x72\166\x65\162\x5f\165\x72\154\x5f\163\x74\x61\x74\x75\x73", "\111\x4e\x56\x41\114\x49\x44", '', "\x6e\157");
return "\x45\x52\x52\x4f\122";
}
function ldap_login($G6, $ah)
{
$G6 = stripcslashes($G6);
$ah = stripcslashes($ah);
$j8 = null;
if (Mo_Ldap_Local_Util::is_extension_installed("\154\x64\141\160")) {
goto jm;
}
$TF = new Mo_Ldap_Auth_Response();
$TF->status = false;
$TF->statusMessage = "\114\104\x41\120\x5f\x45\x52\x52\117\x52";
$TF->userDn = '';
return $TF;
jm:
if (Mo_Ldap_Local_Util::is_extension_installed("\x6f\x70\x65\x6e\x73\x73\x6c")) {
goto nZ;
}
$TF = new Mo_Ldap_Auth_Response();
$TF->status = false;
$TF->statusMessage = "\117\x50\x45\116\123\123\114\x5f\x45\x52\122\117\x52";
$TF->userDn = '';
return $TF;
nZ:
$wQ = $this->getConnection();
if ($wQ) {
goto sV;
}
$TF = new Mo_Ldap_Auth_Response();
$TF->status = false;
$TF->statusMessage = "\x45\x52\122\117\x52";
$TF->userDn = '';
return $TF;
goto Y6;
sV:
$kA = get_option("\x6d\157\x5f\154\x64\x61\160\137\x6c\157\143\x61\154\x5f\x73\145\x61\162\x63\x68\137\x66\151\x6c\164\x65\162") ? Mo_Ldap_Local_Util::decrypt(get_option("\x6d\157\x5f\154\x64\x61\x70\137\x6c\157\x63\x61\154\137\x73\x65\141\x72\x63\x68\137\x66\x69\154\x74\x65\x72")) : '';
$Am = get_option("\x6d\x6f\x5f\154\x64\141\x70\x5f\x6c\157\143\x61\154\x5f\x73\x65\x61\162\143\x68\x5f\x62\141\x73\145") ? Mo_Ldap_Local_Util::decrypt(get_option("\155\x6f\137\154\x64\141\160\x5f\154\x6f\143\x61\x6c\x5f\x73\x65\x61\x72\143\150\137\142\x61\x73\x65")) : '';
$Cw = get_option("\155\x6f\137\x6c\x64\x61\x70\137\154\157\143\141\154\137\163\x65\162\x76\145\162\137\x64\156") ? Mo_Ldap_Local_Util::decrypt(get_option("\x6d\x6f\x5f\154\x64\141\160\137\154\x6f\143\x61\154\137\x73\145\x72\x76\x65\x72\137\144\156")) : '';
$DD = get_option("\155\157\137\154\144\141\x70\x5f\x6c\x6f\x63\141\x6c\137\163\145\162\166\x65\x72\x5f\x70\x61\x73\x73\167\x6f\162\x64") ? Mo_Ldap_Local_Util::decrypt(get_option("\155\x6f\x5f\154\x64\x61\160\137\x6c\157\x63\141\x6c\137\x73\145\x72\166\145\162\137\x70\x61\x73\x73\x77\157\x72\x64")) : '';
$Ko = strtolower(get_option("\x6d\157\x5f\154\x64\141\x70\x5f\154\157\143\x61\154\137\x66\156\x61\x6d\x65\x5f\x61\x74\x74\x72\151\x62\165\164\145"));
$KX = strtolower(get_option("\155\157\137\154\x64\x61\160\137\x6c\157\x63\141\x6c\137\154\x6e\x61\155\x65\x5f\x61\x74\164\x72\x69\x62\x75\164\x65"));
$bN = strtolower(get_option("\x6d\157\x5f\154\x64\141\x70\137\154\157\x63\x61\154\x5f\145\155\x61\x69\154\x5f\141\164\164\162\x69\142\165\164\145"));
$eJ = strtolower(get_option("\x6d\157\137\154\144\141\x70\137\154\x6f\x63\x61\154\x5f\160\150\x6f\x6e\x65\x5f\x61\x74\x74\x72\151\x62\x75\x74\145"));
$La = strtolower(get_option("\155\157\137\154\x64\141\x70\137\x6c\157\x63\141\x6c\137\156\151\143\x6b\x6e\x61\x6d\145\137\x61\164\x74\x72\151\142\165\x74\145"));
$Y7 = array($Ko, $KX, $bN, $La, $eJ);
$G2 = wp_load_alloptions();
foreach ($G2 as $Zh => $Kq) {
if (strpos($Zh, "\155\x6f\137\154\144\x61\x70\137\x6c\x6f\143\x61\154\x5f\143\x75\163\x74\x6f\155\137\141\164\x74\x72\151\142\165\x74\145\x5f") === false) {
goto QI;
}
array_push($Y7, $Kq);
goto ah;
QI:
ah:
z0:
}
jL:
$kA = str_replace("\77", $G6, $kA);
$Hx = explode("\73", $Am);
$hf = null;
$W3 = null;
$W6 = null;
if (!get_option("\155\157\x5f\154\x64\141\160\137\x6c\x6f\x63\141\x6c\137\165\163\145\x5f\x74\x6c\163")) {
goto Qq;
}
ldap_start_tls($wQ);
Qq:
$BP = @ldap_bind($wQ, $Cw, $DD);
$Su = ldap_error($wQ);
if (!(strtolower($Su) != "\x73\165\x63\x63\x65\163\x73")) {
goto vf;
}
$TF = new Mo_Ldap_Auth_Response();
$TF->status = false;
$TF->statusMessage = "\114\x44\101\x50\x5f\116\x4f\x54\137\x52\x45\x53\120\117\x4e\104\x49\x4e\x47";
$TF->userDn = '';
return $TF;
vf:
$GG = 0;
k2:
if (!($GG < sizeof($Hx))) {
goto Hy;
}
if (ldap_search($wQ, $Hx[$GG], $kA, $Y7)) {
goto bt;
}
$TF = new Mo_Ldap_Auth_Response();
$TF->status = false;
$TF->statusMessage = "\105\x52\122\117\x52";
$TF->userDn = '';
return $TF;
goto Cb;
bt:
$hf = ldap_search($wQ, $Hx[$GG], $kA, $Y7);
Cb:
$W6 = ldap_first_entry($wQ, $hf);
$W3 = ldap_get_entries($wQ, $hf);
if (!$W6) {
goto lE;
}
goto Hy;
lE:
b4:
$GG++;
goto k2;
Hy:
if ($W6) {
goto ui;
}
$TF = new Mo_Ldap_Auth_Response();
$TF->status = false;
$TF->statusMessage = "\x55\123\105\122\137\116\x4f\124\x5f\105\x58\x49\x53\124";
$TF->userDn = '';
return $TF;
goto dD;
ui:
$Uh = ldap_get_dn($wQ, $W6);
dD:
$hm = $this->authenticate($Uh, $ah);
if (!($hm->statusMessage == "\x53\x55\x43\x43\105\x53\x53")) {
goto Kn;
}
$hl = array();
$hF = array();
unset($Y7[0]);
unset($Y7[1]);
unset($Y7[2]);
foreach ($Y7 as $ai) {
if (isset($W3[0][strtolower($ai)]["\143\157\165\156\164"]) && $W3[0][strtolower($ai)]["\143\x6f\165\156\164"] > 1) {
goto Cn;
}
$hl["\x6d\157\137\x6c\x64\x61\160\x5f\154\157\x63\141\154\137\143\x75\x73\x74\157\155\137\141\x74\x74\x72\x69\142\x75\x74\145\137" . $ai] = $W3[0][strtolower($ai)][0];
goto Ak;
Cn:
$y5 = array();
$GG = 0;
FK:
if (!($GG < $W3[0][strtolower($ai)]["\143\157\x75\x6e\164"])) {
goto cO;
}
array_push($y5, $W3[0][strtolower($ai)][$GG]);
pZ:
$GG++;
goto FK;
cO:
$hl["\155\x6f\x5f\x6c\144\141\x70\x5f\x6c\157\x63\x61\154\x5f\143\165\x73\x74\157\155\137\141\x74\x74\162\x69\x62\x75\x74\145\137" . $ai] = $y5;
Ak:
Wb:
}
df:
$hm->attributeList = $hl;
$hF["\155\x61\151\x6c"] = $W3[0][$bN][0];
$hF["\146\156\x61\155\x65"] = $W3[0][$Ko][0];
$hF["\154\x6e\x61\x6d\x65"] = $W3[0][$KX][0];
$hF["\156\x69\143\x6b\x6e\x61\155\x65"] = $W3[0][$La][0];
if (!isset($W3[0][$eJ])) {
goto im;
}
$hF["\160\x68\157\x6e\x65"] = $W3[0][$eJ][0];
im:
$hm->profileAttributesList = $hF;
Kn:
return $hm;
Y6:
}
function test_connection()
{
if (!Mo_Ldap_Local_Util::is_extension_installed("\x6c\x64\141\160")) {
goto q7;
}
if (Mo_Ldap_Local_Util::is_extension_installed("\157\x70\x65\156\x73\x73\x6c")) {
goto sU;
}
return json_encode(array("\x73\164\x61\164\165\x73\x43\x6f\144\145" => "\117\120\x45\x4e\x53\x53\114\x5f\105\122\x52\117\x52", "\163\x74\141\x74\x75\163\x4d\145\x73\163\x61\147\x65" => "\74\141\40\164\141\162\x67\145\x74\x3d\42\137\x62\154\x61\156\153\42\x20\150\x72\145\146\x3d\42\x68\x74\x74\x70\72\x2f\x2f\160\150\160\56\x6e\x65\164\x2f\x6d\x61\156\165\x61\154\x2f\x65\156\x2f\157\160\x65\156\x73\x73\x6c\56\x69\156\163\164\x61\x6c\154\x61\164\151\x6f\x6e\56\x70\x68\160\42\x3e\120\x48\x50\x20\117\160\x65\156\123\123\x4c\x20\145\x78\164\x65\x6e\x73\151\x6f\x6e\74\57\141\x3e\x20\151\163\x20\x6e\x6f\164\x20\x69\x6e\163\x74\x61\154\x6c\x65\x64\40\x6f\162\40\144\x69\x73\141\142\x6c\x65\144\56\40\x50\x6c\145\141\163\x65\40\145\x6e\x61\x62\154\x65\40\151\x74\56"));
sU:
goto x6;
q7:
return json_encode(array("\x73\164\x61\164\165\163\103\x6f\144\x65" => "\114\x44\x41\x50\x5f\x45\x52\x52\x4f\x52", "\163\x74\141\x74\x75\x73\x4d\145\x73\163\141\x67\145" => "\74\x61\40\x74\x61\x72\147\145\x74\75\x22\x5f\142\x6c\141\x6e\x6b\x22\40\150\x72\145\x66\75\42\150\164\x74\160\72\x2f\57\x70\x68\160\56\156\145\x74\57\x6d\141\x6e\165\141\154\57\x65\156\x2f\154\x64\141\160\56\x69\156\x73\164\141\x6c\x6c\141\164\151\x6f\156\x2e\x70\x68\x70\x22\76\120\x48\x50\40\114\x44\101\120\x20\x65\170\164\145\x6e\x73\151\x6f\x6e\74\57\141\76\x20\151\x73\x20\156\x6f\x74\40\151\156\163\x74\141\154\x6c\145\144\40\157\162\x20\144\151\163\x61\142\x6c\x65\144\x2e\x20\x50\x6c\145\141\x73\x65\40\x65\156\141\x62\x6c\145\40\151\164\x2e"));
x6:
delete_option("\x6d\157\x5f\154\x64\141\160\137\154\x6f\x63\x61\154\137\163\145\162\x76\145\x72\x5f\x75\162\x6c\x5f\x73\164\141\x74\165\163");
delete_option("\x6d\157\x5f\x6c\x64\x61\160\x5f\x6c\x6f\x63\x61\154\x5f\x73\145\x72\x76\x69\x63\145\137\141\143\143\x6f\x75\156\164\137\163\164\141\164\165\x73");
$Bt = get_option("\x6d\157\137\x6c\144\141\x70\137\154\157\143\x61\x6c\137\163\x65\x72\166\145\162\x5f\165\162\x6c") ? Mo_Ldap_Local_Util::decrypt(get_option("\x6d\157\137\x6c\144\x61\160\x5f\x6c\157\143\x61\154\x5f\163\145\x72\x76\145\162\137\165\162\154")) : '';
$Pf = $this->ping_ldap_server($Bt);
if (!($Pf == "\x45\x52\122\x4f\x52")) {
goto Hj;
}
add_option("\x6d\157\137\154\x64\141\160\137\154\157\x63\x61\154\137\163\145\162\166\x65\x72\137\x75\x72\x6c\137\163\164\141\164\x75\163", "\111\116\126\101\114\x49\x44", '', "\x6e\157");
return json_encode(array("\x73\x74\x61\x74\x75\163\x43\157\x64\145" => "\120\111\x4e\107\137\105\x52\x52\117\x52", "\163\x74\141\x74\x75\163\x4d\x65\x73\163\141\x67\145" => $ml . "\103\141\156\156\157\x74\x20\x63\157\x6e\156\145\x63\164\x20\x74\157\40\114\104\x41\120\x20\123\145\162\166\x65\x72\56\40\x4d\x61\x6b\145\x20\x73\165\x72\x65\40\171\x6f\x75\x20\x68\141\166\145\x20\x65\156\164\x65\x72\145\144\x20\163\145\162\x76\x65\x72\x20\x75\x72\154\x20\x69\156\40\x66\157\x72\x6d\141\x74\40\74\x62\76\x6c\x64\141\160\72\x2f\57\163\145\162\166\x65\162\x5f\141\144\x64\162\145\163\163\x3a\x70\x6f\162\164\74\x2f\142\76\40\141\x6e\x64\x20\151\146\x20\164\150\145\162\x65\40\x69\163\40\141\x20\x66\x69\x72\x65\x77\x61\154\x6c\x2c\x20\x70\x6c\x65\141\163\145\x20\x6f\x70\x65\x6e\x20\x74\150\145\x20\146\151\x72\x65\x77\x61\154\x6c\x20\164\x6f\x20\141\x6c\154\157\167\40\x69\156\143\x6f\x6d\x69\x6e\x67\x20\162\x65\x71\165\x65\x73\x74\x73\40\x74\157\40\171\x6f\x75\x72\x20\x4c\x44\x41\120\40\146\x72\x6f\x6d\40\x79\x6f\165\x72\x20\167\x6f\162\144\x70\162\x65\163\x73\x20\111\x50\x20\x61\156\x64\x20\160\x6f\x72\x74\x20\63\70\x39\56\40\101\x6c\163\x6f\x20\143\150\x65\143\153\40\x74\x72\157\x75\x62\x6c\145\x73\x68\157\157\164\151\x6e\147\40\157\x72\40\x63\157\156\x74\x61\143\x74\x20\x75\x73\x20\x75\163\x69\156\147\x20\x73\x75\160\x70\x6f\162\x74\x20\x62\x65\154\x6f\167\x2e"));
Hj:
add_option("\x6d\x6f\x5f\x6c\144\141\x70\137\x6c\157\x63\x61\x6c\137\163\x65\162\166\145\x72\137\x75\162\154\137\x73\x74\x61\164\165\163", "\x56\x41\x4c\111\x44", '', "\x6e\157");
$wQ = $this->getConnection();
if ($wQ) {
goto le;
}
add_option("\155\x6f\137\154\x64\x61\160\x5f\154\157\x63\141\x6c\x5f\163\145\162\x76\x69\143\145\137\x61\143\143\x6f\165\156\x74\x5f\x73\x74\x61\164\165\163", "\111\116\126\101\x4c\111\x44", '', "\156\157");
return json_encode(array("\x73\x74\141\164\165\x73\x43\157\x64\x65" => "\105\122\x52\x4f\x52", "\x73\164\x61\164\165\163\x4d\145\x73\x73\141\147\x65" => $ml . "\111\x6e\x76\141\154\151\144\40\x73\x65\x72\x76\x69\x63\145\40\x61\143\143\x6f\165\x6e\164\x20\143\x72\x65\144\x65\156\164\151\x61\154\163\56\x20\115\141\x6b\x65\x20\x73\165\x72\145\40\171\157\165\40\150\x61\166\145\x20\145\156\x74\145\162\145\x64\40\143\157\162\162\x65\143\164\x20\123\x65\162\166\x69\143\x65\40\101\143\143\157\165\x6e\x74\x20\x44\x4e\x20\x61\x6e\x64\40\160\141\x73\x73\167\x6f\162\x64\x2e"));
goto vx;
le:
$Cw = get_option("\155\157\137\154\144\x61\x70\x5f\154\x6f\x63\x61\x6c\137\x73\x65\x72\x76\x65\x72\x5f\144\x6e") ? Mo_Ldap_Local_Util::decrypt(get_option("\155\157\x5f\x6c\x64\x61\160\137\154\x6f\143\141\154\x5f\163\x65\x72\166\x65\162\x5f\144\156")) : '';
$DD = get_option("\x6d\x6f\x5f\x6c\144\141\160\137\x6c\157\143\x61\154\x5f\163\x65\x72\x76\145\162\137\160\x61\x73\163\x77\x6f\162\x64") ? Mo_Ldap_Local_Util::decrypt(get_option("\155\x6f\137\x6c\144\141\160\x5f\x6c\x6f\143\141\154\x5f\x73\145\x72\x76\x65\162\x5f\x70\x61\x73\x73\167\x6f\162\144")) : '';
if (!get_option("\155\157\x5f\x6c\x64\x61\x70\137\x6c\157\x63\141\x6c\x5f\165\x73\x65\137\164\154\163")) {
goto E4;
}
ldap_start_tls($wQ);
E4:
$wL = @ldap_bind($wQ, $Cw, $DD);
if ($wL) {
goto aY;
}
add_option("\x6d\157\x5f\154\x64\x61\160\137\154\157\x63\141\154\137\x73\x65\162\x76\151\x63\x65\137\x61\143\x63\157\x75\156\x74\137\163\x74\x61\x74\x75\163", "\x49\116\x56\x41\x4c\x49\104", '', "\x6e\157");
return json_encode(array("\163\x74\141\x74\x75\x73\x43\157\144\145" => "\x45\122\122\x4f\x52", "\163\164\141\x74\165\x73\115\x65\x73\163\141\x67\x65" => $ml . "\111\x6e\x76\141\154\x69\144\x20\163\145\x72\x76\x69\x63\x65\x20\x61\x63\143\157\165\x6e\164\x20\x63\x72\x65\144\x65\156\x74\x69\141\x6c\x73\56\40\x4d\141\x6b\145\x20\x73\165\162\x65\40\x79\x6f\165\x20\150\141\166\x65\40\x65\156\x74\x65\x72\x65\144\x20\143\x6f\162\x72\145\143\x74\x20\x53\x65\x72\x76\151\143\145\x20\x41\x63\143\x6f\165\156\x74\40\104\116\x20\141\x6e\144\x20\160\141\x73\x73\167\157\162\144\56"));
goto My;
aY:
add_option("\x6d\x6f\137\154\x64\x61\x70\137\154\x6f\x63\x61\154\x5f\x73\145\x72\166\151\x63\x65\x5f\141\143\x63\157\165\156\164\137\163\x74\x61\164\165\163", "\x56\101\114\x49\104", '', "\x6e\157");
return json_encode(array("\163\x74\x61\x74\x75\x73\x43\157\x64\145" => "\x53\x55\x43\x43\x45\x53\x53", "\x73\x74\x61\164\x75\163\x4d\145\163\x73\x61\x67\x65" => "\103\157\x6e\x6e\x65\143\164\x69\157\x6e\x20\x77\x61\x73\x20\145\163\164\x61\x62\x6c\151\163\x68\x65\x64\x20\x73\x75\x63\143\x65\163\163\x66\x75\x6c\154\x79\x2e\x20\120\x6c\x65\141\x73\145\40\x74\x65\163\164\40\x61\165\164\150\145\156\x74\x69\x63\x61\x74\151\157\x6e\x20\164\157\x20\166\x65\162\151\x66\171\40\x4c\x44\x41\x50\40\125\163\x65\x72\x20\x4d\x61\160\x70\x69\156\x67\40\103\x6f\x6e\146\151\x67\165\162\141\164\x69\x6f\156\x2e"));
My:
vx:
}
function test_authentication($G6, $ah, $TD)
{
if (!Mo_Ldap_Local_Util::is_extension_installed("\154\144\141\160")) {
goto T4;
}
if (Mo_Ldap_Local_Util::is_extension_installed("\157\x70\x65\x6e\x73\163\x6c")) {
goto sA;
}
return json_encode(array("\163\x74\x61\164\165\x73\x43\157\144\x65" => "\117\120\x45\116\x53\x53\114\x5f\105\x52\122\x4f\x52", "\163\x74\x61\x74\165\x73\x4d\145\163\x73\x61\147\x65" => "\x3c\x61\x20\164\141\162\x67\145\164\75\42\137\142\x6c\141\156\x6b\x22\x20\150\162\145\146\75\42\150\x74\x74\160\x3a\57\x2f\x70\x68\x70\x2e\156\x65\x74\x2f\155\141\156\165\x61\154\x2f\x65\x6e\57\157\160\x65\156\163\x73\x6c\56\151\156\x73\x74\x61\154\x6c\x61\x74\x69\x6f\x6e\56\x70\150\160\x22\76\x50\110\120\x20\x4f\x70\145\x6e\123\x53\114\40\x65\x78\x74\x65\x6e\163\x69\157\156\74\x2f\x61\x3e\40\x69\163\x20\x6e\157\x74\40\x69\156\163\x74\141\x6c\x6c\145\x64\40\157\162\x20\x64\151\163\x61\142\154\145\144\x2e\40\120\x6c\145\141\163\145\40\x65\156\x61\x62\x6c\x65\x20\151\164\x2e"));
sA:
goto C9;
T4:
return json_encode(array("\163\164\x61\x74\165\163\103\x6f\x64\145" => "\114\104\x41\x50\x5f\x45\x52\x52\117\x52", "\x73\164\x61\164\165\x73\115\145\x73\163\141\147\145" => "\x3c\x61\x20\x74\x61\x72\x67\x65\164\75\x22\x5f\x62\x6c\x61\156\x6b\42\x20\150\162\145\146\75\42\x68\164\x74\x70\72\57\x2f\x70\150\x70\56\156\x65\164\57\x6d\141\x6e\x75\x61\154\x2f\x65\156\57\x6c\x64\141\x70\56\x69\156\x73\164\141\154\x6c\141\x74\x69\157\x6e\56\160\x68\x70\x22\x3e\120\x48\120\40\114\x44\x41\120\40\x65\170\x74\145\x6e\x73\x69\x6f\156\x3c\57\141\x3e\x20\x69\163\x20\x6e\x6f\x74\40\151\156\x73\164\141\154\x6c\x65\x64\40\157\x72\x20\144\x69\163\x61\142\x6c\145\144\x2e\40\x50\x6c\x65\141\x73\x65\40\x65\156\x61\142\154\x65\40\151\x74\56"));
C9:
if (!(get_option("\155\x6f\x5f\x6c\144\141\160\x5f\x6c\x6f\x63\x61\154\137\163\x65\162\x76\x65\x72\x5f\x75\x72\154\137\x73\x74\141\164\165\x73") && get_option("\x6d\157\137\154\144\x61\x70\x5f\x6c\157\x63\141\154\x5f\163\145\x72\166\x65\x72\137\165\x72\154\137\x73\x74\x61\x74\165\x73") == "\111\116\x56\101\114\111\104")) {
goto lT;
}
delete_option("\x6d\x6f\x5f\154\x64\x61\x70\137\x6c\x6f\143\x61\x6c\137\x73\x65\162\166\145\162\x5f\165\x72\154\x5f\163\164\141\x74\x75\163");
delete_option("\155\x6f\137\154\x64\141\160\x5f\154\x6f\143\x61\154\x5f\163\145\162\166\151\143\145\x5f\141\143\x63\157\165\x6e\164\137\163\x74\x61\164\165\x73");
add_option("\155\157\137\154\x64\x61\x70\137\154\x6f\x63\x61\x6c\137\163\145\162\x76\145\162\x5f\x75\162\154\x5f\163\164\141\x74\165\163", "\x49\x4e\126\x41\x4c\x49\104", '', "\x6e\x6f");
return json_encode(array("\163\x74\141\164\165\x73\x43\157\144\145" => "\120\x49\x4e\107\137\x45\122\122\x4f\122", "\163\x74\141\164\x75\163\115\x65\x73\x73\141\147\145" => "\x43\x61\x6e\x6e\x6f\x74\x20\x63\157\156\x6e\145\x63\164\40\164\x6f\40\x4c\104\101\120\x20\x53\x65\x72\166\145\162\x2e\x20\x4d\141\x6b\145\x20\x73\x75\162\145\40\171\157\x75\x20\x68\141\166\145\40\x65\x6e\164\x65\x72\x65\144\40\x73\x65\x72\166\x65\162\40\165\162\x6c\x20\151\156\x20\x66\x6f\162\155\x61\164\x20\x3c\x62\76\154\144\141\160\x3a\x2f\x2f\x73\145\162\x76\x65\x72\x5f\141\x64\x64\162\145\x73\x73\x3a\160\x6f\162\x74\74\57\x62\x3e\x20\141\x6e\144\x20\x69\x66\40\164\150\x65\x72\145\40\151\x73\40\141\x20\146\x69\x72\x65\167\x61\154\154\54\40\160\x6c\x65\x61\163\x65\x20\157\160\x65\x6e\40\x74\150\x65\x20\x66\x69\162\145\167\x61\x6c\x6c\x20\164\x6f\40\x61\154\154\x6f\x77\40\x69\x6e\143\157\x6d\151\156\147\x20\162\x65\x71\x75\145\x73\164\163\x20\164\x6f\40\x79\x6f\165\162\40\x4c\x44\x41\120\40\x66\x72\157\155\x20\171\157\x75\162\40\167\x6f\162\144\x70\162\145\163\163\40\111\x50\40\141\x6e\144\x20\160\x6f\162\164\40\x33\70\71\x2e\x20\101\x6c\163\x6f\40\x63\x68\x65\x63\x6b\x20\164\162\x6f\x75\x62\x6c\x65\x73\x68\157\157\164\151\x6e\147\x20\157\162\40\143\x6f\x6e\164\141\x63\x74\40\165\163\40\165\x73\151\x6e\147\x20\x73\165\x70\x70\157\x72\x74\x20\142\145\154\157\167\x2e"));
lT:
if (Mo_Ldap_Local_Util::check_empty_or_null($TD)) {
goto p_;
}
return json_encode(array("\163\x74\x61\x74\x75\163\x43\157\144\145" => "\x53\125\x43\103\x45\123\x53", "\163\x74\141\164\x75\x73\115\x65\x73\163\141\x67\x65" => ''));
goto hK;
p_:
delete_option("\x6d\157\137\154\144\x61\160\137\154\157\x63\x61\154\x5f\165\x73\x65\162\x5f\x6d\x61\160\x70\x69\156\x67\137\163\x74\x61\164\x75\x73");
delete_option("\x6d\x6f\137\x6c\144\141\x70\137\154\x6f\143\141\x6c\137\x75\163\x65\162\x6e\x61\155\145\x5f\x73\x74\141\x74\x75\163");
$TF = $this->ldap_login($G6, $ah);
if ($TF->statusMessage == "\123\125\103\103\105\123\123") {
goto jA;
}
if ($TF->statusMessage == "\125\123\105\x52\x5f\x4e\117\124\x5f\x45\x58\x49\x53\124") {
goto MP;
}
add_option("\x6d\157\137\154\x64\141\x70\137\154\x6f\143\x61\154\137\165\163\145\x72\x5f\x6d\x61\160\160\151\x6e\x67\x5f\163\164\x61\164\165\163", "\126\x41\114\x49\x44", '', "\x6e\x6f");
add_option("\x6d\157\137\154\144\141\x70\137\154\x6f\143\141\x6c\x5f\x75\163\145\162\x6e\141\155\145\137\163\164\x61\x74\x75\163", "\111\116\126\x41\x4c\111\104", '', "\156\x6f");
return json_encode(array("\163\164\141\x74\165\163\103\x6f\x64\x65" => "\x45\x52\122\x4f\122", "\163\x74\x61\x74\165\x73\x4d\145\163\163\x61\x67\x65" => "\x49\x6e\166\141\154\x69\144\x20\120\141\163\163\167\157\x72\144\56\40\120\x6c\145\141\163\x65\40\x63\x68\145\143\153\40\171\157\x75\x72\x20\x70\141\x73\x73\x77\157\x72\144\40\x61\x6e\144\x20\164\x72\171\40\x61\147\141\x69\x6e\x2e"));
goto ux;
MP:
add_option("\155\157\137\x6c\x64\141\x70\x5f\x6c\x6f\x63\x61\154\x5f\x75\163\x65\162\x5f\x6d\x61\160\160\x69\156\x67\x5f\x73\x74\x61\164\165\x73", "\111\116\x56\x41\114\111\x44", '', "\x6e\x6f");
add_option("\155\157\x5f\x6c\x64\141\160\137\x6c\x6f\143\x61\x6c\x5f\165\163\x65\x72\x6e\x61\x6d\145\137\x73\x74\x61\164\x75\x73", "\111\x4e\x56\x41\x4c\x49\x44", '', "\x6e\x6f");
return json_encode(array("\163\164\x61\x74\165\163\x43\x6f\x64\x65" => "\125\x53\105\122\x5f\x4e\117\x54\x5f\x45\130\111\123\124", "\163\x74\x61\x74\x75\163\x4d\145\163\x73\x61\147\145" => "\x43\x61\x6e\x6e\157\164\x20\x66\x69\x6e\x64\40\x75\x73\x65\162\x20\x3c\x62\x3e" . $G6 . "\x3c\57\142\76\x20\x69\x6e\40\x74\x68\x65\40\x64\x69\x72\x65\x63\164\157\162\171\x2e\74\x62\162\76\120\157\x73\163\151\x62\154\145\40\162\x65\141\x73\157\x6e\x73\72\x3c\142\162\76\61\x2e\40\x54\150\x65\40\74\x62\76\x73\x65\x61\162\143\150\40\x62\x61\x73\145\74\x2f\x62\x3e\40\x55\x52\114\x20\151\x73\x20\x74\171\x70\145\144\40\x69\156\x63\157\162\x72\145\143\x74\154\x79\x2e\40\120\154\x65\141\x73\145\x20\166\x65\x72\151\x66\171\40\x69\x66\40\164\150\x61\x74\40\163\x65\x61\162\x63\x68\x20\x62\141\x73\145\40\151\163\x20\x70\162\x65\163\x65\156\164\x2e\x3c\x62\162\x3e\x32\x2e\x20\125\163\x65\x72\40\x69\163\x20\x6e\x6f\164\40\x70\162\145\163\x65\156\x74\40\151\156\40\164\150\x61\x74\40\163\145\x61\162\143\x68\x20\x62\x61\x73\x65\x2e\40\124\150\145\x20\x75\163\145\x72\40\155\x61\171\40\x62\x65\40\160\x72\x65\x73\145\x6e\x74\40\x69\x6e\40\x74\x68\x65\x20\x64\151\x72\145\x63\x74\157\162\x79\x20\x62\165\164\40\151\x6e\x20\x73\157\155\x65\x20\x6f\x74\x68\x65\x72\40\x74\x72\x65\145\x20\141\x6e\x64\x20\171\x6f\x75\x20\155\141\x79\x20\x68\x61\166\145\40\x65\156\x74\x65\x72\145\x64\40\x61\40\164\x72\x65\145\x20\x77\150\145\x72\145\x20\x74\x68\x69\x73\40\x75\163\145\x72\163\40\x69\x73\40\x6e\x6f\x74\40\160\162\145\163\145\x6e\164\x2e\x3c\142\162\x3e\63\x2e\x20\x3c\142\76\x53\x65\141\x72\x63\150\40\x66\x69\x6c\x74\145\x72\74\x2f\x62\76\40\151\163\40\151\156\143\157\162\162\145\x63\x74\x20\55\x20\125\x73\145\162\x20\151\x73\40\160\x72\x65\x73\x65\x6e\x74\40\151\156\40\164\150\145\x20\x73\x65\x61\x72\x63\x68\40\x62\141\x73\145\40\142\x75\x74\x20\x74\150\x65\40\x75\x73\145\162\x6e\x61\155\x65\x20\x69\x73\x20\x6d\x61\160\x70\x65\144\40\x74\157\x20\x61\x20\x64\151\146\146\x65\x72\x65\156\164\x20\141\164\164\162\151\142\x75\164\x65\x20\x69\156\x20\x74\x68\x65\40\163\x65\x61\162\143\x68\x20\146\x69\x6c\164\145\x72\56\x20\x45\56\x67\56\40\x79\x6f\165\40\x6d\141\x79\40\x62\x65\x20\x6c\x6f\147\147\151\156\147\x20\x69\x6e\40\167\x69\164\150\40\165\x73\145\162\156\141\155\x65\x20\x61\x6e\144\40\x6d\141\171\x20\x68\141\166\145\40\155\x61\x70\160\x65\x64\40\151\x74\x20\164\157\x20\x74\x68\145\40\145\x6d\141\151\x6c\40\x61\x74\x74\162\x69\142\x75\164\x65\x2e\40\123\x6f\40\164\x68\x69\x73\x20\x77\x6f\156\x74\x20\x77\157\162\153\x2e\x20\x50\154\x65\x61\x73\x65\40\155\141\153\x65\40\x73\165\x72\x65\x20\x74\150\141\x74\40\x74\x68\x65\40\162\x69\147\x68\164\40\141\x74\x74\162\x69\x62\x75\x74\145\40\x69\x73\x20\155\x65\x6e\164\x69\157\156\x65\x64\40\151\x6e\x20\164\150\145\x20\x73\x65\x61\x72\143\150\x20\146\151\154\x74\x65\x72\40\x28\167\151\164\x68\40\167\150\151\143\x68\40\171\157\165\x20\167\141\156\x74\40\164\x68\x65\40\x6d\141\160\x70\151\156\147\40\164\x6f\40\x68\141\160\x70\x65\156\x29\x2e\x3c\x62\x72\x3e\40\x34\56\x20\x55\x73\x65\162\x20\x69\163\x20\141\143\x74\165\x61\x6c\x6c\x79\x20\x6e\157\164\x20\x70\x72\145\x73\x65\156\x74\40\151\x6e\x20\164\150\x65\40\163\145\x61\x72\143\x68\40\x62\x61\163\145\x2e\x20\x50\154\145\x61\x73\x65\40\x6d\x61\x6b\145\x20\x73\165\x72\145\x20\164\150\141\x74\x20\164\x68\x65\x20\165\x73\145\162\40\x69\x73\x20\160\162\145\163\x65\x6e\x74\40\141\x6e\x64\x20\164\145\x73\164\x20\x77\151\164\x68\40\164\150\145\40\x72\x69\147\x68\x74\40\165\163\145\x72\x2e"));
ux:
goto l5;
jA:
add_option("\x6d\x6f\x5f\x6c\x64\x61\x70\x5f\154\157\143\x61\x6c\x5f\163\x65\x72\x76\x65\162\x5f\x75\x72\x6c\x5f\163\x74\141\x74\165\163", "\x56\x41\x4c\x49\104", '', "\x6e\x6f");
add_option("\155\x6f\137\154\144\141\x70\137\x6c\x6f\143\x61\154\137\163\145\x72\166\x69\143\145\137\141\x63\x63\157\x75\x6e\x74\137\163\x74\x61\164\x75\163", "\126\x41\x4c\x49\104", '', "\x6e\157");
add_option("\x6d\157\x5f\154\x64\141\x70\x5f\x6c\157\143\x61\154\x5f\x75\x73\x65\162\137\x6d\141\x70\160\151\x6e\147\137\x73\x74\141\x74\165\163", "\126\101\x4c\111\x44", '', "\x6e\157");
add_option("\155\x6f\x5f\x6c\x64\x61\160\x5f\154\157\x63\141\154\x5f\x75\163\145\162\x6e\141\155\145\x5f\x73\164\x61\x74\x75\x73", "\126\101\114\x49\104", '', "\156\157");
return json_encode(array("\163\x74\x61\164\x75\163\103\x6f\144\x65" => "\123\125\x43\103\x45\123\x53", "\x73\164\141\x74\x75\x73\115\x65\163\163\x61\147\x65" => "\131\x6f\x75\x20\x68\x61\166\145\x20\x73\x75\x63\x63\x65\x73\x73\146\165\154\154\171\x20\x63\x6f\156\x66\x69\x67\165\x72\x65\x64\40\171\x6f\165\162\40\114\104\101\x50\x20\x73\x65\164\164\x69\x6e\147\x73\56"));
l5:
hK:
}
function getConnection()
{
if (Mo_Ldap_Local_Util::is_extension_installed("\x6f\x70\x65\x6e\163\x73\x6c")) {
goto LG;
}
return null;
LG:
$Bt = get_option("\x6d\157\x5f\x6c\144\x61\160\137\154\x6f\x63\141\154\x5f\163\145\x72\x76\x65\x72\137\x75\162\154") ? Mo_Ldap_Local_Util::decrypt(get_option("\x6d\157\x5f\x6c\144\141\160\x5f\154\x6f\143\141\154\x5f\x73\x65\x72\166\145\162\x5f\x75\162\x6c")) : '';
$wQ = ldap_connect($Bt);
if (!(version_compare(PHP_VERSION, "\x35\x2e\x33\x2e\x30") >= 0)) {
goto ac;
}
ldap_set_option($wQ, LDAP_OPT_NETWORK_TIMEOUT, 5);
ac:
ldap_set_option($wQ, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($wQ, LDAP_OPT_REFERRALS, 0);
return $wQ;
}
function authenticate($Uh, $ah)
{
if (Mo_Ldap_Local_Util::is_extension_installed("\157\160\145\x6e\163\163\154")) {
goto Sa;
}
return false;
Sa:
$Bt = get_option("\155\157\x5f\154\x64\141\160\137\x6c\157\143\141\x6c\137\x73\145\162\166\x65\x72\x5f\x75\162\154") ? Mo_Ldap_Local_Util::decrypt(get_option("\x6d\157\x5f\154\x64\x61\160\x5f\x6c\x6f\143\x61\x6c\137\163\x65\162\166\x65\x72\x5f\165\x72\x6c")) : '';
$wQ = ldap_connect($Bt);
if (!(version_compare(PHP_VERSION, "\65\x2e\x33\56\x30") >= 0)) {
goto Ja;
}
ldap_set_option(null, LDAP_OPT_NETWORK_TIMEOUT, 5);
Ja:
ldap_set_option($wQ, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($wQ, LDAP_OPT_REFERRALS, 0);
if (!get_option("\x6d\x6f\137\x6c\144\141\x70\x5f\154\x6f\x63\141\x6c\137\165\x73\x65\x5f\x74\154\x73")) {
goto NZ;
}
ldap_start_tls($wQ);
NZ:
$wL = @ldap_bind($wQ, $Uh, $ah);
if ($wL) {
goto sS;
}
$TF = new Mo_Ldap_Auth_Response();
$TF->status = false;
$TF->userDn = $Uh;
goto iz;
sS:
$V3 = ldap_search($wQ, $Uh);
$TF = new Mo_Ldap_Auth_Response();
$TF->status = true;
$TF->statusMessage = "\123\x55\x43\103\105\123\x53";
$TF->userDn = $Uh;
return $TF;
iz:
$TF = new Mo_Ldap_Auth_Response();
$TF->status = false;
$TF->statusMessage = "\x45\x52\122\x4f\122";
$TF->userDn = $Uh;
return $TF;
}
function get_user_ldap_info($G6)
{
if (Mo_Ldap_Local_Util::is_extension_installed("\x6f\160\x65\x6e\163\x73\154")) {
goto iL;
}
return null;
iL:
$r6 = get_option("\155\x6f\x5f\x6c\144\141\160\137\x6c\157\x63\141\x6c\x5f\x73\x65\162\x76\x65\x72\137\165\x72\x6c") ? Mo_Ldap_Local_Util::decrypt(get_option("\x6d\157\x5f\x6c\x64\x61\x70\x5f\154\x6f\143\141\x6c\137\163\145\x72\x76\145\162\137\x75\162\154")) : '';
$Cw = get_option("\155\x6f\137\x6c\144\x61\160\x5f\x6c\157\x63\x61\x6c\x5f\x73\x65\162\x76\145\162\137\144\156") ? Mo_Ldap_Local_Util::decrypt(get_option("\155\x6f\x5f\x6c\144\x61\160\x5f\x6c\157\x63\141\154\x5f\163\145\x72\x76\145\x72\x5f\x64\156")) : '';
$DD = get_option("\x6d\x6f\137\x6c\x64\x61\160\137\x6c\x6f\x63\141\154\x5f\163\x65\x72\166\145\162\137\x70\x61\x73\163\167\157\x72\144") ? Mo_Ldap_Local_Util::decrypt(get_option("\x6d\x6f\x5f\x6c\144\141\x70\x5f\154\157\143\x61\154\x5f\163\145\162\166\145\162\x5f\x70\x61\x73\x73\x77\x6f\x72\144")) : '';
$iK = get_option("\x6d\157\137\154\144\x61\160\x5f\154\157\x63\x61\x6c\137\x73\145\x61\162\143\150\137\142\x61\x73\145") ? Mo_Ldap_Local_Util::decrypt(get_option("\x6d\x6f\x5f\154\144\x61\160\137\154\157\x63\x61\x6c\x5f\163\145\141\162\x63\x68\x5f\142\x61\x73\145")) : '';
$Io = get_option("\155\157\137\154\x64\x61\x70\x5f\x6c\x6f\x63\x61\154\137\163\x65\x61\162\143\x68\137\x66\x69\x6c\164\x65\162") ? Mo_Ldap_Local_Util::decrypt(get_option("\155\x6f\x5f\154\x64\x61\160\x5f\x6c\x6f\143\141\154\137\x73\x65\141\x72\x63\150\x5f\146\x69\154\x74\145\162")) : '';
$Xi = ldap_connect($r6);
if ($Xi) {
goto la;
}
$W6 = false;
goto Pa;
la:
ldap_set_option($Xi, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($Xi, LDAP_OPT_REFERRALS, 0);
if (!get_option("\x6d\x6f\x5f\x6c\x64\141\x70\137\x6c\157\143\141\x6c\x5f\x75\163\x65\x5f\x74\x6c\x73")) {
goto GA;
}
ldap_start_tls($Xi);
GA:
$wL = @ldap_bind($Xi, $Cw, $DD);
if ($wL) {
goto o7;
}
$W6 = false;
goto rz;
o7:
$kA = str_replace("\77", $G6, $Io);
$eX = ldap_search($Xi, $iK, $kA);
$W6 = ldap_get_entries($Xi, $eX);
if (!is_null($W6)) {
goto ks;
}
$W6 = false;
ks:
rz:
Pa:
if (!($W6 != false)) {
goto sZ;
}
$W6 = $W6[0];
sZ:
ldap_close($Xi);
return $W6;
}
function modify_user_info_in_ldap($xU, $Mh)
{
if (Mo_Ldap_Local_Util::is_extension_installed("\157\160\145\156\x73\163\154")) {
goto Ed;
}
return null;
Ed:
$Bt = get_option("\x6d\157\x5f\x6c\144\141\160\x5f\154\157\143\x61\x6c\137\163\145\162\166\x65\x72\x5f\x75\162\154") ? Mo_Ldap_Local_Util::decrypt(get_option("\155\x6f\137\154\144\141\160\137\154\x6f\x63\x61\154\137\163\145\x72\x76\145\x72\x5f\165\x72\154")) : '';
if (!(version_compare(PHP_VERSION, "\65\56\63\56\x30") >= 0)) {
goto s3;
}
ldap_set_option(null, LDAP_OPT_NETWORK_TIMEOUT, 5);
s3:
$wQ = ldap_connect($Bt);
$ig = get_user_meta($xU->ID, "\155\157\x5f\x6c\144\x61\160\x5f\165\x73\145\162\x5f\x64\x6e", true);
if ($wQ) {
goto JF;
}
echo "\103\x6f\x75\x6c\x64\40\156\157\164\x20\147\x65\164\40\x63\157\156\x6e\145\x63\x74\x69\157\156";
die(0);
goto aP;
JF:
$bN = get_option("\155\157\x5f\x6c\x64\141\x70\x5f\x6c\x6f\143\x61\x6c\137\x65\x6d\x61\x69\x6c\137\x61\x74\164\162\x69\142\x75\164\x65");
$Ko = get_option("\155\157\x5f\154\144\x61\160\x5f\x6c\x6f\143\141\154\x5f\x66\x6e\x61\x6d\x65\x5f\x61\164\164\x72\x69\x62\165\x74\x65");
$KX = get_option("\155\x6f\x5f\154\x64\141\160\137\154\x6f\143\x61\x6c\x5f\x6c\x6e\141\155\x65\x5f\141\x74\164\162\x69\x62\165\x74\x65");
$IE = array();
if (Mo_Ldap_Local_Util::check_empty_or_null($xU->first_name)) {
goto OV;
}
$IE[$Ko] = $xU->first_name;
OV:
if (Mo_Ldap_Local_Util::check_empty_or_null($xU->last_name)) {
goto BQ;
}
$IE[$KX] = $xU->last_name;
BQ:
if (Mo_Ldap_Local_Util::check_empty_or_null($xU->user_email)) {
goto sB;
}
$IE[$bN] = $xU->user_email;
sB:
foreach ($Mh as $ai => $Kq) {
if (Mo_Ldap_Local_Util::check_empty_or_null($Kq)) {
goto kh;
}
$IE[$ai] = $Kq;
kh:
vB:
}
QJ:
ldap_set_option($wQ, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($wQ, LDAP_OPT_REFERRALS, 0);
$Cw = get_option("\x6d\157\x5f\154\x64\x61\160\137\154\x6f\143\x61\154\x5f\x73\x65\162\x76\145\162\x5f\x64\x6e") ? Mo_Ldap_Local_Util::decrypt(get_option("\x6d\x6f\137\x6c\144\x61\160\137\x6c\x6f\x63\141\x6c\x5f\x73\x65\x72\166\145\162\137\x64\156")) : '';
$DD = get_option("\x6d\157\x5f\154\x64\x61\160\x5f\x6c\157\143\141\x6c\x5f\163\x65\x72\x76\145\x72\137\160\141\x73\x73\167\x6f\x72\144") ? Mo_Ldap_Local_Util::decrypt(get_option("\155\157\137\154\x64\x61\160\137\154\157\143\141\154\x5f\163\145\162\x76\x65\162\x5f\x70\141\163\x73\x77\x6f\162\x64")) : '';
if (!get_option("\155\x6f\137\x6c\x64\x61\x70\137\154\157\x63\x61\154\137\165\x73\145\137\x74\x6c\163")) {
goto CG;
}
ldap_start_tls($wQ);
CG:
$wL = @ldap_bind($wQ, $Cw, $DD);
if ($wL) {
goto eT;
}
echo "\x43\x6f\165\x6c\x64\x20\x6e\x6f\164\x20\142\145\40\x64\157\x6e\x65";
die;
goto un;
eT:
ldap_modify($wQ, $ig, $IE);
un:
aP:
}
function add_user($xU)
{
if (Mo_Ldap_Local_Util::is_extension_installed("\x6f\x70\x65\x6e\x73\163\154")) {
goto Et;
}
return null;
Et:
$Bt = get_option("\155\x6f\137\154\x64\x61\160\137\x6c\157\143\141\x6c\137\x73\145\x72\166\145\162\x5f\165\162\154") ? Mo_Ldap_Local_Util::decrypt(get_option("\155\x6f\x5f\x6c\x64\x61\160\137\154\157\x63\x61\154\137\163\145\x72\166\x65\x72\x5f\165\x72\154")) : '';
if (!(version_compare(PHP_VERSION, "\x35\56\63\x2e\60") >= 0)) {
goto vz;
}
ldap_set_option(null, LDAP_OPT_NETWORK_TIMEOUT, 5);
vz:
$wQ = ldap_connect($Bt);
if ($wQ) {
goto ur;
}
echo "\103\157\165\154\144\40\156\x6f\164\x20\x67\145\x74\40\143\157\x6e\156\x65\143\x74\x69\x6f\156";
die;
goto Nh;
ur:
$K4 = get_option("\155\157\x5f\x6c\144\141\160\x5f\154\x6f\x63\x61\154\137\156\145\x77\x5f\x75\163\x65\x72\137\154\157\143\141\x74\x69\157\156");
$bI = "\x63\156\75" . $xU->user_login . "\x2c" . $K4;
$bN = get_option("\x6d\157\x5f\154\144\141\160\137\154\157\x63\x61\x6c\x5f\145\x6d\141\x69\x6c\137\141\164\x74\162\x69\x62\x75\164\x65");
$Ko = get_option("\x6d\x6f\137\154\144\141\160\x5f\154\157\x63\141\x6c\x5f\146\x6e\141\x6d\145\137\x61\164\164\x72\151\142\x75\x74\x65");
$KX = get_option("\x6d\x6f\x5f\x6c\x64\x61\x70\x5f\x6c\157\x63\141\154\x5f\x6c\156\x61\x6d\x65\137\141\164\164\x72\151\x62\165\164\x65");
$PU = get_option("\x6d\x6f\137\154\144\x61\160\x5f\154\x6f\x63\x61\154\137\x6f\142\152\x65\x63\x74\x63\x6c\x61\163\x73\137\x61\x74\164\x72\151\142\x75\x74\x65");
$IE = array();
$IE["\x63\156"] = $xU->user_login;
$IE[$Ko] = $xU->first_name;
$IE[$KX] = $xU->last_name;
$IE[$bN] = $xU->user_email;
$IE["\157\142\x6a\145\143\x74\x43\x6c\x61\x73\163"] = $PU;
ldap_set_option($wQ, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($wQ, LDAP_OPT_REFERRALS, 0);
$Cw = get_option("\155\x6f\137\154\144\141\160\137\154\x6f\143\141\154\137\163\145\162\166\145\x72\137\x64\x6e") ? Mo_Ldap_Local_Util::decrypt(get_option("\x6d\157\137\x6c\144\x61\160\x5f\x6c\x6f\143\x61\x6c\137\163\x65\x72\x76\145\x72\x5f\x64\156")) : '';
$DD = get_option("\155\x6f\x5f\154\x64\x61\160\x5f\x6c\157\143\141\x6c\137\x73\x65\x72\x76\145\162\137\x70\x61\163\x73\x77\157\162\144") ? Mo_Ldap_Local_Util::decrypt(get_option("\x6d\157\x5f\x6c\x64\141\x70\x5f\x6c\157\143\x61\154\x5f\163\145\x72\166\x65\162\x5f\x70\x61\163\163\x77\157\162\144")) : '';
if (!get_option("\x6d\x6f\x5f\x6c\144\x61\x70\x5f\154\x6f\x63\141\154\137\165\163\145\x5f\164\x6c\163")) {
goto zp;
}
ldap_start_tls($wQ);
zp:
$wL = @ldap_bind($wQ, $Cw, $DD);
if ($wL) {
goto sn;
}
echo "\103\157\x75\154\144\x20\x6e\x6f\x74\x20\142\x65\x20\x64\x6f\156\145";
die;
goto ki;
sn:
ldap_add($wQ, $bI, $IE);
ki:
Nh:
}
function test_attribute_configuration($G6)
{
if (Mo_Ldap_Local_Util::is_extension_installed("\x6f\160\145\x6e\x73\x73\x6c")) {
goto lm;
}
return null;
lm:
$r6 = get_option("\x6d\157\x5f\154\x64\x61\x70\137\x6c\157\143\141\x6c\x5f\163\x65\x72\x76\145\x72\137\165\x72\154") ? Mo_Ldap_Local_Util::decrypt(get_option("\x6d\157\137\x6c\144\141\160\137\x6c\157\143\x61\x6c\137\x73\145\x72\x76\x65\x72\x5f\165\162\154")) : '';
$Cw = get_option("\x6d\157\137\x6c\144\x61\x70\137\154\157\x63\x61\x6c\x5f\163\x65\x72\x76\x65\x72\137\x64\156") ? Mo_Ldap_Local_Util::decrypt(get_option("\x6d\157\137\154\144\141\160\137\x6c\x6f\143\x61\x6c\x5f\x73\145\x72\166\x65\162\137\x64\x6e")) : '';
$DD = get_option("\155\157\x5f\154\144\141\160\137\x6c\x6f\x63\x61\x6c\x5f\x73\145\x72\166\x65\x72\137\160\141\163\x73\167\157\162\x64") ? Mo_Ldap_Local_Util::decrypt(get_option("\155\157\x5f\x6c\x64\x61\160\137\154\x6f\143\141\154\x5f\163\x65\162\x76\145\x72\x5f\x70\141\x73\163\167\x6f\162\144")) : '';
$Am = get_option("\x6d\x6f\137\154\144\x61\160\x5f\154\157\x63\x61\154\137\x73\x65\141\x72\x63\150\x5f\142\141\163\145") ? Mo_Ldap_Local_Util::decrypt(get_option("\x6d\x6f\x5f\154\144\x61\160\x5f\x6c\157\143\141\154\x5f\163\145\x61\x72\143\x68\137\142\141\163\x65")) : '';
$Hx = explode("\x3b", $Am);
$Io = get_option("\x6d\157\x5f\x6c\144\141\160\137\x6c\157\143\x61\154\137\163\145\141\162\x63\x68\137\x66\151\x6c\x74\145\x72") ? Mo_Ldap_Local_Util::decrypt(get_option("\155\157\137\154\144\x61\160\x5f\154\157\143\141\x6c\137\x73\145\x61\162\x63\x68\x5f\146\x69\154\164\x65\162")) : '';
$Io = str_replace("\77", $G6, $Io);
$bN = strtolower(get_option("\x6d\157\137\154\x64\x61\x70\x5f\x6c\x6f\x63\x61\x6c\x5f\x65\x6d\141\151\x6c\137\x61\164\164\x72\151\x62\x75\x74\x65"));
$eJ = strtolower(get_option("\155\157\137\x6c\x64\141\160\x5f\154\x6f\x63\141\154\x5f\x70\x68\x6f\156\x65\x5f\x61\x74\x74\162\151\x62\165\164\x65"));
$Al = strtolower(get_option("\x6d\157\137\154\144\x61\160\x5f\x6c\x6f\x63\x61\x6c\x5f\146\x6e\x61\155\145\x5f\141\x74\164\162\x69\x62\165\164\x65"));
$YG = strtolower(get_option("\155\x6f\x5f\x6c\144\141\x70\137\x6c\x6f\143\x61\154\x5f\154\x6e\141\155\x65\137\x61\x74\x74\x72\151\x62\x75\x74\145"));
$La = strtolower(get_option("\155\157\x5f\154\x64\141\x70\x5f\154\x6f\143\141\x6c\137\156\151\143\x6b\x6e\x61\155\x65\x5f\141\x74\x74\162\151\142\165\164\145"));
$Y7 = array($bN, $eJ, $Al, $YG, $La);
$G2 = wp_load_alloptions();
foreach ($G2 as $Zh => $Kq) {
if (strpos($Zh, "\x6d\157\137\x6c\x64\x61\160\x5f\154\157\x63\x61\154\137\143\x75\163\x74\157\155\137\141\x74\x74\162\151\x62\165\164\145\137") === false) {
goto gz;
}
array_push($Y7, $Kq);
goto Hf;
gz:
Hf:
UA:
}
nV:
if (!(version_compare(PHP_VERSION, "\65\56\63\x2e\x30") >= 0)) {
goto y5;
}
ldap_set_option(null, LDAP_OPT_NETWORK_TIMEOUT, 5);
y5:
$wQ = ldap_connect($r6);
if ($wQ) {
goto fQ;
}
$W6 = false;
goto zu;
fQ:
ldap_set_option($wQ, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($wQ, LDAP_OPT_REFERRALS, 0);
if (!get_option("\155\x6f\137\x6c\x64\141\160\137\x6c\x6f\x63\141\154\x5f\x75\x73\x65\x5f\164\x6c\163")) {
goto ax;
}
ldap_start_tls($wQ);
ax:
$BP = @ldap_bind($wQ, $Cw, $DD);
if (!$BP) {
goto re;
}
$GG = 0;
qw:
if (!($GG < sizeof($Hx))) {
goto fJ;
}
if (!ldap_search($wQ, $Hx[$GG], $Io, $Y7)) {
goto k0;
}
$hf = ldap_search($wQ, $Hx[$GG], $Io, $Y7);
k0:
$W6 = ldap_first_entry($wQ, $hf);
$W3 = ldap_get_entries($wQ, $hf);
if ($W6) {
goto j_;
}
goto dx;
j_:
$V6 = ldap_get_dn($wQ, $W6);
goto fJ;
dx:
oV:
$GG++;
goto qw;
fJ:
re:
?>
<style>
table { border-collapse: collapse; width: 100%; }
table, th, td { border: 1px solid black;}
td{padding:5px;}
</style>
<h2>Attribute Mapping Test : </h2>
<div style="font-family:Calibri;padding:0 3%;">
<?php
if (!empty($V6)) {
goto B0;
}
?>
<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;">TEST FAILED</div>
<div style="color: #a94442;font-size:14pt; margin-bottom:20px;">WARNING: Some Attributes Did Not Match.</div>
<div style="display:block;text-align:center;margin-bottom:4%;"><img style="width:15%;"src="<?php
echo plugin_dir_url(__FILE__) . "\151\156\143\154\165\144\x65\163\x2f\x69\x6d\141\x67\x65\x73\57\167\162\157\x6e\147\x2e\x70\156\147";
?>
"/></div>
<?php
goto Ys;
B0:
?>
<div style="color: #3c763d;background-color: #dff0d8; padding:2%;margin-bottom:20px;text-align:center; border:1px solid #AEDB9A; font-size:18pt;">TEST SUCCESSFUL</div>
<div style="display:block;text-align:center;margin-bottom:4%;"><img style="width:15%;"src="<?php
echo plugin_dir_url(__FILE__) . "\x69\156\x63\154\x75\x64\x65\x73\57\x69\x6d\x61\147\x65\163\57\x67\x72\145\145\x6e\x5f\x63\x68\145\143\x6b\56\160\156\147";
?>
"/></div>
<?php
Ys:
?>
<table>
<tr>
<td style='font-weight:bold;border:2px solid #949090;padding:2%;'>User DN</td>
<td style='padding:2%;border:2px solid #949090; word-wrap:break-word;'><?php
echo isset($V6) ? $V6 : "\x3c\x62\x20\163\164\x79\154\x65\x3d\42\143\x6f\154\157\162\72\x72\145\x64\x3b\42\x3e\x4e\x6f\40\163\165\x63\150\40\141\164\x74\x72\151\142\x75\x74\x65\x20\x66\x6f\x75\156\144\56\74\57\142\x3e";
?>
</td>
</tr>
<?php
foreach ($Y7 as $ai) {
?>
<tr>
<td style='font-weight:bold;border:2px solid #949090;padding:2%;'><?php
echo $ai;
?>
</td>
<td style='padding:2%;border:2px solid #949090; word-wrap:break-word;'>
<?php
if (isset($W3[0][$ai][0])) {
goto Lh;
}
echo "\74\x62\40\163\x74\171\154\145\75\x22\x63\x6f\154\157\162\x3a\162\145\144\x3b\x22\x3e\116\157\40\163\165\x63\x68\40\141\x74\x74\x72\x69\x62\165\x74\145\40\x66\x6f\x75\156\x64\56\74\x2f\142\76";
goto Md;
Lh:
if (isset($W3[0][$ai]["\143\157\x75\156\x74"])) {
goto NG;
}
echo $W3[0][$ai][0];
goto RD;
NG:
$GG = 0;
P_:
if (!($GG < $W3[0][$ai]["\x63\157\165\156\x74"])) {
goto wt;
}
echo $W3[0][$ai][$GG] . "\x3c\x62\162\76";
AZ:
$GG++;
goto P_;
wt:
RD:
Md:
?>
</td>
</tr>
<?php
ud:
}
d1:
?>
</table>
<div style="margin:3%;display:block;text-align:center;"><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"/></div>
<?php
die;
zu:
}
function update_password($xU, $zL)
{
if (Mo_Ldap_Local_Util::is_extension_installed("\157\x70\x65\156\x73\x73\x6c")) {
goto Sj;
}
return null;
Sj:
$Bt = get_option("\x6d\x6f\x5f\154\144\141\160\137\154\x6f\143\141\154\137\x73\x65\x72\166\145\x72\137\x75\162\154") ? Mo_Ldap_Local_Util::decrypt(get_option("\x6d\x6f\x5f\154\x64\x61\160\137\154\x6f\143\x61\154\137\x73\x65\x72\166\145\162\137\165\162\x6c")) : '';
if (!(version_compare(PHP_VERSION, "\65\x2e\x33\56\60") >= 0)) {
goto pW;
}
ldap_set_option(null, LDAP_OPT_NETWORK_TIMEOUT, 5);
pW:
$wQ = ldap_connect($Bt);
if (!$wQ) {
goto zW;
}
$Cw = get_option("\x6d\x6f\137\154\144\141\x70\137\154\x6f\x63\x61\154\x5f\x73\145\x72\x76\145\162\137\144\156") ? Mo_Ldap_Local_Util::decrypt(get_option("\155\x6f\x5f\x6c\144\x61\160\x5f\x6c\x6f\143\141\x6c\x5f\163\x65\162\x76\145\162\x5f\x64\x6e")) : '';
$DD = get_option("\155\x6f\x5f\154\144\141\x70\x5f\x6c\157\x63\141\x6c\137\x73\145\162\x76\145\162\137\x70\141\163\x73\x77\157\x72\x64") ? Mo_Ldap_Local_Util::decrypt(get_option("\x6d\157\137\x6c\144\x61\x70\x5f\x6c\157\x63\x61\154\137\163\145\x72\x76\x65\x72\x5f\x70\141\x73\x73\167\157\162\144")) : '';
$ig = get_user_meta($xU->ID, "\x6d\x6f\137\154\144\141\160\137\x75\163\x65\162\x5f\x64\156", true);
if (!get_option("\x6d\157\x5f\154\144\141\160\x5f\154\157\143\x61\154\137\165\x73\145\x5f\x74\154\x73")) {
goto js;
}
ldap_start_tls($wQ);
js:
$wL = @ldap_bind($wQ, $Cw, $DD);
if ($wL) {
goto jb;
}
echo "\103\157\x75\154\144\40\x6e\157\164\40\x62\x65\40\144\x6f\156\x65";
die;
goto An;
jb:
$aQ = null;
$zL = "\42" . $zL . "\x22";
$qj = strlen($zL);
$GG = 0;
EF:
if (!($GG < $qj)) {
goto Ng;
}
$aQ .= "\x5b{$zL[$GG]}\135\0";
RI:
$GG++;
goto EF;
Ng:
$zL = $aQ;
$pM["\165\x6e\x69\143\x6f\x64\145\160\x77\144"] = $zL;
$yO = ldap_mod_replace($wQ, $ig, $pM);
if ($yO) {
goto br;
}
echo "\124\x68\145\x72\145\x20\x77\141\163\40\x61\40\x70\x72\157\142\x6c\145\155\41";
goto SL;
br:
echo "\125\x73\145\162\x20\x6d\x6f\144\x69\x66\151\x65\x64\41";
SL:
die;
An:
zW:
}
function fetch_user_attributes($user)
{
error_log("\146\x65\x74\143\150\137\x75\163\145\x72\x5f\x61\164\x74\162\x69\142\165\164\145\x73\40\142\x61\163\145\40\160\x6c\165\x67\x69\156");
$Am = get_option("\155\157\x5f\154\x64\x61\x70\137\x6c\x6f\143\141\154\137\163\145\x61\x72\143\150\x5f\142\141\163\145") ? Mo_Ldap_Local_Util::decrypt(get_option("\155\157\137\x6c\144\141\x70\137\x6c\x6f\143\141\x6c\137\163\145\141\162\x63\x68\137\142\x61\x73\145")) : '';
$Io = get_option("\x6d\157\x5f\x6c\144\x61\160\137\154\x6f\143\x61\x6c\137\163\145\x61\162\143\x68\137\x66\151\154\164\x65\x72") ? Mo_Ldap_Local_Util::decrypt(get_option("\155\x6f\137\154\x64\x61\160\137\154\x6f\x63\x61\154\137\163\x65\141\162\x63\x68\137\x66\x69\x6c\x74\x65\x72")) : '';
$Io = str_replace("\x3f", $user->user_login, $Io);
$wQ = self::getConnection();
if (!(version_compare(PHP_VERSION, "\65\x2e\63\56\60") >= 0)) {
goto PE;
}
ldap_set_option(null, LDAP_OPT_NETWORK_TIMEOUT, 5);
PE:
ldap_set_option($wQ, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($wQ, LDAP_OPT_REFERRALS, 0);
$Cw = get_option("\x6d\x6f\x5f\154\144\x61\160\x5f\154\x6f\143\141\154\x5f\163\x65\162\x76\145\162\137\x64\156") ? Mo_Ldap_Local_Util::decrypt(get_option("\155\157\x5f\154\144\x61\160\x5f\154\157\143\141\154\x5f\x73\145\162\x76\x65\x72\x5f\x64\x6e")) : '';
$DD = get_option("\x6d\x6f\x5f\x6c\x64\x61\x70\x5f\x6c\x6f\143\141\x6c\x5f\163\x65\162\x76\145\162\137\160\x61\163\x73\167\157\162\144") ? Mo_Ldap_Local_Util::decrypt(get_option("\155\157\x5f\154\144\141\160\x5f\154\157\x63\141\154\x5f\163\x65\x72\x76\145\x72\x5f\160\x61\x73\163\167\x6f\x72\144")) : '';
$wL = @ldap_bind($wQ, $Cw, $DD);
$Ko = strtolower(get_option("\155\x6f\137\154\x64\141\160\x5f\x6c\x6f\x63\x61\x6c\137\x66\156\x61\155\x65\137\141\164\x74\x72\x69\x62\165\x74\x65"));
$KX = strtolower(get_option("\x6d\x6f\137\x6c\x64\141\x70\137\x6c\157\x63\x61\x6c\137\x6c\156\141\x6d\145\137\x61\x74\x74\162\x69\142\165\x74\x65"));
$bN = strtolower(get_option("\x6d\x6f\x5f\x6c\144\141\x70\x5f\154\157\x63\141\x6c\137\145\155\141\x69\154\137\141\x74\164\162\x69\x62\165\164\145"));
$eJ = strtolower(get_option("\x6d\x6f\x5f\154\144\x61\160\137\154\x6f\143\x61\154\137\x70\x68\x6f\156\145\x5f\x61\164\x74\x72\151\142\x75\164\145"));
$La = strtolower(get_option("\x6d\x6f\137\154\144\141\160\137\x6c\x6f\143\141\154\137\156\151\143\x6b\x6e\141\155\145\x5f\x61\164\164\x72\x69\x62\x75\x74\x65"));
$Y7 = array($Ko, $KX, $bN, $La, $eJ);
$G2 = wp_load_alloptions();
foreach ($G2 as $Zh => $Kq) {
if (strpos($Zh, "\155\157\x5f\154\x64\x61\x70\x5f\154\157\x63\x61\154\x5f\x63\x75\x73\x74\x6f\155\137\141\164\164\162\151\142\x75\164\x65\137") === false) {
goto MQ;
}
array_push($Y7, $Kq);
goto K0;
MQ:
K0:
Ii:
}
Z5:
if ($wL) {
goto sb;
}
$zc = "\x43\x6f\x75\x6c\144\x20\156\157\x74\40\x63\x6f\x6e\156\x65\x63\x74\x20\164\x6f\40\x4c\104\101\120";
error_log($zc, "\102\151\x6e\x64\40\105\x52\x52\117\x52" . ldap_errno($wQ));
sb:
$V3 = ldap_search($wQ, $Am, $Io, $Y7);
if ($V3) {
goto R_s;
}
error_log("\x55\163\145\x72\40\x6e\x6f\164\40" . $user->user_login . "\40\x46\157\165\x6e\144\x20\x69\156\40\114\104\101\120");
goto tn3;
R_s:
error_log("\125\x73\145\x72\x20" . $user->user_login . "\40\x46\157\x75\x6e\144\40\151\x6e\x20\114\x44\101\x50\56\x20\x55\160\144\x61\x74\151\156\147\40\x69\x6e\146\157\162\x6d\141\164\x69\157\156");
$W6 = ldap_first_entry($wQ, $V3);
$GR = ldap_get_entries($wQ, $V3);
if (!$W6) {
goto Lr;
}
$Uh = ldap_get_dn($wQ, $W6);
update_user_meta($user->ID, "\x6d\157\x5f\154\x64\141\x70\x5f\165\163\145\x72\x5f\x64\x6e", $Uh, false);
Lr:
remove_all_actions("\x70\162\157\146\151\x6c\x65\x5f\x75\x70\144\x61\164\145");
$IE = array();
$IE["\x49\x44"] = $user->ID;
if (!isset($GR[0]["\147\x69\x76\x65\156\156\x61\155\145"])) {
goto rM;
}
$IE["\146\x69\162\x73\164\x5f\x6e\x61\x6d\145"] = $GR[0]["\x67\x69\166\x65\x6e\x6e\x61\x6d\x65"][0];
rM:
if (!isset($GR[0]["\163\x6e"])) {
goto Jf;
}
$IE["\x6c\141\x73\x74\x5f\156\x61\155\x65"] = $GR[0]["\163\x6e"][0];
Jf:
if (!isset($GR[0]["\155\x61\x69\x6c"])) {
goto wvi;
}
$IE["\x75\163\145\162\x5f\x65\x6d\x61\x69\154"] = $GR[0]["\155\x61\x69\x6c"][0];
wvi:
error_log("\x55\160\144\141\164\145\40\x44\x61\x74\141\40\146\157\162\40\165\163\x65\x72\x20" . $user->user_login . "\x3a" . print_r($IE, TRUE));
$mV = wp_update_user($IE);
if (is_wp_error($mV)) {
goto Bud;
}
error_log("\125\160\x64\141\x74\145\x64\40\125\163\x65\x72\40\x77\151\x74\150\x20\111\104\x3a\x20" . $mV . "\54\40\x75\x73\x65\x72\x6e\141\x6d\145\x3a\x20" . $user->user_login);
goto lEM;
Bud:
$Rh = $mV->get_error_code();
$fp = $mV->get_error_message($Rh);
error_log("\105\162\162\x6f\x72\40\165\x70\x64\x61\x74\151\x6e\147\40\x75\163\145\162\40" . $user->user_login . "\72\x20\x43\x6f\x64\145\x3a\x20" . $Rh . "\72\40\122\145\x61\x73\157\x6e\72\40" . $fp);
lEM:
if (!isset($GR[0][$eJ])) {
goto T5X;
}
update_user_meta($user->ID, "\155\x6f\x5f\154\144\141\160\137\x75\163\145\x72\137\x70\x68\157\x6e\145", $GR[0][$eJ][0]);
T5X:
unset($Y7[0]);
unset($Y7[1]);
unset($Y7[2]);
$hl = array();
foreach ($Y7 as $ai) {
if (isset($GR[0][strtolower($ai)]["\143\157\x75\x6e\164"]) && $GR[0][strtolower($ai)]["\143\157\x75\x6e\x74"] > 1) {
goto y5k;
}
$hl["\x6d\157\137\154\144\141\160\137\x6c\x6f\143\141\x6c\137\143\x75\x73\x74\x6f\155\137\x61\x74\164\162\151\x62\165\164\145\137" . $ai] = $GR[0][strtolower($ai)][0];
goto PPK;
y5k:
$y5 = array();
$GG = 0;
fah:
if (!($GG < $GR[0][strtolower($ai)]["\x63\157\165\156\x74"])) {
goto T6f;
}
array_push($y5, $GR[0][strtolower($ai)][$GG]);
ykZ:
$GG++;
goto fah;
T6f:
$hl["\x6d\157\137\x6c\x64\141\x70\x5f\x6c\x6f\x63\x61\x6c\x5f\x63\x75\x73\164\x6f\x6d\137\x61\164\x74\162\151\142\x75\164\x65\x5f" . $ai] = $y5;
PPK:
OqP:
}
fi5:
$Mh = $hl;
foreach ($Mh as $ai => $Kq) {
update_user_meta($user->ID, $ai, $Kq);
Nu6:
}
R_j:
do_action("\155\x6f\x5f\154\x64\141\160\137\142\x75\x64\144\x79\x70\x72\145\x73\163", $Mh, $user);
do_action("\x6d\157\137\154\x64\141\x70\137\160\x72\x6f\146\x69\x6c\145\x5f\x70\x69\143\164\x75\162\x65\137\x6d\141\x70\x70\151\x6e\147", $user);
tn3:
ldap_close($wQ);
}
}
?>
Function Calls
None |
Stats
MD5 | 2fd9c60f7640e3d36bd1a8fb283ec56a |
Eval Count | 0 |
Decode Time | 79 ms |