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 /** * This file is a part of the miniorange-saml-20-single-sign-on plugin. * ..
Decoded Output download
<?php
/**
* This file is a part of the miniorange-saml-20-single-sign-on plugin.
*
* @link https://plugins.miniorange.com/
* @author miniOrange
* @package miniorange-saml-20-single-sign-on
*/
require_once Mo_Saml_Plugin_Files::MO_SAML_UTILITIES;
require_once Mo_Saml_Plugin_Files::MO_SAML_RESPONSE;
require_once Mo_Saml_Plugin_Files::MO_SAML_LOGOUT_REQUEST;
require_once Mo_Saml_Plugin_Files::MO_SAML_USER_LOGIN_HANDLER;
require_once Mo_Saml_Plugin_Files::MO_SAML_CONFIG_UTILITY;
if (class_exists("AESEncryption")) {
goto Txh;
}
require_once Mo_Saml_Plugin_Files::MO_SAML_ENCRYPTION;
Txh:
require_once Mo_Saml_Plugin_Files::MO_SAML_XML_SEC_LIBS;
use RobRichards\XMLSecLibs\XMLSecurityKey;
use RobRichards\XMLSecLibs\XMLSecurityDSig;
use RobRichards\XMLSecLibs\XMLSecEnc;
use MOSAML\LicenseLibrary\Mo_License_Service;
class Mo_SAML_Login_Widget extends WP_Widget
{
private static $instance;
public function __construct()
{
parent::__construct("Saml_Login_Widget", "Login", array("description" => __("This is a miniOrange SAML login widget.", "mosaml")));
}
public static function mo_saml_get_object()
{
if (isset(self::$instance)) {
goto ZBV;
}
$Fh = __CLASS__;
self::$instance = new $Fh();
ZBV:
return self::$instance;
}
public function widget($hU, $uF)
{
extract($hU);
if (!(isset($uF["wid_title"]) && !empty($uF["wid_title"]))) {
goto Jdg;
}
$r5 = apply_filters("widget_title", $uF["wid_title"]);
Jdg:
echo $hU["before_widget"];
if (empty($r5)) {
goto aHY;
}
echo $hU["before_title"] . $r5 . $hU["after_title"];
aHY:
$this->loginForm();
echo $hU["after_widget"];
}
public function update($cQ, $X5)
{
$uF = array();
$uF["wid_title"] = strip_tags($cQ["wid_title"]);
return $uF;
}
public function form($uF)
{
$r5 = '';
if (empty($uF["wid_title"])) {
goto CCJ;
}
$r5 = $uF["wid_title"];
CCJ:
echo " <p>
\x9\x9 <label for="";
echo esc_attr($this->get_field_id("wid_title"));
echo "">
\xa\x9\x9\x9 ";
esc_html_e("Title:");
echo "\x9\x9 </label>\xd\xa\x9\x9\x9<input class="widefat" id="";
echo esc_attr($this->get_field_id("wid_title"));
echo "" name="";
echo esc_attr($this->get_field_name("wid_title"));
echo "" type="text" value="";
echo esc_attr($r5);
echo "" />
\x9 </p>
\xa \x9";
}
public function loginForm()
{
global $post;
if (Mo_License_Service::is_customer_license_verified()) {
goto cwJ;
}
return;
cwJ:
$X8 = EnvironmentHelper::getCurrentEnvironment();
if (!SAMLSPUtilities::mo_saml_is_user_logged_in()) {
goto Otc;
}
$current_user = wp_get_current_user();
$bL = EnvironmentHelper::getOptionForSelectedEnvironment("saml_identity_providers", true, $X8);
$s8 = get_user_meta($current_user->ID, "mo_saml_logged_in_with_idp", true);
$s8 = isset($_SESSION["mo_guest_login"]["logged_in_idp_name"]) ? $_SESSION["mo_guest_login"]["logged_in_idp_name"] : get_user_meta($current_user->ID, "mo_saml_logged_in_with_idp", true);
if (!empty($s8)) {
goto aSB;
}
$iG = "DEFAULT";
goto To1;
aSB:
$iG = $bL[$s8];
To1:
$fa = "Hello,";
if (empty($iG["custom_greeting_text"])) {
goto zNP;
}
$fa = $iG["custom_greeting_text"];
zNP:
$oP = '';
if (empty($iG["greeting_name"])) {
goto vGj;
}
switch ($iG["greeting_name"]) {
case "USERNAME":
$oP = $current_user->user_login;
goto El9;
case "EMAIL":
$oP = $current_user->user_email;
goto El9;
case "FNAME":
$oP = $current_user->user_firstname;
goto El9;
case "LNAME":
$oP = $current_user->user_lastname;
goto El9;
case "FNAME_LNAME":
$oP = $current_user->user_firstname . " " . $current_user->user_lastname;
goto El9;
case "LNAME_FNAME":
$oP = $current_user->user_lastname . " " . $current_user->user_firstname;
goto El9;
default:
$oP = $current_user->user_login;
}
num:
El9:
vGj:
if (!empty(trim($oP))) {
goto KfP;
}
$oP = $current_user->user_login;
KfP:
$Cs = $fa . " " . $oP;
$hs = "Logout";
if (empty($iG["custom_logout_text"])) {
goto OZj;
}
$hs = $iG["custom_logout_text"];
OZj:
echo esc_attr($Cs) . " | <a href="" . esc_url(wp_logout_url(home_url())) . "" title="logout" >" . esc_attr($hs) . "</a></li>";
$qG = saml_get_current_page_url();
$j4 = new EnvironmentDao($X8);
$j4->mo_save_environment_settings("logout_redirect_url", $qG);
goto YTO;
Otc:
$Iu = saml_get_current_page_url();
$Lf = EnvironmentHelper::getOptionForSelectedEnvironment("saml_identity_providers", true, $X8);
if (!empty($Lf)) {
goto BKr;
}
echo "Please configure the miniOrange SAML Plugin first.";
goto HFj;
BKr:
foreach ($Lf as $s8) {
if (!empty($s8["enable_idp"])) {
goto pyA;
}
goto tmJ;
pyA:
if (!empty($s8["idp_name"])) {
goto j9G;
}
echo "Please configure the miniOrange SAML Plugin first.";
goto KId;
j9G:
$RY = "login_" . $s8["idp_name"];
$UT = "mosubmitsamlform_" . $s8["idp_name"];
echo "<script>
\xa \x9\x9\x9\x9 jQuery( document ).ready(function() {\xd\xa\x9\x9\x9\x9\x9\x9 jQuery("#" . esc_attr($UT) . "").click(function(e) {\xd
\x9\x9 \x9\x9 e.preventDefault();
\xa \x9\x9 \x9jQuery("#" . esc_attr($RY) . "").submit();
\x9\x9 \x9 \x9});
\xa\x9\x9 \x9 \x9});
\xa \x9 </script>\xd\xa \x9 <form name="" . esc_attr($RY) . "" id="" . esc_attr($RY) . "" method="post" action="">
\xa <input type="hidden" name="option" value="saml_user_login" />
\xa\x9\x9\x9\x9 \x9<input type="hidden" name="redirect_to" value="" . esc_url($Iu) . "" />
\x9\x9 \x9<input type="hidden" name="idp" value="" . esc_attr($s8["idp_name"]) . "" />\xd
\x9\x9 <font size="+1" style="vertical-align:top;"> </font>";
$dh = !empty($s8["custom_login_text"]) ? $s8["custom_login_text"] : "Login with " . (!empty($s8["idp_display_name"]) ? $s8["idp_display_name"] : $s8["idp_name"]);
echo "<a href="#" id="" . esc_attr($UT) . "">" . esc_html($dh) . "</a></form>";
KId:
tmJ:
}
rSc:
HFj:
YTO:
}
public function mo_saml_widget_init()
{
if (!(isset($_REQUEST["option"]) and $_REQUEST["option"] == "saml_user_logout")) {
goto m1f;
}
$user = SAMLSPUtilities::mo_saml_is_user_logged_in() ? wp_get_current_user() : null;
if (empty($user)) {
goto ZYH;
}
wp_logout();
ZYH:
m1f:
}
function mo_saml_logout($DQ)
{
if (!(!session_id() || session_id() == '' || empty($_SESSION))) {
goto Joi;
}
session_start();
Joi:
$kD = '';
if (!empty($_SESSION["mo_saml"]["logged_in_with_idp"])) {
goto LyY;
}
if (isset($_SESSION["mo_guest_login"]["logged_in_idp_name"])) {
goto Tfv;
}
return;
goto UFP;
Tfv:
$kD = $_SESSION["mo_guest_login"]["logged_in_idp_name"];
UFP:
goto vhv;
LyY:
$kD = $_SESSION["mo_saml"]["logged_in_with_idp"];
vhv:
SAMLSPUtilities::mo_saml_check_is_extension_installed();
$X8 = EnvironmentHelper::getCurrentEnvironment();
$bL = EnvironmentHelper::getOptionForSelectedEnvironment("saml_identity_providers", true, $X8);
$Y2 = array();
if (empty($bL[$kD])) {
goto dP7;
}
$Y2 = $bL[$kD];
dP7:
if (empty($Y2)) {
goto nOk;
}
$rm = EnvironmentHelper::getOptionForSelectedEnvironment(mo_options_enum_sso_login::Relay_states, true, $X8);
$jw = !empty($rm["logout_relay_state"]) ? $rm["logout_relay_state"] : array();
if (!empty($jw["DEFAULT"]) || !empty($jw[$kD])) {
goto EQd;
}
if (isset($_REQUEST["redirect_to"]) and !empty($_REQUEST["redirect_to"])) {
goto mqH;
}
$Sz = wp_get_referer();
goto Lal;
mqH:
$Sz = $_REQUEST["redirect_to"];
Lal:
if (!empty($Sz)) {
goto auI;
}
$Sz = !empty(EnvironmentHelper::getOptionForSelectedEnvironment("mo_saml_sp_base_url", false, $X8)) ? EnvironmentHelper::getOptionForSelectedEnvironment("mo_saml_sp_base_url", false, $X8) : home_url();
auI:
goto fRs;
EQd:
$Sz = !empty($kD) && !empty($jw[$kD]) ? $jw[$kD] : $jw["DEFAULT"];
fRs:
$sM = $Y2["slo_url"];
$sM = apply_filters("mo_saml_logout_url", $sM, $kD);
$qr = array_key_exists("slo_response_url", $Y2) ? $Y2["slo_response_url"] : '';
if (!empty($sM) || !empty($qr)) {
goto hnD;
}
SAMLSPUtilities::mo_saml_delete_plugin_cookies();
wp_redirect($Sz);
exit;
goto dIq;
hnD:
if (!(!session_id() || session_id() == '' || empty($_SESSION))) {
goto yRS;
}
session_start();
yRS:
$Ox = $Y2["slo_binding_type"];
if (empty($_SESSION["mo_saml_logout_request"])) {
goto DJ4;
}
self::createLogoutResponseAndRedirect($sM, $qr, $Ox, $Y2, $Sz);
exit;
DJ4:
if (empty($sM)) {
goto irl;
}
$user = get_user_by("id", $DQ);
$current_user = $user;
if (isset($_SESSION["mo_guest_login"]["nameID"])) {
goto W3y;
}
if (isset($_COOKIE["nameID"])) {
goto pWu;
}
$Ts = get_user_meta($current_user->ID, "mo_saml_name_id");
delete_user_meta($current_user->ID, "mo_saml_name_id");
goto YbM;
W3y:
$Ts = $_SESSION["mo_guest_login"]["nameID"];
goto YbM;
pWu:
$Ts = $_COOKIE["nameID"];
YbM:
if (empty($Ts)) {
goto tzw;
}
SAMLSPUtilities::mo_saml_delete_plugin_cookies();
tzw:
$gH = EnvironmentHelper::getOptionForSelectedEnvironment("mo_saml_sp_base_url", false, $X8);
if (!empty($gH)) {
goto tWC;
}
$gH = network_home_url();
tWC:
if (!(substr($gH, -1) == "/")) {
goto XKL;
}
$gH = substr($gH, 0, -1);
XKL:
if (!empty($Y2["saml_sp_entity_id"])) {
goto g3O;
}
$Rt = EnvironmentHelper::getOptionForSelectedEnvironment("mo_saml_sp_entity_id", false, $X8);
if (!empty($Rt)) {
goto c0g;
}
$Rt = $gH . "/wp-content/plugins/miniorange-saml-20-single-sign-on/";
c0g:
goto yzK;
g3O:
$Rt = $Y2["saml_sp_entity_id"];
yzK:
$CT = $sM;
$D6 = $Y2["nameid_format"];
$Sz = parse_url($Sz, PHP_URL_PATH);
$Sz = empty($Sz) ? "/" : $Sz;
if (isset($_SESSION["mo_guest_login"]["sessionIndex"])) {
goto J_i;
}
if (isset($_COOKIE["sessionIndex"])) {
goto ZmT;
}
$gz = get_user_meta($current_user->ID, "mo_saml_session_index");
delete_user_meta($current_user->ID, "mo_saml_session_index");
goto h12;
J_i:
$gz = $_SESSION["mo_guest_login"]["sessionIndex"];
goto h12;
ZmT:
$gz = $_COOKIE["sessionIndex"];
h12:
$DN = SAMLSPUtilities::createLogoutRequest($Ts, $Rt, $CT, $Ox, $gz, $D6);
$u_ = $Y2["request_signed"];
if (empty($Ox) || $Ox == "HttpRedirect") {
goto Pb0;
}
if (!($u_ == "unchecked")) {
goto ie8;
}
$TC = base64_encode($DN);
SAMLSPUtilities::postSAMLRequest($sM, $TC, $Sz);
exit;
ie8:
$TC = SAMLSPUtilities::signXML($DN, $Y2, "NameID");
SAMLSPUtilities::postSAMLRequest($sM, $TC, $Sz);
goto fBs;
Pb0:
$So = $sM;
if (strpos($sM, "?") !== false) {
goto aZx;
}
$So .= "?";
goto Sk_;
aZx:
$So .= "&";
Sk_:
if (!($u_ == "unchecked")) {
goto QSy;
}
$So .= "SAMLRequest=" . $DN . "&RelayState=" . urlencode($Sz);
header("cache-control: max-age=0, private, no-store, no-cache, must-revalidate");
header("Location: " . $So);
exit;
QSy:
$DN = "SAMLRequest=" . $DN . "&RelayState=" . urlencode($Sz) . "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA256);
$uN = array("type" => "private");
$Fx = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, $uN);
$UG = mo_saml_get_sp_private_key_for_idp($Y2);
$Fx->loadKey($UG, false);
$zH = new XMLSecurityDSig();
$oL = $Fx->signData($DN);
$oL = base64_encode($oL);
$So .= $DN . "&Signature=" . urlencode($oL);
header("cache-control: max-age=0, private, no-store, no-cache, must-revalidate");
header("Location: " . $So);
exit;
fBs:
irl:
dIq:
nOk:
}
function createLogoutResponseAndRedirect($sM, $qr, $Ox, $Y2, $jw)
{
if (empty($qr)) {
goto KEx;
}
$sM = $qr;
KEx:
$X8 = EnvironmentHelper::getCurrentEnvironment();
$gH = EnvironmentHelper::getOptionForSelectedEnvironment("mo_saml_sp_base_url", false, $X8);
if (!empty($gH)) {
goto Zga;
}
$gH = home_url();
Zga:
$WF = $_SESSION["mo_saml_logout_request"];
$iN = !empty($jw) ? $jw : $_SESSION["mo_saml_logout_relay_state"];
$u_ = $Y2["request_signed"];
if (!empty($iN) && (filter_var($iN, FILTER_VALIDATE_URL) || parse_url(home_url(), PHP_URL_HOST) === parse_url($iN, PHP_URL_HOST))) {
goto fDs;
}
wp_redirect($gH);
goto OmF;
fDs:
wp_redirect($iN);
OmF:
unset($_SESSION["mo_saml_logout_request"]);
unset($_SESSION["mo_saml_logout_relay_state"]);
SAMLSPUtilities::mo_saml_delete_plugin_cookies();
$tw = SAMLSPUtilities::mo_saml_safe_load_xml($WF, Mo_Saml_Error_Codes::$error_codes["WPSAMLERR025"]);
$WF = $tw->firstChild;
if (!($WF->localName == "LogoutRequest")) {
goto L1X;
}
$Sc = new SAML2_LogoutRequest($WF);
$hJ = EnvironmentHelper::getOptionForSelectedEnvironment("mo_saml_sp_entity_id", false, $X8);
if (!empty($hJ)) {
goto vnq;
}
$hJ = $gH . "/wp-content/plugins/miniorange-saml-20-single-sign-on/";
vnq:
$hJ = !empty($Y2["saml_sp_entity_id"]) ? $Y2["saml_sp_entity_id"] : $hJ;
$CT = $sM;
$m_ = SAMLSPUtilities::createLogoutResponse($Sc->getId(), $hJ, $CT, $Ox);
if (empty($Ox) || $Ox == "HttpRedirect") {
goto o2T;
}
if (!($u_ == "unchecked")) {
goto mE2;
}
$TC = base64_encode($m_);
SAMLSPUtilities::postSAMLResponse($sM, $TC, $iN);
exit;
mE2:
$TC = SAMLSPUtilities::signXML($m_, $Y2, "Status");
SAMLSPUtilities::postSAMLResponse($sM, $TC, $iN);
goto VqC;
o2T:
$So = $sM;
if (strpos($sM, "?") !== false) {
goto FVZ;
}
$So .= "?";
goto xG4;
FVZ:
$So .= "&";
xG4:
if (!($u_ == "unchecked")) {
goto oNQ;
}
$So .= "SAMLResponse=" . $m_ . "&RelayState=" . urlencode($iN);
header("Location: " . $So);
exit;
oNQ:
$So .= "SAMLResponse=" . $m_ . "&RelayState=" . urlencode($iN);
header("Location: " . $So);
exit;
VqC:
L1X:
}
}
function mo_login_validate()
{
if (Mo_License_Service::is_customer_license_verified()) {
goto n4A;
}
return;
n4A:
if (!(isset($_REQUEST["option"]) && in_array($_REQUEST["option"], Mo_Saml_Plugin_Setting_Options::getConstants()))) {
goto gVh;
}
SAMLSPUtilities::mo_saml_check_is_extension_installed();
gVh:
if (!(!empty($_REQUEST["option"]) && $_REQUEST["option"] == "mosaml_metadata" && Mo_License_Service::is_customer_license_valid())) {
goto UJi;
}
miniorange_generate_metadata();
UJi:
if (!(!empty($_REQUEST["option"]) && $_REQUEST["option"] == "export_configuration" && check_admin_referer("export_Configuration"))) {
goto WZE;
}
if (!(current_user_can("manage_options") && Mo_License_Service::is_customer_license_valid())) {
goto ZXx;
}
miniorange_import_export(true);
ZXx:
exit;
WZE:
if (mo_saml_is_sp_configured()) {
goto ebF;
}
return;
ebF:
$X8 = EnvironmentHelper::getCurrentEnvironment();
$rm = EnvironmentHelper::getOptionForSelectedEnvironment(mo_options_enum_sso_login::Relay_states, true, $X8);
$SQ = !empty($rm["login_relay_state"]) ? $rm["login_relay_state"] : array();
if (!(!empty($_REQUEST["option"]) && ("saml_user_login" === $_REQUEST["option"] || "testConfig" === $_REQUEST["option"]))) {
goto V9y;
}
if (!(SAMLSPUtilities::mo_saml_is_user_logged_in() && $_REQUEST["option"] != "testConfig")) {
goto ufV;
}
return;
ufV:
if (!("checked" === get_option("mo_enable_multiple_licenses") && !EnvironmentHelper::isSelectedEnvironmentDefault() && $_REQUEST["option"] === "testConfig")) {
goto jXv;
}
$zb = EnvironmentHelper::getSelectedEnvironment();
$qG = admin_url("/admin-ajax.php");
echo "<div style="font-family:Calibri;padding:0 3%;">\xd
<div style="color: #a94442;display:block;text-align:center;margin-bottom:4%;font-size:14pt;">
<img style="width:15%;"src="" . esc_url(SAMLSPUtilities::mo_saml_get_plugin_base_url()) . "images/wrong.webp"><br><br>
<b>Test configuration failed: Operation not supported</b>
\xa </div>\xd
<div style="margin-bottom:20px;">
<p>\xd\xa You have selected the <b>" . esc_html($zb) . "</b> environment which is not your current environment. As per the SAML protocol you can only perform test configuration for an environment after you migrate to it.<br><br>\xd\xa <b>Note:</b> You can test the configurations for your current environment (<b>" . esc_html($X8) . "</b>) after switching to it in the plugin. If you wish to do so please click on the Select Current Environment button below and click on Test Configuration for your IDP.\xd
</p>\xd\xa </div>\xd\xa <div style="display: flex; justify-content: center;">\xd\xa <input type="button" style="padding:1%;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;" value="Select Current Environment" onclick="submitSelectEnvironmentForm();"/>  
<input type="button" 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;" value="Close" onclick="self.close();"/>
</div>\xd\xa </div>\xd\xa <script>
function submitSelectEnvironmentForm(){
\xa var url = "" . esc_url($qG) . "";
var formData = new FormData();
formData.append("action", "mo_saml_change_environment");
\xa
fetch(url, {
method: "POST",
\xa body: formData
})
\xa .then(response => {
if (response.ok) {\xd
if (window.opener) {\xd\xa window.opener.location.reload();\xd
}
self.close();\xd
}\xd
})
\xa .catch(error => {\xd\xa console.error("Network error:", error);\xd\xa });\xd
}\xd
</script>";
exit;
jXv:
if (!mo_saml_is_sp_configured($X8)) {
goto Z7H;
}
SAMLSPUtilities::mo_saml_disable_extra_idps($X8);
$Lf = EnvironmentHelper::getOptionForSelectedEnvironment("saml_identity_providers", true, $X8);
$bL = array_change_key_case($Lf, CASE_LOWER);
if (!empty($_REQUEST["idp"])) {
goto KzM;
}
if (!empty(EnvironmentHelper::getOptionForSelectedEnvironment("saml_default_idp", false, $X8))) {
goto aVv;
}
goto t_1;
KzM:
$Oj = strtolower($_REQUEST["idp"]);
goto t_1;
aVv:
$Oj = strtolower(EnvironmentHelper::getOptionForSelectedEnvironment("saml_default_idp", false, $X8));
t_1:
if (!empty($Oj) && !empty($bL[$Oj])) {
goto R3Y;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR036"]);
goto VG1;
R3Y:
$s8 = $bL[$Oj];
VG1:
if (empty($_REQUEST["entityID"])) {
goto mPG;
}
$kD = getIdpNameFromEntityId($Lf, $_REQUEST["entityID"]);
if ($kD) {
goto yqn;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR036"]);
yqn:
$s8 = $Lf[$kD];
mPG:
if (!empty($s8["enable_idp"])) {
goto D4k;
}
if (!($_REQUEST["option"] === "saml_user_login")) {
goto vm1;
}
throw new Mo_SAML_IDP_Status_Inactive_Exception("IDP Not Enabled.");
vm1:
D4k:
$gH = EnvironmentHelper::getOptionForSelectedEnvironment("mo_saml_sp_base_url", false, $X8);
if (!empty($gH)) {
goto IV0;
}
$gH = home_url();
IV0:
if ($_REQUEST["option"] == "testConfig" and !empty($_REQUEST["newcert"])) {
goto SQD;
}
if ($_REQUEST["option"] == "testConfig") {
goto SFr;
}
if (!empty($SQ["DEFAULT"]) || !empty($_REQUEST["idp"]) && !empty($SQ[$_REQUEST["idp"]])) {
goto skX;
}
if (!empty($_REQUEST["redirect_to"])) {
goto Tf3;
}
$Sz = saml_get_referer_page_url();
goto MC8;
SQD:
$Sz = "testNewCertificate";
goto MC8;
SFr:
if (!(!is_user_logged_in() || !current_user_can("manage_options"))) {
goto Jik;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR038"]);
Jik:
$Sz = "testValidate";
goto MC8;
skX:
$Dt = !empty($_REQUEST["idp"]) ? sanitize_text_field(wp_unslash($_REQUEST["idp"])) : '';
$Sz = !empty($Dt) && !empty($SQ[$Dt]) ? $SQ[$Dt] : $SQ["DEFAULT"];
goto MC8;
Tf3:
$Sz = $_REQUEST["redirect_to"];
MC8:
if (empty($Sz)) {
goto ODR;
}
$GA = parse_url($Sz, PHP_URL_PATH);
ODR:
$GA = empty($GA) ? "/" : $GA;
if (empty($Sz)) {
goto QBU;
}
$kN = parse_url($Sz, PHP_URL_QUERY);
QBU:
if (!empty($kN)) {
goto Alf;
}
$Sz = $GA;
goto YI3;
Alf:
$Sz = $GA . "?" . $kN;
YI3:
$lg = $s8["sso_url"];
$lg = apply_filters("mo_saml_sso_url", $lg, $s8["idp_name"]);
$u_ = $s8["request_signed"];
$hD = $s8["sso_binding_type"];
$eV = EnvironmentHelper::getOptionForSelectedEnvironment("mo_saml_force_authentication", false, $X8);
$wv = $gH . "/";
$hJ = EnvironmentHelper::getOptionForSelectedEnvironment("mo_saml_sp_entity_id", false, $X8);
$D6 = $s8["nameid_format"];
if (!empty($D6)) {
goto G87;
}
$D6 = "1.1:nameid-format:unspecified";
G87:
if (!empty($hJ)) {
goto XyT;
}
$hJ = $gH . "/wp-content/plugins/miniorange-saml-20-single-sign-on/";
XyT:
$hJ = !empty($s8["saml_sp_entity_id"]) ? $s8["saml_sp_entity_id"] : $hJ;
$He = !empty($_POST["uname_email"]) ? $_POST["uname_email"] : false;
if (!$He) {
goto nuG;
}
$DQ = email_exists($He);
if (!($DQ == false)) {
goto Y4k;
}
$He = false;
update_site_option("mo_saml_shortcode_message", "User does not Exists");
return;
Y4k:
nuG:
$DN = SAMLSPUtilities::createAuthnRequest($wv, $hJ, $lg, $s8, $eV, $hD, $D6);
$GB = SAMLSPUtilities::mo_saml_sanitize_associative_array($_REQUEST);
if (empty($hD) || $hD == "HttpRedirect") {
goto Eyi;
}
if (!($u_ == "unchecked")) {
goto mXR;
}
$TC = base64_encode($DN);
SAMLSPUtilities::postSAMLRequest($lg, $TC, $Sz, $GB, $He);
exit;
mXR:
if ($_REQUEST["option"] == "testidpconfig" && $_REQUEST["newcert"] == true) {
goto Hd4;
}
$TC = SAMLSPUtilities::signXML($DN, $s8, "NameIDPolicy");
goto LrC;
Hd4:
$TC = SAMLSPUtilities::signXML($DN, $s8, "NameIDPolicy", true);
LrC:
SAMLSPUtilities::postSAMLRequest($lg, $TC, $Sz, $GB, $He);
goto o0O;
Eyi:
$So = $lg;
if (strpos($lg, "?") !== false) {
goto AAT;
}
$So .= "?";
goto ISE;
AAT:
$So .= "&";
ISE:
if (!($u_ == "unchecked")) {
goto xZ2;
}
$So .= "SAMLRequest=" . $DN . SAMLSPUtilities::mo_saml_append_params_redirect_binding($GB) . "&RelayState=" . urlencode($Sz);
if (!$He) {
goto thZ;
}
$So .= "&Email=" . urlencode($He);
thZ:
header("cache-control: max-age=0, private, no-store, no-cache, must-revalidate");
header("Location: " . $So);
exit;
xZ2:
$DN = "SAMLRequest=" . $DN . "&RelayState=" . urlencode($Sz) . "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA256);
$uN = array("type" => "private");
$Fx = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, $uN);
if ($_REQUEST["option"] == "testidpconfig" && $_REQUEST["newcert"] == true) {
goto cc9;
}
$UG = mo_saml_get_sp_private_key_for_idp($s8);
goto DLr;
cc9:
$UG = file_get_contents(plugin_dir_path(__FILE__) . "resources" . DIRECTORY_SEPARATOR . mo_options_enum_default_sp_certificate::SP_PRIVATE_KEY_FILE_NAME);
DLr:
$Fx->loadKey($UG, false);
$zH = new XMLSecurityDSig();
$oL = $Fx->signData($DN);
$oL = base64_encode($oL);
$So .= $DN . "&Signature=" . urlencode($oL) . SAMLSPUtilities::mo_saml_append_params_redirect_binding($GB);
if (!$He) {
goto hDi;
}
$So .= "&Email=" . urlencode($He);
hDi:
header("cache-control: max-age=0, private, no-store, no-cache, must-revalidate");
header("Location: " . $So);
exit;
o0O:
Z7H:
V9y:
if (empty($_REQUEST["SAMLResponse"])) {
goto As_;
}
SAMLSPUtilities::mo_saml_check_is_extension_installed();
$gH = EnvironmentHelper::getOptionForSelectedEnvironment("mo_saml_sp_base_url", false, $X8);
if (!empty($gH)) {
goto Uf8;
}
$gH = home_url();
Uf8:
$Gc = htmlspecialchars($_REQUEST["SAMLResponse"]);
$Gc = SAMLSPUtilities::validate_compressed_xml($Gc, "SAMLResponse");
$tw = SAMLSPUtilities::mo_saml_safe_load_xml($Gc, Mo_Saml_Error_Codes::$error_codes["WPSAMLERR017"]);
$Ly = $tw->firstChild;
$bH = $tw->documentElement;
$In = new DOMXpath($tw);
$In->registerNamespace("samlp", "urn:oasis:names:tc:SAML:2.0:protocol");
$In->registerNamespace("saml", "urn:oasis:names:tc:SAML:2.0:assertion");
if ($Ly->localName == "LogoutResponse") {
goto v3W;
}
$ZN = $In->query("/samlp:Response/samlp:Status/samlp:StatusCode", $bH);
$F3 = !empty($ZN) ? $ZN->item(0)->getAttribute("Value") : '';
$lS = explode(":", $F3);
if (empty($lS[7])) {
goto Vsj;
}
$ZN = $lS[7];
Vsj:
$Mn = $In->query("/samlp:Response/samlp:Status/samlp:StatusMessage", $bH);
$cW = !empty($Mn) ? $Mn->item(0) : '';
if (empty($cW)) {
goto k1G;
}
$cW = $cW->nodeValue;
k1G:
$bL = EnvironmentHelper::getOptionForSelectedEnvironment("saml_identity_providers", true, $X8);
if (!empty($_REQUEST["RelayState"]) && $_REQUEST["RelayState"] != "/") {
goto KDd;
}
$T9 = saml_get_current_page_url();
goto LNC;
KDd:
$T9 = $_REQUEST["RelayState"];
LNC:
$K2 = array("saml_response" => base64_encode($Gc));
$Gc = new SAML2_Response($Ly, get_option("mo_saml_current_cert_private_key"));
SAMLSPUtilities::mo_saml_check_saml_response_for_replay_attack($Gc);
if (!(SAMLSPUtilities::mo_saml_is_user_logged_in() && "testValidate" != $T9)) {
goto dZk;
}
return;
dZk:
$tV = $Gc->getIssuer();
$Ub = null;
if (empty($bL)) {
goto ldj;
}
foreach ($bL as $Fx => $QB) {
if (!($QB["idp_entity_id"] == $tV)) {
goto uzG;
}
$Ub = $bL[$Fx];
goto deS;
uzG:
jDv:
}
deS:
ldj:
if (!($Ub == null)) {
goto jLp;
}
$Ub = apply_filters("mo_saml_filter_identity_providers", $bL, $tV);
jLp:
if (SAMLSPUtilities::mo_saml_validate_idp($Ub, $bL)) {
goto Ac2;
}
if ($T9 == "testValidate" or $T9 == "testNewCertificate") {
goto pW4;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR010"]);
goto d4N;
pW4:
$AC = mo_options_error_constants::Error_issuer_not_verified;
$AH = mo_options_error_constants::Cause_issuer_not_verified;
$tQ = "<p><strong>Entity ID found in SAML Response: </strong><font face="Courier New";font-size:10pt><br><br>" . esc_html($tV) . "</p></font>";
Mo_Saml_Error_Message::mo_saml_display_test_config_error(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR010"], $tQ);
mo_saml_download_logs($AC, $AH);
exit;
d4N:
Ac2:
if (!($ZN != "Success")) {
goto lY9;
}
show_status_error($ZN, $T9, $cW, $Ub);
lY9:
$kD = '';
if ($T9 == "testNewCertificate") {
goto gYV;
}
$Yq = mo_saml_get_sp_private_key_for_idp($Ub);
goto qhQ;
gYV:
$Yq = file_get_contents(plugin_dir_path(__FILE__) . "resources" . DIRECTORY_SEPARATOR . mo_options_enum_default_sp_certificate::SP_PRIVATE_KEY_FILE_NAME);
qhQ:
$Gc->parseAssertions($Ly, $Yq);
$n8 = $Gc->getSignatureData();
$WG = current($Gc->getAssertions())->getSignatureData();
if (is_null($Ub)) {
goto eVP;
}
$kD = $Ub["idp_name"];
$bL[$kD] = SAMLSPUtilities::mo_saml_array_merge($bL[$kD], $K2);
$bL = array_filter($bL, "filter_empty_values");
$j4 = new EnvironmentDao($X8);
$j4->mo_save_environment_settings("saml_identity_providers", $bL, false);
eVP:
SAMLSPUtilities::mo_saml_disable_extra_idps($X8);
$Jk = EnvironmentHelper::getOptionForSelectedEnvironment("mo_saml_enabled_idps", true, $X8);
if (array_key_exists($kD, $Jk)) {
goto BqD;
}
if (!($T9 != "testValidate" && $T9 != "testNewCertificate")) {
goto BI_;
}
throw new Mo_SAML_IDP_Status_Inactive_Exception("IDP Not Enabled.");
BI_:
BqD:
if (!(empty($WG) && empty($n8))) {
goto xD_;
}
if ($T9 == "testValidate" or $T9 == "testNewCertificate") {
goto wOn;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR003"]);
goto TYK;
wOn:
Mo_Saml_Error_Message::mo_saml_display_test_config_error(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR003"]);
TYK:
xD_:
$Mo = maybe_unserialize($Ub["x509_certificate"]);
$wv = $gH . "/";
if (is_array($Mo)) {
goto BxR;
}
$Uu = XMLSecurityKey::getRawThumbprint($Mo);
$Uu = mo_saml_convert_to_windows_iconv($Uu, $Ub);
$Uu = preg_replace("/\s+/", '', $Uu);
if (empty($n8)) {
goto drf;
}
$F5 = SAMLSPUtilities::processResponse($wv, $Uu, $n8, $Gc, $Mo, $T9);
drf:
if (empty($WG)) {
goto Jr8;
}
$F5 = SAMLSPUtilities::processResponse($wv, $Uu, $WG, $Gc, $Mo, $T9);
Jr8:
goto VK7;
BxR:
foreach ($Mo as $Gr => $sz) {
$Uu = XMLSecurityKey::getRawThumbprint(SAMLSPUtilities::sanitize_certificate($sz));
$Uu = mo_saml_convert_to_windows_iconv($Uu, $Ub);
$Uu = preg_replace("/\s+/", '', $Uu);
if (empty($n8)) {
goto MEn;
}
$F5 = SAMLSPUtilities::processResponse($wv, $Uu, $n8, $Gc, $sz, $T9);
MEn:
if (empty($WG)) {
goto zRX;
}
$F5 = SAMLSPUtilities::processResponse($wv, $Uu, $WG, $Gc, $sz, $T9);
zRX:
if (!$F5) {
goto sTr;
}
goto S0P;
sTr:
o0I:
}
S0P:
VK7:
if (!(empty($WG) && empty($n8))) {
goto ZA9;
}
echo "No signature found in SAML Response or Assertion. Please sign at least one of them.";
exit;
ZA9:
if ($n8) {
goto tXv;
}
if ($WG) {
goto uKi;
}
goto rqA;
tXv:
if (!(count($n8["Certificates"]) > 0)) {
goto M7s;
}
$yy = $n8["Certificates"][0];
M7s:
goto rqA;
uKi:
if (!(count($WG["Certificates"]) > 0)) {
goto rZr;
}
$yy = $WG["Certificates"][0];
rZr:
rqA:
if ($F5) {
goto OiT;
}
if ($T9 == "testValidate" or $T9 == "testNewCertificate") {
goto m4O;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR004"]);
goto iNu;
m4O:
$nZ = "-----BEGIN CERTIFICATE-----<br>" . chunk_split($yy, 64) . "<br>-----END CERTIFICATE-----";
$tQ = "<p><strong>Certificate found in SAML Response: </strong><font face="Courier New";font-size:10pt><br><br>" . $nZ . "</p></font>";
Mo_Saml_Error_Message::mo_saml_display_test_config_error(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR004"], $tQ);
iNu:
OiT:
$hJ = EnvironmentHelper::getOptionForSelectedEnvironment("mo_saml_sp_entity_id", false, $X8);
if (!empty($hJ)) {
goto ReQ;
}
$hJ = $gH . "/wp-content/plugins/miniorange-saml-20-single-sign-on/";
ReQ:
$hJ = !empty($Ub["saml_sp_entity_id"]) ? $Ub["saml_sp_entity_id"] : $hJ;
$Rt = current($Gc->getAssertions())->getIssuer();
SAMLSPUtilities::validateIssuerAndAudience($Gc, $hJ, $Rt, $T9, $kD);
$VX = sanitize_text_field(current(current($Gc->getAssertions())->getNameId()));
if (!empty($VX)) {
goto ED7;
}
if ($T9 === "testValidate" or $T9 === "testNewCertificate") {
goto HWR;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR002"]);
goto pIH;
HWR:
Mo_Saml_Error_Message::mo_saml_display_test_config_error(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR002"]);
pIH:
ED7:
$P3 = current($Gc->getAssertions())->getAttributes();
if (empty($P3)) {
goto SdE;
}
$P3 = map_deep($P3, "sanitize_text_field");
SdE:
$P3["NameID"] = array("0" => $VX);
$gz = current($Gc->getAssertions())->getSessionIndex();
mo_saml_checkMapping($Ub, $P3, wp_specialchars_decode($T9), $gz);
goto pYm;
v3W:
if (empty($_REQUEST["RelayState"])) {
goto RlG;
}
$iN = $_REQUEST["RelayState"];
RlG:
if (!SAMLSPUtilities::mo_saml_is_user_logged_in()) {
goto fPO;
}
wp_destroy_current_session();
wp_clear_auth_cookie();
wp_set_current_user(0);
fPO:
if (!empty($iN)) {
goto kep;
}
$iN = home_url();
kep:
header("Location: " . $iN);
exit;
pYm:
As_:
if (empty($_REQUEST["SAMLRequest"])) {
goto QlS;
}
SAMLSPUtilities::mo_saml_check_is_extension_installed();
$DN = $_REQUEST["SAMLRequest"];
$T9 = "/";
if (empty($_REQUEST["RelayState"])) {
goto NtM;
}
$T9 = $_REQUEST["RelayState"];
NtM:
$DN = htmlspecialchars($_REQUEST["SAMLRequest"]);
$DN = SAMLSPUtilities::validate_compressed_xml($DN, "SAMLRequest");
$tw = SAMLSPUtilities::mo_saml_safe_load_xml($DN, Mo_Saml_Error_Codes::$error_codes["WPSAMLERR028"]);
$fu = $tw->firstChild;
if (!($fu->localName == "LogoutRequest")) {
goto jmD;
}
$Sc = new SAML2_LogoutRequest($fu);
if (!(!session_id() || session_id() == '' || empty($_SESSION))) {
goto dgf;
}
session_start();
dgf:
$_SESSION["mo_saml_logout_request"] = $DN;
$_SESSION["mo_saml_logout_relay_state"] = $T9;
wp_logout();
jmD:
QlS:
}
function getIdpNameFromEntityId($bL, $Jz)
{
if (!(!empty($bL) and is_array($bL))) {
goto qx3;
}
foreach ($bL as $s8) {
if (!($s8["idp_entity_id"] == $Jz)) {
goto WgA;
}
return $s8["idp_name"];
WgA:
cID:
}
V_z:
qx3:
return false;
}
function mo_saml_checkMapping($Ub, $P3, $T9, $gz)
{
$X8 = EnvironmentHelper::getCurrentEnvironment();
$kD = $Ub["idp_name"];
$Jb = Mo_SAML_Config_Utility::mo_saml_check_if_idp_configurations_configured($kD, "attribute_mapping", $X8) ? $kD : "DEFAULT";
$jm = Mo_SAML_Config_Utility::mo_saml_get_attr_configurations($Jb, $X8);
$y6 = !empty($jm["username"]) ? $jm["username"] : "NameID";
$rr = !empty($jm["email"]) ? $jm["email"] : "NameID";
$SY = !empty($jm["first_name"]) ? $jm["first_name"] : '';
$Mp = !empty($jm["last_name"]) ? $jm["last_name"] : '';
$DX = !empty($jm["nick_name"]) ? $jm["nick_name"] : '';
$IY = !empty($jm["display_name"]) ? $jm["display_name"] : '';
$kT = !empty($P3[$y6][0]) ? $P3[$y6][0] : '';
$t6 = !empty($P3[$rr][0]) ? $P3[$rr][0] : '';
$Oa = !empty($P3[$SY][0]) ? $P3[$SY][0] : '';
$f1 = !empty($P3[$Mp][0]) ? $P3[$Mp][0] : '';
$xf = !empty($P3[$DX][0]) ? $P3[$DX][0] : '';
if (!empty($kT)) {
goto w8N;
}
if ($T9 === "testValidate" or $T9 === "testNewCertificate") {
goto Rfe;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR037"]);
goto z3w;
Rfe:
Mo_Saml_Error_Message::mo_saml_display_test_config_error(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR037"]);
z3w:
w8N:
if (!empty($t6)) {
goto RBV;
}
if ($T9 === "testValidate" or $T9 === "testNewCertificate") {
goto pqb;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR037"]);
goto VAp;
pqb:
Mo_Saml_Error_Message::mo_saml_display_test_config_error(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR037"]);
VAp:
RBV:
if ($T9 == "testValidate" || $T9 == "testNewCertificate") {
goto D2v;
}
mo_saml_login_user($kT, $t6, $Oa, $f1, $xf, $IY, $T9, $Ub, $gz, $P3);
goto po3;
D2v:
if (Mo_License_Service::is_customer_license_valid()) {
goto ogi;
}
throw new Mo_SAML_Invalid_License_Exception("Invalid License");
ogi:
$bL = EnvironmentHelper::getOptionForSelectedEnvironment("saml_identity_providers", true, $X8);
$RN = $Ub["idp_name"];
$K2 = array("test_status" => "Test successful");
if (empty($RN)) {
goto wiL;
}
$bL[$RN] = SAMLSPUtilities::mo_saml_array_merge($bL[$RN], $K2);
$bL = array_filter($bL, "filter_empty_values");
$j4 = new EnvironmentDao($X8);
$j4->mo_save_environment_settings("saml_identity_providers", $bL, false);
wiL:
mo_saml_show_test_result($t6, $P3, $Ub);
po3:
}
function mo_saml_show_test_result($r3, $P3, $Ub)
{
ob_end_clean();
echo "<div style="font-family:Calibri;padding:0 3%;">";
$RN = $Ub["idp_name"];
$X8 = EnvironmentHelper::getCurrentEnvironment();
if (!empty($r3)) {
goto hB6;
}
echo "<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>
\x9\x9\x9\x9<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="" . esc_url(SAMLSPUtilities::mo_saml_get_plugin_base_url()) . "images/wrong.webp"></div>";
goto lbq;
hB6:
$x1 = EnvironmentHelper::getOptionForSelectedEnvironment("mo_saml_test_config_attrs", true, $X8);
if (empty($Ub)) {
goto yu6;
}
$gL = array($RN => $P3);
$x1 = SAMLSPUtilities::mo_saml_array_merge($x1, $gL);
$j4 = new EnvironmentDao($X8);
$j4->mo_save_environment_settings("mo_saml_test_config_attrs", $x1, false);
yu6:
echo "<div style="color: #3c763d;\xd\xa background-color: #dff0d8; padding:2%;margin-bottom:20px;text-align:center; border:1px solid #AEDB9A; font-size:18pt;">TEST SUCCESSFUL</div>
\xa <div style="display:block;text-align:center;margin-bottom:4%;"><img style="width:15%;"src="" . esc_url(SAMLSPUtilities::mo_saml_get_plugin_base_url()) . "images/green_check.webp"></div>";
lbq:
$l9 = EnvironmentHelper::getOptionForSelectedEnvironment("saml_domain_restriction", true, $X8);
$I2 = $RN;
if (!empty($l9[$I2])) {
goto h3x;
}
$I2 = "DEFAULT";
h3x:
if (empty($l9[$I2])) {
goto ScX;
}
$yp = $l9[$I2]["enable_domain_restriction"];
ScX:
if (empty($yp)) {
goto eJS;
}
$na = $l9[$I2]["allow_deny_login"];
if (!empty($na) && $na == "deny") {
goto H5t;
}
$rZ = $l9[$I2]["email_domains"];
$E1 = explode(";", $rZ);
$Qd = explode("@", $r3);
$pQ = !empty($Qd[1]) ? $Qd[1] : '';
if (SAMLSPUtilities::mo_saml_in_array($pQ, $E1)) {
goto B85;
}
echo "<p style="color:red;">This user will not be allowed to login as the domain of the email is not included in the allowed list of Domain Restriction.</p>";
B85:
goto zJD;
H5t:
$rZ = $l9[$I2]["email_domains"];
$E1 = array_map("trim", explode(";", $rZ));
$E1 = array_map("strtolower", $E1);
$Qd = explode("@", $r3);
$pQ = !empty($Qd[1]) ? $Qd[1] : '';
$pQ = strtolower(trim($pQ));
if (!SAMLSPUtilities::mo_saml_in_array($pQ, $E1)) {
goto Ae7;
}
echo "<p style="color:red;">This user will not be allowed to login as the domain of the email is included in the denied list of Domain Restriction.</p>";
Ae7:
zJD:
eJS:
$jm = Mo_SAML_Config_Utility::mo_saml_get_attr_configurations($RN, $X8);
$x1 = EnvironmentHelper::getOptionForSelectedEnvironment("mo_saml_test_config_attrs", true);
$vs = '';
if (empty($jm["username"])) {
goto xki;
}
$Oo = $jm["username"];
if (empty($x1[$RN][$Oo][0])) {
goto nIk;
}
$vs = $x1[$RN][$Oo][0];
nIk:
if (!(strlen($vs) > 60)) {
goto dmp;
}
echo "<p style="color:red;">NOTE : This user will not be able to login as the username value is more than 60 characters long.<br/>
Please try changing the mapping of Username field in <a href="#" onClick="closeAndRedirectToAttributeMapping();">Attribute/Role Mapping</a> tab.</p>";
dmp:
xki:
echo "<span style="font-size:14pt;"><b>Hello</b>, " . esc_html($r3) . "</span><br/><p style="font-weight:bold;font-size:14pt;margin-left:1%;">ATTRIBUTES RECEIVED:</p>\xd\xa\x9 \x9\x9<table style="border-collapse:collapse;border-spacing:0; width:100%; font-size:14pt;background-color:#EDEDED;">
\xa \x9\x9<tr style="text-align:center;"><td style="font-weight:bold;border:2px solid #949090;padding:2%;">ATTRIBUTE NAME</td><td style="font-weight:bold;padding:2%;border:2px solid #949090; word-wrap:break-word;">ATTRIBUTE VALUE</td></tr>";
if (!empty($P3)) {
goto RXT;
}
echo "No Attributes Received.";
goto FSZ;
RXT:
foreach ($P3 as $Fx => $QB) {
echo "<tr><td style='font-weight:bold;border:2px solid #949090;padding:2%;word-wrap:break-word;'>" . esc_html($Fx) . "</td><td style='padding:2%;border:2px solid #949090; word-wrap:break-word;'>" . implode("<hr/>", map_deep($QB, "esc_html")) . "</td></tr>";
wt9:
}
FSQ:
FSZ:
echo "</table></div>";
echo "<div style="margin:3%;display:block;text-align:center;">\xd\xa <input style="padding:1%;width:250px;background: #0091CD none repeat scroll 0% 0%;
cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space:
\xa\x9\x9 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="Configure Attribute/Role Mapping" onClick="closeAndRedirectToAttributeMapping();">
\xa
<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="closeAndRefresh()"></div>";
echo "\xd\xa <script>\xd\xa function closeAndRedirectToAttributeMapping() {\xd\xa if (window.opener) {\xd\xa window.opener.redirect_to_attribute_mapping( '" . esc_url_raw(mo_saml_get_attribute_mapping_url($RN)) . "' );
\xa }\xd
self.close();
\xa }
\xa function closeAndRefresh(){\xd
if (window.opener) {
window.opener.location.reload();\xd\xa }
self.close();
} \xd
</script>";
exit;
}
function mo_saml_convert_to_windows_iconv($Uu, $Ub)
{
$X8 = EnvironmentHelper::getCurrentEnvironment();
$bL = EnvironmentHelper::getOptionForSelectedEnvironment("saml_identity_providers", true, $X8);
if (empty($Ub["idp_name"])) {
goto mLb;
}
$RN = $Ub["idp_name"];
goto cip;
mLb:
$RN = '';
cip:
if (!(!empty($RN) and !empty($bL[$RN]))) {
goto p2t;
}
$od = $bL[$RN]["mo_saml_encoding_enabled"];
if (!($od === "checked" && mo_saml_is_extension_installed(Mo_Saml_Options_Enum_Extension::ICONV))) {
goto BNq;
}
return @iconv(Mo_Saml_Options_Enum_Encoding::ENCODING_UTF_8, Mo_Saml_Options_Enum_Encoding::ENCODING_CP1252, $Uu);
BNq:
p2t:
return $Uu;
}
function mo_saml_login_user($kT, $t6, $Oa, $f1, $xf, $IY, $iN, $s8, $gE, $sW)
{
$kT = sanitize_user($kT, true);
$kT = trim(apply_filters("pre_user_login", sanitize_user($kT)));
if (!(strlen($kT) > 60)) {
goto nLI;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR011"]);
nLI:
$kD = $s8["idp_name"];
if (!empty($s8["enable_idp"])) {
goto Sna;
}
throw new Mo_SAML_IDP_Status_Inactive_Exception("IDP Not Enabled.");
Sna:
do_action("mo_abr_filter_login", $sW);
$X8 = EnvironmentHelper::getCurrentEnvironment();
$iV = false;
if (!SAMLSPUtilities::mo_saml_is_plugin_active("miniorange-advanced-role-mapping/advanced-role-mapping.php")) {
goto S_w;
}
$iV = true;
S_w:
$EY = Mo_SAML_Config_Utility::mo_saml_check_if_idp_configurations_configured($kD, "role_mapping", $X8) ? $kD : "DEFAULT";
$jn = Mo_SAML_Config_Utility::mo_saml_check_if_idp_configurations_configured($kD, "advanced_settings", $X8) ? $kD : "DEFAULT";
$ZF = Mo_SAML_Config_Utility::mo_saml_get_attr_role_advanced_settings($jn, $X8);
if ($iV) {
goto qU_;
}
mo_saml_check_if_attribute_restricted($sW, $ZF);
qU_:
mo_saml_check_if_domain_restricted($t6, $ZF, $X8);
$bm = Mo_SAML_Config_Utility::mo_saml_get_role_mapping_values($EY, $X8);
$Em = Mo_SAML_Config_Utility::mo_saml_get_role_mapping($EY, $X8);
$sJ = !empty($Em["group_name"]) ? $Em["group_name"] : '';
$yz = !empty($sW[$sJ]) && is_array($sW[$sJ]) ? array_filter($sW[$sJ]) : array();
$yz = apply_filters("mo_group_separator", $yz);
$user = false;
if (username_exists($kT)) {
goto H73;
}
if (email_exists($t6)) {
goto b2r;
}
goto tHE;
H73:
$user = get_user_by("login", $kT);
goto tHE;
b2r:
$user = get_user_by("email", $t6);
tHE:
$bR = false;
if (!is_multisite()) {
goto RTM;
}
if (empty($user)) {
goto ou2;
}
$DQ = $user->ID;
$blog_id = get_current_blog_id();
if (is_user_member_of_blog($DQ, $blog_id)) {
goto tOv;
}
$bR = true;
tOv:
ou2:
RTM:
$KB = mo_options_user_meta::VALUE_SSO_USER;
$Ip = mo_options_user_meta::KEY_USER_TYPE;
if (!empty($user) && !$bR) {
goto c0y;
}
if (empty($user) || $bR) {
goto HR3;
}
goto TL6;
c0y:
do_action("mo_guest_login", $sW["NameID"], $gE, $s8, false);
if (!(!Mo_License_Service::is_customer_license_valid() && !user_can(get_user_by("login", $kT)->ID, "manage_options"))) {
goto RxY;
}
throw new Mo_SAML_Invalid_License_Exception("Invalid License");
RxY:
if (username_exists($kT)) {
goto dtd;
}
if (email_exists($t6)) {
goto k16;
}
goto Vx0;
dtd:
$user = get_user_by("login", $kT);
goto Vx0;
k16:
$user = get_user_by("email", $t6);
Vx0:
do_action("mo_saml_update_username", $kT, $kD);
mo_saml_map_attributes($user, $Oa, $f1, $xf, $IY, $sW, true, $kD, $X8);
if (!$iV) {
goto Ara;
}
do_action("mo_saml_assign_role_arm", $user, $sW, false, $kD);
goto Sil;
Ara:
$AY = !empty($ZF["keep_existing_users_role"]) ? $ZF["keep_existing_users_role"] : '';
$g2 = !empty($Em["apply_role_to_admin"]) ? $Em["apply_role_to_admin"] : '';
if (!("checked" !== $AY && (!is_administrator_user($user) || "checked" === $g2))) {
goto j2f;
}
mo_saml_assign_roles($user, false, $bm, $yz, $Em, $ZF);
j2f:
Sil:
update_user_meta($user->ID, $Ip, $KB);
mo_saml_create_cookie($user->ID, $kD, $gE, $sW["NameID"][0]);
$lJ = SAMLSPUtilities::mo_saml_get_redirect_url($iN, $kD, $X8);
do_action("miniorange_post_authenticate_user_login", $user, null, $lJ, true);
do_action("mo_saml_attributes", $kT, $t6, $Oa, $f1, $yz, $kD, $sW);
do_action("mo_wp_user_attributes", $user->ID, $sW, $kD, "SAML", false);
do_action("wp_login", $user->user_login, $user);
wp_redirect($lJ);
exit;
goto TL6;
HR3:
do_action("mo_guest_login", $sW["NameID"], $gE, $s8, true);
if (Mo_License_Service::is_customer_license_valid()) {
goto ANB;
}
throw new Mo_SAML_Invalid_License_Exception("Invalid License");
ANB:
$EU = !empty($ZF["do_not_create_new_users"]) ? $ZF["do_not_create_new_users"] : '';
if (!("checked" === $EU)) {
goto l3w;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR018"]);
l3w:
$k2 = isset($Em["create_new_user"]) ? $Em["create_new_user"] : "checked";
$Yo = mo_saml_get_roles_to_assign($bm, $yz, $ZF);
if (!("checked" !== $k2 && empty($Yo))) {
goto v6u;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR018"]);
v6u:
$user = mo_saml_create_user($user, $kT, $t6, $bR);
if ($user) {
goto Zrc;
}
if (!empty($iN)) {
goto sXC;
}
wp_redirect(network_home_url());
goto pWk;
sXC:
wp_redirect($iN);
pWk:
exit;
Zrc:
mo_saml_map_attributes($user, $Oa, $f1, $xf, $IY, $sW, true, $kD, $X8);
if (!$iV) {
goto fDK;
}
do_action("mo_saml_assign_role_arm", $user, $sW, true, $kD);
goto PV6;
fDK:
mo_saml_assign_roles($user, true, $bm, $yz, $Em, $ZF, $Yo);
PV6:
update_user_meta($user->ID, $Ip, $KB);
mo_saml_create_cookie($user->ID, $kD, $gE, $sW["NameID"][0]);
$lJ = SAMLSPUtilities::mo_saml_get_redirect_url($iN, $kD, $X8);
do_action("miniorange_post_authenticate_user_login", $user, null, $lJ);
do_action("mo_saml_attributes", $kT, $t6, $Oa, $f1, $yz, $kD, $sW);
do_action("mo_wp_user_attributes", $user->ID, $sW, $kD, "SAML", true);
do_action("wp_login", $user->user_login, $user);
wp_redirect($lJ);
exit;
TL6:
}
function mo_saml_check_if_attribute_restricted($sW, $ZF)
{
$YK = !empty($ZF["allow_deny_user_attribute"]) ? $ZF["allow_deny_user_attribute"] : '';
if (!("checked" === $YK)) {
goto B9k;
}
$sU = !empty($ZF["restricted_attribute"]) ? $ZF["restricted_attribute"] : '';
$u3 = !empty($ZF["restricted_attribute_values"]) ? $ZF["restricted_attribute_values"] : '';
$OM = !empty($ZF["allow_deny_attr_option"]) ? $ZF["allow_deny_attr_option"] : "allow";
$u3 = array_map("trim", array_filter(explode(";", $u3)));
$dS = false;
foreach ($u3 as $qw) {
if (!SAMLSPUtilities::mo_saml_in_array($qw, $sW[$sU], true)) {
goto Etd;
}
$dS = true;
goto r2c;
Etd:
dcI:
}
r2c:
if (!("deny" === $OM && $dS || "allow" === $OM && !$dS)) {
goto qG1;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR019"]);
qG1:
B9k:
}
function mo_saml_check_if_domain_restricted($t6, $ZF, $X8)
{
$ci = !empty($ZF["allow_deny_user_domain"]) ? $ZF["allow_deny_user_domain"] : '';
if (!("checked" === $ci)) {
goto Y9p;
}
$zx = !empty($ZF["restricted_domains"]) ? $ZF["restricted_domains"] : '';
$OM = !empty($ZF["allow_deny_domain_option"]) ? $ZF["allow_deny_domain_option"] : "allow";
$E1 = array_map("trim", array_filter(explode(";", $zx)));
$E1 = array_map("strtolower", $E1);
$Cn = explode("@", $t6);
$wS = !empty($Cn[1]) ? strtolower(trim($Cn[1])) : '';
$oz = EnvironmentHelper::getOptionForSelectedEnvironment("mo_saml_restricted_domain_error_msg", false, $X8);
$uy = SAMLSPUtilities::mo_saml_is_plugin_active(Mo_Saml_Addons_Directory::CUSTOM_SSO_ERROR_MESSAGE) ? true : false;
if ("allow" === $OM && !SAMLSPUtilities::mo_saml_in_array($wS, $E1)) {
goto abd;
}
if ("deny" === $OM && SAMLSPUtilities::mo_saml_in_array($wS, $E1)) {
goto ZUe;
}
goto Q3H;
abd:
if (!$uy) {
goto csE;
}
do_action("mo_custom_sso_error_msg", Mo_Saml_Hook_Constant::DOMAIN_RESTRICTION);
csE:
if (empty($oz)) {
goto Jvw;
}
wp_die(esc_html($oz), "Permission Denied : Not a Whitelisted user.");
goto jty;
Jvw:
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR022"]);
jty:
goto Q3H;
ZUe:
if (!$uy) {
goto gfw;
}
do_action("mo_custom_sso_error_msg", Mo_Saml_Hook_Constant::DOMAIN_RESTRICTION);
gfw:
if (empty($oz)) {
goto zx2;
}
wp_die(esc_html($oz), "Permission Denied : Blacklisted user.");
goto KUe;
zx2:
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR021"]);
KUe:
Q3H:
Y9p:
}
function mo_saml_map_attributes($user, $Oa, $f1, $xf, $IY, $sW, $un, $kD, $ic)
{
$kD = Mo_SAML_Config_Utility::mo_saml_check_if_idp_configurations_configured($kD, "attribute_mapping", $ic) ? $kD : "DEFAULT";
mo_saml_map_basic_attributes($user, $Oa, $f1, $xf, $IY, $sW, $un, $kD, $ic);
mo_saml_map_custom_attributes($user, $sW, $kD, $ic);
}
function mo_saml_map_basic_attributes($user, $Oa, $f1, $xf, $IY, $sW, $un, $kD, $ic)
{
$DQ = $user->ID;
if (empty($Oa)) {
goto b_j;
}
$user->data->first_name = $Oa;
b_j:
if (empty($f1)) {
goto bFb;
}
$user->data->last_name = $f1;
bFb:
if (empty($xf)) {
goto soy;
}
$user->data->nickname = $xf;
soy:
update_user_meta($DQ, "mo_saml_user_attributes", $sW);
$jm = Mo_SAML_Config_Utility::mo_saml_get_attr_configurations($kD, $ic);
$vk = !empty($jm["do_not_update_display_name"]) ? $jm["do_not_update_display_name"] : '';
if (!(!empty($IY) && ("checked" !== $vk || !$un))) {
goto yFo;
}
if (strcmp($IY, "USERNAME") == 0) {
goto fas;
}
if (strcmp($IY, "FNAME") == 0 && !empty($Oa)) {
goto Cm3;
}
if (strcmp($IY, "LNAME") == 0 && !empty($f1)) {
goto Y2y;
}
if (strcmp($IY, "NICK_NAME") == 0 && !empty($xf)) {
goto Wea;
}
if (strcmp($IY, "FNAME_LNAME") == 0 && !empty($f1) && !empty($Oa)) {
goto Tsd;
}
if (strcmp($IY, "LNAME_FNAME") == 0 && !empty($f1) && !empty($Oa)) {
goto nhX;
}
goto BDo;
fas:
$user->data->display_name = $user->user_login;
goto BDo;
Cm3:
$user->data->display_name = $Oa;
goto BDo;
Y2y:
$user->data->display_name = $f1;
goto BDo;
Wea:
$user->data->display_name = $xf;
goto BDo;
Tsd:
$user->data->display_name = $Oa . " " . $f1;
goto BDo;
nhX:
$user->data->display_name = $f1 . " " . $Oa;
BDo:
yFo:
wp_update_user($user);
}
function mo_saml_map_custom_attributes($user, $sW, $kD, $ic)
{
$DQ = $user->ID;
$st = EnvironmentHelper::getOptionForSelectedEnvironment("mo_saml_custom_attrs_mapping", true, $ic);
$st = !empty($st[$kD]) ? $st[$kD] : array();
$sW = apply_filters("mo_saml_custom_attributes_filter", $sW);
foreach ($st as $Fx => $QB) {
$QB = trim($QB);
if (empty($sW[$QB])) {
goto cYS;
}
if (is_array($sW[$QB]) && count($sW[$QB]) == 1) {
goto Nbu;
}
update_user_meta($DQ, trim($Fx), $sW[$QB]);
goto n_f;
Nbu:
update_user_meta($DQ, trim($Fx), $sW[$QB][0]);
n_f:
cYS:
Z_P:
}
DmG:
}
function mo_saml_assign_roles($user, $xI, $Qq, $yz, $Em, $ZF, $Yo = array())
{
if (!empty($Yo)) {
goto ZcS;
}
$Yo = mo_saml_get_roles_to_assign($Qq, $yz, $ZF);
ZcS:
if ($xI) {
goto k9y;
}
$CB = $ZF["whitelist_existing_users_roles"] ?? '';
if (!("checked" === $CB)) {
goto yQ6;
}
$PO = is_array($ZF["whitelisted_roles"]) ? array_flip($ZF["whitelisted_roles"]) : array();
$Sk = is_array($user->roles) ? $user->roles : array();
$ah = array_intersect($PO, $Sk);
$Yo = array_merge($Yo, $ah);
yQ6:
k9y:
mo_saml_assign_roles_to_user($user, $Yo, $xI, $Em);
}
function mo_saml_get_roles_to_assign($Qq, $yz, $ZF)
{
$Qw = !empty($ZF["enable_regex"]) ? $ZF["enable_regex"] : '';
$Yo = array();
foreach ($Qq as $yQ => $dR) {
$dR = array_map("trim", array_filter(explode(";", $dR)));
foreach ($dR as $XS) {
foreach ($yz as $Fc) {
if (!("checked" === $Qw && preg_match("/" . $XS . "/", $Fc) || $Fc === $XS)) {
goto ORD;
}
array_push($Yo, $yQ);
ORD:
cPh:
}
EBf:
fuH:
}
rnu:
c29:
}
LJK:
return $Yo;
}
function mo_saml_create_cookie($DQ, $kD, $gE, $L2)
{
wp_set_current_user($DQ);
$ug = apply_filters("mo_remember_me", false);
wp_set_auth_cookie($DQ, $ug, SAMLSPUtilities::mo_saml_is_ssl());
if (empty($kD)) {
goto cIL;
}
update_user_meta($DQ, "mo_saml_logged_in_with_idp", $kD);
cIL:
if (empty($gE)) {
goto YDq;
}
update_user_meta($DQ, "mo_saml_session_index", $gE);
YDq:
if (empty($L2)) {
goto tl2;
}
update_user_meta($DQ, "mo_saml_name_id", $L2);
tl2:
if (!(!session_id() || session_id() == '' || empty($_SESSION))) {
goto M9B;
}
session_start();
M9B:
$_SESSION["mo_saml"]["logged_in_with_idp"] = $kD;
if (empty($gE)) {
goto PFP;
}
$_SESSION["mo_saml"]["sessionIndex"] = $gE;
PFP:
if (empty($L2)) {
goto QMm;
}
$_SESSION["mo_saml"]["nameId"] = $L2;
QMm:
}
function mo_saml_create_user($user, $kT, $t6, $bR)
{
$zF = wp_generate_password(10, false);
if (!$bR) {
goto Oen;
}
$DQ = $user->ID;
goto VRF;
Oen:
$DQ = wp_create_user($kT, $zF, $t6);
if (!is_wp_error($DQ)) {
goto iUv;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR005"]);
iUv:
VRF:
return get_user_by("id", $DQ);
}
function mo_saml_assign_roles_to_user($user, $Yo, $xI, $Em)
{
$yF = false;
if (!empty($Yo)) {
goto HqL;
}
if (!$xI && isset($Em["update_existing_user"]) && "checked" === $Em["update_existing_user"]) {
goto ouq;
}
if ($xI) {
goto xp8;
}
goto MiD;
HqL:
$user->set_role(false);
foreach ($Yo as $yQ) {
$user->add_role($yQ);
H6A:
}
vqg:
goto MiD;
ouq:
$yF = true;
$Hm = !empty($Em["default_role_for_existing_users"]) ? $Em["default_role_for_existing_users"] : get_option("default_role");
goto MiD;
xp8:
$yF = true;
$Hm = !empty($Em["default_role_for_new_users"]) ? $Em["default_role_for_new_users"] : get_option("default_role");
MiD:
if (!$yF) {
goto GGg;
}
if ("none" === $Hm) {
goto dkh;
}
$user->set_role($Hm);
goto vxi;
dkh:
$user->set_role(false);
vxi:
GGg:
}
function show_status_error($NP, $T9, $XW, $Ub)
{
$NP = strip_tags($NP);
$XW = strip_tags($XW);
if ($T9 == "testValidate" or $T9 == "testNewCertificate") {
goto pTZ;
}
if ($NP == "Responder" || $NP == "Requester") {
goto rob;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR006"]);
goto WAC;
pTZ:
if (!($NP == "Responder")) {
goto I98;
}
mo_saml_handle_azureb2c_cases($T9, $XW, $Ub);
I98:
$tQ = "<p><strong>Status Code found in SAML Response: </strong><font face="Courier New";font-size:10pt><br><br>" . esc_html($NP) . "</p></font>";
Mo_Saml_Error_Message::mo_saml_display_test_config_error(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR006"], $tQ, $XW);
goto WAC;
rob:
mo_saml_handle_azureb2c_cases($T9, $XW, $Ub);
WAC:
}
function mo_saml_handle_azureb2c_cases($T9, $XW, $Ub)
{
switch ($XW) {
case mo_options_plugin_azureb2c_statusmsg::Forgot:
mo_saml_paswd_reset_url($Ub, $T9);
goto DDE;
case mo_options_plugin_azureb2c_statusmsg::Cancel:
mo_saml_azureb2c_cancel_msg_case($T9);
case mo_options_plugin_azureb2c_statusmsg::Largeurl:
mo_saml_paswd_reset_large_url_case($T9);
exit;
default:
if (!($T9 != "testValidate")) {
goto sNj;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR006"]);
sNj:
}
Ycy:
DDE:
}
function mo_saml_paswd_reset_url($Ub, $T9)
{
$Ik = $Ub;
$Y1 = !empty($Ik["saml_pw_reset_url"]) ? html_entity_decode($Ik["saml_pw_reset_url"]) : '';
if (!empty($Y1)) {
goto nNe;
}
if ($T9 != "testValidate" && $T9 != "testNewCertificate") {
goto It2;
}
goto wF7;
nNe:
wp_redirect($Y1);
exit;
goto wF7;
It2:
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["WPSAMLERR035"]);
wF7:
}
function mo_saml_paswd_reset_large_url_case($T9)
{
if (!($T9 != "testValidate")) {
goto ULy;
}
$SkL = parse_url($T9);
$T9 = $SkL["path"];
wp_redirect($T9);
ULy:
}
function mo_saml_azureb2c_cancel_msg_case($T9)
{
if ($T9 == "testValidate") {
goto vCp;
}
wp_redirect($T9);
exit;
goto Eht;
vCp:
wp_redirect(home_url());
exit;
Eht:
}
function addLink($BGC, $Nn_)
{
$Ri = "<a href="" . $Nn_ . "">" . $BGC . "</a>";
return $Ri;
}
function get_status_message($NP)
{
switch ($NP) {
case "Requester":
return "The request could not be performed due to an error on the part of the requester.";
goto G2E;
case "Responder":
return "The request could not be performed due to an error on the part of the SAML responder or SAML authority.";
goto G2E;
case "VersionMismatch":
return "The SAML responder could not process the request because the version of the request message was incorrect.";
goto G2E;
default:
return "Unknown";
}
rZy:
G2E:
}
function is_administrator_user($user)
{
$CxS = $user->roles;
if (!is_null($CxS) && SAMLSPUtilities::mo_saml_in_array("administrator", $CxS)) {
goto e8t;
}
return false;
goto Qkq;
e8t:
return true;
Qkq:
}
function mo_saml_is_customer_registered()
{
$t6 = get_option("mo_saml_admin_email");
$MT = get_option("mo_saml_admin_customer_key");
if (!$t6 || !$MT || !is_numeric(trim($MT))) {
goto vaB;
}
return 1;
goto yyk;
vaB:
return 0;
yyk:
}
function saml_get_referer_page_url()
{
if (!(isset($_SERVER["HTTP_REFERER"]) && !empty($_SERVER["HTTP_REFERER"]) && $_SERVER["HTTP_REFERER"] !== "/")) {
goto ChE;
}
return $_SERVER["HTTP_REFERER"];
ChE:
}
function saml_get_current_page_url()
{
$DES = $_SERVER["HTTP_HOST"];
if (!(substr($DES, -1) == "/")) {
goto I3s;
}
$DES = substr($DES, 0, -1);
I3s:
$O2q = $_SERVER["REQUEST_URI"];
if (!(substr($O2q, 0, 1) == "/")) {
goto GaJ;
}
$O2q = substr($O2q, 1);
GaJ:
$AeG = !empty($_SERVER["HTTPS"]) && strcasecmp($_SERVER["HTTPS"], "on") == 0;
$iN = "http" . ($AeG ? "s" : '') . "://" . $DES . "/" . $O2q;
return $iN;
}
add_action("widgets_init", function () {
register_widget("Mo_SAML_Login_Widget");
});
add_action("init", array(Mo_Saml_User_Login_Handler::mo_saml_get_object(), "mo_saml_login_validate"));
?>
Did this file decode correctly?
Original Code
<?php
/**
* This file is a part of the miniorange-saml-20-single-sign-on plugin.
*
* @link https://plugins.miniorange.com/
* @author miniOrange
* @package miniorange-saml-20-single-sign-on
*/
require_once Mo_Saml_Plugin_Files::MO_SAML_UTILITIES;
require_once Mo_Saml_Plugin_Files::MO_SAML_RESPONSE;
require_once Mo_Saml_Plugin_Files::MO_SAML_LOGOUT_REQUEST;
require_once Mo_Saml_Plugin_Files::MO_SAML_USER_LOGIN_HANDLER;
require_once Mo_Saml_Plugin_Files::MO_SAML_CONFIG_UTILITY;
if (class_exists("\x41\x45\123\x45\156\x63\x72\x79\x70\x74\x69\157\156")) {
goto Txh;
}
require_once Mo_Saml_Plugin_Files::MO_SAML_ENCRYPTION;
Txh:
require_once Mo_Saml_Plugin_Files::MO_SAML_XML_SEC_LIBS;
use RobRichards\XMLSecLibs\XMLSecurityKey;
use RobRichards\XMLSecLibs\XMLSecurityDSig;
use RobRichards\XMLSecLibs\XMLSecEnc;
use MOSAML\LicenseLibrary\Mo_License_Service;
class Mo_SAML_Login_Widget extends WP_Widget
{
private static $instance;
public function __construct()
{
parent::__construct("\x53\141\155\154\x5f\114\x6f\x67\x69\x6e\x5f\127\x69\144\147\x65\x74", "\114\157\147\151\x6e", array("\x64\x65\163\x63\162\x69\x70\164\x69\157\156" => __("\x54\150\151\x73\x20\x69\x73\x20\141\40\x6d\151\156\151\117\162\x61\156\147\145\40\123\x41\x4d\x4c\40\x6c\157\147\151\156\x20\x77\x69\x64\147\x65\x74\56", "\155\157\x73\x61\155\154")));
}
public static function mo_saml_get_object()
{
if (isset(self::$instance)) {
goto ZBV;
}
$Fh = __CLASS__;
self::$instance = new $Fh();
ZBV:
return self::$instance;
}
public function widget($hU, $uF)
{
extract($hU);
if (!(isset($uF["\x77\x69\144\137\164\151\x74\x6c\x65"]) && !empty($uF["\x77\151\x64\137\164\x69\x74\x6c\x65"]))) {
goto Jdg;
}
$r5 = apply_filters("\167\151\144\x67\145\164\137\x74\151\164\x6c\145", $uF["\x77\x69\144\x5f\x74\151\x74\154\145"]);
Jdg:
echo $hU["\142\x65\x66\x6f\162\145\137\167\151\x64\147\x65\x74"];
if (empty($r5)) {
goto aHY;
}
echo $hU["\x62\x65\x66\x6f\x72\145\137\x74\x69\x74\x6c\145"] . $r5 . $hU["\141\x66\x74\145\x72\x5f\164\151\164\x6c\x65"];
aHY:
$this->loginForm();
echo $hU["\141\x66\x74\145\162\x5f\167\151\144\147\x65\x74"];
}
public function update($cQ, $X5)
{
$uF = array();
$uF["\x77\x69\x64\x5f\x74\x69\164\154\145"] = strip_tags($cQ["\167\151\x64\137\164\x69\x74\154\x65"]);
return $uF;
}
public function form($uF)
{
$r5 = '';
if (empty($uF["\x77\151\x64\137\x74\151\164\154\x65"])) {
goto CCJ;
}
$r5 = $uF["\x77\x69\x64\137\164\x69\164\154\x65"];
CCJ:
echo "\11\11\x3c\160\x3e\15\12\x9\x9\11\74\x6c\x61\x62\145\x6c\x20\x66\157\162\x3d\x22";
echo esc_attr($this->get_field_id("\x77\151\x64\137\x74\151\x74\x6c\x65"));
echo "\42\76\15\xa\x9\x9\x9\11";
esc_html_e("\x54\x69\x74\154\145\72");
echo "\x9\x9\11\x3c\x2f\154\141\142\x65\x6c\x3e\xd\xa\x9\x9\x9\74\x69\156\x70\x75\164\x20\143\154\141\163\x73\x3d\x22\x77\x69\x64\145\x66\x61\x74\x22\40\151\x64\75\x22";
echo esc_attr($this->get_field_id("\167\x69\x64\x5f\x74\x69\x74\x6c\x65"));
echo "\x22\40\x6e\141\x6d\145\x3d\x22";
echo esc_attr($this->get_field_name("\x77\151\144\x5f\x74\151\164\x6c\145"));
echo "\42\x20\x74\x79\x70\x65\75\x22\164\145\170\x74\42\40\x76\141\x6c\x75\x65\x3d\x22";
echo esc_attr($r5);
echo "\x22\x20\57\76\15\12\x9\11\x3c\57\x70\x3e\15\xa\11\x9";
}
public function loginForm()
{
global $post;
if (Mo_License_Service::is_customer_license_verified()) {
goto cwJ;
}
return;
cwJ:
$X8 = EnvironmentHelper::getCurrentEnvironment();
if (!SAMLSPUtilities::mo_saml_is_user_logged_in()) {
goto Otc;
}
$current_user = wp_get_current_user();
$bL = EnvironmentHelper::getOptionForSelectedEnvironment("\163\141\x6d\x6c\x5f\x69\x64\x65\x6e\164\151\x74\171\137\x70\x72\157\x76\x69\x64\145\x72\163", true, $X8);
$s8 = get_user_meta($current_user->ID, "\155\157\x5f\x73\141\x6d\154\x5f\x6c\157\x67\147\145\x64\x5f\151\156\137\167\151\x74\150\x5f\151\x64\160", true);
$s8 = isset($_SESSION["\x6d\157\137\x67\x75\145\x73\164\x5f\154\x6f\147\151\x6e"]["\154\157\147\x67\x65\144\137\x69\156\137\x69\144\160\x5f\156\141\x6d\145"]) ? $_SESSION["\x6d\x6f\x5f\147\165\x65\x73\x74\137\x6c\x6f\x67\151\156"]["\154\x6f\x67\147\145\x64\x5f\151\156\137\x69\144\160\137\x6e\x61\x6d\x65"] : get_user_meta($current_user->ID, "\x6d\157\x5f\x73\141\x6d\x6c\137\x6c\x6f\x67\147\145\144\137\151\x6e\x5f\167\151\164\150\137\151\x64\x70", true);
if (!empty($s8)) {
goto aSB;
}
$iG = "\104\105\106\101\125\114\124";
goto To1;
aSB:
$iG = $bL[$s8];
To1:
$fa = "\110\x65\154\x6c\157\x2c";
if (empty($iG["\x63\165\163\x74\157\x6d\x5f\147\162\145\145\164\x69\x6e\x67\x5f\164\x65\x78\164"])) {
goto zNP;
}
$fa = $iG["\143\x75\163\164\157\155\137\147\162\145\x65\x74\x69\156\x67\137\x74\145\x78\164"];
zNP:
$oP = '';
if (empty($iG["\147\162\145\x65\164\x69\156\x67\x5f\156\141\155\145"])) {
goto vGj;
}
switch ($iG["\x67\x72\145\145\x74\x69\156\147\137\x6e\141\x6d\145"]) {
case "\125\123\105\x52\116\x41\x4d\x45":
$oP = $current_user->user_login;
goto El9;
case "\105\115\x41\111\x4c":
$oP = $current_user->user_email;
goto El9;
case "\x46\x4e\x41\x4d\x45":
$oP = $current_user->user_firstname;
goto El9;
case "\114\x4e\x41\115\105":
$oP = $current_user->user_lastname;
goto El9;
case "\x46\116\x41\x4d\105\x5f\x4c\116\x41\x4d\105":
$oP = $current_user->user_firstname . "\40" . $current_user->user_lastname;
goto El9;
case "\114\116\101\x4d\x45\x5f\x46\x4e\x41\115\105":
$oP = $current_user->user_lastname . "\x20" . $current_user->user_firstname;
goto El9;
default:
$oP = $current_user->user_login;
}
num:
El9:
vGj:
if (!empty(trim($oP))) {
goto KfP;
}
$oP = $current_user->user_login;
KfP:
$Cs = $fa . "\40" . $oP;
$hs = "\114\157\147\x6f\x75\x74";
if (empty($iG["\x63\x75\x73\x74\157\155\x5f\154\157\147\157\165\x74\x5f\164\x65\x78\164"])) {
goto OZj;
}
$hs = $iG["\x63\165\163\x74\x6f\x6d\x5f\x6c\157\147\157\x75\x74\x5f\164\x65\170\x74"];
OZj:
echo esc_attr($Cs) . "\x20\174\x20\74\x61\x20\x68\162\145\146\75\42" . esc_url(wp_logout_url(home_url())) . "\42\x20\x74\151\164\154\x65\75\42\154\157\x67\157\x75\164\42\x20\x3e" . esc_attr($hs) . "\x3c\57\141\x3e\x3c\57\154\151\x3e";
$qG = saml_get_current_page_url();
$j4 = new EnvironmentDao($X8);
$j4->mo_save_environment_settings("\154\x6f\147\x6f\x75\164\x5f\x72\x65\x64\151\x72\145\143\164\x5f\x75\162\x6c", $qG);
goto YTO;
Otc:
$Iu = saml_get_current_page_url();
$Lf = EnvironmentHelper::getOptionForSelectedEnvironment("\x73\x61\155\x6c\x5f\151\144\145\x6e\164\x69\164\x79\137\160\162\157\166\151\x64\x65\162\163", true, $X8);
if (!empty($Lf)) {
goto BKr;
}
echo "\x50\x6c\145\141\x73\145\40\143\157\x6e\146\151\147\x75\162\145\40\164\150\x65\40\155\151\156\151\117\x72\x61\156\x67\145\x20\123\101\115\x4c\40\120\154\165\x67\151\x6e\40\x66\x69\x72\163\164\x2e";
goto HFj;
BKr:
foreach ($Lf as $s8) {
if (!empty($s8["\145\x6e\141\x62\x6c\x65\137\x69\x64\x70"])) {
goto pyA;
}
goto tmJ;
pyA:
if (!empty($s8["\x69\144\160\137\x6e\x61\155\145"])) {
goto j9G;
}
echo "\x50\x6c\145\x61\163\145\x20\143\x6f\156\146\151\147\165\162\x65\x20\164\150\x65\x20\x6d\151\x6e\151\x4f\x72\x61\156\147\x65\40\123\101\115\114\x20\x50\x6c\165\x67\x69\x6e\40\146\151\162\163\164\56";
goto KId;
j9G:
$RY = "\x6c\157\x67\x69\156\x5f" . $s8["\151\144\160\137\156\141\x6d\145"];
$UT = "\155\x6f\x73\165\142\x6d\x69\x74\163\x61\155\x6c\146\157\162\x6d\137" . $s8["\151\144\160\x5f\x6e\141\155\145"];
echo "\x3c\x73\x63\162\151\160\164\76\15\xa\x20\x20\x20\40\x9\x9\x9\x9\11\x6a\x51\165\x65\162\171\50\x20\x64\157\x63\165\x6d\x65\156\x74\x20\51\56\x72\145\x61\x64\x79\x28\x66\x75\x6e\143\x74\x69\157\x6e\50\x29\40\173\xd\xa\x9\x9\x9\x9\x9\x9\x20\40\x20\x20\152\121\x75\x65\162\x79\50\x22\43" . esc_attr($UT) . "\x22\51\56\x63\154\151\x63\x6b\x28\146\x75\156\143\x74\151\x6f\156\x28\x65\51\x20\x7b\xd\12\x9\x9\11\x9\x9\x20\40\x20\x20\11\11\145\56\160\162\x65\166\145\x6e\x74\104\145\x66\x61\x75\x6c\164\50\x29\73\15\xa\11\11\x9\x9\40\40\40\x20\11\11\x9\152\x51\x75\x65\162\171\50\x22\43" . esc_attr($RY) . "\42\51\56\163\x75\142\155\151\x74\x28\x29\73\15\12\11\x9\x9\x20\x20\40\x20\x9\11\x9\x7d\51\x3b\15\xa\x9\x9\40\x20\40\x20\x9\11\x9\x7d\x29\x3b\15\xa\11\x20\40\40\x20\11\11\x9\11\74\x2f\x73\143\162\151\160\x74\x3e\xd\xa\x20\x20\x20\40\11\x9\11\11\11\74\146\x6f\162\155\40\x6e\141\x6d\145\75\x22" . esc_attr($RY) . "\42\40\x69\x64\75\42" . esc_attr($RY) . "\42\x20\155\x65\x74\150\x6f\x64\x3d\x22\160\x6f\x73\164\x22\x20\x61\x63\164\x69\157\x6e\x3d\x22\42\76\15\xa\x20\40\x20\x20\x20\40\40\40\x20\x20\40\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\40\40\40\40\74\151\x6e\160\165\x74\40\164\171\x70\x65\x3d\42\150\151\144\x64\x65\156\42\x20\x6e\141\155\x65\75\x22\157\x70\164\151\x6f\156\42\40\x76\141\x6c\x75\x65\x3d\x22\x73\x61\x6d\x6c\137\x75\x73\x65\x72\x5f\x6c\157\x67\151\x6e\x22\40\x2f\x3e\15\xa\x9\x9\x9\x9\11\11\40\x20\40\40\x9\x3c\151\156\160\165\x74\40\x74\171\x70\x65\x3d\x22\x68\151\144\x64\145\156\x22\40\x6e\141\155\x65\75\42\162\145\144\x69\x72\145\143\164\x5f\x74\x6f\42\x20\x76\x61\x6c\165\x65\x3d\x22" . esc_url($Iu) . "\42\x20\57\76\15\12\11\11\11\x9\x9\x20\x20\40\40\11\x9\x3c\151\x6e\x70\165\164\40\164\x79\160\x65\x3d\42\150\151\144\x64\145\156\42\40\x6e\x61\x6d\145\75\42\x69\x64\x70\x22\x20\166\x61\154\165\x65\75\42" . esc_attr($s8["\151\x64\x70\137\x6e\x61\155\x65"]) . "\42\x20\57\x3e\xd\12\11\11\x9\x9\40\40\40\x20\11\11\11\74\x66\157\156\x74\x20\163\x69\172\145\75\x22\x2b\61\42\40\x73\164\x79\x6c\x65\x3d\42\166\x65\x72\164\x69\143\x61\x6c\55\141\154\151\x67\x6e\72\x74\157\x70\73\x22\76\x20\x3c\x2f\x66\x6f\x6e\x74\76";
$dh = !empty($s8["\143\x75\x73\x74\x6f\x6d\137\154\157\x67\151\x6e\x5f\164\145\x78\164"]) ? $s8["\x63\x75\163\x74\x6f\155\x5f\x6c\157\x67\x69\156\137\164\145\170\164"] : "\x4c\157\147\151\x6e\x20\167\151\x74\150\40" . (!empty($s8["\151\x64\x70\x5f\x64\151\x73\x70\x6c\x61\171\x5f\x6e\x61\155\145"]) ? $s8["\x69\144\160\x5f\x64\x69\163\160\x6c\141\171\x5f\x6e\141\155\x65"] : $s8["\x69\144\x70\x5f\x6e\141\155\145"]);
echo "\x3c\141\40\150\x72\145\146\75\42\x23\42\x20\x69\x64\x3d\42" . esc_attr($UT) . "\42\76" . esc_html($dh) . "\74\x2f\141\x3e\x3c\x2f\x66\157\162\x6d\x3e";
KId:
tmJ:
}
rSc:
HFj:
YTO:
}
public function mo_saml_widget_init()
{
if (!(isset($_REQUEST["\x6f\160\164\151\x6f\x6e"]) and $_REQUEST["\157\x70\x74\151\157\x6e"] == "\163\x61\x6d\154\x5f\165\x73\145\162\x5f\154\x6f\x67\x6f\x75\164")) {
goto m1f;
}
$user = SAMLSPUtilities::mo_saml_is_user_logged_in() ? wp_get_current_user() : null;
if (empty($user)) {
goto ZYH;
}
wp_logout();
ZYH:
m1f:
}
function mo_saml_logout($DQ)
{
if (!(!session_id() || session_id() == '' || empty($_SESSION))) {
goto Joi;
}
session_start();
Joi:
$kD = '';
if (!empty($_SESSION["\x6d\157\x5f\163\141\x6d\x6c"]["\x6c\157\147\147\145\x64\137\151\x6e\137\x77\x69\164\x68\137\x69\x64\x70"])) {
goto LyY;
}
if (isset($_SESSION["\x6d\157\137\147\165\x65\163\x74\137\x6c\157\147\x69\156"]["\x6c\157\x67\147\145\x64\137\151\x6e\137\151\144\160\x5f\156\141\x6d\145"])) {
goto Tfv;
}
return;
goto UFP;
Tfv:
$kD = $_SESSION["\x6d\157\x5f\147\x75\x65\x73\x74\137\154\157\x67\151\x6e"]["\154\157\x67\147\x65\x64\x5f\x69\156\137\151\x64\x70\137\156\141\155\x65"];
UFP:
goto vhv;
LyY:
$kD = $_SESSION["\x6d\x6f\137\163\x61\155\154"]["\x6c\157\x67\147\x65\x64\137\x69\x6e\137\167\x69\164\150\137\151\144\160"];
vhv:
SAMLSPUtilities::mo_saml_check_is_extension_installed();
$X8 = EnvironmentHelper::getCurrentEnvironment();
$bL = EnvironmentHelper::getOptionForSelectedEnvironment("\163\x61\x6d\x6c\x5f\x69\x64\x65\156\164\x69\164\171\137\x70\x72\157\166\x69\x64\145\162\x73", true, $X8);
$Y2 = array();
if (empty($bL[$kD])) {
goto dP7;
}
$Y2 = $bL[$kD];
dP7:
if (empty($Y2)) {
goto nOk;
}
$rm = EnvironmentHelper::getOptionForSelectedEnvironment(mo_options_enum_sso_login::Relay_states, true, $X8);
$jw = !empty($rm["\x6c\157\x67\x6f\165\164\x5f\162\145\x6c\x61\171\x5f\163\164\141\x74\145"]) ? $rm["\x6c\157\147\x6f\x75\x74\137\162\145\154\x61\171\137\x73\x74\x61\164\x65"] : array();
if (!empty($jw["\x44\x45\x46\x41\x55\x4c\124"]) || !empty($jw[$kD])) {
goto EQd;
}
if (isset($_REQUEST["\162\x65\x64\151\162\145\x63\x74\137\164\x6f"]) and !empty($_REQUEST["\162\145\x64\151\162\145\143\164\137\164\157"])) {
goto mqH;
}
$Sz = wp_get_referer();
goto Lal;
mqH:
$Sz = $_REQUEST["\x72\x65\144\x69\x72\x65\x63\164\x5f\164\157"];
Lal:
if (!empty($Sz)) {
goto auI;
}
$Sz = !empty(EnvironmentHelper::getOptionForSelectedEnvironment("\155\157\137\x73\x61\x6d\154\x5f\163\x70\137\x62\141\163\x65\x5f\x75\162\x6c", false, $X8)) ? EnvironmentHelper::getOptionForSelectedEnvironment("\x6d\x6f\137\163\x61\155\154\137\x73\x70\x5f\142\x61\163\145\x5f\165\162\154", false, $X8) : home_url();
auI:
goto fRs;
EQd:
$Sz = !empty($kD) && !empty($jw[$kD]) ? $jw[$kD] : $jw["\x44\x45\106\101\125\x4c\x54"];
fRs:
$sM = $Y2["\163\154\157\x5f\165\162\x6c"];
$sM = apply_filters("\155\x6f\x5f\163\x61\155\x6c\137\154\157\x67\157\x75\x74\x5f\x75\x72\x6c", $sM, $kD);
$qr = array_key_exists("\163\x6c\x6f\137\x72\x65\163\160\x6f\156\163\145\x5f\x75\x72\154", $Y2) ? $Y2["\163\154\157\137\162\145\163\160\157\x6e\x73\x65\x5f\165\x72\154"] : '';
if (!empty($sM) || !empty($qr)) {
goto hnD;
}
SAMLSPUtilities::mo_saml_delete_plugin_cookies();
wp_redirect($Sz);
exit;
goto dIq;
hnD:
if (!(!session_id() || session_id() == '' || empty($_SESSION))) {
goto yRS;
}
session_start();
yRS:
$Ox = $Y2["\x73\x6c\157\x5f\142\x69\x6e\144\151\x6e\x67\x5f\x74\171\160\145"];
if (empty($_SESSION["\155\x6f\x5f\163\x61\x6d\154\x5f\154\157\x67\157\165\164\137\x72\x65\x71\x75\145\x73\x74"])) {
goto DJ4;
}
self::createLogoutResponseAndRedirect($sM, $qr, $Ox, $Y2, $Sz);
exit;
DJ4:
if (empty($sM)) {
goto irl;
}
$user = get_user_by("\x69\x64", $DQ);
$current_user = $user;
if (isset($_SESSION["\x6d\x6f\137\147\165\x65\163\164\x5f\x6c\x6f\x67\151\156"]["\x6e\x61\x6d\145\x49\x44"])) {
goto W3y;
}
if (isset($_COOKIE["\x6e\x61\x6d\x65\111\x44"])) {
goto pWu;
}
$Ts = get_user_meta($current_user->ID, "\x6d\157\137\x73\141\155\x6c\137\156\141\155\145\x5f\x69\144");
delete_user_meta($current_user->ID, "\155\x6f\137\163\x61\x6d\154\x5f\156\141\x6d\145\137\151\144");
goto YbM;
W3y:
$Ts = $_SESSION["\155\x6f\x5f\x67\165\145\x73\x74\137\154\157\147\151\x6e"]["\156\141\155\145\111\x44"];
goto YbM;
pWu:
$Ts = $_COOKIE["\156\141\155\145\x49\x44"];
YbM:
if (empty($Ts)) {
goto tzw;
}
SAMLSPUtilities::mo_saml_delete_plugin_cookies();
tzw:
$gH = EnvironmentHelper::getOptionForSelectedEnvironment("\155\x6f\137\x73\141\x6d\x6c\x5f\x73\x70\137\142\x61\163\x65\137\x75\x72\x6c", false, $X8);
if (!empty($gH)) {
goto tWC;
}
$gH = network_home_url();
tWC:
if (!(substr($gH, -1) == "\x2f")) {
goto XKL;
}
$gH = substr($gH, 0, -1);
XKL:
if (!empty($Y2["\x73\141\x6d\154\137\163\160\x5f\x65\156\164\x69\164\x79\137\151\144"])) {
goto g3O;
}
$Rt = EnvironmentHelper::getOptionForSelectedEnvironment("\155\157\x5f\x73\141\155\x6c\x5f\163\x70\x5f\x65\156\x74\x69\164\x79\x5f\x69\x64", false, $X8);
if (!empty($Rt)) {
goto c0g;
}
$Rt = $gH . "\x2f\x77\160\55\x63\157\x6e\164\145\x6e\164\x2f\x70\x6c\165\147\151\x6e\163\x2f\x6d\151\x6e\x69\x6f\x72\141\x6e\x67\145\x2d\163\141\x6d\x6c\x2d\62\60\55\x73\x69\156\147\x6c\145\x2d\163\x69\147\156\x2d\157\156\x2f";
c0g:
goto yzK;
g3O:
$Rt = $Y2["\x73\x61\155\154\x5f\x73\x70\137\x65\156\164\x69\164\171\137\x69\x64"];
yzK:
$CT = $sM;
$D6 = $Y2["\x6e\x61\x6d\x65\x69\x64\137\146\x6f\162\x6d\141\x74"];
$Sz = parse_url($Sz, PHP_URL_PATH);
$Sz = empty($Sz) ? "\x2f" : $Sz;
if (isset($_SESSION["\x6d\x6f\137\x67\x75\145\x73\164\137\x6c\157\x67\151\x6e"]["\x73\145\163\163\151\157\156\111\156\x64\145\170"])) {
goto J_i;
}
if (isset($_COOKIE["\163\x65\163\163\151\x6f\156\x49\x6e\144\x65\x78"])) {
goto ZmT;
}
$gz = get_user_meta($current_user->ID, "\x6d\157\137\x73\141\x6d\154\137\x73\145\x73\163\151\x6f\x6e\x5f\151\x6e\144\x65\x78");
delete_user_meta($current_user->ID, "\x6d\x6f\137\x73\x61\155\154\137\163\x65\163\163\151\x6f\156\x5f\151\x6e\144\145\x78");
goto h12;
J_i:
$gz = $_SESSION["\155\x6f\137\x67\x75\x65\163\164\137\x6c\157\147\x69\x6e"]["\x73\145\x73\x73\151\157\x6e\111\x6e\144\x65\170"];
goto h12;
ZmT:
$gz = $_COOKIE["\163\145\163\163\151\x6f\156\111\x6e\x64\x65\170"];
h12:
$DN = SAMLSPUtilities::createLogoutRequest($Ts, $Rt, $CT, $Ox, $gz, $D6);
$u_ = $Y2["\x72\145\161\x75\x65\x73\x74\x5f\x73\151\147\156\x65\x64"];
if (empty($Ox) || $Ox == "\x48\x74\164\160\x52\145\x64\151\x72\145\x63\x74") {
goto Pb0;
}
if (!($u_ == "\165\156\x63\x68\x65\143\153\145\144")) {
goto ie8;
}
$TC = base64_encode($DN);
SAMLSPUtilities::postSAMLRequest($sM, $TC, $Sz);
exit;
ie8:
$TC = SAMLSPUtilities::signXML($DN, $Y2, "\x4e\x61\x6d\145\x49\x44");
SAMLSPUtilities::postSAMLRequest($sM, $TC, $Sz);
goto fBs;
Pb0:
$So = $sM;
if (strpos($sM, "\x3f") !== false) {
goto aZx;
}
$So .= "\x3f";
goto Sk_;
aZx:
$So .= "\46";
Sk_:
if (!($u_ == "\165\156\143\x68\145\143\153\145\x64")) {
goto QSy;
}
$So .= "\x53\x41\115\114\122\x65\x71\x75\145\x73\x74\75" . $DN . "\x26\x52\x65\x6c\141\171\x53\x74\141\164\x65\x3d" . urlencode($Sz);
header("\x63\x61\x63\150\145\55\x63\157\x6e\164\x72\157\154\72\x20\x6d\x61\170\x2d\x61\147\145\75\x30\54\x20\x70\162\151\166\141\164\145\54\40\x6e\157\x2d\x73\x74\x6f\162\145\x2c\x20\156\x6f\x2d\x63\x61\143\x68\x65\x2c\40\155\165\x73\x74\55\162\x65\x76\x61\154\x69\144\141\164\145");
header("\x4c\157\x63\x61\164\151\x6f\x6e\72\x20" . $So);
exit;
QSy:
$DN = "\123\101\115\x4c\x52\145\161\x75\x65\x73\x74\x3d" . $DN . "\46\x52\x65\154\141\x79\x53\164\x61\164\145\75" . urlencode($Sz) . "\x26\123\151\147\x41\154\x67\75" . urlencode(XMLSecurityKey::RSA_SHA256);
$uN = array("\x74\171\160\145" => "\x70\162\151\166\141\164\145");
$Fx = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, $uN);
$UG = mo_saml_get_sp_private_key_for_idp($Y2);
$Fx->loadKey($UG, false);
$zH = new XMLSecurityDSig();
$oL = $Fx->signData($DN);
$oL = base64_encode($oL);
$So .= $DN . "\x26\x53\151\x67\x6e\141\x74\165\x72\x65\75" . urlencode($oL);
header("\143\x61\x63\150\x65\x2d\143\x6f\156\x74\162\157\x6c\x3a\40\155\141\170\x2d\141\x67\145\x3d\60\x2c\40\x70\162\x69\166\141\164\x65\x2c\40\x6e\157\55\163\x74\x6f\162\x65\54\x20\156\x6f\55\x63\141\x63\x68\x65\54\40\155\x75\x73\164\55\x72\x65\x76\x61\154\151\144\x61\x74\145");
header("\x4c\157\143\141\164\x69\x6f\x6e\x3a\40" . $So);
exit;
fBs:
irl:
dIq:
nOk:
}
function createLogoutResponseAndRedirect($sM, $qr, $Ox, $Y2, $jw)
{
if (empty($qr)) {
goto KEx;
}
$sM = $qr;
KEx:
$X8 = EnvironmentHelper::getCurrentEnvironment();
$gH = EnvironmentHelper::getOptionForSelectedEnvironment("\155\x6f\137\x73\x61\155\154\x5f\163\x70\137\142\x61\x73\x65\137\x75\162\x6c", false, $X8);
if (!empty($gH)) {
goto Zga;
}
$gH = home_url();
Zga:
$WF = $_SESSION["\155\x6f\x5f\x73\x61\155\154\x5f\154\x6f\x67\x6f\165\x74\137\x72\x65\x71\x75\x65\163\x74"];
$iN = !empty($jw) ? $jw : $_SESSION["\x6d\x6f\x5f\163\x61\x6d\154\x5f\154\157\147\x6f\x75\x74\x5f\162\145\154\x61\171\137\x73\164\x61\x74\x65"];
$u_ = $Y2["\162\145\x71\165\x65\163\x74\137\x73\x69\147\x6e\145\x64"];
if (!empty($iN) && (filter_var($iN, FILTER_VALIDATE_URL) || parse_url(home_url(), PHP_URL_HOST) === parse_url($iN, PHP_URL_HOST))) {
goto fDs;
}
wp_redirect($gH);
goto OmF;
fDs:
wp_redirect($iN);
OmF:
unset($_SESSION["\155\157\x5f\163\141\x6d\x6c\x5f\154\x6f\x67\x6f\x75\x74\x5f\162\145\161\x75\145\163\x74"]);
unset($_SESSION["\155\x6f\137\163\141\x6d\154\137\x6c\x6f\147\157\165\x74\137\x72\x65\154\x61\x79\137\163\164\141\x74\x65"]);
SAMLSPUtilities::mo_saml_delete_plugin_cookies();
$tw = SAMLSPUtilities::mo_saml_safe_load_xml($WF, Mo_Saml_Error_Codes::$error_codes["\127\120\123\101\115\x4c\x45\x52\x52\60\x32\65"]);
$WF = $tw->firstChild;
if (!($WF->localName == "\x4c\157\147\x6f\x75\164\122\x65\161\165\145\163\x74")) {
goto L1X;
}
$Sc = new SAML2_LogoutRequest($WF);
$hJ = EnvironmentHelper::getOptionForSelectedEnvironment("\155\x6f\137\163\141\x6d\154\x5f\163\x70\137\x65\156\164\151\x74\x79\137\151\x64", false, $X8);
if (!empty($hJ)) {
goto vnq;
}
$hJ = $gH . "\57\x77\x70\x2d\143\157\x6e\x74\x65\156\164\x2f\x70\x6c\165\x67\151\x6e\x73\57\x6d\151\156\151\x6f\162\x61\x6e\147\145\x2d\x73\x61\155\154\x2d\x32\x30\55\163\151\x6e\x67\x6c\x65\55\x73\x69\147\x6e\x2d\157\x6e\x2f";
vnq:
$hJ = !empty($Y2["\163\x61\x6d\x6c\137\x73\160\137\x65\156\164\x69\x74\171\x5f\151\144"]) ? $Y2["\x73\x61\x6d\x6c\x5f\163\x70\x5f\145\156\164\x69\x74\x79\x5f\x69\144"] : $hJ;
$CT = $sM;
$m_ = SAMLSPUtilities::createLogoutResponse($Sc->getId(), $hJ, $CT, $Ox);
if (empty($Ox) || $Ox == "\x48\x74\x74\160\x52\x65\x64\151\x72\145\143\x74") {
goto o2T;
}
if (!($u_ == "\x75\x6e\143\150\145\143\x6b\x65\144")) {
goto mE2;
}
$TC = base64_encode($m_);
SAMLSPUtilities::postSAMLResponse($sM, $TC, $iN);
exit;
mE2:
$TC = SAMLSPUtilities::signXML($m_, $Y2, "\x53\x74\141\x74\x75\x73");
SAMLSPUtilities::postSAMLResponse($sM, $TC, $iN);
goto VqC;
o2T:
$So = $sM;
if (strpos($sM, "\x3f") !== false) {
goto FVZ;
}
$So .= "\x3f";
goto xG4;
FVZ:
$So .= "\x26";
xG4:
if (!($u_ == "\165\x6e\143\x68\145\x63\153\x65\144")) {
goto oNQ;
}
$So .= "\x53\101\115\114\x52\x65\x73\x70\157\156\x73\x65\x3d" . $m_ . "\x26\x52\145\154\141\x79\123\164\x61\164\145\75" . urlencode($iN);
header("\114\157\x63\x61\164\x69\157\x6e\x3a\x20" . $So);
exit;
oNQ:
$So .= "\x53\101\x4d\114\x52\145\163\160\x6f\156\x73\145\75" . $m_ . "\x26\122\145\154\141\x79\123\164\141\x74\145\75" . urlencode($iN);
header("\114\157\143\x61\x74\151\157\x6e\x3a\x20" . $So);
exit;
VqC:
L1X:
}
}
function mo_login_validate()
{
if (Mo_License_Service::is_customer_license_verified()) {
goto n4A;
}
return;
n4A:
if (!(isset($_REQUEST["\x6f\160\x74\151\x6f\x6e"]) && in_array($_REQUEST["\x6f\x70\164\x69\157\156"], Mo_Saml_Plugin_Setting_Options::getConstants()))) {
goto gVh;
}
SAMLSPUtilities::mo_saml_check_is_extension_installed();
gVh:
if (!(!empty($_REQUEST["\157\x70\164\x69\157\156"]) && $_REQUEST["\157\x70\164\x69\x6f\x6e"] == "\x6d\x6f\163\x61\155\x6c\x5f\155\145\164\141\x64\x61\164\141" && Mo_License_Service::is_customer_license_valid())) {
goto UJi;
}
miniorange_generate_metadata();
UJi:
if (!(!empty($_REQUEST["\x6f\x70\164\151\157\x6e"]) && $_REQUEST["\157\x70\164\151\157\156"] == "\x65\x78\x70\157\x72\x74\x5f\x63\x6f\156\146\151\x67\x75\x72\141\x74\x69\x6f\x6e" && check_admin_referer("\x65\170\160\x6f\162\164\x5f\103\157\x6e\x66\151\x67\165\x72\x61\164\151\157\156"))) {
goto WZE;
}
if (!(current_user_can("\155\x61\x6e\x61\147\145\x5f\157\160\x74\151\x6f\156\163") && Mo_License_Service::is_customer_license_valid())) {
goto ZXx;
}
miniorange_import_export(true);
ZXx:
exit;
WZE:
if (mo_saml_is_sp_configured()) {
goto ebF;
}
return;
ebF:
$X8 = EnvironmentHelper::getCurrentEnvironment();
$rm = EnvironmentHelper::getOptionForSelectedEnvironment(mo_options_enum_sso_login::Relay_states, true, $X8);
$SQ = !empty($rm["\154\x6f\147\x69\156\x5f\x72\145\154\x61\171\x5f\163\x74\141\164\145"]) ? $rm["\154\x6f\x67\x69\x6e\137\x72\145\154\x61\171\x5f\163\164\x61\x74\x65"] : array();
if (!(!empty($_REQUEST["\157\x70\x74\x69\157\x6e"]) && ("\x73\141\x6d\x6c\137\165\163\x65\x72\x5f\154\157\147\x69\x6e" === $_REQUEST["\x6f\160\164\x69\x6f\156"] || "\x74\x65\x73\x74\103\x6f\156\146\x69\x67" === $_REQUEST["\x6f\160\164\x69\157\x6e"]))) {
goto V9y;
}
if (!(SAMLSPUtilities::mo_saml_is_user_logged_in() && $_REQUEST["\x6f\160\x74\x69\x6f\x6e"] != "\164\x65\163\x74\103\x6f\156\146\x69\147")) {
goto ufV;
}
return;
ufV:
if (!("\143\150\145\143\153\x65\x64" === get_option("\155\157\137\x65\x6e\x61\x62\x6c\x65\x5f\155\x75\x6c\x74\x69\160\154\x65\x5f\154\151\143\145\x6e\163\145\163") && !EnvironmentHelper::isSelectedEnvironmentDefault() && $_REQUEST["\157\160\164\151\157\x6e"] === "\x74\x65\x73\164\103\157\156\x66\151\x67")) {
goto jXv;
}
$zb = EnvironmentHelper::getSelectedEnvironment();
$qG = admin_url("\57\141\x64\155\x69\x6e\x2d\141\x6a\x61\170\56\160\x68\160");
echo "\74\144\x69\x76\x20\x73\x74\171\x6c\145\75\x22\x66\x6f\x6e\164\55\x66\141\x6d\151\154\171\72\103\141\154\x69\142\162\151\x3b\160\141\144\144\151\156\x67\x3a\60\x20\63\x25\x3b\x22\76\xd\12\x20\40\x20\40\x20\x20\x20\x20\x20\40\x20\x20\x20\x20\40\40\74\144\151\x76\40\163\164\x79\x6c\x65\x3d\42\143\157\x6c\157\162\x3a\40\x23\141\71\x34\64\64\62\x3b\x64\x69\163\x70\x6c\141\x79\x3a\142\x6c\157\x63\x6b\x3b\164\145\170\x74\55\x61\154\x69\x67\x6e\72\143\145\156\164\x65\162\73\155\x61\x72\147\x69\x6e\x2d\142\157\x74\164\x6f\155\x3a\x34\45\73\146\x6f\x6e\164\x2d\163\151\172\145\x3a\x31\x34\160\x74\73\x22\76\15\12\40\x20\x20\x20\40\x20\x20\40\x20\40\x20\40\x20\40\40\40\x20\x20\40\x20\x3c\151\x6d\x67\40\x73\x74\171\154\x65\x3d\x22\x77\151\x64\164\x68\x3a\x31\x35\45\x3b\42\163\162\143\x3d\x22" . esc_url(SAMLSPUtilities::mo_saml_get_plugin_base_url()) . "\x69\155\141\147\145\x73\57\x77\x72\x6f\156\x67\x2e\167\145\142\x70\42\x3e\74\x62\162\76\74\x62\x72\76\15\12\40\40\x20\40\x20\40\40\40\40\x20\x20\x20\40\x20\x20\x20\x20\x20\40\40\x3c\x62\x3e\x54\x65\163\164\x20\143\157\x6e\x66\x69\147\x75\162\141\x74\x69\157\x6e\40\x66\141\151\154\x65\144\72\x20\117\x70\x65\x72\141\164\151\157\156\40\156\x6f\164\x20\163\165\160\x70\x6f\162\164\x65\x64\74\x2f\142\76\15\xa\40\40\40\x20\40\x20\40\40\x20\x20\x20\40\x20\x20\x20\x20\74\x2f\144\151\x76\76\xd\12\40\x20\x20\x20\40\x20\40\x20\40\40\x20\x20\40\x20\x20\40\x3c\144\x69\x76\x20\x73\164\171\x6c\x65\x3d\42\x6d\141\x72\147\x69\156\x2d\x62\x6f\164\x74\157\x6d\x3a\x32\60\x70\x78\x3b\x22\x3e\15\12\x20\40\x20\x20\x20\x20\40\x20\40\40\x20\40\x20\40\40\x20\x20\40\40\x20\x3c\160\76\xd\xa\40\x20\40\40\40\x20\40\40\40\x20\40\x20\x20\40\x20\40\40\40\x20\x20\40\40\40\x20\131\x6f\x75\x20\x68\x61\x76\145\40\x73\x65\x6c\x65\143\x74\145\144\40\x74\150\x65\x20\x3c\142\x3e" . esc_html($zb) . "\x3c\57\x62\76\x20\x65\x6e\x76\151\162\x6f\x6e\x6d\x65\156\164\40\x77\150\x69\x63\x68\x20\x69\163\40\156\x6f\x74\x20\171\157\x75\162\x20\143\165\162\x72\x65\156\164\40\145\156\x76\x69\162\x6f\x6e\155\145\x6e\164\x2e\40\x41\x73\x20\x70\x65\162\x20\164\x68\x65\40\x53\101\115\x4c\40\x70\162\157\164\157\x63\x6f\154\x20\x79\157\165\x20\143\141\x6e\x20\x6f\156\154\171\40\x70\x65\162\x66\x6f\162\x6d\40\x74\145\163\164\40\x63\157\156\x66\151\x67\x75\x72\141\164\151\157\x6e\40\x66\157\162\40\141\x6e\40\145\x6e\x76\x69\x72\157\156\155\x65\156\164\x20\141\146\164\145\x72\40\x79\x6f\x75\x20\x6d\x69\147\x72\141\164\x65\40\x74\x6f\40\151\x74\x2e\x3c\142\162\76\x3c\142\x72\76\xd\xa\x20\40\x20\x20\40\40\x20\40\40\x20\x20\40\40\40\40\x20\x20\x20\x20\40\40\x20\40\40\x3c\142\x3e\x4e\x6f\164\145\72\x3c\x2f\142\76\40\131\x6f\165\40\x63\x61\x6e\x20\164\x65\163\164\x20\x74\150\145\40\143\157\156\146\x69\147\165\162\141\x74\x69\157\x6e\x73\x20\146\157\162\x20\x79\157\165\x72\x20\x63\x75\x72\x72\145\x6e\x74\40\x65\156\x76\151\162\157\156\x6d\145\x6e\164\x20\x28\74\142\76" . esc_html($X8) . "\74\x2f\142\76\51\x20\x61\x66\x74\145\x72\40\x73\x77\151\x74\143\x68\x69\156\147\x20\164\157\40\151\x74\40\151\x6e\x20\164\x68\x65\x20\160\154\165\x67\151\156\56\40\111\x66\40\x79\x6f\x75\x20\167\x69\x73\x68\40\x74\x6f\40\x64\157\40\163\x6f\x20\x70\x6c\145\141\x73\145\x20\143\154\151\143\153\40\x6f\x6e\40\164\x68\x65\x20\x53\145\154\145\143\x74\x20\x43\165\x72\x72\145\x6e\x74\x20\105\156\x76\151\x72\157\156\x6d\145\x6e\x74\40\142\x75\x74\164\157\156\40\142\145\154\x6f\167\x20\x61\x6e\x64\x20\143\154\151\143\x6b\40\x6f\x6e\x20\124\x65\163\164\x20\x43\157\x6e\146\x69\147\165\x72\141\164\x69\x6f\x6e\40\146\157\x72\x20\x79\157\165\162\40\x49\104\x50\56\xd\12\40\40\x20\40\40\40\x20\40\x20\40\x20\x20\x20\x20\40\x20\40\x20\40\40\x3c\57\x70\76\xd\xa\x20\x20\40\x20\x20\x20\40\x20\40\40\x20\x20\40\x20\40\x20\x3c\57\x64\x69\166\76\xd\xa\40\x20\40\40\40\40\x20\40\x20\x20\40\x20\40\x20\x20\40\74\144\x69\x76\40\40\x73\164\171\154\145\75\42\x64\x69\x73\x70\154\x61\171\72\x20\146\154\x65\x78\x3b\x20\x6a\165\163\x74\x69\x66\171\x2d\x63\x6f\x6e\x74\x65\x6e\164\x3a\40\143\145\x6e\x74\145\x72\x3b\x22\x3e\xd\xa\40\40\40\x20\40\40\x20\x20\x20\x20\40\40\x20\x20\40\40\40\40\40\40\x3c\x69\156\160\165\164\x20\x74\171\x70\145\75\42\x62\x75\164\x74\157\x6e\x22\40\163\164\x79\154\145\x3d\x22\x70\x61\144\144\x69\156\147\x3a\x31\x25\73\x62\x61\x63\153\x67\162\157\165\156\x64\72\40\x23\x30\60\x39\x31\x43\104\40\156\157\x6e\x65\40\x72\x65\160\145\141\x74\40\x73\x63\162\x6f\x6c\x6c\x20\x30\45\40\x30\x25\x3b\x63\x75\x72\x73\157\162\x3a\40\x70\157\x69\156\164\145\x72\x3b\146\157\156\164\x2d\163\151\172\145\72\x31\65\x70\x78\x3b\x62\157\x72\x64\145\162\55\167\151\x64\164\x68\72\40\x31\160\170\73\x62\157\162\144\145\162\x2d\x73\x74\171\154\145\x3a\x20\x73\x6f\x6c\x69\144\73\x62\x6f\x72\144\145\162\x2d\x72\141\x64\151\165\163\x3a\40\x33\160\170\73\x77\150\x69\164\145\x2d\163\160\141\x63\145\x3a\40\156\x6f\167\162\x61\160\x3b\x62\157\170\55\x73\151\x7a\151\x6e\147\x3a\x20\142\x6f\x72\144\x65\162\55\142\x6f\170\x3b\142\x6f\x72\144\145\162\55\143\x6f\x6c\x6f\x72\72\x20\43\60\x30\67\x33\101\101\x3b\142\157\170\x2d\x73\150\x61\x64\x6f\x77\x3a\x20\x30\160\170\40\61\160\x78\40\60\x70\170\x20\x72\x67\x62\141\x28\x31\x32\x30\x2c\x20\62\60\60\54\40\62\63\60\54\40\x30\x2e\x36\51\x20\151\156\163\x65\164\x3b\143\x6f\154\157\162\x3a\x20\43\x46\x46\x46\x3b\42\x20\166\141\x6c\x75\145\x3d\42\x53\145\x6c\145\x63\164\x20\x43\x75\x72\x72\x65\156\164\x20\105\156\166\151\162\157\x6e\x6d\x65\x6e\164\42\40\x6f\x6e\143\x6c\x69\143\x6b\75\x22\163\165\142\x6d\151\x74\123\145\154\x65\x63\164\105\x6e\x76\x69\x72\157\156\155\x65\x6e\x74\x46\x6f\162\x6d\x28\51\73\42\x2f\76\x26\x6e\x62\x73\160\x26\x6e\142\163\x70\15\12\x20\40\x20\40\x20\x20\40\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\x20\x20\74\x69\x6e\160\x75\x74\x20\164\171\x70\145\75\x22\x62\x75\164\x74\x6f\x6e\42\40\x73\164\171\154\x65\x3d\42\x70\x61\x64\x64\x69\x6e\x67\72\x31\45\73\x77\151\144\x74\150\72\x31\x30\60\x70\x78\x3b\x62\x61\143\x6b\x67\162\x6f\x75\156\144\72\x20\x23\60\60\x39\61\x43\104\40\x6e\x6f\x6e\x65\x20\162\145\160\x65\x61\x74\40\163\143\x72\157\x6c\154\x20\60\45\40\60\45\73\x63\165\x72\163\157\x72\x3a\x20\x70\157\151\x6e\164\x65\162\73\146\x6f\x6e\164\55\x73\x69\x7a\x65\72\61\x35\160\170\73\x62\157\162\144\145\162\55\167\x69\144\164\x68\x3a\x20\61\160\x78\73\142\157\x72\x64\x65\162\x2d\x73\x74\171\x6c\145\x3a\40\x73\x6f\154\151\144\73\142\157\162\144\x65\162\55\162\x61\144\151\165\163\72\40\63\160\170\73\x77\150\151\x74\x65\55\x73\x70\x61\143\145\72\40\156\157\167\162\141\x70\73\142\157\170\55\x73\x69\172\x69\x6e\x67\72\40\142\x6f\162\x64\145\x72\55\142\x6f\x78\73\x62\157\162\x64\x65\162\55\x63\157\154\x6f\162\72\40\x23\60\x30\67\x33\101\101\x3b\x62\x6f\x78\55\x73\x68\141\x64\157\x77\72\40\60\160\170\x20\61\x70\170\x20\60\x70\170\40\162\x67\142\141\x28\61\62\x30\54\40\x32\x30\60\54\40\x32\63\x30\x2c\40\x30\x2e\66\x29\40\x69\156\x73\x65\x74\x3b\x63\157\x6c\x6f\162\x3a\x20\43\106\106\x46\73\x22\x20\166\141\x6c\165\145\x3d\x22\103\154\x6f\163\145\x22\40\x6f\x6e\x63\x6c\151\x63\x6b\75\x22\x73\145\154\146\56\143\x6c\157\x73\x65\x28\51\73\42\x2f\76\15\12\x20\40\x20\x20\40\x20\40\x20\40\x20\40\x20\40\x20\40\x20\x3c\x2f\x64\x69\166\x3e\xd\xa\x20\x20\40\40\40\40\x20\40\40\x20\x20\x20\74\x2f\144\151\166\76\xd\xa\x20\x20\x20\x20\x20\x20\40\40\x20\40\40\40\x3c\x73\x63\162\x69\x70\164\x3e\15\12\40\x20\x20\40\40\x20\40\x20\40\40\x20\40\x20\40\40\x20\x66\165\x6e\x63\x74\151\x6f\x6e\x20\163\x75\142\x6d\151\164\x53\x65\x6c\x65\x63\164\105\x6e\166\151\x72\157\x6e\x6d\x65\156\x74\x46\157\x72\155\50\x29\173\15\xa\x20\40\40\40\40\40\x20\x20\x20\40\40\x20\40\x20\40\x20\x20\40\40\x20\166\141\x72\x20\165\162\154\x20\75\x20\42" . esc_url($qG) . "\x22\x3b\15\12\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\40\40\40\x20\40\x20\40\40\40\x76\141\162\x20\x66\x6f\x72\x6d\104\141\x74\141\x20\x3d\40\x6e\145\167\x20\106\x6f\x72\155\x44\x61\x74\141\x28\x29\73\15\12\40\40\40\40\x20\x20\40\40\x20\x20\x20\40\40\40\x20\40\40\x20\40\x20\x66\x6f\x72\x6d\104\141\x74\x61\x2e\x61\x70\160\145\156\144\x28\42\x61\x63\x74\151\157\156\x22\x2c\x20\42\x6d\157\x5f\163\x61\x6d\154\x5f\143\150\x61\156\147\145\137\x65\156\x76\151\x72\157\156\155\145\x6e\x74\42\51\x3b\15\xa\40\x20\40\x20\x20\40\x20\x20\40\x20\40\x20\40\40\x20\40\x20\x20\40\40\15\12\x20\40\40\40\40\x20\40\x20\x20\40\40\x20\40\x20\x20\40\x20\x20\40\x20\x66\x65\164\143\150\x28\x75\x72\x6c\x2c\40\173\15\12\x20\x20\x20\40\x20\x20\x20\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\x20\x20\40\x20\x20\x6d\x65\164\x68\157\x64\72\x20\x22\x50\117\123\124\42\x2c\15\xa\x20\40\40\40\40\40\40\x20\40\x20\40\40\x20\40\40\x20\40\x20\x20\40\x20\x20\x20\40\x62\x6f\x64\x79\x3a\40\x66\x6f\162\155\x44\x61\x74\141\15\12\x20\40\40\x20\x20\40\x20\40\x20\40\x20\40\40\x20\40\x20\40\x20\40\x20\x7d\51\15\xa\x20\x20\40\x20\x20\x20\x20\40\40\40\x20\40\40\40\40\x20\40\40\40\x20\56\x74\x68\145\156\x28\162\x65\163\160\157\x6e\x73\x65\x20\75\x3e\40\173\15\12\40\x20\40\40\40\40\40\40\x20\40\40\40\x20\40\x20\40\x20\x20\x20\x20\x20\x20\40\40\151\x66\40\50\x72\x65\163\x70\x6f\x6e\x73\x65\x2e\x6f\x6b\51\40\173\xd\12\40\40\x20\x20\40\40\40\40\x20\40\40\40\x20\x20\x20\40\x20\x20\40\40\x20\x20\40\x20\40\40\x20\x20\x69\x66\40\50\x77\151\156\x64\x6f\167\56\x6f\x70\x65\156\145\x72\51\40\x7b\xd\xa\x20\x20\x20\40\x20\x20\x20\40\40\40\40\x20\40\40\40\40\40\40\x20\40\x20\40\40\40\x20\x20\x20\40\x20\40\x20\40\167\151\156\x64\x6f\167\x2e\157\x70\x65\x6e\x65\x72\56\x6c\157\143\141\164\x69\x6f\x6e\56\x72\145\154\x6f\141\144\50\51\73\xd\12\40\x20\40\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\40\40\x20\x20\x20\x20\x20\40\40\40\40\x20\40\40\x7d\15\12\x20\x20\40\40\x20\40\40\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\163\145\154\146\x2e\x63\x6c\157\163\x65\x28\51\73\xd\12\x20\x20\40\40\x20\40\x20\40\x20\x20\40\40\40\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\175\xd\12\x20\x20\x20\40\x20\x20\x20\40\x20\x20\x20\40\x20\x20\x20\40\40\40\40\40\175\x29\15\xa\x20\x20\40\40\x20\40\x20\40\40\40\40\x20\40\x20\40\40\x20\x20\x20\40\56\x63\x61\164\x63\150\x28\145\x72\162\157\162\40\75\x3e\40\173\xd\xa\40\40\40\x20\x20\x20\40\x20\40\x20\40\40\40\40\40\x20\40\40\x20\x20\40\x20\40\x20\143\x6f\x6e\x73\x6f\x6c\145\x2e\145\x72\x72\157\162\50\x22\x4e\x65\164\x77\157\x72\153\x20\x65\162\x72\157\162\72\x22\x2c\40\145\x72\162\x6f\x72\51\73\xd\xa\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x7d\51\x3b\xd\12\40\x20\40\x20\x20\x20\40\40\40\40\40\40\40\x20\40\x20\x7d\xd\12\40\40\40\40\40\40\40\x20\x20\40\40\x20\74\57\163\x63\x72\151\160\164\76";
exit;
jXv:
if (!mo_saml_is_sp_configured($X8)) {
goto Z7H;
}
SAMLSPUtilities::mo_saml_disable_extra_idps($X8);
$Lf = EnvironmentHelper::getOptionForSelectedEnvironment("\163\141\155\x6c\x5f\151\x64\145\x6e\x74\151\x74\x79\137\160\x72\x6f\x76\x69\144\145\162\x73", true, $X8);
$bL = array_change_key_case($Lf, CASE_LOWER);
if (!empty($_REQUEST["\x69\x64\160"])) {
goto KzM;
}
if (!empty(EnvironmentHelper::getOptionForSelectedEnvironment("\x73\x61\x6d\x6c\x5f\144\145\146\x61\x75\x6c\164\137\x69\x64\160", false, $X8))) {
goto aVv;
}
goto t_1;
KzM:
$Oj = strtolower($_REQUEST["\151\x64\x70"]);
goto t_1;
aVv:
$Oj = strtolower(EnvironmentHelper::getOptionForSelectedEnvironment("\163\141\155\x6c\x5f\x64\x65\146\x61\x75\x6c\164\137\x69\144\160", false, $X8));
t_1:
if (!empty($Oj) && !empty($bL[$Oj])) {
goto R3Y;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\127\x50\x53\101\115\114\x45\122\122\x30\63\x36"]);
goto VG1;
R3Y:
$s8 = $bL[$Oj];
VG1:
if (empty($_REQUEST["\145\x6e\164\151\164\x79\111\104"])) {
goto mPG;
}
$kD = getIdpNameFromEntityId($Lf, $_REQUEST["\145\x6e\x74\x69\x74\171\x49\x44"]);
if ($kD) {
goto yqn;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\127\x50\123\x41\115\114\105\122\x52\x30\x33\x36"]);
yqn:
$s8 = $Lf[$kD];
mPG:
if (!empty($s8["\145\x6e\x61\142\x6c\x65\x5f\x69\x64\160"])) {
goto D4k;
}
if (!($_REQUEST["\157\x70\x74\x69\x6f\156"] === "\x73\x61\155\154\137\165\163\145\162\x5f\x6c\157\x67\151\156")) {
goto vm1;
}
throw new Mo_SAML_IDP_Status_Inactive_Exception("\111\x44\x50\x20\116\157\164\40\105\156\141\142\154\x65\144\x2e");
vm1:
D4k:
$gH = EnvironmentHelper::getOptionForSelectedEnvironment("\155\157\x5f\x73\141\x6d\154\x5f\x73\x70\137\142\x61\163\145\x5f\165\x72\x6c", false, $X8);
if (!empty($gH)) {
goto IV0;
}
$gH = home_url();
IV0:
if ($_REQUEST["\157\160\x74\151\x6f\x6e"] == "\x74\x65\x73\164\103\157\156\x66\151\x67" and !empty($_REQUEST["\x6e\x65\x77\x63\145\162\x74"])) {
goto SQD;
}
if ($_REQUEST["\x6f\x70\164\151\157\156"] == "\164\x65\163\164\x43\157\156\146\151\147") {
goto SFr;
}
if (!empty($SQ["\104\x45\x46\x41\125\x4c\x54"]) || !empty($_REQUEST["\151\144\x70"]) && !empty($SQ[$_REQUEST["\x69\144\x70"]])) {
goto skX;
}
if (!empty($_REQUEST["\162\x65\x64\x69\x72\x65\143\164\x5f\164\157"])) {
goto Tf3;
}
$Sz = saml_get_referer_page_url();
goto MC8;
SQD:
$Sz = "\x74\x65\x73\164\116\x65\x77\x43\145\162\x74\151\x66\151\143\x61\x74\x65";
goto MC8;
SFr:
if (!(!is_user_logged_in() || !current_user_can("\155\141\156\x61\147\145\x5f\157\160\164\x69\157\x6e\163"))) {
goto Jik;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\x57\120\x53\101\115\114\105\x52\x52\x30\63\x38"]);
Jik:
$Sz = "\x74\145\x73\x74\126\141\154\x69\144\141\164\x65";
goto MC8;
skX:
$Dt = !empty($_REQUEST["\151\x64\x70"]) ? sanitize_text_field(wp_unslash($_REQUEST["\151\x64\x70"])) : '';
$Sz = !empty($Dt) && !empty($SQ[$Dt]) ? $SQ[$Dt] : $SQ["\x44\x45\106\x41\x55\x4c\x54"];
goto MC8;
Tf3:
$Sz = $_REQUEST["\x72\x65\x64\x69\x72\145\x63\x74\x5f\x74\x6f"];
MC8:
if (empty($Sz)) {
goto ODR;
}
$GA = parse_url($Sz, PHP_URL_PATH);
ODR:
$GA = empty($GA) ? "\x2f" : $GA;
if (empty($Sz)) {
goto QBU;
}
$kN = parse_url($Sz, PHP_URL_QUERY);
QBU:
if (!empty($kN)) {
goto Alf;
}
$Sz = $GA;
goto YI3;
Alf:
$Sz = $GA . "\77" . $kN;
YI3:
$lg = $s8["\x73\x73\x6f\x5f\x75\162\x6c"];
$lg = apply_filters("\155\x6f\137\x73\x61\155\x6c\137\163\163\x6f\x5f\x75\162\154", $lg, $s8["\x69\144\x70\x5f\156\x61\x6d\145"]);
$u_ = $s8["\x72\145\x71\165\x65\163\164\137\x73\151\147\156\x65\x64"];
$hD = $s8["\x73\x73\157\137\x62\x69\156\x64\x69\x6e\x67\x5f\x74\171\x70\145"];
$eV = EnvironmentHelper::getOptionForSelectedEnvironment("\155\157\x5f\163\x61\x6d\x6c\137\146\157\x72\x63\145\137\141\165\164\150\x65\x6e\x74\151\x63\x61\164\x69\x6f\156", false, $X8);
$wv = $gH . "\57";
$hJ = EnvironmentHelper::getOptionForSelectedEnvironment("\155\157\x5f\x73\141\x6d\154\137\163\x70\x5f\x65\x6e\164\151\164\171\x5f\151\x64", false, $X8);
$D6 = $s8["\x6e\141\x6d\x65\x69\144\137\x66\x6f\x72\155\x61\164"];
if (!empty($D6)) {
goto G87;
}
$D6 = "\x31\x2e\x31\x3a\x6e\x61\x6d\x65\151\x64\55\146\157\162\x6d\141\164\72\165\156\x73\160\145\143\x69\x66\x69\145\144";
G87:
if (!empty($hJ)) {
goto XyT;
}
$hJ = $gH . "\x2f\167\x70\55\x63\x6f\156\x74\145\x6e\x74\x2f\160\x6c\165\147\x69\156\x73\57\x6d\x69\156\151\x6f\x72\141\x6e\x67\145\55\x73\141\x6d\154\x2d\x32\60\55\x73\151\156\x67\154\145\x2d\x73\x69\147\x6e\x2d\157\156\x2f";
XyT:
$hJ = !empty($s8["\163\141\155\x6c\x5f\163\160\137\145\x6e\x74\151\164\x79\x5f\151\x64"]) ? $s8["\x73\x61\x6d\154\x5f\163\x70\137\x65\156\164\x69\x74\171\x5f\151\x64"] : $hJ;
$He = !empty($_POST["\165\x6e\x61\155\145\x5f\x65\155\141\151\154"]) ? $_POST["\x75\x6e\x61\155\x65\x5f\x65\x6d\x61\x69\154"] : false;
if (!$He) {
goto nuG;
}
$DQ = email_exists($He);
if (!($DQ == false)) {
goto Y4k;
}
$He = false;
update_site_option("\155\157\137\x73\x61\x6d\154\137\163\x68\x6f\x72\x74\x63\157\x64\145\137\155\x65\163\163\141\x67\x65", "\125\163\145\162\40\144\157\x65\x73\40\156\157\x74\40\x45\x78\x69\x73\x74\x73");
return;
Y4k:
nuG:
$DN = SAMLSPUtilities::createAuthnRequest($wv, $hJ, $lg, $s8, $eV, $hD, $D6);
$GB = SAMLSPUtilities::mo_saml_sanitize_associative_array($_REQUEST);
if (empty($hD) || $hD == "\110\164\164\160\x52\145\x64\151\x72\145\x63\x74") {
goto Eyi;
}
if (!($u_ == "\x75\156\x63\x68\x65\143\153\145\x64")) {
goto mXR;
}
$TC = base64_encode($DN);
SAMLSPUtilities::postSAMLRequest($lg, $TC, $Sz, $GB, $He);
exit;
mXR:
if ($_REQUEST["\157\160\164\151\157\x6e"] == "\164\x65\163\164\151\x64\x70\143\x6f\156\x66\151\147" && $_REQUEST["\156\x65\x77\x63\x65\x72\164"] == true) {
goto Hd4;
}
$TC = SAMLSPUtilities::signXML($DN, $s8, "\x4e\141\155\145\111\x44\120\157\154\x69\143\171");
goto LrC;
Hd4:
$TC = SAMLSPUtilities::signXML($DN, $s8, "\116\x61\x6d\x65\111\x44\x50\x6f\x6c\151\x63\171", true);
LrC:
SAMLSPUtilities::postSAMLRequest($lg, $TC, $Sz, $GB, $He);
goto o0O;
Eyi:
$So = $lg;
if (strpos($lg, "\x3f") !== false) {
goto AAT;
}
$So .= "\77";
goto ISE;
AAT:
$So .= "\46";
ISE:
if (!($u_ == "\165\156\143\x68\x65\x63\153\x65\x64")) {
goto xZ2;
}
$So .= "\123\101\115\x4c\x52\x65\161\165\145\x73\x74\75" . $DN . SAMLSPUtilities::mo_saml_append_params_redirect_binding($GB) . "\x26\122\x65\x6c\141\171\x53\164\x61\164\145\x3d" . urlencode($Sz);
if (!$He) {
goto thZ;
}
$So .= "\x26\105\x6d\141\x69\154\75" . urlencode($He);
thZ:
header("\143\x61\143\150\x65\x2d\143\x6f\x6e\164\162\157\x6c\72\x20\x6d\x61\170\55\x61\x67\x65\75\x30\54\x20\160\162\x69\166\x61\164\x65\54\x20\156\157\55\163\164\x6f\162\x65\x2c\40\156\x6f\55\x63\141\x63\x68\x65\x2c\x20\x6d\x75\163\164\55\x72\x65\x76\141\154\151\144\x61\x74\x65");
header("\114\157\x63\141\x74\x69\157\156\x3a\x20" . $So);
exit;
xZ2:
$DN = "\123\x41\x4d\x4c\122\145\161\165\x65\163\x74\x3d" . $DN . "\46\x52\145\x6c\x61\x79\x53\164\141\x74\145\75" . urlencode($Sz) . "\x26\x53\151\147\101\154\147\75" . urlencode(XMLSecurityKey::RSA_SHA256);
$uN = array("\x74\171\x70\145" => "\160\162\151\166\141\x74\145");
$Fx = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, $uN);
if ($_REQUEST["\x6f\x70\164\151\x6f\x6e"] == "\x74\x65\163\164\151\144\x70\143\x6f\156\146\x69\x67" && $_REQUEST["\x6e\145\x77\x63\145\x72\x74"] == true) {
goto cc9;
}
$UG = mo_saml_get_sp_private_key_for_idp($s8);
goto DLr;
cc9:
$UG = file_get_contents(plugin_dir_path(__FILE__) . "\x72\x65\x73\157\165\x72\143\x65\x73" . DIRECTORY_SEPARATOR . mo_options_enum_default_sp_certificate::SP_PRIVATE_KEY_FILE_NAME);
DLr:
$Fx->loadKey($UG, false);
$zH = new XMLSecurityDSig();
$oL = $Fx->signData($DN);
$oL = base64_encode($oL);
$So .= $DN . "\x26\123\x69\147\x6e\x61\x74\165\162\145\x3d" . urlencode($oL) . SAMLSPUtilities::mo_saml_append_params_redirect_binding($GB);
if (!$He) {
goto hDi;
}
$So .= "\46\x45\x6d\141\151\154\75" . urlencode($He);
hDi:
header("\143\x61\143\x68\145\x2d\x63\x6f\156\x74\x72\x6f\x6c\72\x20\155\141\170\55\141\x67\145\x3d\x30\54\x20\160\162\x69\166\141\164\145\54\40\156\157\55\x73\164\x6f\162\x65\54\40\156\157\55\143\141\143\x68\x65\x2c\x20\155\x75\163\164\55\x72\145\x76\x61\154\x69\144\141\164\145");
header("\x4c\157\143\141\x74\x69\157\x6e\x3a\40" . $So);
exit;
o0O:
Z7H:
V9y:
if (empty($_REQUEST["\123\101\115\x4c\122\x65\x73\x70\157\156\x73\145"])) {
goto As_;
}
SAMLSPUtilities::mo_saml_check_is_extension_installed();
$gH = EnvironmentHelper::getOptionForSelectedEnvironment("\x6d\157\x5f\163\x61\x6d\x6c\x5f\163\160\x5f\x62\141\x73\145\137\165\162\154", false, $X8);
if (!empty($gH)) {
goto Uf8;
}
$gH = home_url();
Uf8:
$Gc = htmlspecialchars($_REQUEST["\x53\x41\115\114\122\145\163\x70\157\156\163\x65"]);
$Gc = SAMLSPUtilities::validate_compressed_xml($Gc, "\123\101\115\x4c\122\145\x73\x70\x6f\x6e\163\145");
$tw = SAMLSPUtilities::mo_saml_safe_load_xml($Gc, Mo_Saml_Error_Codes::$error_codes["\x57\x50\x53\101\x4d\x4c\105\122\x52\x30\x31\67"]);
$Ly = $tw->firstChild;
$bH = $tw->documentElement;
$In = new DOMXpath($tw);
$In->registerNamespace("\163\141\x6d\154\x70", "\165\x72\x6e\x3a\x6f\141\163\x69\163\x3a\x6e\141\x6d\145\x73\72\164\x63\x3a\123\101\x4d\114\72\x32\x2e\60\x3a\160\162\157\164\x6f\143\157\x6c");
$In->registerNamespace("\x73\x61\x6d\154", "\x75\x72\x6e\x3a\x6f\141\x73\151\x73\x3a\x6e\141\x6d\x65\163\72\x74\143\x3a\123\101\115\114\72\x32\x2e\x30\72\141\163\163\145\162\x74\151\157\x6e");
if ($Ly->localName == "\114\157\x67\157\x75\x74\x52\x65\x73\160\157\156\x73\145") {
goto v3W;
}
$ZN = $In->query("\57\163\x61\155\154\160\72\x52\145\163\x70\x6f\156\x73\x65\57\163\141\x6d\x6c\x70\x3a\x53\x74\x61\164\165\163\57\x73\x61\155\x6c\160\72\123\164\x61\x74\165\x73\x43\x6f\144\x65", $bH);
$F3 = !empty($ZN) ? $ZN->item(0)->getAttribute("\x56\141\154\165\145") : '';
$lS = explode("\x3a", $F3);
if (empty($lS[7])) {
goto Vsj;
}
$ZN = $lS[7];
Vsj:
$Mn = $In->query("\57\163\141\x6d\x6c\x70\x3a\x52\145\163\160\x6f\x6e\163\145\x2f\163\141\155\154\x70\72\x53\x74\x61\164\165\163\x2f\163\141\155\154\160\x3a\x53\164\141\x74\165\163\115\x65\x73\x73\x61\147\145", $bH);
$cW = !empty($Mn) ? $Mn->item(0) : '';
if (empty($cW)) {
goto k1G;
}
$cW = $cW->nodeValue;
k1G:
$bL = EnvironmentHelper::getOptionForSelectedEnvironment("\x73\141\155\x6c\137\151\144\x65\156\164\151\164\x79\137\160\x72\157\x76\151\144\145\x72\163", true, $X8);
if (!empty($_REQUEST["\x52\145\x6c\141\x79\123\x74\x61\164\x65"]) && $_REQUEST["\x52\145\x6c\141\171\x53\164\x61\164\145"] != "\x2f") {
goto KDd;
}
$T9 = saml_get_current_page_url();
goto LNC;
KDd:
$T9 = $_REQUEST["\x52\145\x6c\141\171\123\x74\141\164\145"];
LNC:
$K2 = array("\x73\x61\155\x6c\137\x72\x65\163\160\157\x6e\163\145" => base64_encode($Gc));
$Gc = new SAML2_Response($Ly, get_option("\x6d\x6f\x5f\163\x61\155\x6c\x5f\x63\165\x72\x72\145\156\164\x5f\x63\x65\162\x74\x5f\x70\162\151\x76\141\x74\145\x5f\153\x65\171"));
SAMLSPUtilities::mo_saml_check_saml_response_for_replay_attack($Gc);
if (!(SAMLSPUtilities::mo_saml_is_user_logged_in() && "\x74\x65\163\164\126\x61\154\x69\144\141\164\145" != $T9)) {
goto dZk;
}
return;
dZk:
$tV = $Gc->getIssuer();
$Ub = null;
if (empty($bL)) {
goto ldj;
}
foreach ($bL as $Fx => $QB) {
if (!($QB["\x69\144\160\137\145\156\x74\151\x74\x79\x5f\151\144"] == $tV)) {
goto uzG;
}
$Ub = $bL[$Fx];
goto deS;
uzG:
jDv:
}
deS:
ldj:
if (!($Ub == null)) {
goto jLp;
}
$Ub = apply_filters("\155\157\137\x73\141\155\x6c\137\x66\151\x6c\164\145\162\x5f\x69\144\145\156\164\x69\x74\x79\137\x70\162\157\x76\x69\x64\145\x72\163", $bL, $tV);
jLp:
if (SAMLSPUtilities::mo_saml_validate_idp($Ub, $bL)) {
goto Ac2;
}
if ($T9 == "\x74\x65\x73\164\x56\x61\154\x69\x64\141\164\x65" or $T9 == "\164\x65\163\x74\x4e\145\x77\103\145\162\164\151\146\151\143\x61\164\145") {
goto pW4;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\x57\120\123\x41\115\x4c\105\122\x52\60\x31\x30"]);
goto d4N;
pW4:
$AC = mo_options_error_constants::Error_issuer_not_verified;
$AH = mo_options_error_constants::Cause_issuer_not_verified;
$tQ = "\x3c\x70\x3e\x3c\163\x74\x72\x6f\156\x67\x3e\x45\x6e\164\x69\x74\x79\40\111\104\40\x66\157\x75\x6e\144\40\151\x6e\40\123\101\115\x4c\x20\122\x65\x73\x70\157\x6e\163\x65\72\x20\74\x2f\x73\164\162\x6f\156\147\x3e\x3c\146\157\156\164\x20\146\141\143\x65\x3d\x22\103\157\x75\162\151\x65\162\40\x4e\x65\x77\42\x3b\x66\157\x6e\x74\55\x73\151\172\145\x3a\61\60\160\164\x3e\74\142\x72\x3e\74\142\162\76" . esc_html($tV) . "\74\57\x70\x3e\x3c\57\x66\157\x6e\164\76";
Mo_Saml_Error_Message::mo_saml_display_test_config_error(Mo_Saml_Error_Codes::$error_codes["\127\x50\x53\x41\x4d\114\x45\x52\122\x30\61\60"], $tQ);
mo_saml_download_logs($AC, $AH);
exit;
d4N:
Ac2:
if (!($ZN != "\123\165\143\143\145\163\x73")) {
goto lY9;
}
show_status_error($ZN, $T9, $cW, $Ub);
lY9:
$kD = '';
if ($T9 == "\164\x65\163\x74\x4e\145\167\103\x65\162\x74\151\x66\x69\x63\x61\164\x65") {
goto gYV;
}
$Yq = mo_saml_get_sp_private_key_for_idp($Ub);
goto qhQ;
gYV:
$Yq = file_get_contents(plugin_dir_path(__FILE__) . "\162\x65\x73\x6f\x75\162\x63\x65\x73" . DIRECTORY_SEPARATOR . mo_options_enum_default_sp_certificate::SP_PRIVATE_KEY_FILE_NAME);
qhQ:
$Gc->parseAssertions($Ly, $Yq);
$n8 = $Gc->getSignatureData();
$WG = current($Gc->getAssertions())->getSignatureData();
if (is_null($Ub)) {
goto eVP;
}
$kD = $Ub["\x69\x64\160\137\x6e\141\x6d\145"];
$bL[$kD] = SAMLSPUtilities::mo_saml_array_merge($bL[$kD], $K2);
$bL = array_filter($bL, "\x66\151\154\164\x65\162\x5f\145\155\x70\x74\171\137\x76\x61\154\165\145\163");
$j4 = new EnvironmentDao($X8);
$j4->mo_save_environment_settings("\x73\141\x6d\x6c\137\151\x64\145\x6e\164\151\x74\x79\137\160\x72\x6f\166\x69\x64\145\x72\163", $bL, false);
eVP:
SAMLSPUtilities::mo_saml_disable_extra_idps($X8);
$Jk = EnvironmentHelper::getOptionForSelectedEnvironment("\x6d\x6f\x5f\x73\141\155\x6c\x5f\145\156\x61\x62\x6c\x65\144\137\151\144\160\x73", true, $X8);
if (array_key_exists($kD, $Jk)) {
goto BqD;
}
if (!($T9 != "\164\x65\x73\x74\126\141\154\151\x64\x61\164\x65" && $T9 != "\x74\145\x73\x74\x4e\x65\x77\103\x65\162\164\x69\x66\x69\143\x61\164\145")) {
goto BI_;
}
throw new Mo_SAML_IDP_Status_Inactive_Exception("\x49\104\120\x20\x4e\x6f\164\40\105\156\141\x62\154\x65\144\56");
BI_:
BqD:
if (!(empty($WG) && empty($n8))) {
goto xD_;
}
if ($T9 == "\x74\x65\163\164\x56\x61\154\x69\144\x61\164\145" or $T9 == "\164\145\163\x74\x4e\x65\167\x43\x65\x72\x74\151\146\151\x63\x61\x74\145") {
goto wOn;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\x57\120\x53\x41\x4d\x4c\x45\122\x52\60\60\63"]);
goto TYK;
wOn:
Mo_Saml_Error_Message::mo_saml_display_test_config_error(Mo_Saml_Error_Codes::$error_codes["\x57\x50\x53\x41\x4d\x4c\x45\122\122\60\60\63"]);
TYK:
xD_:
$Mo = maybe_unserialize($Ub["\x78\x35\x30\x39\137\x63\145\162\x74\x69\x66\x69\143\x61\164\x65"]);
$wv = $gH . "\x2f";
if (is_array($Mo)) {
goto BxR;
}
$Uu = XMLSecurityKey::getRawThumbprint($Mo);
$Uu = mo_saml_convert_to_windows_iconv($Uu, $Ub);
$Uu = preg_replace("\57\134\x73\x2b\57", '', $Uu);
if (empty($n8)) {
goto drf;
}
$F5 = SAMLSPUtilities::processResponse($wv, $Uu, $n8, $Gc, $Mo, $T9);
drf:
if (empty($WG)) {
goto Jr8;
}
$F5 = SAMLSPUtilities::processResponse($wv, $Uu, $WG, $Gc, $Mo, $T9);
Jr8:
goto VK7;
BxR:
foreach ($Mo as $Gr => $sz) {
$Uu = XMLSecurityKey::getRawThumbprint(SAMLSPUtilities::sanitize_certificate($sz));
$Uu = mo_saml_convert_to_windows_iconv($Uu, $Ub);
$Uu = preg_replace("\x2f\134\x73\53\x2f", '', $Uu);
if (empty($n8)) {
goto MEn;
}
$F5 = SAMLSPUtilities::processResponse($wv, $Uu, $n8, $Gc, $sz, $T9);
MEn:
if (empty($WG)) {
goto zRX;
}
$F5 = SAMLSPUtilities::processResponse($wv, $Uu, $WG, $Gc, $sz, $T9);
zRX:
if (!$F5) {
goto sTr;
}
goto S0P;
sTr:
o0I:
}
S0P:
VK7:
if (!(empty($WG) && empty($n8))) {
goto ZA9;
}
echo "\x4e\x6f\x20\x73\151\x67\156\x61\164\x75\162\145\40\146\x6f\x75\x6e\144\x20\151\156\40\123\101\x4d\114\40\x52\x65\x73\x70\157\x6e\163\145\x20\x6f\162\40\x41\163\x73\145\x72\x74\151\157\x6e\56\40\x50\154\145\x61\163\145\x20\163\x69\x67\x6e\40\141\x74\x20\154\x65\x61\x73\x74\40\x6f\x6e\x65\40\157\146\40\x74\150\x65\x6d\x2e";
exit;
ZA9:
if ($n8) {
goto tXv;
}
if ($WG) {
goto uKi;
}
goto rqA;
tXv:
if (!(count($n8["\x43\x65\x72\x74\151\146\151\x63\141\164\x65\x73"]) > 0)) {
goto M7s;
}
$yy = $n8["\x43\145\162\x74\151\x66\151\143\141\x74\145\x73"][0];
M7s:
goto rqA;
uKi:
if (!(count($WG["\x43\145\162\164\151\146\x69\x63\141\x74\145\163"]) > 0)) {
goto rZr;
}
$yy = $WG["\x43\145\162\x74\151\x66\151\143\141\164\145\x73"][0];
rZr:
rqA:
if ($F5) {
goto OiT;
}
if ($T9 == "\x74\x65\x73\x74\126\141\x6c\151\144\x61\164\145" or $T9 == "\x74\x65\x73\x74\116\x65\167\103\x65\162\164\151\x66\151\143\x61\164\145") {
goto m4O;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\127\120\x53\x41\x4d\114\x45\x52\122\x30\x30\64"]);
goto iNu;
m4O:
$nZ = "\55\x2d\55\55\55\102\105\x47\x49\x4e\x20\x43\x45\x52\124\x49\x46\111\x43\101\x54\105\x2d\55\55\55\x2d\x3c\x62\x72\76" . chunk_split($yy, 64) . "\x3c\x62\x72\76\x2d\x2d\x2d\55\55\x45\116\x44\x20\103\105\x52\x54\x49\106\111\x43\101\124\105\x2d\x2d\x2d\x2d\x2d";
$tQ = "\x3c\160\76\74\x73\x74\162\157\x6e\x67\76\x43\x65\162\x74\x69\x66\151\143\x61\164\145\x20\146\x6f\x75\x6e\x64\40\151\x6e\x20\x53\101\x4d\114\x20\x52\x65\x73\160\x6f\x6e\x73\145\x3a\x20\74\57\163\x74\x72\x6f\x6e\147\76\x3c\x66\x6f\x6e\164\40\x66\141\143\145\x3d\x22\x43\157\x75\x72\x69\145\162\40\116\145\x77\42\73\x66\157\x6e\x74\55\x73\x69\x7a\145\72\61\x30\x70\x74\x3e\74\x62\162\x3e\x3c\x62\162\76" . $nZ . "\74\x2f\160\76\x3c\x2f\146\x6f\x6e\x74\76";
Mo_Saml_Error_Message::mo_saml_display_test_config_error(Mo_Saml_Error_Codes::$error_codes["\127\x50\x53\101\x4d\114\105\x52\x52\60\x30\64"], $tQ);
iNu:
OiT:
$hJ = EnvironmentHelper::getOptionForSelectedEnvironment("\155\157\x5f\x73\x61\155\x6c\x5f\x73\160\137\x65\x6e\164\x69\164\x79\137\x69\x64", false, $X8);
if (!empty($hJ)) {
goto ReQ;
}
$hJ = $gH . "\57\x77\x70\x2d\x63\157\x6e\164\x65\x6e\x74\57\x70\x6c\165\147\x69\156\x73\x2f\155\x69\156\151\x6f\162\141\156\147\145\x2d\x73\x61\x6d\x6c\55\x32\x30\55\163\151\x6e\x67\x6c\145\x2d\163\x69\147\x6e\55\x6f\x6e\x2f";
ReQ:
$hJ = !empty($Ub["\163\x61\155\154\137\x73\160\x5f\145\x6e\x74\x69\164\x79\x5f\151\x64"]) ? $Ub["\163\x61\x6d\x6c\x5f\x73\160\137\x65\x6e\164\151\164\x79\137\x69\x64"] : $hJ;
$Rt = current($Gc->getAssertions())->getIssuer();
SAMLSPUtilities::validateIssuerAndAudience($Gc, $hJ, $Rt, $T9, $kD);
$VX = sanitize_text_field(current(current($Gc->getAssertions())->getNameId()));
if (!empty($VX)) {
goto ED7;
}
if ($T9 === "\x74\145\163\164\x56\141\x6c\x69\144\141\x74\x65" or $T9 === "\x74\145\163\164\116\x65\167\103\x65\162\x74\151\x66\x69\x63\x61\164\x65") {
goto HWR;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\x57\x50\x53\101\x4d\114\105\122\x52\60\x30\x32"]);
goto pIH;
HWR:
Mo_Saml_Error_Message::mo_saml_display_test_config_error(Mo_Saml_Error_Codes::$error_codes["\x57\x50\x53\x41\x4d\x4c\x45\122\122\60\x30\62"]);
pIH:
ED7:
$P3 = current($Gc->getAssertions())->getAttributes();
if (empty($P3)) {
goto SdE;
}
$P3 = map_deep($P3, "\163\141\x6e\151\x74\x69\x7a\145\137\164\145\x78\x74\x5f\x66\151\145\x6c\x64");
SdE:
$P3["\x4e\141\x6d\x65\111\104"] = array("\60" => $VX);
$gz = current($Gc->getAssertions())->getSessionIndex();
mo_saml_checkMapping($Ub, $P3, wp_specialchars_decode($T9), $gz);
goto pYm;
v3W:
if (empty($_REQUEST["\x52\145\154\x61\171\123\164\141\164\145"])) {
goto RlG;
}
$iN = $_REQUEST["\x52\145\154\x61\x79\x53\x74\x61\164\145"];
RlG:
if (!SAMLSPUtilities::mo_saml_is_user_logged_in()) {
goto fPO;
}
wp_destroy_current_session();
wp_clear_auth_cookie();
wp_set_current_user(0);
fPO:
if (!empty($iN)) {
goto kep;
}
$iN = home_url();
kep:
header("\114\x6f\x63\141\164\x69\x6f\156\72\x20" . $iN);
exit;
pYm:
As_:
if (empty($_REQUEST["\x53\101\x4d\114\x52\x65\161\165\x65\163\164"])) {
goto QlS;
}
SAMLSPUtilities::mo_saml_check_is_extension_installed();
$DN = $_REQUEST["\x53\101\x4d\x4c\122\x65\161\x75\145\163\x74"];
$T9 = "\57";
if (empty($_REQUEST["\122\145\154\x61\171\123\164\141\x74\x65"])) {
goto NtM;
}
$T9 = $_REQUEST["\122\x65\154\141\x79\123\164\x61\x74\x65"];
NtM:
$DN = htmlspecialchars($_REQUEST["\123\x41\115\114\122\x65\161\165\145\163\164"]);
$DN = SAMLSPUtilities::validate_compressed_xml($DN, "\x53\101\115\x4c\122\x65\x71\x75\x65\163\x74");
$tw = SAMLSPUtilities::mo_saml_safe_load_xml($DN, Mo_Saml_Error_Codes::$error_codes["\x57\120\x53\x41\x4d\x4c\x45\x52\x52\60\x32\70"]);
$fu = $tw->firstChild;
if (!($fu->localName == "\x4c\157\147\157\165\164\122\145\161\165\145\x73\164")) {
goto jmD;
}
$Sc = new SAML2_LogoutRequest($fu);
if (!(!session_id() || session_id() == '' || empty($_SESSION))) {
goto dgf;
}
session_start();
dgf:
$_SESSION["\155\157\137\163\141\155\154\137\154\157\147\x6f\165\164\x5f\162\145\x71\165\145\x73\x74"] = $DN;
$_SESSION["\x6d\157\137\x73\141\x6d\x6c\x5f\x6c\x6f\x67\x6f\x75\164\137\162\145\154\141\171\137\163\x74\141\164\145"] = $T9;
wp_logout();
jmD:
QlS:
}
function getIdpNameFromEntityId($bL, $Jz)
{
if (!(!empty($bL) and is_array($bL))) {
goto qx3;
}
foreach ($bL as $s8) {
if (!($s8["\151\x64\x70\x5f\x65\156\x74\x69\x74\171\137\151\144"] == $Jz)) {
goto WgA;
}
return $s8["\151\144\160\x5f\x6e\141\155\145"];
WgA:
cID:
}
V_z:
qx3:
return false;
}
function mo_saml_checkMapping($Ub, $P3, $T9, $gz)
{
$X8 = EnvironmentHelper::getCurrentEnvironment();
$kD = $Ub["\151\x64\x70\137\156\141\155\145"];
$Jb = Mo_SAML_Config_Utility::mo_saml_check_if_idp_configurations_configured($kD, "\141\x74\164\162\x69\x62\x75\164\x65\137\155\x61\x70\160\151\156\147", $X8) ? $kD : "\x44\105\106\101\125\114\124";
$jm = Mo_SAML_Config_Utility::mo_saml_get_attr_configurations($Jb, $X8);
$y6 = !empty($jm["\x75\x73\145\x72\156\141\155\x65"]) ? $jm["\x75\x73\x65\162\x6e\141\155\x65"] : "\116\141\x6d\x65\x49\104";
$rr = !empty($jm["\x65\x6d\141\x69\x6c"]) ? $jm["\x65\155\141\x69\x6c"] : "\x4e\141\x6d\x65\111\104";
$SY = !empty($jm["\x66\x69\162\163\164\137\x6e\x61\155\145"]) ? $jm["\146\151\x72\x73\164\137\156\x61\x6d\x65"] : '';
$Mp = !empty($jm["\x6c\141\163\164\x5f\156\141\155\x65"]) ? $jm["\154\141\x73\x74\x5f\156\x61\155\x65"] : '';
$DX = !empty($jm["\x6e\151\x63\153\137\156\141\x6d\x65"]) ? $jm["\x6e\x69\143\x6b\137\156\x61\155\145"] : '';
$IY = !empty($jm["\x64\x69\x73\160\x6c\141\171\137\156\x61\155\145"]) ? $jm["\x64\151\163\160\x6c\x61\x79\137\156\x61\155\x65"] : '';
$kT = !empty($P3[$y6][0]) ? $P3[$y6][0] : '';
$t6 = !empty($P3[$rr][0]) ? $P3[$rr][0] : '';
$Oa = !empty($P3[$SY][0]) ? $P3[$SY][0] : '';
$f1 = !empty($P3[$Mp][0]) ? $P3[$Mp][0] : '';
$xf = !empty($P3[$DX][0]) ? $P3[$DX][0] : '';
if (!empty($kT)) {
goto w8N;
}
if ($T9 === "\x74\x65\163\x74\126\141\x6c\x69\x64\141\x74\145" or $T9 === "\x74\145\x73\x74\116\145\167\103\x65\x72\x74\x69\x66\151\x63\x61\164\145") {
goto Rfe;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\x57\x50\123\101\115\114\x45\x52\x52\60\63\67"]);
goto z3w;
Rfe:
Mo_Saml_Error_Message::mo_saml_display_test_config_error(Mo_Saml_Error_Codes::$error_codes["\x57\x50\x53\x41\x4d\x4c\105\122\x52\60\x33\x37"]);
z3w:
w8N:
if (!empty($t6)) {
goto RBV;
}
if ($T9 === "\x74\x65\163\x74\x56\141\154\x69\x64\141\x74\145" or $T9 === "\164\145\163\x74\x4e\x65\167\103\x65\x72\x74\x69\x66\151\x63\x61\x74\x65") {
goto pqb;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\x57\120\123\x41\115\x4c\105\122\x52\60\63\67"]);
goto VAp;
pqb:
Mo_Saml_Error_Message::mo_saml_display_test_config_error(Mo_Saml_Error_Codes::$error_codes["\x57\x50\x53\101\115\x4c\x45\122\x52\x30\63\67"]);
VAp:
RBV:
if ($T9 == "\x74\x65\163\x74\126\x61\154\x69\x64\141\x74\x65" || $T9 == "\164\x65\x73\x74\x4e\x65\167\x43\x65\x72\164\151\x66\x69\x63\141\x74\x65") {
goto D2v;
}
mo_saml_login_user($kT, $t6, $Oa, $f1, $xf, $IY, $T9, $Ub, $gz, $P3);
goto po3;
D2v:
if (Mo_License_Service::is_customer_license_valid()) {
goto ogi;
}
throw new Mo_SAML_Invalid_License_Exception("\111\x6e\x76\x61\x6c\x69\x64\x20\x4c\x69\143\145\156\163\145");
ogi:
$bL = EnvironmentHelper::getOptionForSelectedEnvironment("\163\141\155\154\137\x69\144\x65\x6e\164\151\164\x79\x5f\160\x72\x6f\x76\x69\x64\145\162\x73", true, $X8);
$RN = $Ub["\151\x64\160\x5f\156\x61\x6d\x65"];
$K2 = array("\x74\x65\x73\x74\x5f\x73\164\141\x74\165\163" => "\124\145\163\164\40\x73\165\x63\x63\145\163\x73\x66\165\154");
if (empty($RN)) {
goto wiL;
}
$bL[$RN] = SAMLSPUtilities::mo_saml_array_merge($bL[$RN], $K2);
$bL = array_filter($bL, "\146\151\x6c\x74\x65\162\137\x65\155\160\x74\171\137\166\141\x6c\x75\x65\163");
$j4 = new EnvironmentDao($X8);
$j4->mo_save_environment_settings("\163\141\x6d\x6c\x5f\151\x64\145\x6e\164\x69\x74\171\x5f\x70\x72\x6f\x76\151\x64\145\162\163", $bL, false);
wiL:
mo_saml_show_test_result($t6, $P3, $Ub);
po3:
}
function mo_saml_show_test_result($r3, $P3, $Ub)
{
ob_end_clean();
echo "\74\x64\151\166\x20\163\164\x79\154\x65\x3d\42\x66\157\156\x74\55\146\x61\x6d\151\154\171\x3a\x43\141\154\151\142\162\x69\73\x70\x61\144\x64\x69\156\147\x3a\60\x20\63\x25\73\x22\x3e";
$RN = $Ub["\151\144\160\x5f\156\141\x6d\x65"];
$X8 = EnvironmentHelper::getCurrentEnvironment();
if (!empty($r3)) {
goto hB6;
}
echo "\74\x64\151\166\40\163\x74\171\154\145\75\42\143\x6f\154\x6f\x72\72\x20\43\141\71\64\x34\64\x32\x3b\142\141\x63\x6b\147\x72\157\x75\156\x64\x2d\143\157\x6c\157\x72\x3a\40\x23\x66\62\144\x65\144\x65\73\160\141\x64\144\151\x6e\x67\72\x20\61\x35\x70\x78\x3b\x6d\141\162\x67\151\156\55\x62\157\164\x74\x6f\x6d\72\x20\62\60\x70\170\x3b\164\145\170\164\55\141\154\x69\147\156\72\x63\x65\x6e\x74\145\x72\x3b\142\x6f\x72\144\145\162\72\x31\160\170\x20\163\x6f\154\151\x64\x20\x23\105\66\x42\x33\102\62\73\146\157\x6e\164\x2d\x73\151\x7a\x65\72\61\70\x70\x74\x3b\x22\x3e\x54\x45\x53\x54\x20\106\101\111\x4c\x45\104\x3c\x2f\x64\151\166\x3e\15\12\x9\x9\x9\x9\74\x64\151\x76\40\163\164\171\154\145\x3d\42\x63\x6f\154\157\162\72\x20\x23\141\71\x34\x34\64\62\73\146\x6f\156\x74\x2d\x73\151\172\x65\72\x31\64\160\x74\x3b\40\x6d\141\162\x67\x69\156\55\x62\x6f\164\x74\x6f\x6d\x3a\x32\60\160\170\x3b\42\x3e\127\x41\x52\x4e\111\116\x47\x3a\x20\123\x6f\x6d\145\40\101\164\x74\x72\x69\x62\165\164\145\163\x20\104\x69\x64\40\x4e\x6f\x74\40\x4d\141\164\x63\x68\x2e\x3c\57\144\151\x76\x3e\15\12\11\11\11\11\x3c\x64\151\x76\40\x73\x74\171\x6c\x65\75\x22\x64\151\163\x70\x6c\x61\x79\x3a\x62\x6c\x6f\x63\153\73\164\145\x78\x74\x2d\x61\154\x69\147\156\x3a\143\x65\x6e\x74\x65\x72\x3b\x6d\141\x72\147\x69\x6e\x2d\142\157\x74\x74\157\155\72\64\x25\73\x22\76\x3c\151\x6d\147\40\x73\164\x79\x6c\145\x3d\x22\167\x69\x64\164\150\x3a\x31\x35\45\73\42\x73\162\143\x3d\42" . esc_url(SAMLSPUtilities::mo_saml_get_plugin_base_url()) . "\x69\155\141\147\145\163\x2f\167\x72\x6f\156\x67\x2e\x77\145\x62\160\x22\x3e\x3c\x2f\144\151\166\x3e";
goto lbq;
hB6:
$x1 = EnvironmentHelper::getOptionForSelectedEnvironment("\155\157\137\163\x61\x6d\154\137\x74\145\163\164\137\143\x6f\156\x66\151\147\x5f\141\x74\x74\x72\163", true, $X8);
if (empty($Ub)) {
goto yu6;
}
$gL = array($RN => $P3);
$x1 = SAMLSPUtilities::mo_saml_array_merge($x1, $gL);
$j4 = new EnvironmentDao($X8);
$j4->mo_save_environment_settings("\155\x6f\137\163\x61\155\x6c\137\x74\x65\x73\164\137\143\x6f\156\x66\151\x67\x5f\141\164\164\x72\163", $x1, false);
yu6:
echo "\74\x64\151\166\40\x73\x74\171\x6c\145\x3d\42\143\x6f\x6c\x6f\x72\x3a\40\43\63\143\67\66\x33\x64\73\xd\xa\x20\x20\40\40\40\x20\40\x20\40\40\40\x20\x20\40\x20\x20\142\141\143\x6b\147\x72\157\x75\156\144\x2d\143\157\x6c\x6f\162\x3a\40\43\x64\x66\146\60\x64\70\73\x20\160\141\144\x64\x69\156\x67\x3a\62\x25\73\x6d\x61\x72\147\151\x6e\x2d\142\157\164\164\157\155\72\62\60\x70\170\73\x74\x65\170\x74\55\141\154\x69\x67\156\72\143\x65\156\x74\x65\162\73\x20\142\157\x72\144\145\x72\72\61\x70\170\40\x73\x6f\154\151\144\x20\x23\101\x45\104\102\x39\101\x3b\40\146\x6f\156\164\x2d\163\151\172\x65\72\x31\x38\160\164\x3b\x22\76\124\x45\123\x54\40\x53\125\x43\103\x45\123\x53\x46\125\x4c\74\57\144\x69\x76\76\15\xa\x20\40\40\40\40\40\x20\40\40\40\40\40\x20\x20\40\40\x3c\144\x69\166\40\163\x74\171\x6c\145\75\x22\x64\151\x73\x70\154\x61\171\x3a\142\x6c\157\143\x6b\x3b\164\x65\x78\164\x2d\x61\x6c\151\x67\x6e\72\143\145\156\164\145\x72\x3b\x6d\141\162\147\x69\156\55\x62\157\x74\x74\x6f\155\72\64\45\x3b\42\76\74\151\155\147\40\163\x74\171\x6c\x65\x3d\42\167\x69\x64\164\150\72\61\65\x25\73\x22\x73\x72\143\75\42" . esc_url(SAMLSPUtilities::mo_saml_get_plugin_base_url()) . "\x69\x6d\141\147\x65\x73\57\147\162\145\145\x6e\x5f\143\x68\x65\x63\x6b\56\167\145\x62\x70\x22\76\x3c\57\144\151\x76\76";
lbq:
$l9 = EnvironmentHelper::getOptionForSelectedEnvironment("\x73\x61\x6d\154\137\144\157\x6d\141\151\x6e\137\x72\x65\163\x74\x72\151\143\164\151\157\x6e", true, $X8);
$I2 = $RN;
if (!empty($l9[$I2])) {
goto h3x;
}
$I2 = "\104\105\x46\x41\x55\114\124";
h3x:
if (empty($l9[$I2])) {
goto ScX;
}
$yp = $l9[$I2]["\x65\156\141\142\154\145\137\x64\157\155\141\x69\156\x5f\162\145\x73\x74\162\151\x63\164\151\x6f\x6e"];
ScX:
if (empty($yp)) {
goto eJS;
}
$na = $l9[$I2]["\x61\154\154\x6f\167\x5f\144\x65\156\x79\x5f\x6c\157\147\151\x6e"];
if (!empty($na) && $na == "\x64\x65\x6e\171") {
goto H5t;
}
$rZ = $l9[$I2]["\145\155\141\151\x6c\137\144\157\155\x61\151\156\x73"];
$E1 = explode("\73", $rZ);
$Qd = explode("\x40", $r3);
$pQ = !empty($Qd[1]) ? $Qd[1] : '';
if (SAMLSPUtilities::mo_saml_in_array($pQ, $E1)) {
goto B85;
}
echo "\x3c\160\x20\163\164\x79\x6c\x65\75\42\x63\x6f\154\x6f\x72\72\x72\145\144\73\x22\76\x54\x68\x69\x73\x20\165\163\145\x72\x20\x77\151\154\x6c\40\x6e\x6f\164\40\142\145\x20\141\x6c\x6c\157\x77\145\144\40\x74\157\x20\x6c\x6f\x67\x69\x6e\x20\141\x73\x20\164\x68\x65\x20\144\157\155\141\151\156\x20\157\146\x20\x74\x68\145\40\145\155\141\x69\154\x20\x69\x73\x20\156\157\x74\x20\x69\156\143\154\165\144\x65\144\40\x69\x6e\x20\164\150\x65\x20\x61\x6c\154\x6f\167\x65\x64\x20\x6c\151\163\164\x20\157\x66\x20\x44\x6f\x6d\141\151\x6e\40\122\145\163\164\162\151\143\164\x69\x6f\156\x2e\74\x2f\x70\76";
B85:
goto zJD;
H5t:
$rZ = $l9[$I2]["\x65\x6d\141\151\154\137\x64\x6f\x6d\x61\x69\x6e\x73"];
$E1 = array_map("\164\x72\151\x6d", explode("\x3b", $rZ));
$E1 = array_map("\163\164\x72\164\x6f\154\x6f\x77\x65\x72", $E1);
$Qd = explode("\x40", $r3);
$pQ = !empty($Qd[1]) ? $Qd[1] : '';
$pQ = strtolower(trim($pQ));
if (!SAMLSPUtilities::mo_saml_in_array($pQ, $E1)) {
goto Ae7;
}
echo "\x3c\160\40\x73\x74\x79\x6c\145\x3d\x22\x63\x6f\x6c\157\162\x3a\162\145\x64\x3b\x22\76\x54\x68\151\163\x20\165\x73\145\162\40\x77\x69\154\x6c\x20\x6e\157\x74\40\142\x65\40\x61\154\x6c\x6f\x77\x65\144\x20\x74\157\x20\154\x6f\147\151\x6e\40\x61\163\40\164\150\x65\40\144\157\x6d\141\x69\156\x20\x6f\146\x20\x74\x68\x65\x20\145\155\141\151\154\x20\151\163\40\151\156\x63\x6c\x75\144\145\144\40\151\x6e\40\164\x68\x65\x20\x64\x65\x6e\151\x65\x64\x20\x6c\x69\163\x74\40\157\x66\40\x44\x6f\155\141\x69\156\40\122\x65\x73\164\x72\151\x63\x74\x69\157\156\56\x3c\57\x70\76";
Ae7:
zJD:
eJS:
$jm = Mo_SAML_Config_Utility::mo_saml_get_attr_configurations($RN, $X8);
$x1 = EnvironmentHelper::getOptionForSelectedEnvironment("\x6d\157\137\163\141\155\154\137\x74\x65\163\164\x5f\143\157\156\x66\151\x67\137\x61\x74\164\x72\163", true);
$vs = '';
if (empty($jm["\165\163\145\x72\156\141\x6d\x65"])) {
goto xki;
}
$Oo = $jm["\165\163\145\x72\156\x61\x6d\x65"];
if (empty($x1[$RN][$Oo][0])) {
goto nIk;
}
$vs = $x1[$RN][$Oo][0];
nIk:
if (!(strlen($vs) > 60)) {
goto dmp;
}
echo "\74\160\40\163\x74\x79\x6c\x65\75\42\x63\157\x6c\157\162\x3a\x72\145\144\73\x22\76\x4e\x4f\x54\105\40\x3a\40\124\x68\151\x73\x20\165\163\145\162\x20\x77\151\154\x6c\40\156\157\x74\40\x62\x65\40\x61\x62\x6c\x65\x20\x74\157\40\x6c\x6f\147\x69\x6e\x20\x61\x73\x20\x74\150\145\40\x75\163\145\x72\x6e\141\x6d\145\40\166\x61\x6c\x75\x65\x20\x69\163\x20\x6d\157\x72\x65\x20\x74\150\x61\x6e\x20\x36\60\x20\143\150\x61\162\141\x63\164\145\x72\163\40\x6c\x6f\x6e\x67\x2e\x3c\142\162\x2f\76\15\12\11\11\x20\40\x20\x20\x50\x6c\x65\x61\163\x65\40\164\162\171\40\143\150\141\156\x67\151\156\x67\40\x74\150\x65\40\155\141\160\160\x69\156\x67\x20\x6f\146\40\x55\163\x65\x72\156\x61\x6d\145\40\x66\x69\x65\x6c\x64\40\151\156\x20\74\x61\x20\x68\162\x65\x66\75\x22\x23\x22\x20\157\x6e\x43\154\151\x63\153\75\42\x63\x6c\157\163\145\x41\x6e\144\x52\145\x64\151\162\145\143\164\x54\x6f\x41\x74\164\x72\x69\x62\x75\164\145\115\141\160\x70\151\x6e\147\50\51\x3b\x22\x3e\x41\x74\164\x72\151\x62\165\x74\x65\x2f\x52\x6f\154\145\x20\x4d\141\x70\160\x69\156\x67\x3c\57\x61\76\x20\x74\141\x62\x2e\x3c\57\x70\x3e";
dmp:
xki:
echo "\x3c\163\x70\141\156\40\x73\x74\x79\154\145\75\42\x66\x6f\x6e\x74\x2d\x73\x69\172\145\x3a\x31\x34\x70\164\73\42\x3e\x3c\x62\76\x48\145\154\154\157\74\57\x62\76\54\x20" . esc_html($r3) . "\x3c\x2f\163\x70\141\x6e\x3e\x3c\x62\162\57\76\74\x70\40\163\164\x79\154\145\75\42\x66\157\x6e\x74\55\x77\145\x69\x67\x68\164\72\142\157\154\x64\x3b\146\157\156\x74\55\x73\x69\172\145\x3a\61\x34\160\x74\x3b\x6d\141\x72\x67\x69\156\x2d\x6c\145\x66\x74\72\61\45\x3b\x22\x3e\x41\124\124\x52\x49\102\x55\124\x45\123\x20\x52\105\x43\105\x49\126\x45\104\x3a\74\57\x70\x3e\xd\xa\x9\11\x9\x9\74\164\141\x62\x6c\x65\x20\163\x74\171\x6c\145\x3d\x22\142\157\162\144\x65\162\x2d\143\157\x6c\154\141\x70\x73\x65\72\143\157\x6c\x6c\x61\160\163\x65\x3b\142\x6f\x72\x64\x65\x72\x2d\163\x70\141\143\151\x6e\x67\72\x30\x3b\40\x77\x69\x64\x74\150\72\61\x30\x30\45\x3b\x20\146\x6f\x6e\x74\x2d\163\151\x7a\x65\x3a\61\x34\x70\164\73\142\141\x63\153\147\162\x6f\165\x6e\x64\x2d\x63\157\x6c\157\162\x3a\x23\105\104\x45\x44\105\104\73\x22\76\15\xa\11\11\x9\x9\x3c\164\x72\40\163\164\x79\154\x65\x3d\x22\164\145\170\164\55\x61\154\151\x67\156\x3a\143\x65\x6e\164\x65\x72\x3b\x22\76\74\164\x64\40\x73\164\x79\x6c\x65\x3d\x22\146\x6f\x6e\x74\x2d\x77\x65\x69\x67\150\x74\72\x62\157\x6c\x64\73\142\x6f\x72\x64\x65\162\72\62\x70\170\x20\x73\x6f\x6c\151\x64\x20\x23\71\64\x39\x30\x39\x30\x3b\x70\141\x64\144\151\156\147\x3a\x32\45\73\42\76\x41\124\124\x52\111\102\x55\124\105\x20\116\101\x4d\105\x3c\57\x74\x64\76\x3c\164\x64\x20\x73\164\x79\x6c\145\75\42\146\x6f\156\164\x2d\167\145\x69\x67\x68\164\72\x62\157\154\x64\73\x70\x61\x64\144\x69\156\147\x3a\62\45\x3b\x62\157\162\144\x65\x72\x3a\62\160\170\40\163\x6f\x6c\151\x64\x20\x23\x39\64\71\x30\x39\x30\x3b\x20\167\x6f\162\x64\55\x77\x72\141\160\x3a\x62\x72\x65\141\x6b\55\167\157\x72\x64\x3b\42\76\101\124\124\x52\x49\x42\125\124\x45\40\126\101\x4c\125\105\x3c\57\164\144\x3e\74\57\x74\162\x3e";
if (!empty($P3)) {
goto RXT;
}
echo "\x4e\x6f\x20\101\164\164\x72\x69\x62\165\x74\x65\163\40\122\x65\x63\145\151\166\145\144\56";
goto FSZ;
RXT:
foreach ($P3 as $Fx => $QB) {
echo "\74\164\162\x3e\x3c\x74\x64\40\163\x74\x79\x6c\x65\75\47\x66\157\156\164\x2d\x77\145\151\147\150\164\72\142\x6f\154\144\73\142\x6f\162\x64\145\x72\72\x32\160\x78\40\163\157\x6c\151\144\40\43\71\64\x39\60\71\x30\73\x70\141\144\144\151\x6e\147\x3a\62\45\x3b\x77\157\x72\x64\x2d\x77\162\141\160\x3a\142\162\x65\x61\153\55\x77\x6f\x72\144\x3b\47\76" . esc_html($Fx) . "\74\x2f\164\144\76\x3c\164\x64\x20\163\164\171\x6c\145\x3d\x27\160\141\x64\144\151\156\147\x3a\x32\x25\x3b\142\157\x72\x64\145\x72\72\x32\160\x78\40\163\157\154\x69\x64\x20\x23\x39\x34\x39\60\71\x30\73\x20\x77\x6f\x72\144\x2d\167\x72\x61\x70\x3a\x62\162\145\141\x6b\x2d\167\157\162\144\x3b\x27\x3e" . implode("\74\150\x72\x2f\76", map_deep($QB, "\x65\163\143\137\x68\164\x6d\x6c")) . "\74\x2f\x74\144\76\74\57\164\x72\x3e";
wt9:
}
FSQ:
FSZ:
echo "\74\x2f\164\141\x62\154\145\76\x3c\x2f\x64\151\166\76";
echo "\x3c\x64\151\166\40\163\164\171\154\x65\x3d\x22\x6d\141\x72\x67\x69\156\72\x33\x25\x3b\144\151\163\160\154\x61\x79\x3a\x62\154\x6f\x63\153\x3b\x74\x65\x78\164\x2d\141\154\151\147\x6e\72\x63\145\156\x74\x65\162\x3b\42\x3e\xd\xa\x20\x20\40\x20\x3c\x69\x6e\160\x75\164\x20\x73\164\x79\x6c\x65\75\42\160\x61\144\x64\151\156\147\x3a\x31\x25\x3b\167\151\x64\164\x68\x3a\x32\65\x30\x70\170\73\142\x61\x63\x6b\147\162\157\165\156\144\72\40\43\60\60\71\x31\103\104\40\156\157\156\145\40\x72\x65\160\x65\141\x74\40\163\143\x72\157\154\x6c\x20\x30\x25\x20\x30\45\73\15\12\11\11\x63\165\162\x73\157\x72\x3a\40\x70\157\151\x6e\x74\x65\162\x3b\x66\157\x6e\164\x2d\163\x69\172\145\x3a\x31\65\160\x78\73\x62\157\x72\144\145\x72\55\x77\151\144\164\x68\x3a\40\x31\160\x78\73\142\x6f\x72\x64\x65\x72\55\163\164\171\x6c\145\72\x20\163\x6f\x6c\x69\144\x3b\142\157\162\x64\145\x72\55\162\x61\x64\x69\165\x73\72\x20\x33\160\170\73\x77\150\x69\164\145\x2d\x73\x70\x61\x63\x65\72\15\xa\x9\x9\x20\156\x6f\x77\x72\x61\x70\x3b\142\x6f\x78\x2d\x73\x69\x7a\x69\156\147\x3a\x20\x62\x6f\x72\x64\145\x72\x2d\x62\157\x78\73\x62\x6f\x72\x64\145\162\x2d\x63\x6f\x6c\x6f\162\x3a\40\43\60\x30\x37\63\x41\x41\x3b\x62\157\170\x2d\x73\x68\141\x64\x6f\x77\72\x20\60\160\170\x20\61\x70\170\40\60\x70\x78\40\x72\x67\x62\x61\50\x31\x32\60\54\40\62\60\x30\54\40\62\x33\x30\54\40\x30\56\x36\51\40\151\x6e\163\145\x74\x3b\143\157\154\x6f\162\x3a\40\43\x46\x46\106\x3b\42\15\12\x20\40\40\x20\x20\x20\40\x20\x20\x20\40\x20\164\x79\x70\x65\x3d\42\142\165\x74\x74\157\x6e\x22\x20\x76\141\x6c\x75\x65\x3d\42\x43\x6f\156\146\x69\147\x75\162\145\x20\x41\164\164\162\x69\142\x75\164\x65\x2f\x52\157\154\145\x20\115\141\160\x70\151\x6e\147\42\x20\x6f\156\103\x6c\x69\143\153\75\42\x63\154\x6f\163\x65\101\x6e\x64\x52\x65\x64\x69\x72\x65\x63\x74\x54\157\101\164\x74\x72\151\142\x75\164\145\x4d\141\x70\x70\151\x6e\x67\x28\x29\73\x22\76\x20\46\156\x62\x73\160\x3b\40\15\xa\40\x20\40\x20\x20\40\40\x20\15\12\x20\40\40\x20\74\x69\156\x70\x75\x74\x20\163\x74\171\x6c\x65\x3d\x22\x70\x61\144\x64\151\156\x67\x3a\x31\45\73\167\x69\x64\164\x68\72\61\x30\x30\x70\x78\x3b\142\x61\143\153\147\162\157\165\x6e\x64\x3a\x20\x23\60\x30\x39\x31\x43\x44\40\156\157\156\x65\40\x72\145\160\145\141\164\x20\x73\x63\162\157\154\154\x20\x30\45\40\x30\45\x3b\143\x75\x72\163\x6f\x72\72\x20\x70\x6f\151\x6e\x74\145\x72\x3b\x66\157\156\164\x2d\x73\151\172\145\72\x31\65\160\170\x3b\x62\157\x72\144\145\x72\55\x77\151\x64\164\150\72\x20\61\160\170\73\142\x6f\x72\x64\x65\x72\x2d\163\164\171\154\x65\72\x20\163\157\x6c\x69\144\x3b\x62\x6f\162\144\145\162\55\x72\x61\144\151\165\x73\72\40\63\160\170\73\167\x68\151\164\x65\x2d\163\x70\x61\x63\145\x3a\x20\156\157\x77\x72\141\x70\x3b\x62\x6f\170\x2d\x73\x69\172\x69\156\x67\72\x20\x62\157\162\x64\145\x72\55\x62\157\x78\73\142\x6f\162\144\145\162\x2d\143\x6f\x6c\157\x72\72\40\x23\x30\x30\67\x33\x41\101\73\142\x6f\x78\x2d\x73\150\x61\x64\x6f\x77\x3a\40\60\160\x78\40\61\x70\170\40\60\160\x78\x20\162\147\142\x61\x28\61\62\x30\x2c\x20\62\60\60\x2c\40\x32\63\60\x2c\x20\60\x2e\66\x29\40\x69\x6e\x73\145\164\x3b\143\157\x6c\x6f\x72\72\40\x23\106\106\106\x3b\42\164\x79\x70\145\x3d\42\x62\165\164\164\x6f\x6e\x22\x20\x76\141\x6c\x75\x65\75\42\104\157\x6e\x65\42\x20\157\156\103\x6c\151\x63\153\x3d\42\x63\154\157\x73\145\101\156\x64\122\x65\146\162\x65\x73\150\x28\51\42\76\x3c\x2f\144\x69\x76\x3e";
echo "\xd\xa\40\x20\x20\x20\74\x73\143\162\x69\x70\164\76\xd\xa\x20\x20\40\40\40\x20\40\x20\x66\x75\156\x63\164\151\x6f\156\40\143\x6c\x6f\163\x65\101\156\x64\122\145\144\151\162\x65\143\164\x54\157\101\x74\164\x72\x69\142\x75\164\145\115\141\x70\160\x69\x6e\147\50\x29\40\x7b\xd\xa\40\x20\x20\x20\x20\x20\x20\40\x20\40\x20\x20\151\146\40\x28\167\x69\x6e\144\x6f\x77\x2e\157\x70\145\156\x65\162\x29\x20\x7b\xd\xa\40\x20\x20\40\x20\x20\40\x20\40\40\40\x20\40\x20\40\x20\x77\151\x6e\144\157\x77\x2e\157\x70\x65\x6e\145\162\56\x72\145\144\151\162\145\x63\x74\x5f\164\x6f\x5f\141\x74\164\162\151\x62\x75\164\x65\137\x6d\141\x70\x70\x69\x6e\x67\x28\40\x27" . esc_url_raw(mo_saml_get_attribute_mapping_url($RN)) . "\x27\x20\51\73\15\xa\x20\x20\40\40\40\40\x20\40\x20\x20\x20\40\x7d\xd\12\40\x20\x20\40\x20\40\40\x20\x20\x20\40\x20\163\145\154\146\56\x63\154\157\163\145\50\x29\x3b\15\xa\x20\x20\x20\x20\x20\40\x20\x20\x7d\40\x20\15\xa\40\40\x20\x20\40\x20\40\40\x66\x75\156\x63\x74\x69\157\156\x20\143\x6c\x6f\163\145\x41\x6e\x64\x52\145\x66\x72\x65\x73\x68\50\x29\x7b\xd\12\40\x20\x20\40\x20\40\40\40\40\x20\x20\40\151\x66\40\50\x77\151\156\x64\x6f\167\x2e\157\x70\x65\x6e\145\162\x29\x20\x7b\15\12\40\40\40\40\40\40\40\40\x20\x20\40\x20\x20\40\40\40\x77\151\156\144\157\x77\56\157\160\145\156\x65\162\56\x6c\x6f\143\141\x74\151\x6f\x6e\56\x72\145\154\157\x61\144\50\51\73\xd\xa\x20\x20\40\x20\x20\40\x20\40\x20\40\40\40\x7d\15\12\x20\x20\x20\x20\x20\x20\40\40\x20\40\x20\x20\x73\x65\154\x66\56\143\154\x6f\x73\x65\x28\x29\x3b\15\12\x20\x20\40\x20\40\x20\x20\40\175\40\xd\12\x20\40\40\x20\x3c\57\x73\143\x72\151\x70\x74\x3e";
exit;
}
function mo_saml_convert_to_windows_iconv($Uu, $Ub)
{
$X8 = EnvironmentHelper::getCurrentEnvironment();
$bL = EnvironmentHelper::getOptionForSelectedEnvironment("\163\141\x6d\x6c\x5f\151\x64\145\156\x74\x69\164\171\137\x70\162\x6f\x76\151\x64\145\x72\163", true, $X8);
if (empty($Ub["\151\x64\x70\137\x6e\141\155\145"])) {
goto mLb;
}
$RN = $Ub["\x69\x64\160\x5f\156\x61\x6d\145"];
goto cip;
mLb:
$RN = '';
cip:
if (!(!empty($RN) and !empty($bL[$RN]))) {
goto p2t;
}
$od = $bL[$RN]["\155\157\137\163\x61\155\154\137\x65\x6e\x63\x6f\144\x69\156\x67\x5f\x65\156\141\142\x6c\145\x64"];
if (!($od === "\x63\150\x65\x63\153\145\144" && mo_saml_is_extension_installed(Mo_Saml_Options_Enum_Extension::ICONV))) {
goto BNq;
}
return @iconv(Mo_Saml_Options_Enum_Encoding::ENCODING_UTF_8, Mo_Saml_Options_Enum_Encoding::ENCODING_CP1252, $Uu);
BNq:
p2t:
return $Uu;
}
function mo_saml_login_user($kT, $t6, $Oa, $f1, $xf, $IY, $iN, $s8, $gE, $sW)
{
$kT = sanitize_user($kT, true);
$kT = trim(apply_filters("\x70\162\145\137\165\163\x65\162\137\x6c\157\147\x69\156", sanitize_user($kT)));
if (!(strlen($kT) > 60)) {
goto nLI;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\x57\120\123\x41\x4d\x4c\105\122\x52\60\61\61"]);
nLI:
$kD = $s8["\151\x64\160\x5f\156\x61\155\145"];
if (!empty($s8["\145\156\x61\x62\x6c\145\x5f\x69\144\x70"])) {
goto Sna;
}
throw new Mo_SAML_IDP_Status_Inactive_Exception("\111\x44\120\x20\116\157\164\x20\x45\156\141\x62\154\145\144\x2e");
Sna:
do_action("\x6d\157\137\x61\x62\162\x5f\x66\151\x6c\x74\x65\162\x5f\154\157\147\151\x6e", $sW);
$X8 = EnvironmentHelper::getCurrentEnvironment();
$iV = false;
if (!SAMLSPUtilities::mo_saml_is_plugin_active("\155\151\156\x69\157\162\x61\x6e\x67\145\55\x61\x64\x76\x61\x6e\x63\x65\x64\55\162\x6f\x6c\x65\x2d\155\141\160\160\151\156\x67\57\141\144\166\x61\156\143\x65\144\x2d\x72\157\x6c\145\55\155\x61\160\x70\x69\156\147\x2e\160\x68\160")) {
goto S_w;
}
$iV = true;
S_w:
$EY = Mo_SAML_Config_Utility::mo_saml_check_if_idp_configurations_configured($kD, "\x72\157\x6c\x65\x5f\155\141\x70\160\151\x6e\x67", $X8) ? $kD : "\x44\105\x46\101\x55\x4c\124";
$jn = Mo_SAML_Config_Utility::mo_saml_check_if_idp_configurations_configured($kD, "\141\x64\x76\x61\156\143\x65\144\137\163\x65\164\x74\x69\x6e\147\163", $X8) ? $kD : "\104\x45\x46\x41\125\x4c\124";
$ZF = Mo_SAML_Config_Utility::mo_saml_get_attr_role_advanced_settings($jn, $X8);
if ($iV) {
goto qU_;
}
mo_saml_check_if_attribute_restricted($sW, $ZF);
qU_:
mo_saml_check_if_domain_restricted($t6, $ZF, $X8);
$bm = Mo_SAML_Config_Utility::mo_saml_get_role_mapping_values($EY, $X8);
$Em = Mo_SAML_Config_Utility::mo_saml_get_role_mapping($EY, $X8);
$sJ = !empty($Em["\147\x72\157\165\160\x5f\x6e\x61\155\145"]) ? $Em["\147\162\157\165\160\137\156\141\155\145"] : '';
$yz = !empty($sW[$sJ]) && is_array($sW[$sJ]) ? array_filter($sW[$sJ]) : array();
$yz = apply_filters("\155\157\x5f\x67\x72\157\165\x70\137\x73\x65\160\x61\162\141\x74\x6f\x72", $yz);
$user = false;
if (username_exists($kT)) {
goto H73;
}
if (email_exists($t6)) {
goto b2r;
}
goto tHE;
H73:
$user = get_user_by("\x6c\x6f\147\151\156", $kT);
goto tHE;
b2r:
$user = get_user_by("\145\155\141\x69\x6c", $t6);
tHE:
$bR = false;
if (!is_multisite()) {
goto RTM;
}
if (empty($user)) {
goto ou2;
}
$DQ = $user->ID;
$blog_id = get_current_blog_id();
if (is_user_member_of_blog($DQ, $blog_id)) {
goto tOv;
}
$bR = true;
tOv:
ou2:
RTM:
$KB = mo_options_user_meta::VALUE_SSO_USER;
$Ip = mo_options_user_meta::KEY_USER_TYPE;
if (!empty($user) && !$bR) {
goto c0y;
}
if (empty($user) || $bR) {
goto HR3;
}
goto TL6;
c0y:
do_action("\155\157\x5f\147\165\x65\x73\x74\137\154\157\147\151\x6e", $sW["\x4e\141\155\x65\x49\x44"], $gE, $s8, false);
if (!(!Mo_License_Service::is_customer_license_valid() && !user_can(get_user_by("\x6c\x6f\147\x69\x6e", $kT)->ID, "\x6d\x61\156\141\x67\145\137\157\x70\164\151\x6f\156\x73"))) {
goto RxY;
}
throw new Mo_SAML_Invalid_License_Exception("\x49\x6e\x76\x61\154\151\144\40\x4c\151\x63\x65\156\x73\x65");
RxY:
if (username_exists($kT)) {
goto dtd;
}
if (email_exists($t6)) {
goto k16;
}
goto Vx0;
dtd:
$user = get_user_by("\154\157\x67\151\156", $kT);
goto Vx0;
k16:
$user = get_user_by("\145\155\x61\151\154", $t6);
Vx0:
do_action("\x6d\157\137\163\x61\x6d\x6c\137\165\160\144\x61\x74\x65\x5f\165\x73\145\x72\x6e\x61\x6d\145", $kT, $kD);
mo_saml_map_attributes($user, $Oa, $f1, $xf, $IY, $sW, true, $kD, $X8);
if (!$iV) {
goto Ara;
}
do_action("\x6d\157\x5f\163\141\x6d\154\x5f\141\163\x73\x69\147\x6e\x5f\162\157\x6c\145\x5f\x61\x72\x6d", $user, $sW, false, $kD);
goto Sil;
Ara:
$AY = !empty($ZF["\153\x65\x65\x70\137\145\170\151\163\164\x69\156\x67\137\x75\163\x65\x72\x73\x5f\x72\157\154\x65"]) ? $ZF["\153\145\145\x70\137\x65\170\x69\163\x74\151\x6e\147\x5f\165\x73\145\162\163\137\162\157\x6c\x65"] : '';
$g2 = !empty($Em["\141\160\x70\x6c\171\137\x72\157\x6c\x65\137\164\x6f\137\141\x64\155\151\156"]) ? $Em["\141\x70\x70\x6c\x79\137\162\x6f\154\145\x5f\164\x6f\x5f\141\x64\155\x69\156"] : '';
if (!("\143\x68\145\143\153\145\144" !== $AY && (!is_administrator_user($user) || "\143\150\145\143\x6b\x65\144" === $g2))) {
goto j2f;
}
mo_saml_assign_roles($user, false, $bm, $yz, $Em, $ZF);
j2f:
Sil:
update_user_meta($user->ID, $Ip, $KB);
mo_saml_create_cookie($user->ID, $kD, $gE, $sW["\x4e\141\155\x65\x49\104"][0]);
$lJ = SAMLSPUtilities::mo_saml_get_redirect_url($iN, $kD, $X8);
do_action("\155\x69\156\151\157\162\x61\156\x67\145\137\x70\157\x73\x74\x5f\141\x75\x74\150\x65\x6e\x74\151\x63\x61\x74\x65\137\x75\163\145\x72\x5f\x6c\x6f\x67\x69\x6e", $user, null, $lJ, true);
do_action("\155\x6f\137\163\141\x6d\x6c\x5f\x61\x74\x74\x72\151\x62\165\x74\145\x73", $kT, $t6, $Oa, $f1, $yz, $kD, $sW);
do_action("\155\157\x5f\167\160\137\x75\163\x65\162\137\141\x74\164\x72\x69\142\165\x74\145\163", $user->ID, $sW, $kD, "\123\101\x4d\x4c", false);
do_action("\x77\160\137\154\x6f\x67\151\156", $user->user_login, $user);
wp_redirect($lJ);
exit;
goto TL6;
HR3:
do_action("\x6d\157\x5f\x67\165\x65\163\x74\x5f\x6c\x6f\147\x69\156", $sW["\116\141\155\x65\111\104"], $gE, $s8, true);
if (Mo_License_Service::is_customer_license_valid()) {
goto ANB;
}
throw new Mo_SAML_Invalid_License_Exception("\111\x6e\x76\x61\x6c\x69\144\40\x4c\x69\x63\145\x6e\x73\145");
ANB:
$EU = !empty($ZF["\144\157\137\x6e\157\164\x5f\143\x72\145\x61\x74\x65\137\x6e\145\x77\x5f\165\163\x65\162\x73"]) ? $ZF["\144\x6f\137\x6e\x6f\x74\x5f\x63\162\145\x61\164\145\x5f\156\x65\x77\137\165\163\x65\x72\x73"] : '';
if (!("\x63\150\x65\143\x6b\x65\144" === $EU)) {
goto l3w;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\127\x50\x53\101\x4d\114\105\x52\122\60\61\70"]);
l3w:
$k2 = isset($Em["\143\162\x65\x61\164\x65\x5f\x6e\x65\167\x5f\165\163\x65\162"]) ? $Em["\x63\162\145\x61\x74\145\137\156\x65\167\137\165\x73\145\162"] : "\x63\150\145\143\x6b\x65\144";
$Yo = mo_saml_get_roles_to_assign($bm, $yz, $ZF);
if (!("\x63\150\x65\x63\153\145\x64" !== $k2 && empty($Yo))) {
goto v6u;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\x57\120\x53\101\115\114\105\122\122\x30\x31\70"]);
v6u:
$user = mo_saml_create_user($user, $kT, $t6, $bR);
if ($user) {
goto Zrc;
}
if (!empty($iN)) {
goto sXC;
}
wp_redirect(network_home_url());
goto pWk;
sXC:
wp_redirect($iN);
pWk:
exit;
Zrc:
mo_saml_map_attributes($user, $Oa, $f1, $xf, $IY, $sW, true, $kD, $X8);
if (!$iV) {
goto fDK;
}
do_action("\x6d\157\x5f\x73\x61\155\154\x5f\141\x73\x73\x69\147\x6e\137\x72\x6f\154\145\x5f\x61\x72\155", $user, $sW, true, $kD);
goto PV6;
fDK:
mo_saml_assign_roles($user, true, $bm, $yz, $Em, $ZF, $Yo);
PV6:
update_user_meta($user->ID, $Ip, $KB);
mo_saml_create_cookie($user->ID, $kD, $gE, $sW["\116\141\155\145\x49\x44"][0]);
$lJ = SAMLSPUtilities::mo_saml_get_redirect_url($iN, $kD, $X8);
do_action("\155\151\156\151\x6f\162\x61\156\147\x65\x5f\160\157\x73\x74\137\x61\165\164\x68\145\156\164\x69\x63\141\164\x65\137\165\x73\x65\162\x5f\x6c\157\x67\151\156", $user, null, $lJ);
do_action("\x6d\157\x5f\x73\x61\x6d\x6c\x5f\141\164\164\x72\x69\x62\165\164\x65\163", $kT, $t6, $Oa, $f1, $yz, $kD, $sW);
do_action("\155\x6f\137\167\x70\137\165\x73\x65\x72\x5f\141\x74\164\x72\151\142\x75\164\x65\163", $user->ID, $sW, $kD, "\x53\x41\x4d\114", true);
do_action("\167\x70\137\x6c\x6f\x67\151\156", $user->user_login, $user);
wp_redirect($lJ);
exit;
TL6:
}
function mo_saml_check_if_attribute_restricted($sW, $ZF)
{
$YK = !empty($ZF["\x61\x6c\x6c\x6f\167\137\x64\x65\156\171\137\x75\163\145\162\137\x61\164\x74\x72\x69\142\x75\164\x65"]) ? $ZF["\x61\154\x6c\x6f\x77\x5f\x64\145\156\x79\x5f\x75\163\x65\x72\x5f\141\x74\164\162\151\142\x75\x74\145"] : '';
if (!("\x63\x68\x65\143\x6b\x65\144" === $YK)) {
goto B9k;
}
$sU = !empty($ZF["\162\x65\x73\164\162\x69\x63\x74\x65\x64\137\x61\x74\164\x72\151\x62\165\164\x65"]) ? $ZF["\x72\145\163\164\x72\151\143\x74\145\144\x5f\141\164\x74\162\x69\x62\x75\164\145"] : '';
$u3 = !empty($ZF["\162\145\x73\164\x72\151\143\x74\145\144\x5f\141\x74\164\x72\x69\142\165\x74\x65\137\166\141\154\x75\145\163"]) ? $ZF["\x72\x65\163\x74\162\x69\x63\x74\x65\144\137\141\x74\164\x72\x69\x62\x75\164\145\x5f\x76\141\x6c\x75\x65\163"] : '';
$OM = !empty($ZF["\141\x6c\x6c\x6f\167\137\x64\x65\x6e\171\137\141\164\164\162\x5f\x6f\x70\164\x69\157\156"]) ? $ZF["\141\x6c\154\x6f\x77\137\x64\145\156\x79\x5f\141\164\164\x72\x5f\157\x70\x74\x69\x6f\x6e"] : "\141\154\154\157\167";
$u3 = array_map("\164\162\x69\x6d", array_filter(explode("\73", $u3)));
$dS = false;
foreach ($u3 as $qw) {
if (!SAMLSPUtilities::mo_saml_in_array($qw, $sW[$sU], true)) {
goto Etd;
}
$dS = true;
goto r2c;
Etd:
dcI:
}
r2c:
if (!("\144\x65\x6e\171" === $OM && $dS || "\141\154\154\157\x77" === $OM && !$dS)) {
goto qG1;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\127\x50\x53\x41\115\x4c\105\122\122\x30\x31\x39"]);
qG1:
B9k:
}
function mo_saml_check_if_domain_restricted($t6, $ZF, $X8)
{
$ci = !empty($ZF["\141\154\154\157\x77\137\144\145\156\171\x5f\x75\163\x65\x72\137\144\157\155\141\151\x6e"]) ? $ZF["\141\154\154\157\x77\137\144\x65\x6e\171\x5f\x75\x73\x65\162\x5f\144\x6f\155\x61\151\x6e"] : '';
if (!("\143\x68\x65\x63\153\145\x64" === $ci)) {
goto Y9p;
}
$zx = !empty($ZF["\162\145\163\164\162\151\143\164\145\144\137\144\157\155\x61\151\x6e\163"]) ? $ZF["\162\x65\x73\x74\162\151\143\x74\x65\144\x5f\x64\157\155\x61\x69\156\x73"] : '';
$OM = !empty($ZF["\x61\x6c\x6c\157\x77\x5f\x64\x65\x6e\x79\137\x64\157\155\x61\x69\156\x5f\x6f\x70\164\x69\x6f\x6e"]) ? $ZF["\x61\x6c\154\x6f\167\x5f\x64\x65\156\x79\x5f\144\x6f\155\141\x69\x6e\137\157\x70\x74\x69\x6f\x6e"] : "\141\154\x6c\157\167";
$E1 = array_map("\x74\162\151\x6d", array_filter(explode("\73", $zx)));
$E1 = array_map("\x73\164\162\x74\157\x6c\157\167\145\x72", $E1);
$Cn = explode("\100", $t6);
$wS = !empty($Cn[1]) ? strtolower(trim($Cn[1])) : '';
$oz = EnvironmentHelper::getOptionForSelectedEnvironment("\155\157\x5f\x73\141\155\154\137\x72\x65\163\x74\x72\x69\143\164\x65\x64\137\x64\157\x6d\x61\x69\156\137\145\162\162\157\x72\137\x6d\163\147", false, $X8);
$uy = SAMLSPUtilities::mo_saml_is_plugin_active(Mo_Saml_Addons_Directory::CUSTOM_SSO_ERROR_MESSAGE) ? true : false;
if ("\x61\154\x6c\157\x77" === $OM && !SAMLSPUtilities::mo_saml_in_array($wS, $E1)) {
goto abd;
}
if ("\x64\x65\x6e\x79" === $OM && SAMLSPUtilities::mo_saml_in_array($wS, $E1)) {
goto ZUe;
}
goto Q3H;
abd:
if (!$uy) {
goto csE;
}
do_action("\x6d\157\137\143\x75\x73\x74\157\155\x5f\163\163\157\137\x65\162\x72\157\162\x5f\x6d\x73\147", Mo_Saml_Hook_Constant::DOMAIN_RESTRICTION);
csE:
if (empty($oz)) {
goto Jvw;
}
wp_die(esc_html($oz), "\120\145\162\155\x69\x73\x73\151\157\156\40\104\x65\x6e\x69\145\x64\40\72\x20\116\157\x74\x20\x61\40\x57\150\151\x74\x65\154\x69\163\x74\145\x64\x20\165\x73\145\x72\x2e");
goto jty;
Jvw:
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\127\120\123\x41\x4d\x4c\105\x52\x52\60\x32\62"]);
jty:
goto Q3H;
ZUe:
if (!$uy) {
goto gfw;
}
do_action("\x6d\x6f\x5f\x63\165\x73\x74\157\155\137\x73\x73\157\x5f\x65\x72\162\x6f\162\137\155\163\x67", Mo_Saml_Hook_Constant::DOMAIN_RESTRICTION);
gfw:
if (empty($oz)) {
goto zx2;
}
wp_die(esc_html($oz), "\120\x65\162\155\151\163\x73\x69\x6f\156\x20\x44\x65\x6e\151\x65\144\x20\72\x20\102\x6c\x61\x63\153\154\151\163\x74\x65\144\x20\x75\163\x65\162\x2e");
goto KUe;
zx2:
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\x57\x50\123\101\115\x4c\x45\x52\x52\x30\62\x31"]);
KUe:
Q3H:
Y9p:
}
function mo_saml_map_attributes($user, $Oa, $f1, $xf, $IY, $sW, $un, $kD, $ic)
{
$kD = Mo_SAML_Config_Utility::mo_saml_check_if_idp_configurations_configured($kD, "\x61\x74\164\x72\151\x62\x75\164\x65\x5f\x6d\141\160\160\151\x6e\147", $ic) ? $kD : "\104\105\106\101\125\114\124";
mo_saml_map_basic_attributes($user, $Oa, $f1, $xf, $IY, $sW, $un, $kD, $ic);
mo_saml_map_custom_attributes($user, $sW, $kD, $ic);
}
function mo_saml_map_basic_attributes($user, $Oa, $f1, $xf, $IY, $sW, $un, $kD, $ic)
{
$DQ = $user->ID;
if (empty($Oa)) {
goto b_j;
}
$user->data->first_name = $Oa;
b_j:
if (empty($f1)) {
goto bFb;
}
$user->data->last_name = $f1;
bFb:
if (empty($xf)) {
goto soy;
}
$user->data->nickname = $xf;
soy:
update_user_meta($DQ, "\155\x6f\137\163\x61\155\154\137\x75\163\x65\162\x5f\x61\164\x74\x72\151\x62\165\x74\145\163", $sW);
$jm = Mo_SAML_Config_Utility::mo_saml_get_attr_configurations($kD, $ic);
$vk = !empty($jm["\144\157\x5f\156\x6f\164\137\165\x70\x64\x61\x74\x65\x5f\144\151\163\160\154\141\x79\x5f\x6e\141\x6d\145"]) ? $jm["\144\157\x5f\156\x6f\164\x5f\x75\x70\144\141\164\145\x5f\x64\x69\x73\160\154\141\171\x5f\x6e\141\155\145"] : '';
if (!(!empty($IY) && ("\x63\150\x65\143\153\x65\x64" !== $vk || !$un))) {
goto yFo;
}
if (strcmp($IY, "\125\x53\x45\x52\x4e\x41\115\x45") == 0) {
goto fas;
}
if (strcmp($IY, "\106\116\101\115\x45") == 0 && !empty($Oa)) {
goto Cm3;
}
if (strcmp($IY, "\114\x4e\x41\x4d\x45") == 0 && !empty($f1)) {
goto Y2y;
}
if (strcmp($IY, "\x4e\x49\103\113\137\x4e\x41\x4d\105") == 0 && !empty($xf)) {
goto Wea;
}
if (strcmp($IY, "\x46\116\101\x4d\x45\137\114\116\x41\x4d\x45") == 0 && !empty($f1) && !empty($Oa)) {
goto Tsd;
}
if (strcmp($IY, "\114\116\x41\x4d\105\x5f\x46\x4e\x41\x4d\x45") == 0 && !empty($f1) && !empty($Oa)) {
goto nhX;
}
goto BDo;
fas:
$user->data->display_name = $user->user_login;
goto BDo;
Cm3:
$user->data->display_name = $Oa;
goto BDo;
Y2y:
$user->data->display_name = $f1;
goto BDo;
Wea:
$user->data->display_name = $xf;
goto BDo;
Tsd:
$user->data->display_name = $Oa . "\40" . $f1;
goto BDo;
nhX:
$user->data->display_name = $f1 . "\x20" . $Oa;
BDo:
yFo:
wp_update_user($user);
}
function mo_saml_map_custom_attributes($user, $sW, $kD, $ic)
{
$DQ = $user->ID;
$st = EnvironmentHelper::getOptionForSelectedEnvironment("\155\157\137\163\141\x6d\x6c\x5f\x63\x75\x73\164\x6f\155\137\x61\164\164\x72\163\137\x6d\x61\160\160\151\156\147", true, $ic);
$st = !empty($st[$kD]) ? $st[$kD] : array();
$sW = apply_filters("\155\x6f\137\x73\x61\155\154\137\x63\x75\x73\164\x6f\x6d\x5f\141\x74\164\x72\x69\142\165\x74\145\163\x5f\146\x69\x6c\x74\x65\162", $sW);
foreach ($st as $Fx => $QB) {
$QB = trim($QB);
if (empty($sW[$QB])) {
goto cYS;
}
if (is_array($sW[$QB]) && count($sW[$QB]) == 1) {
goto Nbu;
}
update_user_meta($DQ, trim($Fx), $sW[$QB]);
goto n_f;
Nbu:
update_user_meta($DQ, trim($Fx), $sW[$QB][0]);
n_f:
cYS:
Z_P:
}
DmG:
}
function mo_saml_assign_roles($user, $xI, $Qq, $yz, $Em, $ZF, $Yo = array())
{
if (!empty($Yo)) {
goto ZcS;
}
$Yo = mo_saml_get_roles_to_assign($Qq, $yz, $ZF);
ZcS:
if ($xI) {
goto k9y;
}
$CB = $ZF["\x77\150\151\x74\x65\x6c\151\x73\164\137\145\x78\x69\163\x74\151\x6e\x67\x5f\x75\163\x65\162\163\137\x72\157\x6c\x65\163"] ?? '';
if (!("\143\x68\145\x63\153\x65\144" === $CB)) {
goto yQ6;
}
$PO = is_array($ZF["\167\x68\151\x74\145\154\151\x73\x74\x65\144\x5f\162\157\154\x65\x73"]) ? array_flip($ZF["\167\150\151\x74\145\x6c\x69\x73\164\x65\x64\137\162\x6f\154\145\x73"]) : array();
$Sk = is_array($user->roles) ? $user->roles : array();
$ah = array_intersect($PO, $Sk);
$Yo = array_merge($Yo, $ah);
yQ6:
k9y:
mo_saml_assign_roles_to_user($user, $Yo, $xI, $Em);
}
function mo_saml_get_roles_to_assign($Qq, $yz, $ZF)
{
$Qw = !empty($ZF["\145\156\141\142\x6c\x65\x5f\x72\145\147\x65\170"]) ? $ZF["\x65\156\141\x62\x6c\x65\x5f\162\x65\147\x65\170"] : '';
$Yo = array();
foreach ($Qq as $yQ => $dR) {
$dR = array_map("\164\162\151\x6d", array_filter(explode("\x3b", $dR)));
foreach ($dR as $XS) {
foreach ($yz as $Fc) {
if (!("\x63\x68\x65\x63\x6b\x65\144" === $Qw && preg_match("\57" . $XS . "\57", $Fc) || $Fc === $XS)) {
goto ORD;
}
array_push($Yo, $yQ);
ORD:
cPh:
}
EBf:
fuH:
}
rnu:
c29:
}
LJK:
return $Yo;
}
function mo_saml_create_cookie($DQ, $kD, $gE, $L2)
{
wp_set_current_user($DQ);
$ug = apply_filters("\155\x6f\x5f\162\x65\155\145\x6d\142\145\x72\137\x6d\145", false);
wp_set_auth_cookie($DQ, $ug, SAMLSPUtilities::mo_saml_is_ssl());
if (empty($kD)) {
goto cIL;
}
update_user_meta($DQ, "\155\x6f\137\163\141\155\154\137\x6c\x6f\x67\147\145\144\137\151\x6e\137\x77\x69\164\150\137\151\x64\x70", $kD);
cIL:
if (empty($gE)) {
goto YDq;
}
update_user_meta($DQ, "\155\x6f\137\163\141\x6d\x6c\137\163\x65\x73\163\x69\x6f\156\137\x69\156\x64\145\x78", $gE);
YDq:
if (empty($L2)) {
goto tl2;
}
update_user_meta($DQ, "\155\157\137\x73\x61\155\154\137\x6e\141\155\x65\x5f\x69\x64", $L2);
tl2:
if (!(!session_id() || session_id() == '' || empty($_SESSION))) {
goto M9B;
}
session_start();
M9B:
$_SESSION["\155\x6f\x5f\x73\141\x6d\154"]["\x6c\x6f\x67\147\145\x64\x5f\151\156\137\x77\151\164\x68\x5f\x69\144\x70"] = $kD;
if (empty($gE)) {
goto PFP;
}
$_SESSION["\155\157\137\x73\x61\155\154"]["\163\x65\x73\163\x69\157\x6e\x49\x6e\144\x65\x78"] = $gE;
PFP:
if (empty($L2)) {
goto QMm;
}
$_SESSION["\x6d\157\137\163\141\x6d\154"]["\x6e\x61\155\x65\x49\x64"] = $L2;
QMm:
}
function mo_saml_create_user($user, $kT, $t6, $bR)
{
$zF = wp_generate_password(10, false);
if (!$bR) {
goto Oen;
}
$DQ = $user->ID;
goto VRF;
Oen:
$DQ = wp_create_user($kT, $zF, $t6);
if (!is_wp_error($DQ)) {
goto iUv;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\x57\120\123\101\x4d\x4c\105\x52\122\x30\x30\65"]);
iUv:
VRF:
return get_user_by("\151\144", $DQ);
}
function mo_saml_assign_roles_to_user($user, $Yo, $xI, $Em)
{
$yF = false;
if (!empty($Yo)) {
goto HqL;
}
if (!$xI && isset($Em["\x75\x70\x64\x61\164\x65\x5f\145\170\x69\163\x74\151\x6e\147\137\x75\163\x65\162"]) && "\143\x68\x65\x63\x6b\145\144" === $Em["\x75\x70\x64\141\164\x65\137\x65\170\x69\163\164\151\x6e\147\x5f\x75\163\x65\x72"]) {
goto ouq;
}
if ($xI) {
goto xp8;
}
goto MiD;
HqL:
$user->set_role(false);
foreach ($Yo as $yQ) {
$user->add_role($yQ);
H6A:
}
vqg:
goto MiD;
ouq:
$yF = true;
$Hm = !empty($Em["\144\x65\x66\x61\165\154\164\137\x72\x6f\x6c\x65\137\146\x6f\162\137\x65\170\151\163\164\151\156\x67\137\165\163\145\162\x73"]) ? $Em["\144\x65\x66\x61\x75\x6c\164\x5f\162\157\x6c\145\x5f\x66\x6f\162\137\x65\x78\151\163\x74\x69\x6e\147\137\165\x73\x65\162\x73"] : get_option("\144\x65\x66\141\165\154\x74\137\x72\157\154\145");
goto MiD;
xp8:
$yF = true;
$Hm = !empty($Em["\x64\x65\146\x61\165\154\164\137\x72\x6f\154\x65\x5f\x66\157\x72\x5f\156\x65\x77\x5f\165\x73\145\162\163"]) ? $Em["\144\145\x66\141\165\154\164\137\x72\x6f\154\145\137\146\x6f\162\137\156\x65\x77\137\x75\x73\145\162\163"] : get_option("\x64\x65\x66\x61\x75\154\x74\x5f\162\157\x6c\145");
MiD:
if (!$yF) {
goto GGg;
}
if ("\156\x6f\156\x65" === $Hm) {
goto dkh;
}
$user->set_role($Hm);
goto vxi;
dkh:
$user->set_role(false);
vxi:
GGg:
}
function show_status_error($NP, $T9, $XW, $Ub)
{
$NP = strip_tags($NP);
$XW = strip_tags($XW);
if ($T9 == "\x74\145\x73\164\x56\141\x6c\x69\144\x61\164\145" or $T9 == "\164\x65\x73\x74\x4e\145\167\x43\x65\x72\x74\x69\x66\151\143\x61\x74\145") {
goto pTZ;
}
if ($NP == "\122\145\x73\160\157\x6e\x64\145\x72" || $NP == "\122\145\161\165\x65\x73\164\x65\x72") {
goto rob;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\x57\120\123\101\x4d\114\105\x52\x52\60\60\x36"]);
goto WAC;
pTZ:
if (!($NP == "\122\145\x73\x70\x6f\x6e\144\145\x72")) {
goto I98;
}
mo_saml_handle_azureb2c_cases($T9, $XW, $Ub);
I98:
$tQ = "\74\x70\76\74\x73\164\162\157\x6e\147\76\x53\x74\141\164\x75\x73\40\103\x6f\144\145\40\146\x6f\x75\x6e\144\x20\151\x6e\40\123\101\x4d\114\x20\122\x65\x73\160\x6f\x6e\x73\x65\72\x20\x3c\57\163\164\162\x6f\x6e\x67\76\x3c\x66\x6f\156\164\40\146\x61\143\145\75\42\103\x6f\165\162\x69\x65\162\x20\116\x65\167\x22\x3b\146\x6f\156\164\x2d\x73\151\172\x65\x3a\61\x30\x70\x74\x3e\x3c\142\x72\76\74\142\x72\76" . esc_html($NP) . "\x3c\x2f\160\x3e\74\57\x66\157\156\164\76";
Mo_Saml_Error_Message::mo_saml_display_test_config_error(Mo_Saml_Error_Codes::$error_codes["\127\x50\123\x41\x4d\x4c\105\122\122\x30\x30\x36"], $tQ, $XW);
goto WAC;
rob:
mo_saml_handle_azureb2c_cases($T9, $XW, $Ub);
WAC:
}
function mo_saml_handle_azureb2c_cases($T9, $XW, $Ub)
{
switch ($XW) {
case mo_options_plugin_azureb2c_statusmsg::Forgot:
mo_saml_paswd_reset_url($Ub, $T9);
goto DDE;
case mo_options_plugin_azureb2c_statusmsg::Cancel:
mo_saml_azureb2c_cancel_msg_case($T9);
case mo_options_plugin_azureb2c_statusmsg::Largeurl:
mo_saml_paswd_reset_large_url_case($T9);
exit;
default:
if (!($T9 != "\x74\145\163\x74\x56\x61\x6c\x69\x64\141\x74\145")) {
goto sNj;
}
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\x57\120\x53\101\115\114\105\122\x52\x30\x30\66"]);
sNj:
}
Ycy:
DDE:
}
function mo_saml_paswd_reset_url($Ub, $T9)
{
$Ik = $Ub;
$Y1 = !empty($Ik["\x73\x61\155\154\137\x70\x77\x5f\162\x65\163\145\x74\137\165\162\x6c"]) ? html_entity_decode($Ik["\163\141\155\x6c\x5f\x70\x77\137\162\145\163\145\164\x5f\165\x72\154"]) : '';
if (!empty($Y1)) {
goto nNe;
}
if ($T9 != "\x74\145\163\164\x56\x61\x6c\151\x64\x61\164\145" && $T9 != "\x74\x65\163\164\x4e\x65\167\103\x65\162\x74\151\x66\x69\143\141\x74\x65") {
goto It2;
}
goto wF7;
nNe:
wp_redirect($Y1);
exit;
goto wF7;
It2:
Mo_Saml_Error_Message::mo_saml_display_error_code_message(Mo_Saml_Error_Codes::$error_codes["\127\120\123\101\x4d\x4c\x45\122\x52\x30\x33\x35"]);
wF7:
}
function mo_saml_paswd_reset_large_url_case($T9)
{
if (!($T9 != "\x74\x65\x73\x74\x56\141\x6c\151\144\x61\x74\x65")) {
goto ULy;
}
$SkL = parse_url($T9);
$T9 = $SkL["\160\141\164\150"];
wp_redirect($T9);
ULy:
}
function mo_saml_azureb2c_cancel_msg_case($T9)
{
if ($T9 == "\x74\145\x73\164\x56\x61\154\151\x64\x61\x74\145") {
goto vCp;
}
wp_redirect($T9);
exit;
goto Eht;
vCp:
wp_redirect(home_url());
exit;
Eht:
}
function addLink($BGC, $Nn_)
{
$Ri = "\74\x61\40\x68\x72\145\x66\75\x22" . $Nn_ . "\42\x3e" . $BGC . "\x3c\57\141\76";
return $Ri;
}
function get_status_message($NP)
{
switch ($NP) {
case "\x52\145\161\x75\x65\x73\164\145\x72":
return "\124\150\x65\x20\x72\x65\x71\165\145\163\x74\x20\x63\x6f\165\154\144\x20\156\157\x74\40\x62\x65\40\160\x65\162\x66\157\x72\155\x65\x64\x20\x64\x75\145\x20\x74\157\x20\141\x6e\x20\x65\162\162\157\x72\40\157\156\40\x74\150\x65\40\x70\141\162\164\x20\157\146\x20\164\150\145\x20\x72\145\x71\x75\x65\163\x74\x65\x72\x2e";
goto G2E;
case "\x52\x65\163\x70\157\x6e\x64\145\x72":
return "\124\150\x65\40\x72\x65\x71\x75\145\163\164\40\x63\157\x75\154\144\x20\156\x6f\x74\40\142\x65\40\160\145\162\146\157\x72\x6d\x65\x64\40\x64\165\x65\40\164\x6f\x20\141\x6e\40\x65\x72\x72\157\x72\40\157\x6e\x20\x74\150\145\x20\160\x61\x72\164\x20\157\146\40\164\x68\x65\40\123\x41\115\114\40\x72\145\x73\x70\157\156\144\x65\x72\x20\157\162\x20\x53\101\115\114\x20\141\x75\x74\x68\x6f\162\x69\164\171\x2e";
goto G2E;
case "\126\x65\x72\163\151\157\156\x4d\151\x73\x6d\x61\164\143\x68":
return "\124\150\145\x20\x53\101\115\x4c\x20\x72\145\163\x70\157\x6e\144\145\x72\x20\143\157\x75\x6c\144\x20\156\x6f\x74\40\160\x72\x6f\143\145\163\x73\40\164\150\x65\x20\x72\x65\161\165\145\163\x74\x20\x62\x65\143\141\x75\x73\145\x20\x74\150\x65\x20\x76\145\162\163\151\157\156\x20\x6f\x66\x20\164\x68\x65\x20\x72\x65\x71\165\x65\163\x74\x20\155\x65\163\163\141\x67\145\40\x77\141\x73\40\151\x6e\143\157\x72\x72\145\143\164\56";
goto G2E;
default:
return "\125\156\x6b\x6e\157\x77\156";
}
rZy:
G2E:
}
function is_administrator_user($user)
{
$CxS = $user->roles;
if (!is_null($CxS) && SAMLSPUtilities::mo_saml_in_array("\x61\144\x6d\151\x6e\151\x73\x74\162\x61\x74\157\x72", $CxS)) {
goto e8t;
}
return false;
goto Qkq;
e8t:
return true;
Qkq:
}
function mo_saml_is_customer_registered()
{
$t6 = get_option("\155\157\x5f\x73\141\x6d\154\x5f\141\144\x6d\151\156\x5f\x65\x6d\x61\151\x6c");
$MT = get_option("\x6d\157\137\x73\x61\155\154\x5f\141\x64\x6d\x69\x6e\137\143\x75\163\x74\x6f\155\145\x72\x5f\153\145\171");
if (!$t6 || !$MT || !is_numeric(trim($MT))) {
goto vaB;
}
return 1;
goto yyk;
vaB:
return 0;
yyk:
}
function saml_get_referer_page_url()
{
if (!(isset($_SERVER["\110\124\x54\120\137\x52\x45\x46\x45\x52\x45\122"]) && !empty($_SERVER["\110\124\x54\120\x5f\x52\105\x46\x45\122\105\x52"]) && $_SERVER["\x48\124\124\x50\137\x52\x45\106\105\x52\105\122"] !== "\57")) {
goto ChE;
}
return $_SERVER["\x48\124\124\x50\137\122\x45\x46\x45\122\x45\122"];
ChE:
}
function saml_get_current_page_url()
{
$DES = $_SERVER["\x48\124\x54\x50\x5f\110\x4f\123\124"];
if (!(substr($DES, -1) == "\x2f")) {
goto I3s;
}
$DES = substr($DES, 0, -1);
I3s:
$O2q = $_SERVER["\x52\105\121\125\x45\123\x54\x5f\x55\122\111"];
if (!(substr($O2q, 0, 1) == "\57")) {
goto GaJ;
}
$O2q = substr($O2q, 1);
GaJ:
$AeG = !empty($_SERVER["\x48\124\x54\x50\123"]) && strcasecmp($_SERVER["\x48\x54\x54\x50\x53"], "\x6f\156") == 0;
$iN = "\x68\x74\x74\x70" . ($AeG ? "\163" : '') . "\72\x2f\57" . $DES . "\57" . $O2q;
return $iN;
}
add_action("\167\151\x64\147\x65\x74\x73\137\x69\156\x69\164", function () {
register_widget("\x4d\157\137\123\x41\115\x4c\137\x4c\x6f\x67\x69\x6e\x5f\x57\151\144\x67\145\x74");
});
add_action("\151\x6e\151\164", array(Mo_Saml_User_Login_Handler::mo_saml_get_object(), "\155\157\x5f\163\141\x6d\154\x5f\x6c\x6f\147\x69\x6e\137\166\141\x6c\x69\x64\141\x74\x65"));
Function Calls
None |
Stats
MD5 | 92f96c483d9bfa23530997d70a6c55eb |
Eval Count | 0 |
Decode Time | 94 ms |