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 include_once dirname(__FILE__) . "\57\125\x74\151\x6c\x69\x74\151\x65\163\56\x7..

Decoded Output download

<?php 
 
 
include_once dirname(__FILE__) . "/Utilities.php"; 
include_once dirname(__FILE__) . "/Response.php"; 
include_once dirname(__FILE__) . "/LogoutRequest.php"; 
require_once dirname(__FILE__) . "/includes/lib/encryption.php"; 
include_once "xmlseclibs.php"; 
use RobRichards\XMLSecLibs\XMLSecurityKey; 
use RobRichards\XMLSecLibs\XMLSecurityDSig; 
use RobRichards\XMLSecLibs\XMLSecEnc; 
class Mo_SAML_Login_Widget extends WP_Widget 
{ 
    public function __construct() 
    { 
        parent::__construct("Saml_Login_Widget", "Single Sign-On Link", array("description" => __("This is a miniOrange SAML login widget.", "mosaml"))); 
    } 
    public function widget($XT, $Lx) 
    { 
        extract($XT); 
        $Uu = apply_filters("widget_title", $Lx["wid_title"]); 
        echo $XT["before_widget"]; 
        if (empty($Uu)) { 
            goto niH; 
        } 
        echo $XT["before_title"] . $Uu . $XT["after_title"]; 
        niH: 
        $this->loginForm(); 
        echo $XT["after_widget"]; 
    } 
    public function update($x6, $o0) 
    { 
        $Lx = array(); 
        $Lx["wid_title"] = strip_tags($x6["wid_title"]); 
        return $Lx; 
    } 
    public function form($Lx) 
    { 
        $Uu = ''; 
        if (!array_key_exists("wid_title", $Lx)) { 
            goto JZz; 
        } 
        $Uu = $Lx["wid_title"]; 
        JZz: 
        echo "\xd\xa\x9	<p><label for="" . $this->get_field_id("wid_title") . "">"; 
        _e("Title:"); 
        echo "</label>\xd
		<input class="widefat" id="" . $this->get_field_id("wid_title") . "" name="" . $this->get_field_name("wid_title") . "" type="text" value="" . $Uu . "" />\xd
\x9	</p>"; 
    } 
    public function loginForm() 
    { 
        global $post; 
        $this->error_message(); 
        if (!Utilities::mo_saml_is_user_logged_in()) { 
            goto cq6; 
        } 
        $current_user = wp_get_current_user(); 
        $x7 = get_site_option("saml_identity_providers"); 
        $x7 = maybe_unserialize($x7); 
        $C5 = 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); 
        $C5 = get_site_option("selected_idp"); 
        $c6 = $x7[$C5]; 
        $WX = "Hello,"; 
        if (empty($c6["custom_greeting_text"])) { 
            goto IVb; 
        } 
        $WX = $c6["custom_greeting_text"]; 
        IVb: 
        $fQ = ''; 
        if (empty($c6["greeting_name"])) { 
            goto Po4; 
        } 
        switch ($c6["greeting_name"]) { 
            case "USERNAME": 
                $fQ = $current_user->user_login; 
                goto G9U; 
            case "EMAIL": 
                $fQ = $current_user->user_email; 
                goto G9U; 
            case "FNAME": 
                $fQ = $current_user->user_firstname; 
                goto G9U; 
            case "LNAME": 
                $fQ = $current_user->user_lastname; 
                goto G9U; 
            case "FNAME_LNAME": 
                $fQ = $current_user->user_firstname . " " . $current_user->user_lastname; 
                goto G9U; 
            case "LNAME_FNAME": 
                $fQ = $current_user->user_lastname . " " . $current_user->user_firstname; 
                goto G9U; 
            default: 
                $fQ = $current_user->user_login; 
        } 
        vir: 
        G9U: 
        Po4: 
        if (!empty(trim($fQ))) { 
            goto TrW; 
        } 
        $fQ = $current_user->user_login; 
        TrW: 
        $Ov = $WX . " " . $fQ; 
        $C4 = "Logout"; 
        if (empty($c6["custom_logout_text"])) { 
            goto ZyR; 
        } 
        $C4 = $c6["custom_logout_text"]; 
        ZyR: 
        echo $Ov . " | <a href="" . wp_logout_url(home_url()) . "" title="logout" >" . $C4 . "</a></li>"; 
        $qV = saml_get_current_page_url(); 
        update_site_option("logout_redirect_url", $qV); 
        goto spm; 
        cq6: 
        $eW = saml_get_current_page_url(); 
        $Gh = get_site_option("saml_identity_providers"); 
        $Gh = maybe_unserialize($Gh); 
        if (!empty($Gh)) { 
            goto L1m; 
        } 
        echo "Please configure the miniOrange SAML Plugin first."; 
        goto jpG; 
        L1m: 
        foreach ($Gh as $C5) { 
            if (!empty($C5["idp_name"])) { 
                goto wp5; 
            } 
            echo "Please configure the miniOrange SAML Plugin first."; 
            goto whU; 
            wp5: 
            $QB = "login_" . $C5["idp_name"]; 
            $Q8 = "mosubmitsamlform_" . $C5["idp_name"]; 
            echo "<script>
	\x9\x9\x9	    jQuery( document ).ready(function() {
	\x9\x9	    	\x9jQuery("#" . $Q8 . "").click(function(e) {\xd\xa\x9		    	\x9\x9	e.preventDefault();\xd\xa	\x9    \x9		\x9\x9jQuery("#" . $QB . "").submit();\xd
\x9    				\x9});
    	\x9		\x9});\xd\xa	\x9			    </script>
\xa		\x9	\x9    <form name="" . $QB . "" id="" . $QB . "" method="post" action="">\xd\xa\x9			    \x9	\x9<input type="hidden" name="option" value="saml_user_login" />\xd\xa	\x9	    			\x9<input type="hidden" name="redirect_to" value="" . $eW . "" />
\xa\x9	    \x9				<input type="hidden" name="idp" value="" . $C5["idp_name"] . "" />\xd
	    	\x9	\x9\x9	<font size="+1" style="vertical-align:top;"> </font>"; 
            $BV = !empty($C5["custom_login_text"]) ? $C5["custom_login_text"] : "Login with " . $C5["idp_name"]; 
            echo "<a href="#" id="" . $Q8 . "">" . $BV . "</a></form>"; 
            whU: 
            Ivl: 
        } 
        XkV: 
        jpG: 
        spm: 
    } 
    public function mo_saml_check_empty_or_null_val($jG) 
    { 
        if (!(!isset($jG) || empty($jG))) { 
            goto iOr; 
        } 
        return true; 
        iOr: 
        return false; 
    } 
    public function error_message() 
    { 
        if (!(isset($_SESSION["msg"]) and $_SESSION["msg"])) { 
            goto oZ_; 
        } 
        echo "<div class="" . $_SESSION["msg_class"] . "">" . $_SESSION["msg"] . "</div>"; 
        unset($_SESSION["msg"]); 
        unset($_SESSION["msg_class"]); 
        oZ_: 
    } 
    public function mo_saml_logout($user) 
    { 
        if (!(!session_id() || session_id() == '' || !isset($_SESSION))) { 
            goto aO_; 
        } 
        session_start(); 
        aO_: 
        $BU = array(); 
        $Q1 = isset($_SESSION["mo_saml"]["logged_in_with_idp"]) ? $_SESSION["mo_saml"]["logged_in_with_idp"] : ''; 
        $x7 = get_site_option("saml_identity_providers"); 
        $x7 = maybe_unserialize($x7); 
        if (!array_key_exists($Q1, $x7)) { 
            goto bk3; 
        } 
        $BU = $x7[$Q1]; 
        bk3: 
        if (empty($BU)) { 
            goto pEC; 
        } 
        $mC = $BU["slo_url"]; 
        $Pq = $BU["slo_binding_type"]; 
        $yb = $BU["request_signed"]; 
        if (!empty($mC)) { 
            goto W8l; 
        } 
        $Wq = wp_get_referer(); 
        if (!empty($Wq)) { 
            goto KBo; 
        } 
        $Wq = !empty(get_site_option("mo_saml_sp_base_url")) ? get_site_option("mo_saml_sp_base_url") : get_network_site_url(); 
        KBo: 
        wp_redirect($Wq); 
        exit; 
        goto D5N; 
        W8l: 
        if (!(!session_id() || session_id() == '' || !isset($_SESSION))) { 
            goto KkA; 
        } 
        session_start(); 
        KkA: 
        if (isset($_SESSION["mo_saml_logout_request"])) { 
            goto lMQ; 
        } 
        if (isset($_SESSION["mo_saml"]["logged_in_with_idp"])) { 
            goto JWK; 
        } 
        goto y43; 
        lMQ: 
        self::createLogoutResponseAndRedirect($mC, $Pq); 
        exit; 
        goto y43; 
        JWK: 
        unset($_SESSION["mo_saml"]); 
        $ZK = get_user_meta($user, "mo_saml_name_id"); 
        $UV = get_user_meta($user, "mo_saml_session_index"); 
        $ED = get_site_option("mo_saml_sp_base_url"); 
        if (!empty($ED)) { 
            goto l6q; 
        } 
        $ED = network_site_url(); 
        l6q: 
        if (!(substr($ED, -1) == "/")) { 
            goto wNW; 
        } 
        $ED = substr($ED, 0, -1); 
        wNW: 
        $Wq = wp_get_referer(); 
        if (!empty($Wq)) { 
            goto ql5; 
        } 
        $Wq = $ED; 
        ql5: 
        $FI = get_site_option("mo_saml_sp_entity_id"); 
        if (!empty($FI)) { 
            goto lGG; 
        } 
        $FI = $ED . "/wp-content/plugins/miniorange-saml-20-single-sign-on/"; 
        lGG: 
        $d0 = $mC; 
        $oq = $Wq; 
        $oq = mo_saml_relaystate_url($oq); 
        $TV = Utilities::createLogoutRequest($ZK, $FI, $d0, $UV, $Pq); 
        if (empty($Pq) || $Pq == "HttpRedirect") { 
            goto raI; 
        } 
        if (!($yb == "unchecked")) { 
            goto b09; 
        } 
        $pr = base64_encode($TV); 
        Utilities::postSAMLRequest($mC, $pr, $oq); 
        exit; 
        b09: 
        $hw = ''; 
        $JG = ''; 
        $pr = Utilities::signXML($TV, "NameID"); 
        Utilities::postSAMLRequest($mC, $pr, $oq); 
        goto WIc; 
        raI: 
        $M4 = $mC; 
        if (strpos($mC, "?") !== false) { 
            goto f_O; 
        } 
        $M4 .= "?"; 
        goto UIq; 
        f_O: 
        $M4 .= "&"; 
        UIq: 
        if (!($yb == "unchecked")) { 
            goto Jnb; 
        } 
        $M4 .= "SAMLRequest=" . $TV . "&RelayState=" . urlencode($oq); 
        header("Location: " . $M4); 
        exit; 
        Jnb: 
        $TV = "SAMLRequest=" . $TV . "&RelayState=" . urlencode($oq) . "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA256); 
        $cj = array("type" => "private"); 
        $N1 = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, $cj); 
        $IN = get_site_option("mo_saml_current_cert_private_key"); 
        $N1->loadKey($IN, false); 
        $rx = new XMLSecurityDSig(); 
        $kf = $N1->signData($TV); 
        $kf = base64_encode($kf); 
        $M4 .= $TV . "&Signature=" . urlencode($kf); 
        header("Location: " . $M4); 
        exit; 
        WIc: 
        y43: 
        D5N: 
        pEC: 
    } 
    public function createLogoutResponseAndRedirect($mC, $Pq) 
    { 
        $ED = get_site_option("mo_saml_sp_base_url"); 
        if (!empty($ED)) { 
            goto B_D; 
        } 
        $ED = network_site_url(); 
        B_D: 
        if (!(substr($ED, -1) == "/")) { 
            goto NCo; 
        } 
        $ED = substr($ED, 0, -1); 
        NCo: 
        $jf = $_SESSION["mo_saml_logout_request"]; 
        $V8 = $_SESSION["mo_saml_logout_relay_state"]; 
        unset($_SESSION["mo_saml_logout_request"]); 
        unset($_SESSION["mo_saml_logout_relay_state"]); 
        Utilities::mo_saml_delete_plugin_cookies(); 
        $li = new DOMDocument(); 
        $li->loadXML($jf); 
        $jf = $li->firstChild; 
        if (!($jf->localName == "LogoutRequest")) { 
            goto jqJ; 
        } 
        $Du = new SAML2_LogoutRequest($jf); 
        $FI = get_site_option("mo_saml_sp_entity_id"); 
        if (!empty($FI)) { 
            goto aae; 
        } 
        $FI = $ED . "/wp-content/plugins/miniorange-saml-20-single-sign-on/"; 
        aae: 
        $d0 = $mC; 
        $HO = Utilities::createLogoutResponse($Du->getId(), $FI, $d0, $Pq); 
        if (empty($Pq) || $Pq == "HttpRedirect") { 
            goto R8P; 
        } 
        if (!($yb == "unchecked")) { 
            goto l18; 
        } 
        $pr = base64_encode($HO); 
        Utilities::postSAMLResponse($mC, $pr, $V8); 
        exit; 
        l18: 
        $hw = ''; 
        $JG = ''; 
        $pr = Utilities::signXML($HO, "Status"); 
        Utilities::postSAMLResponse($mC, $pr, $V8); 
        goto z5p; 
        R8P: 
        $M4 = $mC; 
        if (strpos($mC, "?") !== false) { 
            goto g8H; 
        } 
        $M4 .= "?"; 
        goto pbe; 
        g8H: 
        $M4 .= "&"; 
        pbe: 
        if (!($yb == "unchecked")) { 
            goto GYN; 
        } 
        $M4 .= "SAMLResponse=" . $HO . "&RelayState=" . urlencode($V8); 
        header("Location: " . $M4); 
        exit; 
        GYN: 
        $M4 .= "SAMLResponse=" . $HO . "&RelayState=" . urlencode($V8); 
        header("Location: " . $M4); 
        exit; 
        z5p: 
        jqJ: 
    } 
} 
function plugin_settings_script_widget() 
{ 
    wp_enqueue_script("jquery"); 
    wp_enqueue_script("mo_saml_admin_settings_script_widget", plugins_url("includes/js/settings.js", __FILE__)); 
} 
function plugin_settings_style_widget() 
{ 
    wp_enqueue_style("mo_saml_admin_settings_style", plugins_url("includes/css/jquery.ui.css", __FILE__)); 
} 
function mo_login_validate() 
{ 
    if (!(isset($_REQUEST["option"]) && $_REQUEST["option"] == "mosaml_metadata")) { 
        goto R1z; 
    } 
    miniorange_generate_metadata(); 
    R1z: 
    $Gh = get_site_option("saml_identity_providers"); 
    $Gh = maybe_unserialize($Gh); 
    if (!isset($_REQUEST["idp"])) { 
        goto AAO; 
    } 
    update_site_option("selected_idp", $_REQUEST["idp"]); 
    AAO: 
    if (!(!empty($Gh) && (isset($_REQUEST["option"]) && $_REQUEST["option"] == "saml_user_login" || isset($_REQUEST["option"]) && $_REQUEST["option"] == "testConfig") && isset($_REQUEST["idp"]) && array_key_exists($_REQUEST["idp"], $Gh))) { 
        goto GGj; 
    } 
    if (!(Utilities::mo_saml_is_user_logged_in() && $_REQUEST["option"] != "testConfig")) { 
        goto S81; 
    } 
    return; 
    S81: 
    if (!mo_saml_is_sp_configured()) { 
        goto x5O; 
    } 
    $ED = get_site_option("mo_saml_sp_base_url"); 
    $C5 = $Gh[$_REQUEST["idp"]]; 
    if (!empty($ED)) { 
        goto DUx; 
    } 
    $ED = network_site_url(); 
    DUx: 
    if (!(substr($ED, -1) == "/")) { 
        goto ef2; 
    } 
    $ED = substr($ED, 0, -1); 
    ef2: 
    if ($_REQUEST["option"] == "testConfig") { 
        goto kQE; 
    } 
    if (get_site_option("mo_saml_relay_state") && get_site_option("mo_saml_relay_state") != '') { 
        goto fam; 
    } 
    if (isset($_REQUEST["redirect_to"])) { 
        goto HRn; 
    } 
    $oq = saml_get_current_page_url(); 
    goto X5N; 
    HRn: 
    $oq = $_REQUEST["redirect_to"]; 
    X5N: 
    goto uPk; 
    fam: 
    $oq = get_site_option("mo_saml_relay_state"); 
    uPk: 
    goto W6C; 
    kQE: 
    $oq = "testValidate"; 
    W6C: 
    $oq = mo_saml_relaystate_url($oq); 
    $Hl = $C5["sso_url"]; 
    $yb = $C5["request_signed"]; 
    $nV = $C5["sso_binding_type"]; 
    $y_ = $C5["nameid_format"]; 
    $kS = get_site_option("mo_saml_force_authentication"); 
    $Cs = $ED . "/"; 
    $FI = get_site_option("mo_saml_sp_entity_id"); 
    if (!empty($FI)) { 
        goto XLp; 
    } 
    $FI = $ED . "/wp-content/plugins/miniorange-saml-20-single-sign-on/"; 
    XLp: 
    $TV = Utilities::createAuthnRequest($Cs, $FI, $Hl, $kS, $nV, $y_); 
    if (empty($nV) || $nV == "HttpRedirect") { 
        goto H_d; 
    } 
    if (!($yb == "unchecked")) { 
        goto pJi; 
    } 
    $pr = base64_encode($TV); 
    Utilities::postSAMLRequest($Hl, $pr, $oq); 
    exit; 
    pJi: 
    $hw = ''; 
    $JG = ''; 
    $pr = Utilities::signXML($TV, "NameIDPolicy"); 
    Utilities::postSAMLRequest($Hl, $pr, $oq); 
    goto YRe; 
    H_d: 
    $M4 = $Hl; 
    if (strpos($Hl, "?") !== false) { 
        goto rXg; 
    } 
    $M4 .= "?"; 
    goto VNL; 
    rXg: 
    $M4 .= "&"; 
    VNL: 
    if (!($yb == "unchecked")) { 
        goto geR; 
    } 
    $M4 .= "SAMLRequest=" . $TV . "&RelayState=" . urlencode($oq); 
    header("Location: " . $M4); 
    exit; 
    geR: 
    $TV = "SAMLRequest=" . $TV . "&RelayState=" . urlencode($oq) . "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA256); 
    $cj = array("type" => "private"); 
    $N1 = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, $cj); 
    $IN = get_site_option("mo_saml_current_cert_private_key"); 
    $N1->loadKey($IN, false); 
    $rx = new XMLSecurityDSig(); 
    $kf = $N1->signData($TV); 
    $kf = base64_encode($kf); 
    $M4 .= $TV . "&Signature=" . urlencode($kf); 
    header("Location: " . $M4); 
    exit; 
    YRe: 
    x5O: 
    GGj: 
    if (!(array_key_exists("SAMLResponse", $_REQUEST) && !empty($_REQUEST["SAMLResponse"]))) { 
        goto PTP; 
    } 
    $ED = get_site_option("mo_saml_sp_base_url"); 
    if (!empty($ED)) { 
        goto mHf; 
    } 
    $ED = network_site_url(); 
    mHf: 
    if (!(substr($ED, -1) == "/")) { 
        goto JCl; 
    } 
    $ED = substr($ED, 0, -1); 
    JCl: 
    $FD = $_REQUEST["SAMLResponse"]; 
    $V8 = empty($_REQUEST["RelayState"]) ? '' : $_REQUEST["RelayState"]; 
    $FD = base64_decode($FD); 
    if (!(array_key_exists("SAMLResponse", $_GET) && !empty($_GET["SAMLResponse"]))) { 
        goto YN8; 
    } 
    $FD = gzinflate($FD); 
    YN8: 
    $li = new DOMDocument(); 
    $li->loadXML($FD); 
    $sT = $li->firstChild; 
    $rS = $li->documentElement; 
    $w7 = new DOMXpath($li); 
    $w7->registerNamespace("samlp", "urn:oasis:names:tc:SAML:2.0:protocol"); 
    $w7->registerNamespace("saml", "urn:oasis:names:tc:SAML:2.0:assertion"); 
    if ($sT->localName == "LogoutResponse") { 
        goto bmO; 
    } 
    $GS = $w7->query("/samlp:Response/samlp:Status/samlp:StatusCode", $li->documentElement); 
    $kN = isset($GS) ? $GS->item(0)->getAttribute("Value") : ''; 
    $EX = explode(":", $kN); 
    if (!array_key_exists(7, $EX)) { 
        goto HHl; 
    } 
    $GS = $EX[7]; 
    HHl: 
    $sL = $w7->query("/samlp:Response/samlp:Status/samlp:StatusMessage", $rS); 
    $Pu = isset($sL) ? $sL->item(0) : ''; 
    if (empty($Pu)) { 
        goto aoL; 
    } 
    $Pu = $Pu->nodeValue; 
    aoL: 
    $x7 = get_site_option("saml_identity_providers"); 
    $x7 = maybe_unserialize($x7); 
    if (array_key_exists("RelayState", $_POST) && !empty($_POST["RelayState"]) && $_POST["RelayState"] != "/") { 
        goto ial; 
    } 
    $aK = ''; 
    goto GRX; 
    ial: 
    $aK = $_POST["RelayState"]; 
    GRX: 
    if (!($GS != "Success")) { 
        goto SyQ; 
    } 
    show_status_error($GS, $aK, $Pu); 
    SyQ: 
    if (!($aK !== "testValidate" && $aK !== "testNewCertificate")) { 
        goto P2V; 
    } 
    $A6 = parse_url($aK, PHP_URL_HOST); 
    $Kw = parse_url($ED, PHP_URL_HOST); 
    $IF = parse_url(get_current_base_url(), PHP_URL_HOST); 
    if (!empty($aK)) { 
        goto KRw; 
    } 
    $aK = "/"; 
    goto ygw; 
    KRw: 
    $aK = mo_saml_parse_url($aK); 
    ygw: 
    if (!(!empty($A6) && $A6 != $IF)) { 
        goto zPk; 
    } 
    Utilities::postSAMLResponse($aK, $_REQUEST["SAMLResponse"], mo_saml_relaystate_url($aK)); 
    zPk: 
    P2V: 
    $jX = ''; 
    if (empty(get_site_option("selected_idp"))) { 
        goto i4v; 
    } 
    $jX = get_site_option("selected_idp"); 
    i4v: 
    $kA = array("saml_response" => base64_encode($FD)); 
    if (!array_key_exists($jX, $x7)) { 
        goto dpN; 
    } 
    $x7[$jX] = array_merge($x7[$jX], $kA); 
    dpN: 
    $x7 = array_filter($x7, "filter_empty_values"); 
    update_site_option("saml_identity_providers", $x7); 
    $FD = new SAML2_Response($sT); 
    $oY = $FD->getSignatureData(); 
    $eF = current($FD->getAssertions())->getSignatureData(); 
    if (!(empty($eF) && empty($oY))) { 
        goto OJR; 
    } 
    if ($aK == "testValidate") { 
        goto duO; 
    } 
    wp_die("We could not sign you in. Please contact administrator", "Error: Invalid SAML Response"); 
    goto XFX; 
    duO: 
    $bx = mo_options_error_constants::Error_no_certificate; 
    $K0 = mo_options_error_constants::Cause_no_certificate; 
    echo "<div style="font-family:Calibri;padding:0 3%;">\xd
                    <div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>\xd\xa                    <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error  :" . $bx . " </strong></p>\xd
                    
\xa                    <p><strong>Possible Cause: " . $K0 . "</strong></p>\xd\xa                    \xd\xa                    </div></div>"; 
    mo_saml_download_logs($bx, $K0); 
    exit; 
    XFX: 
    OJR: 
    $FI = current($FD->getAssertions())->getIssuer(); 
    $u2 = null; 
    foreach ($x7 as $N1 => $jG) { 
        if (!($jG["idp_entity_id"] == $FI)) { 
            goto zBL; 
        } 
        $u2 = $x7[$N1]; 
        goto FEm; 
        zBL: 
        PWn: 
    } 
    FEm: 
    if (!($u2 === null)) { 
        goto diF; 
    } 
    echo "<div style="font-family:Calibri;padding:0 3%;">"; 
    echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>\xd
\x9\x9\x9<div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>Unable to find a IDP Entity ID matching the configured fingerprint.</p>\xd\xa	\x9	<p>Please contact your administrator and report the following error:</p>
	\x9	<p><strong>Possible Cause: </strong>'IDP Entity ID' field in plugin does not match the one found in SAML Response.</p>
\xa	\x9	<p><strong>Identiy ID found in SAML Response: </strong><font face="Courier New";font-size:10pt><br><br>" . $FI . "</p></font>\xd\xa	\x9	\x9\x9</div>\xd\xa	\x9			<div style="margin:3%;display:block;text-align:center;">\xd
\x9\x9\x9\x9\x9<form action="index.php">\xd
\x9			\x9<div style="margin:3%;display:block;text-align:center;"><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"></div>"; 
    exit; 
    diF: 
    $HG = maybe_unserialize($u2["x509_certificate"]); 
    $Cs = $ED . "/"; 
    if (is_array($HG)) { 
        goto B5F; 
    } 
    $Yc = XMLSecurityKey::getRawThumbprint($HG); 
    $Yc = mo_saml_convert_to_windows_iconv($Yc); 
    $Yc = preg_replace("/\s+/", '', $Yc); 
    if (empty($oY)) { 
        goto NJK; 
    } 
    $xh = Utilities::processResponse($Cs, $Yc, $oY, $FD, 0, $aK); 
    NJK: 
    if (empty($eF)) { 
        goto YpW; 
    } 
    $xh = Utilities::processResponse($Cs, $Yc, $eF, $FD, 0, $aK); 
    YpW: 
    goto Yik; 
    B5F: 
    foreach ($HG as $N1 => $jG) { 
        $Yc = XMLSecurityKey::getRawThumbprint(Utilities::sanitize_certificate($jG)); 
        $Yc = mo_saml_convert_to_windows_iconv($Yc); 
        $Yc = preg_replace("/\s+/", '', $Yc); 
        if (empty($oY)) { 
            goto jM7; 
        } 
        $xh = Utilities::processResponse($Cs, $Yc, $oY, $FD, $N1, $aK); 
        jM7: 
        if (empty($eF)) { 
            goto AWl; 
        } 
        $xh = Utilities::processResponse($Cs, $Yc, $eF, $FD, $N1, $aK); 
        AWl: 
        if (!$xh) { 
            goto Ub9; 
        } 
        goto e_M; 
        Ub9: 
        DYs: 
    } 
    e_M: 
    Yik: 
    if ($oY) { 
        goto Wmn; 
    } 
    if ($eF) { 
        goto K24; 
    } 
    goto MnV; 
    Wmn: 
    $G6 = $oY["Certificates"][0]; 
    goto MnV; 
    K24: 
    $G6 = $eF["Certificates"][0]; 
    MnV: 
    if ($xh) { 
        goto QpD; 
    } 
    if ($aK == "testValidate") { 
        goto Mzc; 
    } 
    wp_die("We could not sign you in. Please contact administrator", "Error: Invalid SAML Response"); 
    goto vmW; 
    Mzc: 
    $Ok = "-----BEGIN CERTIFICATE-----<br>" . chunk_split($G6, 64) . "<br>-----END CERTIFICATE-----"; 
    echo "<div style="font-family:Calibri;padding:0 3%;">"; 
    echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>
	\x9	<div style="color: #a94442;font-size:14pt; margin-bottom:20px; onclick="this.select()"><p><strong>Error: </strong>Unable to find a certificate matching the configured fingerprint.</p>
	\x9\x9<p>Please contact your administrator and report the following error:</p>\xd\xa			<p><strong>Possible Cause: </strong>'X.509 Certificate' field in plugin does not match the certificate found in SAML Response.</p>
\xa\x9	\x9<p><strong>Certificate found in SAML Response: </strong><font face="Courier New";font-size:10pt><br><br>" . $Ok . "</p></font>
            <p><strong>Solution: </strong></p>\xd
\x9\x9	 <ol>\xd
                <li>Copy paste the certificate provided above in X509 Certificate under Service Provider Setup tab.</li>\xd
                <li>If issue persists disable <b>Character encoding</b> under Service Provder Setup tab.</li>
\xa             </ol>        \xd
            </div>
\x9\x9	\x9	<div style="margin:3%;display:block;text-align:center;">
\x9\x9\x9\x9\x9<form action="index.php">\xd
	\x9			<div style="margin:3%;display:block;text-align:center;"><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"></div>"; 
    exit; 
    vmW: 
    QpD: 
    $AC = get_site_option("mo_saml_sp_entity_id"); 
    if (!empty($AC)) { 
        goto Rwj; 
    } 
    $AC = $ED . "/wp-content/plugins/miniorange-saml-20-single-sign-on/"; 
    Rwj: 
    Utilities::validateIssuerAndAudience($FD, $AC, $FI, $aK); 
    $xU = current(current($FD->getAssertions())->getNameId()); 
    $eS = current($FD->getAssertions())->getAttributes(); 
    $eS["NameID"] = array("0" => $xU); 
    $UV = current($FD->getAssertions())->getSessionIndex(); 
    mo_saml_checkMapping($u2, $eS, $aK, $UV); 
    goto F55; 
    bmO: 
    wp_logout(); 
    if (empty($V8)) { 
        goto EUw; 
    } 
    $V8 = mo_saml_parse_url($V8); 
    goto UfC; 
    EUw: 
    $V8 = $ED; 
    UfC: 
    header("Location: " . $V8); 
    exit; 
    F55: 
    PTP: 
    if (!(array_key_exists("SAMLRequest", $_REQUEST) && !empty($_REQUEST["SAMLRequest"]))) { 
        goto X4v; 
    } 
    $TV = $_REQUEST["SAMLRequest"]; 
    $aK = "/"; 
    if (!array_key_exists("RelayState", $_REQUEST)) { 
        goto AMC; 
    } 
    $aK = $_REQUEST["RelayState"]; 
    AMC: 
    $TV = base64_decode($TV); 
    if (!(array_key_exists("SAMLRequest", $_GET) && !empty($_GET["SAMLRequest"]))) { 
        goto g5j; 
    } 
    $TV = gzinflate($TV); 
    g5j: 
    $li = new DOMDocument(); 
    $li->loadXML($TV); 
    $kE = $li->firstChild; 
    if (!($kE->localName == "LogoutRequest")) { 
        goto KvQ; 
    } 
    $Du = new SAML2_LogoutRequest($kE); 
    if (!(!session_id() || session_id() == '' || !isset($_SESSION))) { 
        goto zlw; 
    } 
    session_start(); 
    zlw: 
    $_SESSION["mo_saml_logout_request"] = $TV; 
    $_SESSION["mo_saml_logout_relay_state"] = $aK; 
    wp_logout(); 
    KvQ: 
    X4v: 
} 
function mo_saml_checkMapping($u2, $eS, $aK, $UV) 
{ 
    try { 
        $Tz = get_site_option("saml_idp_attribute_mapping"); 
        $Tz = maybe_unserialize($Tz); 
        $Uy = get_site_option("saml_idp_role_mapping"); 
        $Uy = maybe_unserialize($Uy); 
        $sc = "NameID"; 
        $gq = "NameID"; 
        $Q4 = ''; 
        if (!(!empty($Tz) && array_key_exists($u2["idp_name"], $Tz))) { 
            goto vPH; 
        } 
        $sc = $Tz[$u2["idp_name"]]["email"]; 
        $gq = $Tz[$u2["idp_name"]]["username"]; 
        $V0 = $Tz[$u2["idp_name"]]["first_name"]; 
        $iQ = $Tz[$u2["idp_name"]]["last_name"]; 
        $e2 = $Tz[$u2["idp_name"]]["group_name"]; 
        $Q4 = $Tz[$u2["idp_name"]]["display_name"]; 
        vPH: 
        $Hj = ''; 
        $k8 = ''; 
        if (empty($eS)) { 
            goto Suu; 
        } 
        if (!empty($V0) && array_key_exists($V0, $eS)) { 
            goto O0w; 
        } 
        $V0 = ''; 
        goto HoF; 
        O0w: 
        $V0 = $eS[$V0][0]; 
        HoF: 
        if (!empty($iQ) && array_key_exists($iQ, $eS)) { 
            goto bAH; 
        } 
        $iQ = ''; 
        goto w1y; 
        bAH: 
        $iQ = $eS[$iQ][0]; 
        w1y: 
        if (!empty($gq) && array_key_exists($gq, $eS)) { 
            goto kzw; 
        } 
        $k8 = $eS["NameID"][0]; 
        goto klZ; 
        kzw: 
        $k8 = $eS[$gq][0]; 
        klZ: 
        if (!empty($sc) && array_key_exists($sc, $eS)) { 
            goto KTw; 
        } 
        $Hj = $eS["NameID"][0]; 
        goto j64; 
        KTw: 
        $Hj = $eS[$sc][0]; 
        j64: 
        if (!empty($e2) && array_key_exists($e2, $eS)) { 
            goto fFt; 
        } 
        $e2 = array(); 
        goto KXt; 
        fFt: 
        $e2 = $eS[$e2]; 
        KXt: 
        Suu: 
        if ($aK == "testValidate") { 
            goto XJN; 
        } 
        mo_saml_login_user($Hj, $V0, $iQ, $k8, $e2, $aK, $u2, $UV, $eS["NameID"][0], $Q4, $eS); 
        goto krk; 
        XJN: 
        $x7 = get_site_option("saml_identity_providers"); 
        $x7 = maybe_unserialize($x7); 
        $jX = ''; 
        if (empty(get_site_option("selected_idp"))) { 
            goto qeP; 
        } 
        $jX = get_site_option("selected_idp"); 
        qeP: 
        $kA = array("test_status" => "Test successful"); 
        $x7[$jX] = array_merge($x7[$jX], $kA); 
        $x7 = array_filter($x7, "filter_empty_values"); 
        update_site_option("saml_identity_providers", $x7); 
        mo_saml_show_test_result($V0, $iQ, $Hj, $e2, $eS); 
        krk: 
    } catch (Exception $AN) { 
        echo sprintf("An error occurred while processing the SAML Response."); 
        exit; 
    } 
} 
function show_status_error($i8, $aK) 
{ 
    if ($aK == "testValidate") { 
        goto Zn0; 
    } 
    wp_die("We could not sign you in. Please contact your Administrator.", "Error: Invalid SAML Response Status"); 
    goto EEv; 
    Zn0: 
    echo "<div style="font-family:Calibri;padding:0 3%;">"; 
    echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>
\xa        <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong> Invalid SAML Response Status.</p>\xd
            <p><strong>Causes</strong>: Identity Provider has sent '" . $i8 . "' status code in SAML Response. </p>
            <p><strong>Reason</strong>: " . get_status_message($i8) . "</p><br>"; 
    if (empty($M_)) { 
        goto vRj; 
    } 
    echo "<p><strong>Status Message in the SAML Response:</strong> <br/>" . $M_ . "</p><br>"; 
    vRj: 
    echo "
\xa        </div>

\xa        <div style="margin:3%;display:block;text-align:center;">\xd
            <div style="margin:3%;display:block;text-align:center;"><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"></div>"; 
    exit; 
    EEv: 
} 
function get_status_message($i8) 
{ 
    switch ($i8) { 
        case "Requester": 
            return "The request could not be performed due to an error on the part of the requester."; 
            goto pyZ; 
        case "Responder": 
            return "The request could not be performed due to an error on the part of the SAML responder or SAML authority."; 
            goto pyZ; 
        case "VersionMismatch": 
            return "The SAML responder could not process the request because the version of the request message was incorrect."; 
            goto pyZ; 
        default: 
            return "Unknown"; 
    } 
    gr_: 
    pyZ: 
} 
function mo_saml_show_test_result($V0, $iQ, $Hj, $e2, $eS) 
{ 
    ob_end_clean(); 
    echo "<div style="font-family:Calibri;padding:0 3%;">"; 
    if (!empty($Hj)) { 
        goto NRu; 
    } 
    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>\xd\xa	\x9		<div style="color: #a94442;font-size:14pt; margin-bottom:20px;">WARNING: Some Attributes Did Not Match.</div>
\x9\x9\x9	<div style="display:block;text-align:center;margin-bottom:4%;"><img style="width:15%;"src="" . plugin_dir_url(__FILE__) . "images/wrong.png"></div>"; 
    goto WEV; 
    NRu: 
    echo "<div style="color: #3c763d;\xd
	\x9	\x9background-color: #dff0d8; padding:2%;margin-bottom:20px;text-align:center; border:1px solid #AEDB9A; font-size:18pt;">TEST SUCCESSFUL</div>
\x9	\x9\x9<div style="display:block;text-align:center;margin-bottom:4%;"><img style="width:15%;"src="" . plugin_dir_url(__FILE__) . "images/green_check.png"></div>"; 
    WEV: 
    echo "<span style="font-size:14pt;"><b>Hello</b>, " . $Hj . "</span><br/><p style="font-weight:bold;font-size:14pt;margin-left:1%;">ATTRIBUTES RECEIVED:</p>\xd\xa		\x9	<table style="border-collapse:collapse;border-spacing:0; display:table;width:100%; font-size:14pt;background-color:#EDEDED;">\xd
\x9	\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($eS)) { 
        goto iAc; 
    } 
    echo "No Attributes Received."; 
    goto nxs; 
    iAc: 
    foreach ($eS as $N1 => $jG) { 
        echo "<tr><td style='font-weight:bold;border:2px solid #949090;padding:2%;'>" . $N1 . "</td><td style='padding:2%;border:2px solid #949090; word-wrap:break-word;'>" . implode("<hr/>", $jG) . "</td></tr>"; 
        Iqm: 
    } 
    xF2: 
    nxs: 
    echo "</table></div>"; 
    echo "<div style="margin:3%;display:block;text-align:center;"><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"></div>"; 
    exit; 
} 
function mo_saml_convert_to_windows_iconv($Yc) 
{ 
    $x7 = get_site_option("saml_identity_providers"); 
    $x7 = maybe_unserialize($x7); 
    $jX = ''; 
    if (empty(get_site_option("selected_idp"))) { 
        goto EYM; 
    } 
    $jX = get_site_option("selected_idp"); 
    EYM: 
    $JY = $x7[$jX]["mo_saml_encoding_enabled"]; 
    if (!($JY === '')) { 
        goto x3I; 
    } 
    return $Yc; 
    x3I: 
    return iconv("UTF-8", "CP1252//IGNORE", $Yc); 
} 
function mo_saml_login_user($Hj, $V0, $iQ, $k8, $e2, $aK, $C5 = null, $UV = '', $ZK = '', $bJ = '', $eS = null) 
{ 
    check_if_user_allowed_to_login_due_to_role_restriction($e2); 
    $ED = get_site_option("mo_saml_sp_base_url"); 
    global $wpdb; 
    $W4 = get_current_blog_id(); 
    $x1 = "unchecked"; 
    if (!empty($ED)) { 
        goto iqF; 
    } 
    $ED = network_site_url(); 
    if (!(substr($ED, -1) == "/")) { 
        goto Mg6; 
    } 
    $ED = substr($ED, 0, -1); 
    Mg6: 
    iqF: 
    if (username_exists($k8) || email_exists($Hj)) { 
        goto bvU; 
    } 
    $y2 = NULL; 
    $cz = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}"); 
    $Uy = get_site_option("saml_idp_role_mapping"); 
    $Uy = maybe_unserialize($Uy); 
    $Q1 = $C5["idp_name"]; 
    foreach ($cz as $blog_id) { 
        $Vb = TRUE; 
        if (empty($Uy)) { 
            goto VAH; 
        } 
        if (!array_key_exists($Q1, $Uy)) { 
            goto D2b; 
        } 
        if (!empty($Uy[$Q1][$blog_id])) { 
            goto h6Y; 
        } 
        if (!empty($Uy[$Q1]["DEFAULT"])) { 
            goto rki; 
        } 
        goto yUz; 
        h6Y: 
        $e8 = $Uy[$Q1][$blog_id]["default_role"]; 
        $N7 = $Uy[$Q1][$blog_id]["dont_allow_unlisted_user"]; 
        $yO = $Uy[$Q1][$blog_id]["keep_existing_users_role"]; 
        $FT = get_saml_roles_to_assign($Uy, $Q1, $blog_id, $e2); 
        if (!(empty($FT) && strcmp($Uy[$Q1][$blog_id]["dont_create_user"], "checked") == 0)) { 
            goto fJM; 
        } 
        $Vb = FALSE; 
        fJM: 
        goto yUz; 
        rki: 
        $e8 = $Uy[$Q1]["DEFAULT"]["default_role"]; 
        $N7 = $Uy[$Q1]["DEFAULT"]["dont_allow_unlisted_user"]; 
        $yO = $Uy[$Q1]["DEFAULT"]["keep_existing_users_role"]; 
        $FT = get_saml_roles_to_assign($Uy, $Q1, $blog_id, $e2); 
        if (!(empty($FT) && strcmp($Uy[$Q1]["DEFAULT"]["dont_create_user"], "checked") == 0)) { 
            goto Jrc; 
        } 
        $Vb = FALSE; 
        Jrc: 
        yUz: 
        D2b: 
        VAH: 
        if (!empty($FT)) { 
            goto geF; 
        } 
        $u3 = get_site_option("mo_saml_super_admin_role_mapping"); 
        if (!in_array($u3, $e2)) { 
            goto wGz; 
        } 
        $Vb = TRUE; 
        wGz: 
        geF: 
        $Mq = get_site_option("enable_saml_sso_for_sites"); 
        $Mq = maybe_unserialize($Mq); 
        $RF = substr($aK, 0, strpos($aK, "/wp-admin/")); 
        $NI = get_blog_details($blog_id); 
        $NI = $NI->siteurl; 
        $xZ = FALSE; 
        if (!(!empty($Mq) && array_key_exists($blog_id, $Mq) && !strcmp($RF, $NI))) { 
            goto qpH; 
        } 
        $xZ = TRUE; 
        qpH: 
        if (!($Vb && $xZ)) { 
            goto jfM; 
        } 
        $jt = NULL; 
        switch_to_blog($blog_id); 
        if (email_exists($Hj)) { 
            goto mbO; 
        } 
        $QP = wp_generate_password(10, false); 
        if (!empty($k8)) { 
            goto FD0; 
        } 
        if (username_exists($Hj)) { 
            goto Df8; 
        } 
        $jt = wp_create_user($Hj, $QP, $Hj); 
        goto hQs; 
        Df8: 
        $user = get_user_by("login", $Hj); 
        $jt = $user->ID; 
        add_user_to_blog($blog_id, $jt, false); 
        hQs: 
        if (!is_wp_error($jt)) { 
            goto OZY; 
        } 
        echo "<strong>ERROR</strong>: Empty User Name and Email. Please contact your administrator."; 
        exit; 
        OZY: 
        goto TSq; 
        FD0: 
        if (username_exists($k8)) { 
            goto F5m; 
        } 
        $jt = wp_create_user($k8, $QP, $Hj); 
        goto zfD; 
        F5m: 
        $user = get_user_by("login", $k8); 
        $jt = $user->ID; 
        add_user_to_blog($blog_id, $jt, false); 
        zfD: 
        if (!is_wp_error($jt)) { 
            goto eca; 
        } 
        echo "<strong>ERROR</strong>: Empty User Name and Email. Please contact your administrator."; 
        exit; 
        eca: 
        TSq: 
        goto m53; 
        mbO: 
        $user = get_user_by("email", $Hj); 
        $jt = $user->ID; 
        add_user_to_blog($blog_id, $jt, false); 
        m53: 
        $user = get_user_by("id", $jt); 
        $y2 = $user; 
        $Lq = !empty(get_site_option("mo_saml_idp_registered_users")) ? get_site_option("mo_saml_idp_registered_users") : array(); 
        $Lq[$jt] = $Q1; 
        update_site_option("mo_saml_idp_registered_users", $Lq); 
        $TB = assign_roles_to_user($user, $Uy, $Q1, $blog_id, $e2); 
        if ($TB !== true && !empty($yO) && $yO == " checked") { 
            goto Qt1; 
        } 
        if ($TB !== true && !empty($N7) && $N7 == "checked") { 
            goto YjK; 
        } 
        if ($TB !== true && !empty($e8) && $e8 !== "false") { 
            goto Orq; 
        } 
        if ($TB !== true) { 
            goto PvO; 
        } 
        goto v34; 
        Qt1: 
        $jt = wp_update_user(array("ID" => $jt)); 
        goto v34; 
        YjK: 
        $jt = wp_update_user(array("ID" => $jt, "role" => false)); 
        goto v34; 
        Orq: 
        $jt = wp_update_user(array("ID" => $jt, "role" => $e8)); 
        goto v34; 
        PvO: 
        $L3 = $Uy[$Q1][$blog_id]["default_role"]; 
        $jt = wp_update_user(array("ID" => $jt, "role" => $L3)); 
        v34: 
        $la = $user->{$wpdb->prefix . "capabilities"}; 
        if (isset($wp_roles)) { 
            goto sjM; 
        } 
        $wp_roles = new WP_Roles($blog_id); 
        sjM: 
        if (empty($V0)) { 
            goto cql; 
        } 
        $jt = wp_update_user(array("ID" => $jt, "first_name" => $V0)); 
        cql: 
        if (empty($iQ)) { 
            goto b_5; 
        } 
        $jt = wp_update_user(array("ID" => $jt, "last_name" => $iQ)); 
        b_5: 
        if (is_null($eS)) { 
            goto TUz; 
        } 
        update_user_meta($jt, "mo_saml_user_attributes", $eS); 
        if (empty($bJ)) { 
            goto Qvb; 
        } 
        if (strcmp($bJ, "USERNAME") == 0) { 
            goto G3Z; 
        } 
        if (strcmp($bJ, "FNAME") == 0 && !empty($V0)) { 
            goto wYv; 
        } 
        if (strcmp($bJ, "LNAME") == 0 && !empty($iQ)) { 
            goto Y2p; 
        } 
        if (strcmp($bJ, "FNAME_LNAME") == 0 && !empty($iQ) && !empty($V0)) { 
            goto XKu; 
        } 
        if (strcmp($bJ, "LNAME_FNAME") == 0 && !empty($iQ) && !empty($V0)) { 
            goto w0H; 
        } 
        goto CUg; 
        G3Z: 
        $jt = wp_update_user(array("ID" => $jt, "display_name" => $user->user_login)); 
        goto CUg; 
        wYv: 
        $jt = wp_update_user(array("ID" => $jt, "display_name" => $V0)); 
        goto CUg; 
        Y2p: 
        $jt = wp_update_user(array("ID" => $jt, "display_name" => $iQ)); 
        goto CUg; 
        XKu: 
        $jt = wp_update_user(array("ID" => $jt, "display_name" => $V0 . " " . $iQ)); 
        goto CUg; 
        w0H: 
        $jt = wp_update_user(array("ID" => $jt, "display_name" => $iQ . " " . $V0)); 
        CUg: 
        Qvb: 
        if (!get_site_option("mo_saml_custom_attrs_mapping")) { 
            goto siA; 
        } 
        $Z0 = get_site_option("mo_saml_custom_attrs_mapping"); 
        $Z0 = maybe_unserialize($Z0); 
        if (empty($Z0)) { 
            goto eMT; 
        } 
        if (!array_key_exists($Q1, $Z0)) { 
            goto ApP; 
        } 
        foreach ($Z0[$Q1] as $N1 => $jG) { 
            if (!array_key_exists($jG, $eS)) { 
                goto qz5; 
            } 
            $p5 = false; 
            if (!(count($eS[$jG]) == 1)) { 
                goto M4U; 
            } 
            $p5 = true; 
            M4U: 
            if (!$p5) { 
                goto h9y; 
            } 
            update_user_meta($jt, $N1, $eS[$jG][0]); 
            goto sGX; 
            h9y: 
            $wU = array(); 
            foreach ($eS[$jG] as $mX) { 
                array_push($wU, $mX); 
                PD1: 
            } 
            AHy: 
            update_user_meta($jt, $N1, $wU); 
            sGX: 
            qz5: 
            RRF: 
        } 
        Q_Q: 
        ApP: 
        eMT: 
        siA: 
        TUz: 
        jfM: 
        jNn: 
    } 
    IO8: 
    switch_to_blog($W4); 
    if ($y2 !== null) { 
        goto vAq; 
    } 
    $DR = get_site_option("mo_saml_account_creation_disabled_msg"); 
    if (!empty($DR)) { 
        goto ioF; 
    } 
    $DR = "We could not sign you in. Please contact your Administrator."; 
    ioF: 
    wp_die($DR, "Error: Not a WordPress Member"); 
    exit; 
    goto ddd; 
    vAq: 
    $jt = $y2->ID; 
    wp_set_current_user($jt); 
    wp_set_auth_cookie($jt, true); 
    $user = get_user_by("id", $jt); 
    do_action("wp_login", $user->user_login, $user); 
    if (empty($UV)) { 
        goto A9t; 
    } 
    update_user_meta($jt, "mo_saml_session_index", $UV); 
    A9t: 
    if (empty($ZK)) { 
        goto xXU; 
    } 
    update_user_meta($jt, "mo_saml_name_id", $ZK); 
    xXU: 
    if (!(!session_id() || session_id() == '' || !isset($_SESSION))) { 
        goto Ng1; 
    } 
    session_start(); 
    Ng1: 
    $_SESSION["mo_saml"]["logged_in_with_idp"] = $Q1; 
    ddd: 
    $jS = get_site_option("mo_saml_relay_state"); 
    if (!empty($jS)) { 
        goto Mig; 
    } 
    if (!empty($aK)) { 
        goto t6T; 
    } 
    wp_redirect($ED); 
    goto qyc; 
    Mig: 
    wp_redirect($jS); 
    goto qyc; 
    t6T: 
    wp_redirect($aK); 
    qyc: 
    exit; 
    goto kJW; 
    bvU: 
    if (email_exists($Hj)) { 
        goto nbL; 
    } 
    $user = get_user_by("login", $k8); 
    goto nsG; 
    nbL: 
    $user = get_user_by("email", $Hj); 
    nsG: 
    $jt = $user->ID; 
    if (empty($V0)) { 
        goto J3w; 
    } 
    $jt = wp_update_user(array("ID" => $jt, "first_name" => $V0)); 
    J3w: 
    if (empty($iQ)) { 
        goto Ars; 
    } 
    $jt = wp_update_user(array("ID" => $jt, "last_name" => $iQ)); 
    Ars: 
    if (empty($Hj)) { 
        goto vod; 
    } 
    $jt = wp_update_user(array("ID" => $jt, "user_email" => $Hj)); 
    vod: 
    $Q1 = $C5["idp_name"]; 
    if (!get_site_option("mo_saml_custom_attrs_mapping")) { 
        goto g47; 
    } 
    $Z0 = get_site_option("mo_saml_custom_attrs_mapping"); 
    $Z0 = maybe_unserialize($Z0); 
    if (empty($Z0)) { 
        goto G1b; 
    } 
    if (!array_key_exists($Q1, $Z0)) { 
        goto aR2; 
    } 
    foreach ($Z0[$Q1] as $N1 => $jG) { 
        if (!array_key_exists($jG, $eS)) { 
            goto F5E; 
        } 
        $p5 = false; 
        if (!(count($eS[$jG]) == 1)) { 
            goto aFj; 
        } 
        $p5 = true; 
        aFj: 
        if (!$p5) { 
            goto Fz1; 
        } 
        update_user_meta($jt, $N1, $eS[$jG][0]); 
        goto XpI; 
        Fz1: 
        $wU = array(); 
        foreach ($eS[$jG] as $mX) { 
            array_push($wU, $mX); 
            FVl: 
        } 
        zkl: 
        update_user_meta($jt, $N1, $wU); 
        XpI: 
        F5E: 
        wWx: 
    } 
    c56: 
    aR2: 
    G1b: 
    g47: 
    global $wpdb; 
    $cz = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}"); 
    $Uy = get_site_option("saml_idp_role_mapping"); 
    $Uy = maybe_unserialize($Uy); 
    foreach ($cz as $blog_id) { 
        switch_to_blog($blog_id); 
        $user = get_user_by("id", $jt); 
        $RF = substr($aK, 0, strpos($aK, "/wp-admin/")); 
        $NI = get_blog_details($blog_id); 
        $NI = $NI->siteurl; 
        if (strcmp($RF, $NI) == 0) { 
            goto imW; 
        } 
        goto Sx_; 
        goto AVI; 
        imW: 
        if (empty($Uy)) { 
            goto iku; 
        } 
        if (!array_key_exists($Q1, $Uy)) { 
            goto Wje; 
        } 
        if (!empty($Uy[$Q1][$blog_id])) { 
            goto eXd; 
        } 
        if (!empty($Uy[$Q1]["DEFAULT"])) { 
            goto Rlf; 
        } 
        goto yfV; 
        eXd: 
        $e8 = $Uy[$Q1][$blog_id]["default_role"]; 
        $N7 = $Uy[$Q1][$blog_id]["dont_allow_unlisted_user"]; 
        $x1 = $Uy[$Q1][$blog_id]["dont_create_user"]; 
        $yO = $Uy[$Q1][$blog_id]["keep_existing_users_role"]; 
        goto yfV; 
        Rlf: 
        $e8 = $Uy[$Q1]["DEFAULT"]["default_role"]; 
        $N7 = $Uy[$Q1]["DEFAULT"]["dont_allow_unlisted_user"]; 
        $x1 = $Uy[$Q1]["DEFAULT"]["dont_create_user"]; 
        $yO = $Uy[$Q1]["DEFAULT"]["keep_existing_users_role"]; 
        yfV: 
        Wje: 
        iku: 
        if (!is_user_member_of_blog($jt, $blog_id) && !strcmp($RF, $NI)) { 
            goto HpJ; 
        } 
        if (isset($yO) && $yO == "checked") { 
            goto aJi; 
        } 
        $TB = assign_roles_to_user($user, $Uy, $Q1, $blog_id, $e2); 
        goto SiA; 
        aJi: 
        $TB = false; 
        SiA: 
        if (!(!is_administrator_user($user) && !empty($x1) && $x1 == "unchecked")) { 
            goto h4M; 
        } 
        if (isset($yO) && $yO == "checked") { 
            goto kn_; 
        } 
        if ($TB !== true && !empty($N7) && $N7 == "checked") { 
            goto Z_A; 
        } 
        if ($TB !== true && !empty($e8) && $e8 !== "false") { 
            goto XBc; 
        } 
        if ($TB !== true && is_user_member_of_blog($jt, $blog_id)) { 
            goto EPZ; 
        } 
        goto f6q; 
        kn_: 
        $jt = wp_update_user(array("ID" => $jt)); 
        goto f6q; 
        Z_A: 
        $jt = wp_update_user(array("ID" => $jt, "role" => false)); 
        goto f6q; 
        XBc: 
        $jt = wp_update_user(array("ID" => $jt, "role" => $e8)); 
        goto f6q; 
        EPZ: 
        $L3 = $Uy[$Q1][$blog_id]["default_role"]; 
        $jt = wp_update_user(array("ID" => $jt, "role" => $L3)); 
        f6q: 
        h4M: 
        goto MrB; 
        HpJ: 
        $xZ = true; 
        if (empty($Uy)) { 
            goto fNe; 
        } 
        if (array_key_exists($blog_id, $Uy)) { 
            goto q6h; 
        } 
        if (array_key_exists("DEFAULT", $Uy)) { 
            goto rn8; 
        } 
        goto gU5; 
        q6h: 
        $FT = get_saml_roles_to_assign($Uy, $Q1, $blog_id, $e2); 
        if (!(empty($FT) && strcmp($Uy[$Q1][$blog_id]["dont_create_user"], "checked") == 0)) { 
            goto FK3; 
        } 
        $xZ = false; 
        FK3: 
        goto gU5; 
        rn8: 
        $FT = get_saml_roles_to_assign($Uy, $Q1, $blog_id, $e2); 
        if (!(empty($FT) && strcmp($Uy[$Q1]["DEFAULT"]["dont_create_user"], "checked") == 0)) { 
            goto p4K; 
        } 
        $xZ = false; 
        p4K: 
        gU5: 
        fNe: 
        $Mq = get_site_option("enable_saml_sso_for_sites"); 
        $Mq = maybe_unserialize($Mq); 
        if (empty($Mq)) { 
            goto Fdl; 
        } 
        if (!array_key_exists($blog_id, $Mq)) { 
            goto rvU; 
        } 
        $Vb = true; 
        goto DGX; 
        rvU: 
        $Vb = false; 
        DGX: 
        Fdl: 
        if (!($xZ && $Vb)) { 
            goto XJz; 
        } 
        add_user_to_blog($blog_id, $jt, false); 
        $TB = assign_roles_to_user($user, $Uy, $Q1, $blog_id, $e2); 
        if ($TB !== true && !empty($N7) && $N7 == "checked") { 
            goto Woo; 
        } 
        if ($TB !== true && !empty($e8) && $e8 !== "false") { 
            goto lOH; 
        } 
        if ($TB !== true) { 
            goto oeY; 
        } 
        goto HyK; 
        Woo: 
        $jt = wp_update_user(array("ID" => $jt, "role" => false)); 
        goto HyK; 
        lOH: 
        $jt = wp_update_user(array("ID" => $jt, "role" => $e8)); 
        goto HyK; 
        oeY: 
        $L3 = $Uy[$Q1][$blog_id]["default_role"]; 
        $jt = wp_update_user(array("ID" => $jt, "role" => $L3)); 
        HyK: 
        XJz: 
        MrB: 
        AVI: 
        Sx_: 
    } 
    MtY: 
    switch_to_blog($W4); 
    if (is_null($eS)) { 
        goto Hlc; 
    } 
    update_user_meta($jt, "mo_saml_user_attributes", $eS); 
    if (empty($bJ)) { 
        goto Hlb; 
    } 
    if (strcmp($bJ, "USERNAME") == 0) { 
        goto xh2; 
    } 
    if (strcmp($bJ, "FNAME") == 0 && !empty($V0)) { 
        goto uvT; 
    } 
    if (strcmp($bJ, "LNAME") == 0 && !empty($iQ)) { 
        goto DIU; 
    } 
    if (strcmp($bJ, "FNAME_LNAME") == 0 && !empty($iQ) && !empty($V0)) { 
        goto PpZ; 
    } 
    if (strcmp($bJ, "LNAME_FNAME") == 0 && !empty($iQ) && !empty($V0)) { 
        goto Dos; 
    } 
    goto MTD; 
    xh2: 
    $jt = wp_update_user(array("ID" => $jt, "display_name" => $user->user_login)); 
    goto MTD; 
    uvT: 
    $jt = wp_update_user(array("ID" => $jt, "display_name" => $V0)); 
    goto MTD; 
    DIU: 
    $jt = wp_update_user(array("ID" => $jt, "display_name" => $iQ)); 
    goto MTD; 
    PpZ: 
    $jt = wp_update_user(array("ID" => $jt, "display_name" => $V0 . " " . $iQ)); 
    goto MTD; 
    Dos: 
    $jt = wp_update_user(array("ID" => $jt, "display_name" => $iQ . " " . $V0)); 
    MTD: 
    Hlb: 
    Hlc: 
    wp_set_current_user($jt); 
    wp_set_auth_cookie($jt, true); 
    $user = get_user_by("id", $jt); 
    do_action("wp_login", $user->user_login, $user); 
    if (empty($UV)) { 
        goto GqA; 
    } 
    update_user_meta($jt, "mo_saml_session_index", $UV); 
    GqA: 
    if (empty($ZK)) { 
        goto xDe; 
    } 
    update_user_meta($jt, "mo_saml_name_id", $ZK); 
    xDe: 
    if (!(!session_id() || session_id() == '' || !isset($_SESSION))) { 
        goto XcI; 
    } 
    session_start(); 
    XcI: 
    $_SESSION["mo_saml"]["logged_in_with_idp"] = $Q1; 
    $jS = get_site_option("mo_saml_relay_state"); 
    if (!empty($jS)) { 
        goto E1Z; 
    } 
    if (!empty($aK)) { 
        goto jCK; 
    } 
    wp_redirect($ED); 
    goto X3G; 
    E1Z: 
    wp_redirect($jS); 
    goto X3G; 
    jCK: 
    wp_redirect($aK); 
    X3G: 
    exit; 
    kJW: 
} 
function check_if_user_allowed_to_login($user, $ED) 
{ 
    $jt = $user->ID; 
    global $wpdb; 
    if (get_user_meta($jt, "mo_saml_user_type", true)) { 
        goto c3L; 
    } 
    if (get_site_option("mo_saml_usr_lmt")) { 
        goto u9R; 
    } 
    update_user_meta($jt, "mo_saml_user_type", "sso_user"); 
    goto khF; 
    u9R: 
    $N1 = get_site_option("mo_saml_customer_token"); 
    $GE = AESEncryption::decrypt_data(get_site_option("mo_saml_usr_lmt"), $N1); 
    $Hy = "SELECT COUNT(*) FROM " . $wpdb->prefix . "usermeta WHERE meta_key='mo_saml_user_type'"; 
    $XP = $wpdb->get_var($Hy); 
    if ($XP >= $GE) { 
        goto rRN; 
    } 
    update_user_meta($jt, "mo_saml_user_type", "sso_user"); 
    goto oJD; 
    rRN: 
    if (get_site_option("user_alert_email_sent")) { 
        goto tt0; 
    } 
    $ar = new Customersaml(); 
    $ar->mo_saml_send_user_exceeded_alert_email($GE); 
    tt0: 
    if (is_administrator_user($user)) { 
        goto qw9; 
    } 
    wp_redirect($ED); 
    exit; 
    goto vAi; 
    qw9: 
    update_user_meta($jt, "mo_saml_user_type", "sso_user"); 
    vAi: 
    oJD: 
    khF: 
    c3L: 
} 
function check_if_user_allowed_to_login_due_to_role_restriction($e2) 
{ 
    $Uy = get_site_option("saml_idp_role_mapping"); 
    $Uy = maybe_unserialize($Uy); 
    global $wpdb; 
    $u2 = get_site_option("selected_idp"); 
    if (!(!empty($Uy) && array_key_exists($u2, $Uy))) { 
        goto xUV; 
    } 
    $cz = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}"); 
    foreach ($cz as $blog_id) { 
        if (!isset($Uy[$u2][$blog_id])) { 
            goto LMg; 
        } 
        $Zg = $Uy[$u2][$blog_id]["mo_saml_dont_allow_user_tologin_create_with_given_groups"]; 
        if (!($Zg == "checked")) { 
            goto N5Q; 
        } 
        if (empty($e2)) { 
            goto Qrx; 
        } 
        $HJ = $Uy[$u2][$blog_id]["mo_saml_restrict_users_with_groups"]; 
        $rk = explode(";", $HJ); 
        foreach ($rk as $cX) { 
            foreach ($e2 as $lb) { 
                $lb = trim($lb); 
                if (!(!empty($lb) && $lb == $cX)) { 
                    goto KqM; 
                } 
                wp_die("You are not authorized to login. Please contact your administrator.", "Error"); 
                KqM: 
                Xkc: 
            } 
            ben: 
            Ym_: 
        } 
        XpK: 
        Qrx: 
        N5Q: 
        LMg: 
        OTj: 
    } 
    zRq: 
    xUV: 
} 
function assign_roles_to_user($user, $Uy, $Q1, $blog_id, $e2) 
{ 
    $TB = false; 
    if (!empty($Uy) && !is_administrator_user($user) && !empty($Uy[$Q1]) && is_user_member_of_blog($user->ID, $blog_id)) { 
        goto rM4; 
    } 
    if (empty($Uy[$Q1]["DEFAULT"])) { 
        goto x02; 
    } 
    $Eg = $Uy[$Q1]; 
    $b0 = $Eg["DEFAULT"]["dont_create_user"]; 
    $yO = $Eg["DEFAULT"]["keep_existing_users_role"]; 
    $user->set_role(false); 
    $Nf = ''; 
    $Td = false; 
    unset($Eg["DEFAULT"]["default_role"]); 
    unset($Eg["DEFAULT"]["dont_create_user"]); 
    unset($Eg["DEFAULT"]["dont_allow_unlisted_user"]); 
    foreach ($Eg["DEFAULT"] as $P0 => $A2) { 
        $rk = explode(";", $A2); 
        foreach ($rk as $cX) { 
            if (!in_array($cX, $e2)) { 
                goto JW9; 
            } 
            $TB = true; 
            $user->add_role($P0); 
            JW9: 
            IYz: 
        } 
        fBy: 
        h62: 
    } 
    bpN: 
    x02: 
    goto M28; 
    rM4: 
    if (empty($Uy[$Q1][$blog_id])) { 
        goto SD1; 
    } 
    $Eg = $Uy[$Q1]; 
    $b0 = $Eg[$blog_id]["dont_create_user"]; 
    $yO = $Eg[$blog_id]["keep_existing_users_role"]; 
    $user->set_role(false); 
    $Nf = ''; 
    $Td = false; 
    unset($Eg[$blog_id]["default_role"]); 
    unset($Eg[$blog_id]["dont_create_user"]); 
    unset($Eg[$blog_id]["dont_allow_unlisted_user"]); 
    foreach ($Eg[$blog_id] as $P0 => $A2) { 
        $rk = explode(";", $A2); 
        foreach ($rk as $cX) { 
            if (!in_array($cX, $e2)) { 
                goto j0Q; 
            } 
            $TB = true; 
            $user->add_role($P0); 
            j0Q: 
            yWK: 
        } 
        aHV: 
        o_u: 
    } 
    PLY: 
    SD1: 
    M28: 
    $MD = get_site_option("mo_saml_super_admin_role_mapping"); 
    $Sl = explode(";", $MD); 
    if (!(!empty(array_filter($e2)) && !empty(array_filter($Sl)))) { 
        goto U_b; 
    } 
    foreach ($Sl as $cX) { 
        if (!in_array($cX, $e2)) { 
            goto wDu; 
        } 
        grant_super_admin($user->ID); 
        wDu: 
        UPW: 
    } 
    vf_: 
    U_b: 
    return $TB; 
} 
function get_saml_roles_to_assign($Uy, $Q1, $blog_id, $e2) 
{ 
    $FT = array(); 
    $Uy = get_site_option("saml_idp_role_mapping"); 
    $Uy = maybe_unserialize($Uy); 
    if (!(!empty($e2) && !empty($Uy) && !empty($Uy[$Q1]))) { 
        goto u8k; 
    } 
    if (!empty($Uy[$Q1][$blog_id])) { 
        goto ceq; 
    } 
    if (empty($Uy[$Q1]["DEFAULT"])) { 
        goto CWl; 
    } 
    unset($Uy[$Q1]["DEFAULT"]["default_role"]); 
    unset($Uy[$Q1]["DEFAULT"]["dont_create_user"]); 
    unset($Uy[$Q1]["DEFAULT"]["dont_allow_unlisted_user"]); 
    foreach ($Uy[$Q1]["DEFAULT"] as $P0 => $A2) { 
        $rk = explode(";", $A2); 
        foreach ($rk as $cX) { 
            if (!in_array($cX, $e2)) { 
                goto lD_; 
            } 
            array_push($FT, $P0); 
            lD_: 
            R2j: 
        } 
        kTq: 
        WEI: 
    } 
    tCr: 
    CWl: 
    goto b3Z; 
    ceq: 
    unset($Uy[$Q1][$blog_id]["default_role"]); 
    unset($Uy[$Q1][$blog_id]["dont_create_user"]); 
    unset($Uy[$Q1][$blog_id]["dont_allow_unlisted_user"]); 
    unset($Uy[$Q1][$blog_id]["keep_existing_users_role"]); 
    unset($Uy[$Q1][$blog_id]["dont_allow_user_tologin_create_with_given_groups"]); 
    unset($Uy[$Q1][$blog_id]["mo_saml_dont_allow_user_tologin_create_with_given_groups"]); 
    foreach ($Uy[$Q1][$blog_id] as $P0 => $A2) { 
        $rk = explode(";", $A2); 
        foreach ($rk as $cX) { 
            if (!in_array($cX, $e2)) { 
                goto A1W; 
            } 
            array_push($FT, $P0); 
            A1W: 
            P3u: 
        } 
        EYm: 
        E5J: 
    } 
    TqU: 
    b3Z: 
    u8k: 
    return $FT; 
} 
function is_administrator_user($user) 
{ 
    $Dz = $user->roles; 
    if (!is_null($Dz) && in_array("administrator", $Dz)) { 
        goto vpA; 
    } 
    return false; 
    goto dpu; 
    vpA: 
    return true; 
    dpu: 
} 
function mo_saml_is_customer_registered() 
{ 
    $oI = get_site_option("mo_saml_admin_email"); 
    $BX = get_site_option("mo_saml_admin_customer_key"); 
    if (!$oI || !$BX || !is_numeric(trim($BX))) { 
        goto XBj; 
    } 
    return 1; 
    goto d5E; 
    XBj: 
    return 0; 
    d5E: 
} 
function saml_get_current_page_url() 
{ 
    $B2 = $_SERVER["HTTP_HOST"]; 
    if (!(substr($B2, -1) == "/")) { 
        goto kw1; 
    } 
    $B2 = substr($B2, 0, -1); 
    kw1: 
    $eQ = $_SERVER["REQUEST_URI"]; 
    if (!(substr($eQ, 0, 1) == "/")) { 
        goto dY3; 
    } 
    $eQ = substr($eQ, 1); 
    dY3: 
    $Jr = isset($_SERVER["HTTPS"]) && strcasecmp($_SERVER["HTTPS"], "on") == 0; 
    $V8 = "http" . ($Jr ? "s" : '') . "://" . $B2 . "/" . $eQ; 
    return $V8; 
} 
function get_network_site_url() 
{ 
    $qV = network_site_url(); 
    if (!(substr($qV, -1) == "/")) { 
        goto njz; 
    } 
    $qV = substr($qV, 0, -1); 
    njz: 
    return $qV; 
} 
function mo_saml_parse_url($aK) 
{ 
    if (!($aK != "testValidate" && $aK != "testNewCertificate")) { 
        goto xlG; 
    } 
    $ED = get_site_option("mo_saml_sp_base_url"); 
    if (!empty($ED)) { 
        goto cFA; 
    } 
    $ED = get_network_site_url(); 
    cFA: 
    $i4 = parse_url($ED, PHP_URL_SCHEME); 
    if (filter_var($aK, FILTER_VALIDATE_URL)) { 
        goto nzQ; 
    } 
    $aK = $i4 . "://" . $aK; 
    nzQ: 
    xlG: 
    return $aK; 
} 
function get_current_base_url() 
{ 
    return sprintf("%s://%s/", isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] != "off" ? "https" : "http", $_SERVER["HTTP_HOST"]); 
} 
function mo_saml_relaystate_url($aK) 
{ 
    $i4 = parse_url($aK, PHP_URL_SCHEME); 
    $aK = str_replace($i4 . "://", '', $aK); 
    return $aK; 
} 
add_action("widgets_init", function () { 
    register_widget("Mo_SAML_Login_Widget"); 
}); 
add_action("wp_enqueue_scripts", "plugin_settings_style_widget"); 
add_action("wp_enqueue_scripts", "plugin_settings_script_widget"); 
add_action("init", "mo_login_validate"); 
 ?>

Did this file decode correctly?

Original Code

<?php


include_once dirname(__FILE__) . "\57\125\x74\151\x6c\x69\x74\151\x65\163\56\x70\150\x70";
include_once dirname(__FILE__) . "\x2f\x52\145\163\x70\x6f\x6e\x73\x65\x2e\x70\150\x70";
include_once dirname(__FILE__) . "\x2f\x4c\x6f\x67\157\x75\x74\122\145\x71\x75\x65\x73\164\56\160\x68\160";
require_once dirname(__FILE__) . "\x2f\151\156\143\x6c\165\144\145\163\x2f\x6c\151\142\x2f\145\156\x63\162\x79\x70\164\151\x6f\156\x2e\160\x68\160";
include_once "\x78\155\154\163\x65\x63\154\151\142\163\56\160\x68\160";
use RobRichards\XMLSecLibs\XMLSecurityKey;
use RobRichards\XMLSecLibs\XMLSecurityDSig;
use RobRichards\XMLSecLibs\XMLSecEnc;
class Mo_SAML_Login_Widget extends WP_Widget
{
    public function __construct()
    {
        parent::__construct("\123\141\155\154\x5f\114\x6f\x67\x69\x6e\137\127\x69\x64\147\x65\x74", "\x53\151\x6e\x67\x6c\x65\40\123\x69\x67\x6e\x2d\x4f\x6e\x20\x4c\x69\156\x6b", array("\x64\145\163\143\162\x69\x70\164\151\157\x6e" => __("\124\150\x69\163\x20\151\x73\x20\141\x20\x6d\151\x6e\x69\117\162\141\156\147\x65\40\123\x41\x4d\x4c\40\154\x6f\x67\151\156\40\167\151\144\147\x65\x74\x2e", "\x6d\x6f\x73\141\x6d\x6c")));
    }
    public function widget($XT, $Lx)
    {
        extract($XT);
        $Uu = apply_filters("\x77\151\x64\x67\x65\x74\x5f\164\x69\x74\x6c\x65", $Lx["\x77\x69\144\137\164\151\x74\154\145"]);
        echo $XT["\x62\145\146\157\x72\x65\x5f\x77\x69\x64\x67\145\x74"];
        if (empty($Uu)) {
            goto niH;
        }
        echo $XT["\142\x65\146\x6f\x72\145\x5f\x74\x69\x74\154\145"] . $Uu . $XT["\x61\146\x74\x65\162\x5f\164\151\164\154\x65"];
        niH:
        $this->loginForm();
        echo $XT["\141\x66\164\x65\162\137\167\151\x64\147\145\x74"];
    }
    public function update($x6, $o0)
    {
        $Lx = array();
        $Lx["\x77\151\x64\x5f\x74\151\164\x6c\x65"] = strip_tags($x6["\167\x69\144\x5f\164\151\164\154\145"]);
        return $Lx;
    }
    public function form($Lx)
    {
        $Uu = '';
        if (!array_key_exists("\167\151\x64\137\164\151\x74\x6c\x65", $Lx)) {
            goto JZz;
        }
        $Uu = $Lx["\x77\x69\144\137\164\151\164\x6c\145"];
        JZz:
        echo "\xd\xa\x9\11\74\160\76\x3c\x6c\x61\x62\x65\154\x20\146\x6f\162\75\x22" . $this->get_field_id("\167\151\144\x5f\x74\151\164\x6c\x65") . "\42\x3e";
        _e("\124\x69\x74\x6c\145\x3a");
        echo "\74\x2f\154\141\x62\145\x6c\76\xd\12\11\11\x3c\x69\x6e\x70\x75\164\x20\143\154\x61\163\163\x3d\x22\x77\151\144\145\x66\141\x74\x22\40\151\x64\x3d\x22" . $this->get_field_id("\x77\151\144\137\x74\151\164\154\x65") . "\x22\40\156\141\x6d\145\75\x22" . $this->get_field_name("\x77\151\144\137\x74\151\164\154\145") . "\42\x20\164\x79\160\x65\75\42\164\x65\x78\x74\x22\40\166\141\x6c\x75\145\x3d\42" . $Uu . "\x22\x20\57\76\xd\12\x9\11\74\x2f\160\76";
    }
    public function loginForm()
    {
        global $post;
        $this->error_message();
        if (!Utilities::mo_saml_is_user_logged_in()) {
            goto cq6;
        }
        $current_user = wp_get_current_user();
        $x7 = get_site_option("\163\x61\x6d\154\x5f\151\144\x65\156\164\151\x74\x79\137\160\162\x6f\x76\x69\x64\x65\x72\x73");
        $x7 = maybe_unserialize($x7);
        $C5 = isset($_SESSION["\155\x6f\137\x67\x75\x65\x73\x74\x5f\x6c\x6f\x67\151\x6e"]["\154\157\147\147\145\x64\137\x69\156\x5f\x69\144\x70\x5f\156\141\x6d\x65"]) ? $_SESSION["\155\x6f\x5f\147\x75\145\x73\x74\x5f\154\157\x67\x69\156"]["\154\157\x67\147\x65\x64\x5f\151\156\137\x69\144\160\x5f\156\141\155\145"] : get_user_meta($current_user->ID, "\x6d\157\137\163\x61\x6d\x6c\x5f\154\x6f\x67\147\145\144\x5f\x69\x6e\137\x77\151\x74\150\137\151\144\160", true);
        $C5 = get_site_option("\163\145\x6c\x65\143\x74\145\144\x5f\151\x64\x70");
        $c6 = $x7[$C5];
        $WX = "\110\x65\x6c\x6c\x6f\x2c";
        if (empty($c6["\x63\165\163\164\x6f\155\137\147\162\145\x65\x74\x69\156\147\137\164\145\170\164"])) {
            goto IVb;
        }
        $WX = $c6["\x63\165\163\x74\157\x6d\x5f\x67\162\x65\x65\x74\151\156\147\x5f\x74\x65\170\164"];
        IVb:
        $fQ = '';
        if (empty($c6["\x67\x72\x65\x65\x74\x69\x6e\147\137\x6e\141\155\x65"])) {
            goto Po4;
        }
        switch ($c6["\x67\x72\x65\x65\164\151\x6e\147\x5f\x6e\141\x6d\x65"]) {
            case "\125\123\x45\122\x4e\101\x4d\105":
                $fQ = $current_user->user_login;
                goto G9U;
            case "\x45\x4d\x41\x49\114":
                $fQ = $current_user->user_email;
                goto G9U;
            case "\106\116\x41\x4d\105":
                $fQ = $current_user->user_firstname;
                goto G9U;
            case "\114\116\x41\x4d\x45":
                $fQ = $current_user->user_lastname;
                goto G9U;
            case "\x46\116\101\115\x45\x5f\114\116\x41\x4d\105":
                $fQ = $current_user->user_firstname . "\40" . $current_user->user_lastname;
                goto G9U;
            case "\x4c\116\x41\115\x45\137\106\x4e\x41\x4d\x45":
                $fQ = $current_user->user_lastname . "\x20" . $current_user->user_firstname;
                goto G9U;
            default:
                $fQ = $current_user->user_login;
        }
        vir:
        G9U:
        Po4:
        if (!empty(trim($fQ))) {
            goto TrW;
        }
        $fQ = $current_user->user_login;
        TrW:
        $Ov = $WX . "\x20" . $fQ;
        $C4 = "\114\x6f\x67\157\x75\x74";
        if (empty($c6["\143\165\163\164\x6f\x6d\x5f\x6c\157\x67\x6f\x75\164\x5f\164\x65\x78\x74"])) {
            goto ZyR;
        }
        $C4 = $c6["\143\x75\x73\164\x6f\155\x5f\x6c\157\147\x6f\x75\x74\137\x74\x65\170\164"];
        ZyR:
        echo $Ov . "\40\x7c\40\74\141\40\x68\162\x65\146\x3d\x22" . wp_logout_url(home_url()) . "\x22\40\x74\151\164\x6c\145\75\x22\x6c\157\x67\x6f\165\x74\x22\40\x3e" . $C4 . "\74\57\141\x3e\74\x2f\154\151\x3e";
        $qV = saml_get_current_page_url();
        update_site_option("\154\x6f\x67\x6f\165\164\137\x72\145\144\x69\162\145\143\x74\137\x75\162\x6c", $qV);
        goto spm;
        cq6:
        $eW = saml_get_current_page_url();
        $Gh = get_site_option("\x73\141\155\x6c\x5f\x69\x64\x65\156\164\151\x74\x79\137\x70\x72\157\166\151\x64\145\162\x73");
        $Gh = maybe_unserialize($Gh);
        if (!empty($Gh)) {
            goto L1m;
        }
        echo "\120\154\145\x61\x73\x65\x20\143\x6f\x6e\x66\x69\147\165\162\x65\40\164\x68\x65\x20\155\x69\156\151\117\162\141\156\147\x65\40\123\101\115\114\x20\120\x6c\x75\x67\151\x6e\x20\146\151\x72\x73\164\56";
        goto jpG;
        L1m:
        foreach ($Gh as $C5) {
            if (!empty($C5["\151\144\160\x5f\x6e\141\155\x65"])) {
                goto wp5;
            }
            echo "\x50\154\145\141\x73\x65\40\143\157\x6e\x66\x69\x67\165\x72\145\40\x74\x68\145\x20\155\x69\156\x69\117\x72\x61\x6e\147\x65\40\123\x41\115\x4c\40\x50\154\x75\147\151\156\x20\146\151\x72\163\164\x2e";
            goto whU;
            wp5:
            $QB = "\x6c\x6f\147\x69\156\x5f" . $C5["\x69\144\160\137\x6e\x61\155\x65"];
            $Q8 = "\x6d\x6f\163\165\142\155\151\164\163\x61\x6d\x6c\146\157\162\x6d\x5f" . $C5["\x69\144\160\x5f\156\141\x6d\x65"];
            echo "\74\163\x63\162\x69\x70\164\76\15\12\11\x9\x9\x9\11\40\x20\x20\x20\x6a\x51\x75\145\x72\x79\x28\40\144\157\143\165\x6d\145\x6e\164\40\x29\x2e\x72\145\x61\x64\x79\50\146\x75\156\x63\164\x69\x6f\x6e\x28\x29\x20\173\15\12\11\x9\x9\11\40\x20\40\x20\11\x9\152\121\165\x65\162\x79\50\42\43" . $Q8 . "\x22\x29\56\143\x6c\x69\x63\x6b\x28\x66\165\x6e\143\164\x69\x6f\156\50\x65\51\x20\173\xd\xa\x9\11\11\40\40\x20\x20\11\x9\x9\11\x65\x2e\160\162\145\166\145\156\164\x44\x65\x66\141\165\154\164\x28\x29\73\xd\xa\11\x9\x20\x20\x20\x20\x9\11\11\x9\x9\152\121\x75\x65\162\171\50\42\x23" . $QB . "\42\x29\x2e\163\x75\x62\x6d\x69\164\50\51\73\xd\12\x9\x20\40\40\40\11\11\11\11\x9\175\51\73\15\12\x20\x20\40\40\11\x9\11\11\x9\175\x29\73\xd\xa\11\x9\11\11\11\40\x20\40\40\x3c\x2f\x73\x63\x72\151\x70\x74\76\15\xa\11\11\x9\11\x9\x20\x20\x20\40\74\x66\x6f\x72\x6d\40\156\141\x6d\x65\75\x22" . $QB . "\x22\x20\x69\x64\75\x22" . $QB . "\42\40\x6d\145\164\150\157\144\x3d\42\x70\x6f\163\164\x22\x20\141\143\x74\151\x6f\156\75\x22\x22\76\xd\xa\x9\11\11\11\x20\40\40\40\x9\11\x9\x3c\151\x6e\160\165\x74\x20\x74\171\x70\145\x3d\42\x68\151\x64\x64\x65\x6e\42\40\x6e\x61\x6d\x65\75\x22\x6f\x70\164\151\x6f\156\42\x20\166\x61\154\165\x65\x3d\42\x73\x61\155\x6c\x5f\165\163\x65\162\x5f\x6c\x6f\147\x69\156\42\x20\x2f\76\xd\xa\11\x9\11\40\x20\x20\40\11\11\11\x9\x3c\x69\156\x70\x75\x74\40\164\x79\x70\145\x3d\42\150\151\x64\x64\x65\x6e\42\x20\x6e\141\x6d\145\x3d\42\x72\x65\144\x69\162\x65\143\164\x5f\164\x6f\x22\40\x76\x61\x6c\165\x65\x3d\42" . $eW . "\x22\x20\x2f\76\15\xa\x9\11\x20\40\40\x20\x9\11\11\11\11\x3c\x69\x6e\x70\165\164\x20\164\x79\x70\x65\x3d\42\x68\x69\x64\x64\x65\156\42\40\156\141\155\x65\x3d\42\x69\144\160\x22\x20\166\141\154\165\145\75\42" . $C5["\151\x64\160\x5f\156\141\x6d\145"] . "\x22\40\57\76\xd\12\11\x20\x20\x20\40\11\x9\11\x9\x9\11\74\146\157\156\164\x20\x73\151\x7a\145\x3d\x22\x2b\x31\x22\40\163\x74\x79\154\145\75\42\166\x65\x72\164\x69\143\x61\x6c\x2d\x61\x6c\151\x67\x6e\72\x74\157\160\73\42\76\x20\74\57\146\157\x6e\x74\76";
            $BV = !empty($C5["\x63\x75\x73\x74\x6f\155\x5f\154\x6f\x67\151\x6e\x5f\164\x65\x78\164"]) ? $C5["\x63\x75\x73\x74\157\x6d\137\x6c\x6f\x67\151\x6e\x5f\164\145\x78\164"] : "\x4c\x6f\147\151\x6e\x20\167\x69\x74\150\40" . $C5["\151\x64\x70\137\x6e\x61\155\145"];
            echo "\x3c\x61\40\150\x72\145\146\75\x22\x23\x22\x20\151\144\x3d\x22" . $Q8 . "\x22\76" . $BV . "\x3c\57\x61\x3e\x3c\57\146\157\162\x6d\x3e";
            whU:
            Ivl:
        }
        XkV:
        jpG:
        spm:
    }
    public function mo_saml_check_empty_or_null_val($jG)
    {
        if (!(!isset($jG) || empty($jG))) {
            goto iOr;
        }
        return true;
        iOr:
        return false;
    }
    public function error_message()
    {
        if (!(isset($_SESSION["\x6d\x73\x67"]) and $_SESSION["\155\163\x67"])) {
            goto oZ_;
        }
        echo "\x3c\x64\151\166\40\143\154\141\163\x73\75\42" . $_SESSION["\x6d\x73\147\x5f\x63\154\141\163\x73"] . "\x22\x3e" . $_SESSION["\x6d\x73\x67"] . "\74\57\144\151\166\x3e";
        unset($_SESSION["\x6d\x73\x67"]);
        unset($_SESSION["\x6d\163\x67\x5f\143\x6c\141\163\x73"]);
        oZ_:
    }
    public function mo_saml_logout($user)
    {
        if (!(!session_id() || session_id() == '' || !isset($_SESSION))) {
            goto aO_;
        }
        session_start();
        aO_:
        $BU = array();
        $Q1 = isset($_SESSION["\x6d\x6f\137\163\141\155\x6c"]["\154\157\x67\147\145\144\x5f\x69\156\x5f\167\151\164\x68\x5f\x69\144\160"]) ? $_SESSION["\x6d\157\x5f\163\141\155\154"]["\154\x6f\x67\147\x65\144\x5f\x69\x6e\137\167\x69\x74\150\137\151\x64\x70"] : '';
        $x7 = get_site_option("\163\141\x6d\x6c\137\151\x64\x65\x6e\x74\x69\x74\x79\137\160\x72\x6f\166\151\144\145\162\x73");
        $x7 = maybe_unserialize($x7);
        if (!array_key_exists($Q1, $x7)) {
            goto bk3;
        }
        $BU = $x7[$Q1];
        bk3:
        if (empty($BU)) {
            goto pEC;
        }
        $mC = $BU["\x73\154\x6f\137\165\x72\x6c"];
        $Pq = $BU["\x73\x6c\x6f\x5f\x62\x69\156\144\x69\x6e\x67\x5f\164\x79\160\x65"];
        $yb = $BU["\x72\x65\161\x75\145\163\x74\137\163\151\147\156\x65\144"];
        if (!empty($mC)) {
            goto W8l;
        }
        $Wq = wp_get_referer();
        if (!empty($Wq)) {
            goto KBo;
        }
        $Wq = !empty(get_site_option("\155\157\x5f\x73\x61\155\x6c\x5f\x73\160\137\x62\141\163\145\x5f\x75\x72\154")) ? get_site_option("\155\x6f\x5f\163\x61\x6d\154\137\163\160\137\142\x61\163\x65\x5f\x75\x72\154") : get_network_site_url();
        KBo:
        wp_redirect($Wq);
        exit;
        goto D5N;
        W8l:
        if (!(!session_id() || session_id() == '' || !isset($_SESSION))) {
            goto KkA;
        }
        session_start();
        KkA:
        if (isset($_SESSION["\x6d\157\137\163\141\x6d\154\x5f\x6c\157\147\x6f\x75\x74\x5f\162\x65\x71\x75\145\163\x74"])) {
            goto lMQ;
        }
        if (isset($_SESSION["\155\157\x5f\x73\x61\155\154"]["\x6c\x6f\x67\147\x65\x64\x5f\151\x6e\x5f\x77\151\x74\150\x5f\x69\144\x70"])) {
            goto JWK;
        }
        goto y43;
        lMQ:
        self::createLogoutResponseAndRedirect($mC, $Pq);
        exit;
        goto y43;
        JWK:
        unset($_SESSION["\155\x6f\137\163\x61\155\154"]);
        $ZK = get_user_meta($user, "\155\x6f\137\163\x61\155\154\137\x6e\141\155\x65\137\x69\144");
        $UV = get_user_meta($user, "\155\x6f\137\x73\141\155\154\137\163\x65\x73\x73\x69\157\156\x5f\x69\156\144\145\x78");
        $ED = get_site_option("\x6d\x6f\x5f\163\141\x6d\154\137\163\x70\137\x62\x61\163\145\137\x75\162\154");
        if (!empty($ED)) {
            goto l6q;
        }
        $ED = network_site_url();
        l6q:
        if (!(substr($ED, -1) == "\x2f")) {
            goto wNW;
        }
        $ED = substr($ED, 0, -1);
        wNW:
        $Wq = wp_get_referer();
        if (!empty($Wq)) {
            goto ql5;
        }
        $Wq = $ED;
        ql5:
        $FI = get_site_option("\x6d\157\x5f\x73\x61\x6d\x6c\137\163\x70\137\145\156\164\x69\x74\171\137\x69\x64");
        if (!empty($FI)) {
            goto lGG;
        }
        $FI = $ED . "\57\167\x70\55\143\157\156\x74\x65\156\164\x2f\160\x6c\165\147\x69\x6e\163\x2f\155\x69\156\151\x6f\x72\x61\156\x67\x65\55\x73\141\155\154\55\62\60\x2d\163\151\x6e\147\x6c\x65\x2d\x73\151\147\156\x2d\157\156\x2f";
        lGG:
        $d0 = $mC;
        $oq = $Wq;
        $oq = mo_saml_relaystate_url($oq);
        $TV = Utilities::createLogoutRequest($ZK, $FI, $d0, $UV, $Pq);
        if (empty($Pq) || $Pq == "\x48\164\x74\x70\122\145\144\x69\x72\x65\143\164") {
            goto raI;
        }
        if (!($yb == "\x75\x6e\x63\x68\145\143\153\x65\x64")) {
            goto b09;
        }
        $pr = base64_encode($TV);
        Utilities::postSAMLRequest($mC, $pr, $oq);
        exit;
        b09:
        $hw = '';
        $JG = '';
        $pr = Utilities::signXML($TV, "\x4e\141\x6d\x65\111\x44");
        Utilities::postSAMLRequest($mC, $pr, $oq);
        goto WIc;
        raI:
        $M4 = $mC;
        if (strpos($mC, "\77") !== false) {
            goto f_O;
        }
        $M4 .= "\x3f";
        goto UIq;
        f_O:
        $M4 .= "\46";
        UIq:
        if (!($yb == "\165\156\143\x68\145\143\153\x65\x64")) {
            goto Jnb;
        }
        $M4 .= "\x53\101\115\x4c\x52\145\x71\165\x65\163\x74\x3d" . $TV . "\46\122\x65\x6c\141\171\x53\164\x61\164\145\x3d" . urlencode($oq);
        header("\x4c\x6f\143\141\164\151\x6f\156\72\x20" . $M4);
        exit;
        Jnb:
        $TV = "\123\x41\115\x4c\x52\x65\x71\x75\x65\163\164\x3d" . $TV . "\46\122\x65\x6c\x61\171\x53\x74\141\x74\145\75" . urlencode($oq) . "\x26\x53\x69\x67\x41\154\x67\75" . urlencode(XMLSecurityKey::RSA_SHA256);
        $cj = array("\x74\171\x70\x65" => "\x70\x72\x69\166\141\x74\x65");
        $N1 = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, $cj);
        $IN = get_site_option("\x6d\157\x5f\163\x61\155\154\x5f\143\x75\162\162\145\156\x74\137\143\145\x72\164\137\160\x72\151\x76\x61\164\x65\137\x6b\x65\171");
        $N1->loadKey($IN, false);
        $rx = new XMLSecurityDSig();
        $kf = $N1->signData($TV);
        $kf = base64_encode($kf);
        $M4 .= $TV . "\46\x53\151\x67\156\x61\x74\x75\x72\x65\x3d" . urlencode($kf);
        header("\114\x6f\143\141\164\x69\157\x6e\72\40" . $M4);
        exit;
        WIc:
        y43:
        D5N:
        pEC:
    }
    public function createLogoutResponseAndRedirect($mC, $Pq)
    {
        $ED = get_site_option("\155\x6f\137\163\141\x6d\x6c\137\x73\160\137\142\x61\163\x65\x5f\x75\162\154");
        if (!empty($ED)) {
            goto B_D;
        }
        $ED = network_site_url();
        B_D:
        if (!(substr($ED, -1) == "\x2f")) {
            goto NCo;
        }
        $ED = substr($ED, 0, -1);
        NCo:
        $jf = $_SESSION["\x6d\157\137\163\x61\x6d\x6c\x5f\x6c\x6f\x67\x6f\165\x74\137\x72\x65\x71\x75\x65\163\x74"];
        $V8 = $_SESSION["\x6d\x6f\x5f\163\x61\155\x6c\137\154\x6f\x67\157\165\164\137\x72\145\x6c\141\x79\137\163\x74\141\164\145"];
        unset($_SESSION["\x6d\157\x5f\163\141\155\154\x5f\x6c\157\147\157\165\x74\137\x72\x65\161\165\145\x73\x74"]);
        unset($_SESSION["\x6d\x6f\137\163\x61\x6d\x6c\137\x6c\157\147\x6f\x75\164\x5f\x72\x65\154\x61\171\x5f\x73\x74\x61\x74\145"]);
        Utilities::mo_saml_delete_plugin_cookies();
        $li = new DOMDocument();
        $li->loadXML($jf);
        $jf = $li->firstChild;
        if (!($jf->localName == "\114\157\x67\157\165\x74\122\145\x71\x75\x65\163\164")) {
            goto jqJ;
        }
        $Du = new SAML2_LogoutRequest($jf);
        $FI = get_site_option("\x6d\x6f\137\x73\x61\x6d\x6c\137\163\160\x5f\145\156\x74\151\164\171\x5f\151\x64");
        if (!empty($FI)) {
            goto aae;
        }
        $FI = $ED . "\57\x77\x70\x2d\143\157\x6e\x74\145\x6e\164\x2f\160\x6c\165\147\151\156\163\57\x6d\151\x6e\151\x6f\x72\x61\x6e\147\145\55\x73\141\155\x6c\55\x32\x30\55\x73\x69\156\x67\x6c\x65\55\163\x69\147\156\x2d\x6f\156\57";
        aae:
        $d0 = $mC;
        $HO = Utilities::createLogoutResponse($Du->getId(), $FI, $d0, $Pq);
        if (empty($Pq) || $Pq == "\110\164\164\160\x52\145\x64\151\162\x65\143\x74") {
            goto R8P;
        }
        if (!($yb == "\165\x6e\x63\150\145\x63\153\145\x64")) {
            goto l18;
        }
        $pr = base64_encode($HO);
        Utilities::postSAMLResponse($mC, $pr, $V8);
        exit;
        l18:
        $hw = '';
        $JG = '';
        $pr = Utilities::signXML($HO, "\x53\x74\141\x74\165\x73");
        Utilities::postSAMLResponse($mC, $pr, $V8);
        goto z5p;
        R8P:
        $M4 = $mC;
        if (strpos($mC, "\77") !== false) {
            goto g8H;
        }
        $M4 .= "\77";
        goto pbe;
        g8H:
        $M4 .= "\x26";
        pbe:
        if (!($yb == "\165\156\143\x68\145\x63\x6b\145\x64")) {
            goto GYN;
        }
        $M4 .= "\x53\x41\115\x4c\x52\x65\163\x70\x6f\x6e\x73\145\x3d" . $HO . "\x26\122\x65\154\x61\171\123\164\141\164\145\x3d" . urlencode($V8);
        header("\114\157\143\141\x74\151\x6f\x6e\72\40" . $M4);
        exit;
        GYN:
        $M4 .= "\x53\101\115\x4c\x52\145\x73\160\x6f\x6e\163\x65\75" . $HO . "\46\x52\145\154\141\171\x53\164\141\164\x65\75" . urlencode($V8);
        header("\114\157\143\x61\x74\151\x6f\156\72\40" . $M4);
        exit;
        z5p:
        jqJ:
    }
}
function plugin_settings_script_widget()
{
    wp_enqueue_script("\x6a\x71\165\145\162\171");
    wp_enqueue_script("\x6d\157\137\x73\x61\155\154\x5f\x61\x64\x6d\151\x6e\x5f\x73\x65\x74\164\x69\156\x67\163\137\163\143\x72\151\x70\x74\137\x77\151\144\147\145\164", plugins_url("\x69\156\x63\x6c\x75\x64\x65\x73\x2f\x6a\163\x2f\x73\145\x74\x74\151\x6e\147\x73\x2e\x6a\x73", __FILE__));
}
function plugin_settings_style_widget()
{
    wp_enqueue_style("\155\x6f\x5f\x73\x61\155\154\x5f\141\x64\x6d\151\x6e\137\x73\145\164\x74\151\x6e\147\163\x5f\x73\164\x79\154\x65", plugins_url("\151\156\x63\x6c\x75\144\x65\x73\x2f\143\x73\x73\57\152\x71\x75\145\x72\x79\56\x75\151\56\x63\163\163", __FILE__));
}
function mo_login_validate()
{
    if (!(isset($_REQUEST["\157\x70\164\151\x6f\x6e"]) && $_REQUEST["\157\160\164\x69\157\156"] == "\155\157\163\141\x6d\x6c\x5f\x6d\145\164\141\144\x61\x74\x61")) {
        goto R1z;
    }
    miniorange_generate_metadata();
    R1z:
    $Gh = get_site_option("\x73\x61\155\154\x5f\x69\144\x65\x6e\x74\x69\164\x79\x5f\x70\x72\x6f\166\151\x64\145\162\163");
    $Gh = maybe_unserialize($Gh);
    if (!isset($_REQUEST["\151\x64\160"])) {
        goto AAO;
    }
    update_site_option("\x73\145\154\x65\143\164\x65\144\x5f\151\144\160", $_REQUEST["\x69\144\160"]);
    AAO:
    if (!(!empty($Gh) && (isset($_REQUEST["\157\160\x74\x69\157\156"]) && $_REQUEST["\x6f\x70\x74\x69\x6f\156"] == "\x73\141\155\154\x5f\x75\x73\x65\x72\x5f\154\157\147\151\x6e" || isset($_REQUEST["\157\x70\164\151\157\x6e"]) && $_REQUEST["\x6f\160\x74\151\157\156"] == "\164\x65\163\164\103\157\x6e\146\x69\147") && isset($_REQUEST["\x69\144\160"]) && array_key_exists($_REQUEST["\151\x64\x70"], $Gh))) {
        goto GGj;
    }
    if (!(Utilities::mo_saml_is_user_logged_in() && $_REQUEST["\x6f\x70\x74\x69\157\156"] != "\x74\x65\x73\164\103\x6f\x6e\x66\151\x67")) {
        goto S81;
    }
    return;
    S81:
    if (!mo_saml_is_sp_configured()) {
        goto x5O;
    }
    $ED = get_site_option("\155\157\x5f\x73\x61\x6d\154\x5f\x73\160\x5f\142\141\x73\x65\x5f\165\162\154");
    $C5 = $Gh[$_REQUEST["\x69\144\x70"]];
    if (!empty($ED)) {
        goto DUx;
    }
    $ED = network_site_url();
    DUx:
    if (!(substr($ED, -1) == "\x2f")) {
        goto ef2;
    }
    $ED = substr($ED, 0, -1);
    ef2:
    if ($_REQUEST["\x6f\160\164\151\x6f\x6e"] == "\164\x65\x73\x74\x43\x6f\156\146\x69\147") {
        goto kQE;
    }
    if (get_site_option("\x6d\157\x5f\x73\141\155\154\137\162\x65\x6c\x61\171\137\163\164\141\164\145") && get_site_option("\155\x6f\x5f\163\x61\x6d\154\x5f\x72\145\x6c\x61\171\137\x73\x74\x61\x74\145") != '') {
        goto fam;
    }
    if (isset($_REQUEST["\162\145\144\151\162\x65\x63\x74\x5f\x74\x6f"])) {
        goto HRn;
    }
    $oq = saml_get_current_page_url();
    goto X5N;
    HRn:
    $oq = $_REQUEST["\162\x65\144\x69\x72\x65\143\x74\x5f\164\x6f"];
    X5N:
    goto uPk;
    fam:
    $oq = get_site_option("\155\157\137\x73\141\x6d\154\x5f\x72\145\x6c\x61\x79\x5f\163\164\x61\x74\x65");
    uPk:
    goto W6C;
    kQE:
    $oq = "\x74\x65\x73\164\126\x61\154\151\144\141\164\145";
    W6C:
    $oq = mo_saml_relaystate_url($oq);
    $Hl = $C5["\x73\x73\157\x5f\165\x72\x6c"];
    $yb = $C5["\162\x65\161\x75\x65\163\164\137\163\151\x67\x6e\145\x64"];
    $nV = $C5["\x73\163\x6f\x5f\142\151\156\144\151\156\147\x5f\164\171\160\x65"];
    $y_ = $C5["\156\x61\155\145\151\x64\137\x66\157\162\x6d\x61\164"];
    $kS = get_site_option("\155\157\x5f\163\141\155\154\137\146\x6f\x72\x63\145\137\141\x75\x74\x68\x65\x6e\164\x69\143\141\x74\x69\157\156");
    $Cs = $ED . "\57";
    $FI = get_site_option("\x6d\x6f\x5f\163\141\x6d\154\x5f\163\x70\137\x65\156\x74\151\x74\x79\137\151\144");
    if (!empty($FI)) {
        goto XLp;
    }
    $FI = $ED . "\x2f\x77\160\55\143\157\156\x74\145\x6e\164\x2f\x70\154\165\147\x69\x6e\x73\57\155\151\x6e\x69\x6f\162\141\156\147\x65\55\x73\141\155\154\x2d\x32\x30\x2d\163\x69\156\x67\154\x65\55\163\x69\147\156\55\157\156\x2f";
    XLp:
    $TV = Utilities::createAuthnRequest($Cs, $FI, $Hl, $kS, $nV, $y_);
    if (empty($nV) || $nV == "\110\x74\x74\x70\122\x65\x64\x69\x72\x65\x63\x74") {
        goto H_d;
    }
    if (!($yb == "\165\x6e\x63\150\145\x63\153\x65\144")) {
        goto pJi;
    }
    $pr = base64_encode($TV);
    Utilities::postSAMLRequest($Hl, $pr, $oq);
    exit;
    pJi:
    $hw = '';
    $JG = '';
    $pr = Utilities::signXML($TV, "\x4e\x61\155\x65\x49\x44\120\157\154\151\143\171");
    Utilities::postSAMLRequest($Hl, $pr, $oq);
    goto YRe;
    H_d:
    $M4 = $Hl;
    if (strpos($Hl, "\x3f") !== false) {
        goto rXg;
    }
    $M4 .= "\x3f";
    goto VNL;
    rXg:
    $M4 .= "\46";
    VNL:
    if (!($yb == "\165\156\143\x68\145\x63\153\x65\x64")) {
        goto geR;
    }
    $M4 .= "\123\x41\x4d\114\x52\x65\161\x75\x65\x73\164\x3d" . $TV . "\46\x52\145\x6c\x61\171\123\164\x61\164\145\x3d" . urlencode($oq);
    header("\x4c\157\143\x61\x74\151\x6f\156\72\40" . $M4);
    exit;
    geR:
    $TV = "\123\x41\115\x4c\x52\145\x71\x75\x65\x73\164\75" . $TV . "\x26\122\145\x6c\141\x79\x53\x74\141\x74\145\75" . urlencode($oq) . "\x26\x53\151\x67\x41\154\x67\x3d" . urlencode(XMLSecurityKey::RSA_SHA256);
    $cj = array("\x74\171\160\x65" => "\x70\162\151\166\x61\164\x65");
    $N1 = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, $cj);
    $IN = get_site_option("\155\x6f\x5f\x73\141\x6d\154\x5f\x63\165\162\x72\x65\x6e\164\137\143\145\162\x74\x5f\160\162\151\x76\141\164\x65\137\153\145\171");
    $N1->loadKey($IN, false);
    $rx = new XMLSecurityDSig();
    $kf = $N1->signData($TV);
    $kf = base64_encode($kf);
    $M4 .= $TV . "\x26\123\151\147\x6e\141\x74\x75\x72\x65\75" . urlencode($kf);
    header("\114\x6f\x63\x61\x74\151\x6f\156\x3a\x20" . $M4);
    exit;
    YRe:
    x5O:
    GGj:
    if (!(array_key_exists("\123\x41\x4d\x4c\122\x65\163\x70\x6f\156\163\145", $_REQUEST) && !empty($_REQUEST["\x53\x41\115\x4c\122\145\163\160\x6f\156\163\x65"]))) {
        goto PTP;
    }
    $ED = get_site_option("\155\157\x5f\x73\x61\x6d\154\137\163\x70\x5f\x62\141\163\145\137\x75\x72\x6c");
    if (!empty($ED)) {
        goto mHf;
    }
    $ED = network_site_url();
    mHf:
    if (!(substr($ED, -1) == "\57")) {
        goto JCl;
    }
    $ED = substr($ED, 0, -1);
    JCl:
    $FD = $_REQUEST["\123\x41\x4d\114\x52\145\163\160\x6f\x6e\x73\x65"];
    $V8 = empty($_REQUEST["\x52\145\154\x61\171\123\x74\x61\164\x65"]) ? '' : $_REQUEST["\x52\x65\x6c\141\x79\x53\x74\x61\164\145"];
    $FD = base64_decode($FD);
    if (!(array_key_exists("\x53\101\x4d\114\122\145\163\160\x6f\156\x73\145", $_GET) && !empty($_GET["\x53\101\x4d\114\x52\145\x73\x70\x6f\x6e\x73\145"]))) {
        goto YN8;
    }
    $FD = gzinflate($FD);
    YN8:
    $li = new DOMDocument();
    $li->loadXML($FD);
    $sT = $li->firstChild;
    $rS = $li->documentElement;
    $w7 = new DOMXpath($li);
    $w7->registerNamespace("\x73\x61\x6d\x6c\x70", "\x75\162\x6e\72\x6f\x61\163\x69\163\72\156\x61\155\145\163\x3a\164\x63\72\123\101\x4d\114\72\62\56\x30\x3a\160\162\157\x74\157\143\x6f\154");
    $w7->registerNamespace("\x73\x61\155\154", "\165\162\156\72\x6f\141\163\151\x73\x3a\156\x61\155\145\x73\72\164\x63\72\123\x41\x4d\x4c\x3a\x32\56\60\72\141\163\x73\x65\x72\164\x69\157\x6e");
    if ($sT->localName == "\114\157\147\x6f\x75\164\122\x65\x73\160\x6f\156\163\x65") {
        goto bmO;
    }
    $GS = $w7->query("\x2f\163\x61\x6d\154\x70\x3a\122\145\163\x70\157\x6e\163\x65\57\163\141\155\154\x70\x3a\123\x74\x61\164\x75\163\x2f\x73\x61\155\x6c\x70\72\x53\x74\x61\x74\x75\163\x43\157\x64\x65", $li->documentElement);
    $kN = isset($GS) ? $GS->item(0)->getAttribute("\x56\x61\x6c\165\x65") : '';
    $EX = explode("\x3a", $kN);
    if (!array_key_exists(7, $EX)) {
        goto HHl;
    }
    $GS = $EX[7];
    HHl:
    $sL = $w7->query("\x2f\x73\x61\x6d\x6c\x70\72\122\145\x73\160\157\156\x73\x65\x2f\163\141\x6d\x6c\x70\x3a\123\x74\141\x74\x75\163\57\x73\x61\155\154\160\72\123\164\x61\x74\165\x73\115\x65\x73\163\141\x67\x65", $rS);
    $Pu = isset($sL) ? $sL->item(0) : '';
    if (empty($Pu)) {
        goto aoL;
    }
    $Pu = $Pu->nodeValue;
    aoL:
    $x7 = get_site_option("\x73\x61\155\154\x5f\151\x64\145\156\x74\151\164\x79\137\160\162\x6f\166\x69\144\145\162\163");
    $x7 = maybe_unserialize($x7);
    if (array_key_exists("\122\x65\x6c\141\171\x53\164\x61\x74\x65", $_POST) && !empty($_POST["\122\145\x6c\x61\x79\x53\x74\x61\164\x65"]) && $_POST["\x52\x65\x6c\x61\171\123\164\x61\x74\x65"] != "\57") {
        goto ial;
    }
    $aK = '';
    goto GRX;
    ial:
    $aK = $_POST["\122\145\x6c\141\171\x53\164\141\164\145"];
    GRX:
    if (!($GS != "\123\x75\143\143\145\163\x73")) {
        goto SyQ;
    }
    show_status_error($GS, $aK, $Pu);
    SyQ:
    if (!($aK !== "\164\145\x73\164\x56\141\x6c\x69\144\x61\164\145" && $aK !== "\164\145\x73\x74\116\x65\167\103\145\162\164\151\x66\x69\x63\x61\x74\x65")) {
        goto P2V;
    }
    $A6 = parse_url($aK, PHP_URL_HOST);
    $Kw = parse_url($ED, PHP_URL_HOST);
    $IF = parse_url(get_current_base_url(), PHP_URL_HOST);
    if (!empty($aK)) {
        goto KRw;
    }
    $aK = "\x2f";
    goto ygw;
    KRw:
    $aK = mo_saml_parse_url($aK);
    ygw:
    if (!(!empty($A6) && $A6 != $IF)) {
        goto zPk;
    }
    Utilities::postSAMLResponse($aK, $_REQUEST["\x53\x41\115\114\122\145\x73\160\157\x6e\163\145"], mo_saml_relaystate_url($aK));
    zPk:
    P2V:
    $jX = '';
    if (empty(get_site_option("\x73\145\x6c\x65\143\x74\x65\144\137\151\144\160"))) {
        goto i4v;
    }
    $jX = get_site_option("\163\145\x6c\145\143\164\145\x64\x5f\151\x64\160");
    i4v:
    $kA = array("\163\x61\x6d\x6c\x5f\162\145\x73\160\x6f\156\x73\x65" => base64_encode($FD));
    if (!array_key_exists($jX, $x7)) {
        goto dpN;
    }
    $x7[$jX] = array_merge($x7[$jX], $kA);
    dpN:
    $x7 = array_filter($x7, "\146\151\x6c\164\x65\x72\x5f\x65\x6d\x70\164\171\x5f\x76\141\x6c\165\145\163");
    update_site_option("\x73\x61\x6d\x6c\137\x69\144\x65\x6e\x74\x69\164\x79\137\160\162\157\166\x69\144\x65\162\163", $x7);
    $FD = new SAML2_Response($sT);
    $oY = $FD->getSignatureData();
    $eF = current($FD->getAssertions())->getSignatureData();
    if (!(empty($eF) && empty($oY))) {
        goto OJR;
    }
    if ($aK == "\x74\x65\163\x74\126\x61\154\x69\144\141\164\145") {
        goto duO;
    }
    wp_die("\x57\145\x20\143\x6f\165\x6c\144\x20\156\157\x74\40\163\151\x67\x6e\40\171\x6f\165\x20\151\x6e\x2e\40\x50\154\x65\141\163\x65\40\x63\x6f\x6e\x74\x61\143\164\x20\x61\144\x6d\x69\156\151\x73\x74\x72\x61\164\157\162", "\105\x72\162\157\x72\x3a\40\111\x6e\x76\x61\154\x69\144\40\x53\x41\115\114\x20\122\145\163\160\157\x6e\x73\x65");
    goto XFX;
    duO:
    $bx = mo_options_error_constants::Error_no_certificate;
    $K0 = mo_options_error_constants::Cause_no_certificate;
    echo "\74\x64\x69\166\40\163\164\171\x6c\145\x3d\x22\x66\x6f\156\x74\55\x66\x61\x6d\151\154\x79\72\x43\141\154\x69\x62\162\x69\x3b\160\x61\x64\x64\x69\156\147\72\60\x20\x33\45\73\x22\x3e\xd\12\40\40\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\x3c\144\151\x76\x20\163\x74\x79\154\x65\75\42\143\x6f\154\x6f\x72\x3a\40\x23\x61\71\x34\x34\64\x32\x3b\142\141\143\153\147\162\x6f\165\x6e\x64\x2d\143\x6f\154\x6f\162\x3a\40\43\146\62\x64\x65\144\145\x3b\160\141\x64\144\151\156\x67\x3a\x20\61\x35\160\x78\73\155\141\162\147\151\156\55\x62\x6f\164\164\x6f\155\72\40\62\x30\x70\x78\x3b\x74\145\170\x74\55\141\x6c\151\147\x6e\72\x63\145\x6e\x74\145\162\x3b\x62\157\162\144\145\162\72\x31\x70\170\x20\163\157\154\x69\x64\40\x23\105\66\x42\x33\x42\x32\73\x66\x6f\156\x74\x2d\163\151\x7a\x65\x3a\x31\x38\160\x74\73\42\76\40\105\122\x52\117\122\x3c\57\144\x69\x76\x3e\xd\xa\x20\x20\x20\40\x20\40\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\x20\x20\40\x3c\144\151\166\40\x73\x74\171\154\x65\x3d\x22\x63\157\154\x6f\x72\72\x20\43\141\71\x34\x34\x34\x32\x3b\x66\157\x6e\164\x2d\163\x69\172\x65\72\x31\x34\x70\164\73\x20\155\x61\162\147\151\156\55\142\157\x74\164\157\x6d\x3a\x32\60\160\x78\x3b\x22\76\x3c\160\x3e\74\x73\164\162\x6f\156\147\76\x45\x72\162\x6f\162\x20\40\72" . $bx . "\40\74\57\163\164\162\157\x6e\147\x3e\74\x2f\x70\x3e\xd\12\x20\x20\x20\x20\40\x20\40\x20\40\x20\x20\40\x20\x20\x20\40\40\40\x20\x20\15\xa\x20\x20\x20\x20\x20\40\x20\40\40\40\40\40\40\x20\x20\40\x20\40\x20\x20\x3c\x70\x3e\x3c\163\164\162\x6f\x6e\x67\76\120\x6f\163\x73\151\142\154\145\x20\103\x61\x75\163\x65\x3a\40" . $K0 . "\74\x2f\x73\164\162\157\x6e\147\x3e\x3c\x2f\x70\76\xd\xa\40\x20\x20\x20\40\40\x20\x20\40\x20\40\x20\x20\x20\40\x20\40\40\40\x20\xd\xa\40\40\40\40\x20\x20\x20\40\x20\x20\x20\40\40\40\40\x20\40\40\40\x20\x3c\57\x64\151\166\76\74\57\x64\151\166\x3e";
    mo_saml_download_logs($bx, $K0);
    exit;
    XFX:
    OJR:
    $FI = current($FD->getAssertions())->getIssuer();
    $u2 = null;
    foreach ($x7 as $N1 => $jG) {
        if (!($jG["\151\144\160\x5f\x65\x6e\164\x69\164\171\x5f\151\144"] == $FI)) {
            goto zBL;
        }
        $u2 = $x7[$N1];
        goto FEm;
        zBL:
        PWn:
    }
    FEm:
    if (!($u2 === null)) {
        goto diF;
    }
    echo "\74\144\151\x76\x20\163\x74\x79\154\x65\x3d\x22\x66\x6f\156\x74\55\146\141\x6d\x69\x6c\x79\72\103\141\x6c\151\x62\x72\151\73\x70\x61\x64\x64\151\156\x67\72\x30\x20\63\45\73\42\x3e";
    echo "\74\x64\151\166\x20\x73\164\x79\x6c\x65\75\42\x63\x6f\x6c\157\162\72\x20\43\x61\71\64\x34\64\62\x3b\142\x61\x63\x6b\147\162\157\165\156\x64\x2d\143\x6f\154\x6f\x72\x3a\40\43\x66\x32\144\x65\144\145\x3b\x70\141\x64\144\151\156\x67\72\x20\61\x35\x70\x78\73\155\x61\162\147\x69\x6e\x2d\142\x6f\164\x74\157\x6d\72\x20\x32\x30\x70\x78\x3b\x74\145\170\164\55\x61\x6c\x69\147\156\x3a\143\x65\156\x74\145\162\73\x62\157\162\x64\x65\x72\72\61\160\x78\40\163\157\x6c\x69\x64\x20\43\105\x36\x42\63\102\62\73\x66\157\156\164\x2d\163\151\x7a\x65\x3a\61\70\x70\x74\73\42\x3e\x20\105\x52\122\117\x52\x3c\x2f\144\151\x76\76\xd\12\x9\x9\x9\x3c\x64\151\x76\x20\x73\164\x79\154\145\x3d\42\143\x6f\x6c\x6f\162\x3a\40\x23\x61\71\64\64\x34\x32\73\146\x6f\x6e\x74\x2d\x73\151\x7a\145\72\61\64\160\x74\x3b\x20\155\141\x72\x67\x69\x6e\x2d\142\x6f\164\164\x6f\155\72\62\x30\x70\x78\x3b\x22\x3e\74\160\76\74\x73\x74\x72\x6f\x6e\147\76\x45\x72\162\157\162\72\x20\x3c\57\163\x74\x72\x6f\x6e\147\76\125\156\x61\142\x6c\145\40\164\157\40\x66\151\156\x64\40\141\40\x49\x44\x50\x20\105\156\164\151\164\x79\x20\111\x44\40\155\x61\164\143\150\151\156\147\40\x74\x68\145\40\x63\x6f\x6e\x66\x69\x67\x75\x72\x65\144\x20\146\x69\156\x67\145\x72\160\x72\x69\156\x74\56\x3c\57\x70\x3e\xd\xa\11\x9\11\74\160\76\120\x6c\145\141\x73\x65\40\143\157\x6e\164\x61\143\164\x20\x79\157\x75\x72\40\141\144\155\151\x6e\x69\163\x74\x72\x61\x74\x6f\162\40\x61\x6e\x64\40\x72\x65\160\157\x72\164\x20\x74\150\x65\x20\146\x6f\x6c\x6c\157\167\x69\x6e\x67\x20\x65\x72\162\157\x72\x3a\74\x2f\x70\x3e\15\12\11\x9\11\74\160\x3e\74\163\164\162\x6f\156\147\x3e\120\157\x73\163\x69\x62\x6c\145\40\x43\141\165\163\x65\x3a\x20\74\57\x73\x74\162\x6f\x6e\x67\x3e\x27\111\104\x50\x20\105\156\164\x69\164\x79\x20\111\104\47\x20\146\x69\145\x6c\x64\40\151\x6e\40\160\154\x75\147\151\156\40\x64\157\145\163\40\x6e\157\164\40\x6d\141\164\x63\150\x20\x74\150\x65\40\x6f\156\145\x20\x66\x6f\x75\x6e\x64\40\151\156\40\x53\x41\115\114\40\x52\145\163\x70\157\x6e\x73\145\56\x3c\57\160\x3e\15\xa\11\x9\11\x3c\x70\76\74\x73\x74\x72\x6f\x6e\x67\76\x49\x64\x65\x6e\x74\x69\x79\x20\111\104\x20\146\157\165\156\x64\40\x69\156\x20\123\101\x4d\x4c\x20\122\145\163\x70\157\156\163\x65\72\x20\x3c\57\163\x74\x72\x6f\x6e\x67\76\x3c\146\157\156\164\x20\146\141\x63\x65\75\x22\103\157\165\162\151\x65\162\x20\116\145\167\x22\x3b\146\x6f\x6e\164\x2d\163\151\172\145\72\61\60\160\x74\76\74\x62\162\x3e\74\x62\162\x3e" . $FI . "\x3c\x2f\160\76\x3c\57\x66\157\156\164\76\xd\xa\11\x9\11\x9\x9\74\57\144\151\x76\76\xd\xa\11\x9\11\11\11\74\144\x69\x76\40\163\164\171\154\145\75\42\x6d\141\x72\x67\151\156\72\63\45\73\x64\x69\163\x70\154\141\171\x3a\142\154\157\x63\153\73\164\145\170\164\x2d\141\154\151\x67\156\72\143\145\156\x74\x65\x72\73\42\76\xd\12\x9\x9\x9\x9\x9\x3c\146\x6f\162\x6d\40\141\x63\x74\x69\157\156\x3d\42\x69\156\144\145\x78\x2e\160\x68\x70\42\76\xd\12\x9\11\11\11\x9\x3c\144\151\x76\40\163\x74\x79\x6c\x65\x3d\42\x6d\141\x72\x67\x69\156\x3a\63\x25\73\144\151\163\x70\154\x61\171\x3a\x62\154\157\x63\153\x3b\164\x65\170\164\55\x61\x6c\151\147\x6e\x3a\x63\x65\x6e\164\x65\162\73\x22\76\x3c\151\156\160\x75\164\x20\x73\164\171\154\x65\x3d\x22\160\141\x64\144\151\x6e\x67\72\61\x25\73\167\x69\144\x74\150\72\x31\x30\60\x70\x78\x3b\142\x61\x63\x6b\x67\162\157\165\156\144\x3a\x20\43\60\x30\71\61\103\104\x20\x6e\x6f\156\x65\40\162\x65\160\x65\x61\x74\x20\163\x63\162\x6f\154\154\40\x30\45\40\60\x25\73\143\x75\x72\x73\157\162\72\x20\x70\x6f\x69\156\164\145\162\73\x66\157\156\x74\55\x73\151\172\x65\x3a\x31\65\x70\x78\73\x62\157\x72\x64\x65\x72\x2d\167\151\144\x74\x68\x3a\x20\61\x70\170\73\x62\x6f\162\x64\145\162\x2d\x73\x74\171\154\145\72\x20\163\x6f\x6c\151\144\x3b\142\157\162\144\x65\162\55\162\141\144\151\165\x73\x3a\x20\x33\160\x78\73\167\150\151\164\145\x2d\x73\160\141\143\x65\x3a\x20\156\157\x77\x72\141\160\x3b\142\157\x78\x2d\x73\x69\x7a\x69\156\x67\72\x20\142\157\162\144\x65\x72\55\x62\157\170\x3b\x62\157\x72\144\x65\162\x2d\x63\x6f\x6c\157\x72\x3a\40\43\60\x30\67\63\101\x41\x3b\x62\x6f\x78\x2d\163\150\x61\144\157\167\x3a\40\x30\160\170\40\61\160\x78\40\x30\x70\x78\x20\x72\x67\x62\141\50\61\x32\x30\x2c\40\x32\60\x30\54\x20\62\63\x30\54\x20\60\56\66\51\40\151\156\163\x65\x74\73\x63\157\154\157\162\72\40\43\106\x46\106\x3b\x22\164\x79\x70\145\75\42\142\165\x74\164\x6f\x6e\42\40\166\x61\154\x75\145\x3d\x22\x44\x6f\156\145\42\40\157\156\103\154\151\x63\x6b\x3d\42\163\x65\154\146\56\143\154\157\x73\x65\50\51\73\x22\x3e\74\57\144\151\x76\x3e";
    exit;
    diF:
    $HG = maybe_unserialize($u2["\170\x35\x30\71\137\143\x65\x72\164\x69\x66\x69\143\141\164\145"]);
    $Cs = $ED . "\57";
    if (is_array($HG)) {
        goto B5F;
    }
    $Yc = XMLSecurityKey::getRawThumbprint($HG);
    $Yc = mo_saml_convert_to_windows_iconv($Yc);
    $Yc = preg_replace("\x2f\x5c\163\53\57", '', $Yc);
    if (empty($oY)) {
        goto NJK;
    }
    $xh = Utilities::processResponse($Cs, $Yc, $oY, $FD, 0, $aK);
    NJK:
    if (empty($eF)) {
        goto YpW;
    }
    $xh = Utilities::processResponse($Cs, $Yc, $eF, $FD, 0, $aK);
    YpW:
    goto Yik;
    B5F:
    foreach ($HG as $N1 => $jG) {
        $Yc = XMLSecurityKey::getRawThumbprint(Utilities::sanitize_certificate($jG));
        $Yc = mo_saml_convert_to_windows_iconv($Yc);
        $Yc = preg_replace("\57\134\x73\53\x2f", '', $Yc);
        if (empty($oY)) {
            goto jM7;
        }
        $xh = Utilities::processResponse($Cs, $Yc, $oY, $FD, $N1, $aK);
        jM7:
        if (empty($eF)) {
            goto AWl;
        }
        $xh = Utilities::processResponse($Cs, $Yc, $eF, $FD, $N1, $aK);
        AWl:
        if (!$xh) {
            goto Ub9;
        }
        goto e_M;
        Ub9:
        DYs:
    }
    e_M:
    Yik:
    if ($oY) {
        goto Wmn;
    }
    if ($eF) {
        goto K24;
    }
    goto MnV;
    Wmn:
    $G6 = $oY["\103\x65\162\x74\151\146\151\143\141\164\x65\x73"][0];
    goto MnV;
    K24:
    $G6 = $eF["\103\145\x72\x74\151\146\151\x63\x61\x74\145\163"][0];
    MnV:
    if ($xh) {
        goto QpD;
    }
    if ($aK == "\x74\x65\163\164\x56\x61\x6c\x69\144\x61\164\145") {
        goto Mzc;
    }
    wp_die("\127\x65\x20\143\157\x75\154\x64\40\x6e\157\x74\x20\x73\151\x67\156\40\x79\x6f\165\x20\x69\156\x2e\40\x50\x6c\x65\x61\x73\x65\40\x63\157\156\x74\x61\x63\x74\x20\141\144\x6d\151\156\x69\163\x74\162\x61\x74\157\162", "\x45\162\162\x6f\x72\x3a\x20\111\x6e\x76\x61\x6c\x69\144\x20\123\x41\x4d\114\40\x52\145\x73\160\x6f\156\163\145");
    goto vmW;
    Mzc:
    $Ok = "\x2d\x2d\x2d\55\55\102\105\107\111\116\40\103\x45\122\x54\x49\x46\x49\103\x41\x54\105\x2d\x2d\x2d\55\x2d\x3c\142\162\x3e" . chunk_split($G6, 64) . "\x3c\142\x72\x3e\55\55\55\x2d\55\105\x4e\x44\x20\103\105\122\124\111\x46\x49\x43\101\x54\x45\x2d\x2d\x2d\x2d\x2d";
    echo "\74\x64\151\x76\x20\x73\x74\x79\154\x65\75\42\146\x6f\156\x74\x2d\x66\x61\155\x69\154\171\72\x43\x61\154\x69\x62\x72\151\x3b\160\x61\x64\144\x69\x6e\147\x3a\x30\40\x33\45\x3b\42\x3e";
    echo "\74\144\x69\x76\x20\x73\164\171\154\145\x3d\x22\x63\x6f\154\x6f\162\x3a\x20\x23\141\71\x34\x34\x34\62\73\x62\x61\x63\153\x67\162\157\165\x6e\x64\x2d\143\157\154\x6f\162\72\x20\43\146\62\144\x65\144\145\73\x70\141\x64\x64\x69\156\x67\x3a\40\61\x35\160\x78\x3b\155\x61\x72\147\x69\156\55\x62\157\x74\164\157\x6d\72\40\x32\60\160\170\x3b\164\145\x78\x74\55\141\154\151\x67\x6e\x3a\143\x65\156\x74\145\x72\73\x62\x6f\162\x64\x65\162\72\x31\x70\170\40\x73\x6f\154\x69\x64\x20\x23\105\66\x42\x33\102\x32\73\x66\x6f\156\x74\55\x73\x69\172\x65\72\x31\70\160\164\x3b\42\x3e\x20\x45\122\122\117\x52\x3c\57\x64\x69\166\76\15\12\11\x9\11\x3c\x64\151\166\40\163\164\x79\x6c\145\75\x22\143\x6f\x6c\157\162\x3a\x20\x23\x61\x39\64\x34\64\x32\73\146\x6f\156\164\55\163\x69\x7a\145\72\x31\x34\x70\164\73\x20\155\x61\x72\x67\x69\x6e\x2d\x62\157\x74\164\x6f\155\72\x32\60\x70\x78\x3b\x20\x6f\x6e\143\x6c\151\143\x6b\x3d\x22\x74\x68\151\x73\x2e\x73\x65\154\145\x63\164\50\51\42\76\74\160\76\x3c\163\164\x72\x6f\156\147\x3e\105\162\x72\x6f\162\72\40\74\57\163\164\162\157\156\x67\76\125\156\141\x62\154\145\x20\x74\157\x20\x66\151\x6e\x64\x20\141\x20\x63\145\162\x74\151\x66\151\143\141\164\145\40\155\141\x74\143\x68\x69\156\x67\40\164\150\x65\40\143\x6f\156\146\x69\147\165\x72\145\x64\40\x66\151\x6e\147\x65\162\160\x72\151\156\164\x2e\x3c\x2f\160\76\15\12\11\x9\x9\74\x70\76\120\154\145\141\163\145\40\143\157\x6e\164\141\x63\164\x20\171\157\165\162\x20\141\x64\155\x69\x6e\x69\x73\x74\162\x61\x74\x6f\162\40\x61\x6e\144\x20\162\145\160\x6f\x72\x74\x20\164\150\145\40\x66\157\154\154\157\x77\x69\x6e\x67\40\145\162\x72\157\162\72\74\x2f\x70\x3e\xd\xa\11\11\11\x3c\x70\76\74\x73\x74\x72\x6f\156\x67\76\x50\x6f\x73\x73\151\x62\x6c\x65\40\x43\x61\x75\x73\145\72\40\74\x2f\163\x74\162\157\156\x67\x3e\x27\130\x2e\65\x30\71\40\103\x65\162\164\151\146\151\143\x61\164\145\x27\40\146\151\145\x6c\x64\x20\x69\156\x20\160\154\x75\x67\151\x6e\x20\144\x6f\x65\x73\40\156\157\164\40\155\141\164\x63\150\x20\x74\150\145\40\x63\145\162\x74\x69\x66\x69\x63\141\x74\145\40\x66\x6f\165\x6e\144\x20\x69\x6e\x20\123\x41\115\x4c\40\122\145\x73\160\x6f\x6e\x73\145\56\74\57\160\76\15\xa\x9\11\x9\x3c\x70\76\x3c\x73\164\x72\157\156\x67\76\103\x65\162\164\x69\146\151\x63\141\164\145\40\x66\x6f\165\x6e\x64\40\x69\156\40\123\x41\115\x4c\x20\x52\145\163\160\x6f\x6e\x73\145\72\x20\x3c\x2f\163\164\162\x6f\156\147\x3e\x3c\x66\x6f\156\164\x20\146\141\143\145\x3d\x22\103\157\165\162\151\x65\162\x20\116\145\167\42\x3b\x66\157\156\164\x2d\163\x69\x7a\145\x3a\61\x30\160\164\x3e\x3c\142\162\76\74\142\162\76" . $Ok . "\74\57\160\76\x3c\57\x66\x6f\x6e\164\76\15\12\x20\40\40\40\40\x20\40\x20\x20\40\40\40\74\x70\76\74\163\164\162\x6f\x6e\147\76\x53\x6f\154\165\x74\151\x6f\x6e\x3a\40\74\x2f\163\x74\x72\157\x6e\x67\x3e\x3c\x2f\160\76\xd\12\x9\x9\11\x20\74\157\154\76\xd\12\40\40\40\x20\x20\x20\40\40\x20\40\40\x20\40\x20\x20\x20\74\x6c\x69\x3e\103\x6f\x70\x79\40\x70\x61\x73\164\145\40\x74\x68\x65\40\143\x65\x72\x74\x69\146\x69\x63\x61\164\x65\x20\160\162\x6f\166\151\x64\145\144\x20\141\142\x6f\166\x65\40\151\156\x20\130\65\x30\x39\x20\x43\145\x72\x74\151\x66\151\x63\x61\x74\145\40\165\x6e\x64\x65\162\x20\123\145\162\x76\151\143\x65\x20\x50\162\157\x76\151\144\x65\162\40\x53\x65\x74\165\x70\x20\164\x61\x62\56\74\57\x6c\151\x3e\xd\12\40\x20\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\x20\40\74\x6c\151\x3e\111\x66\40\151\x73\x73\x75\145\40\160\x65\x72\163\151\x73\x74\x73\x20\x64\151\x73\141\x62\154\x65\x20\74\x62\x3e\x43\x68\x61\162\x61\143\x74\145\162\40\x65\156\143\157\144\151\x6e\147\x3c\x2f\x62\x3e\40\x75\156\x64\145\x72\40\123\x65\162\x76\x69\x63\x65\40\x50\162\157\x76\x64\145\162\40\123\x65\x74\x75\160\40\x74\141\x62\x2e\x3c\x2f\x6c\x69\x3e\15\xa\x20\x20\40\x20\x20\40\x20\40\x20\40\x20\40\40\x3c\57\157\154\x3e\40\x20\x20\40\x20\40\40\x20\xd\12\40\x20\x20\x20\40\40\40\x20\40\40\x20\x20\x3c\x2f\144\151\166\x3e\15\12\x9\x9\11\x9\11\74\144\151\166\40\163\164\x79\x6c\x65\75\x22\x6d\x61\162\147\151\x6e\72\x33\x25\73\144\151\x73\x70\x6c\x61\x79\72\142\x6c\157\x63\x6b\x3b\x74\145\x78\164\55\x61\x6c\151\x67\156\x3a\x63\x65\156\x74\145\162\x3b\x22\76\15\12\x9\x9\x9\x9\x9\74\146\157\x72\155\40\x61\143\x74\151\x6f\156\75\42\151\156\x64\x65\170\x2e\160\150\x70\x22\x3e\xd\12\11\x9\11\11\11\x3c\x64\151\166\40\163\x74\x79\x6c\x65\x3d\x22\x6d\141\162\x67\151\x6e\72\x33\45\73\144\151\x73\x70\154\141\171\x3a\142\x6c\x6f\x63\x6b\x3b\164\x65\170\x74\x2d\x61\154\x69\147\156\72\x63\145\x6e\164\x65\162\x3b\x22\76\74\x69\x6e\x70\165\x74\40\x73\164\171\154\x65\x3d\x22\160\141\x64\144\x69\x6e\147\72\x31\x25\73\167\151\x64\164\150\72\x31\x30\x30\160\170\73\x62\x61\x63\153\x67\162\157\165\x6e\144\72\40\x23\60\60\x39\61\103\104\x20\x6e\157\x6e\x65\x20\162\x65\x70\145\x61\164\x20\163\x63\162\157\154\x6c\x20\60\x25\40\60\45\73\143\x75\x72\x73\157\162\x3a\40\x70\157\x69\156\164\145\162\x3b\146\x6f\156\164\55\x73\x69\x7a\x65\x3a\x31\65\160\170\x3b\142\x6f\x72\x64\145\162\x2d\x77\x69\x64\x74\x68\x3a\40\x31\x70\x78\73\x62\157\162\x64\x65\x72\55\x73\x74\171\154\145\x3a\x20\x73\157\154\151\x64\73\142\x6f\x72\144\145\162\x2d\x72\141\144\x69\165\x73\72\x20\63\x70\x78\73\167\x68\151\x74\x65\x2d\x73\160\141\x63\x65\72\40\x6e\157\x77\162\141\x70\x3b\142\157\170\x2d\x73\x69\172\x69\x6e\147\72\x20\142\157\x72\x64\x65\162\55\x62\157\170\x3b\x62\x6f\162\144\145\x72\55\x63\157\154\x6f\x72\x3a\x20\43\60\x30\67\x33\101\101\x3b\142\x6f\170\x2d\163\150\x61\x64\x6f\167\x3a\x20\60\x70\x78\x20\x31\160\170\40\x30\160\170\40\162\147\142\141\50\61\x32\60\x2c\40\x32\60\60\x2c\x20\x32\x33\60\x2c\40\x30\x2e\66\x29\x20\x69\156\163\145\164\73\x63\157\x6c\x6f\x72\72\x20\43\x46\106\x46\x3b\42\x74\x79\x70\x65\x3d\x22\x62\165\x74\x74\157\x6e\42\x20\x76\141\x6c\x75\x65\x3d\x22\x44\157\x6e\x65\42\x20\157\x6e\x43\x6c\151\143\x6b\x3d\x22\163\x65\x6c\146\56\143\x6c\157\x73\x65\x28\51\x3b\x22\76\74\x2f\144\x69\x76\76";
    exit;
    vmW:
    QpD:
    $AC = get_site_option("\155\x6f\137\163\141\x6d\154\x5f\x73\160\137\x65\156\x74\x69\164\x79\x5f\x69\144");
    if (!empty($AC)) {
        goto Rwj;
    }
    $AC = $ED . "\57\x77\x70\x2d\x63\157\156\164\x65\156\x74\57\160\154\x75\147\x69\x6e\x73\x2f\155\x69\x6e\x69\157\162\x61\156\x67\145\55\163\141\155\x6c\x2d\x32\x30\x2d\x73\151\156\147\154\x65\55\163\151\147\156\x2d\x6f\x6e\57";
    Rwj:
    Utilities::validateIssuerAndAudience($FD, $AC, $FI, $aK);
    $xU = current(current($FD->getAssertions())->getNameId());
    $eS = current($FD->getAssertions())->getAttributes();
    $eS["\116\141\155\x65\x49\104"] = array("\x30" => $xU);
    $UV = current($FD->getAssertions())->getSessionIndex();
    mo_saml_checkMapping($u2, $eS, $aK, $UV);
    goto F55;
    bmO:
    wp_logout();
    if (empty($V8)) {
        goto EUw;
    }
    $V8 = mo_saml_parse_url($V8);
    goto UfC;
    EUw:
    $V8 = $ED;
    UfC:
    header("\x4c\x6f\x63\141\164\x69\x6f\156\72\40" . $V8);
    exit;
    F55:
    PTP:
    if (!(array_key_exists("\x53\101\115\x4c\x52\x65\161\x75\145\x73\164", $_REQUEST) && !empty($_REQUEST["\123\x41\115\114\x52\145\161\x75\145\163\x74"]))) {
        goto X4v;
    }
    $TV = $_REQUEST["\123\101\x4d\114\x52\x65\161\165\145\163\164"];
    $aK = "\x2f";
    if (!array_key_exists("\x52\145\154\141\x79\x53\164\x61\x74\x65", $_REQUEST)) {
        goto AMC;
    }
    $aK = $_REQUEST["\x52\145\154\x61\171\x53\164\x61\x74\x65"];
    AMC:
    $TV = base64_decode($TV);
    if (!(array_key_exists("\123\x41\115\x4c\x52\x65\x71\x75\145\163\164", $_GET) && !empty($_GET["\x53\x41\x4d\x4c\x52\145\161\165\145\163\164"]))) {
        goto g5j;
    }
    $TV = gzinflate($TV);
    g5j:
    $li = new DOMDocument();
    $li->loadXML($TV);
    $kE = $li->firstChild;
    if (!($kE->localName == "\114\x6f\147\157\165\x74\x52\x65\x71\x75\x65\163\x74")) {
        goto KvQ;
    }
    $Du = new SAML2_LogoutRequest($kE);
    if (!(!session_id() || session_id() == '' || !isset($_SESSION))) {
        goto zlw;
    }
    session_start();
    zlw:
    $_SESSION["\155\x6f\137\163\x61\155\x6c\x5f\x6c\157\147\157\x75\x74\x5f\x72\145\x71\x75\145\x73\x74"] = $TV;
    $_SESSION["\x6d\157\137\163\x61\155\x6c\x5f\154\157\x67\157\165\164\x5f\x72\x65\154\x61\x79\x5f\x73\x74\141\164\x65"] = $aK;
    wp_logout();
    KvQ:
    X4v:
}
function mo_saml_checkMapping($u2, $eS, $aK, $UV)
{
    try {
        $Tz = get_site_option("\163\141\155\x6c\137\151\144\x70\137\x61\164\x74\162\151\142\165\x74\x65\137\x6d\x61\x70\x70\x69\156\x67");
        $Tz = maybe_unserialize($Tz);
        $Uy = get_site_option("\163\x61\x6d\154\x5f\151\144\x70\x5f\162\x6f\154\145\x5f\155\x61\x70\160\x69\x6e\147");
        $Uy = maybe_unserialize($Uy);
        $sc = "\116\x61\155\145\111\104";
        $gq = "\x4e\141\x6d\145\x49\104";
        $Q4 = '';
        if (!(!empty($Tz) && array_key_exists($u2["\x69\144\160\137\156\141\x6d\x65"], $Tz))) {
            goto vPH;
        }
        $sc = $Tz[$u2["\151\144\160\x5f\156\141\x6d\x65"]]["\145\x6d\141\x69\x6c"];
        $gq = $Tz[$u2["\x69\144\160\x5f\x6e\x61\x6d\145"]]["\x75\x73\x65\162\156\x61\155\x65"];
        $V0 = $Tz[$u2["\x69\x64\160\x5f\156\x61\x6d\x65"]]["\x66\x69\x72\x73\164\137\156\141\155\x65"];
        $iQ = $Tz[$u2["\151\144\x70\x5f\156\x61\x6d\145"]]["\154\x61\x73\x74\x5f\156\141\155\145"];
        $e2 = $Tz[$u2["\151\144\160\x5f\156\x61\x6d\x65"]]["\x67\x72\x6f\x75\160\137\156\x61\x6d\x65"];
        $Q4 = $Tz[$u2["\151\144\x70\x5f\156\141\x6d\x65"]]["\x64\x69\163\160\154\141\x79\x5f\x6e\141\155\x65"];
        vPH:
        $Hj = '';
        $k8 = '';
        if (empty($eS)) {
            goto Suu;
        }
        if (!empty($V0) && array_key_exists($V0, $eS)) {
            goto O0w;
        }
        $V0 = '';
        goto HoF;
        O0w:
        $V0 = $eS[$V0][0];
        HoF:
        if (!empty($iQ) && array_key_exists($iQ, $eS)) {
            goto bAH;
        }
        $iQ = '';
        goto w1y;
        bAH:
        $iQ = $eS[$iQ][0];
        w1y:
        if (!empty($gq) && array_key_exists($gq, $eS)) {
            goto kzw;
        }
        $k8 = $eS["\x4e\x61\x6d\145\x49\104"][0];
        goto klZ;
        kzw:
        $k8 = $eS[$gq][0];
        klZ:
        if (!empty($sc) && array_key_exists($sc, $eS)) {
            goto KTw;
        }
        $Hj = $eS["\116\141\x6d\145\111\x44"][0];
        goto j64;
        KTw:
        $Hj = $eS[$sc][0];
        j64:
        if (!empty($e2) && array_key_exists($e2, $eS)) {
            goto fFt;
        }
        $e2 = array();
        goto KXt;
        fFt:
        $e2 = $eS[$e2];
        KXt:
        Suu:
        if ($aK == "\164\145\x73\164\126\x61\x6c\x69\144\x61\x74\145") {
            goto XJN;
        }
        mo_saml_login_user($Hj, $V0, $iQ, $k8, $e2, $aK, $u2, $UV, $eS["\116\x61\155\x65\x49\104"][0], $Q4, $eS);
        goto krk;
        XJN:
        $x7 = get_site_option("\x73\x61\x6d\x6c\137\151\x64\x65\156\164\x69\164\x79\x5f\160\x72\157\x76\x69\x64\x65\x72\x73");
        $x7 = maybe_unserialize($x7);
        $jX = '';
        if (empty(get_site_option("\163\145\154\145\143\164\x65\x64\137\x69\144\x70"))) {
            goto qeP;
        }
        $jX = get_site_option("\163\x65\x6c\x65\143\x74\x65\x64\137\x69\x64\x70");
        qeP:
        $kA = array("\164\x65\x73\164\137\x73\x74\x61\x74\x75\x73" => "\124\x65\x73\164\x20\x73\x75\143\x63\145\x73\x73\146\x75\154");
        $x7[$jX] = array_merge($x7[$jX], $kA);
        $x7 = array_filter($x7, "\x66\151\154\x74\145\162\x5f\x65\x6d\160\x74\x79\137\x76\x61\154\x75\x65\x73");
        update_site_option("\163\141\155\x6c\x5f\151\144\145\156\x74\x69\164\171\x5f\x70\162\157\166\151\x64\145\162\x73", $x7);
        mo_saml_show_test_result($V0, $iQ, $Hj, $e2, $eS);
        krk:
    } catch (Exception $AN) {
        echo sprintf("\x41\x6e\x20\145\162\162\x6f\162\40\x6f\143\x63\x75\x72\162\145\144\40\x77\150\x69\x6c\x65\x20\x70\162\x6f\x63\145\163\x73\x69\156\147\40\x74\150\x65\40\123\101\x4d\114\40\x52\145\163\x70\x6f\156\163\145\56");
        exit;
    }
}
function show_status_error($i8, $aK)
{
    if ($aK == "\x74\x65\x73\164\126\x61\154\151\x64\141\164\145") {
        goto Zn0;
    }
    wp_die("\127\x65\x20\143\x6f\x75\154\144\x20\x6e\157\x74\x20\163\x69\x67\156\40\x79\x6f\165\x20\151\x6e\56\x20\120\x6c\x65\141\x73\x65\40\x63\x6f\156\x74\x61\x63\x74\40\171\157\165\162\x20\101\x64\x6d\x69\x6e\x69\163\x74\x72\x61\164\157\x72\x2e", "\105\x72\162\157\x72\x3a\x20\x49\156\x76\x61\x6c\x69\x64\40\x53\x41\115\114\40\122\x65\163\x70\x6f\156\x73\x65\40\123\x74\141\x74\x75\163");
    goto EEv;
    Zn0:
    echo "\x3c\x64\x69\166\x20\x73\x74\171\x6c\145\x3d\42\x66\x6f\156\x74\55\x66\141\155\x69\x6c\x79\x3a\x43\x61\154\x69\142\x72\151\x3b\160\x61\144\x64\151\x6e\x67\x3a\x30\40\63\45\x3b\42\x3e";
    echo "\x3c\144\151\x76\x20\163\164\171\154\x65\75\x22\x63\157\x6c\x6f\x72\72\40\x23\x61\71\x34\x34\64\62\73\142\x61\x63\x6b\x67\162\x6f\165\156\144\55\143\x6f\x6c\157\162\x3a\40\x23\146\62\144\x65\x64\145\x3b\160\x61\144\144\151\x6e\x67\x3a\40\x31\65\160\x78\73\x6d\x61\162\147\151\x6e\x2d\142\157\x74\164\157\x6d\x3a\40\x32\60\x70\170\x3b\164\145\170\x74\x2d\141\x6c\x69\147\156\x3a\x63\x65\x6e\164\x65\162\x3b\x62\x6f\x72\x64\x65\x72\x3a\61\160\x78\x20\x73\x6f\154\151\144\x20\43\105\x36\x42\x33\102\x32\73\x66\x6f\156\164\55\x73\x69\x7a\x65\72\x31\x38\x70\164\73\42\x3e\40\105\x52\122\x4f\122\x3c\57\144\x69\166\76\15\xa\x20\x20\x20\40\x20\40\40\40\74\144\151\x76\40\x73\x74\171\x6c\145\75\42\143\157\x6c\x6f\x72\72\x20\43\141\71\x34\x34\64\62\73\x66\157\156\x74\55\163\x69\172\x65\72\61\64\x70\164\73\40\x6d\141\x72\147\151\156\55\142\157\x74\x74\x6f\x6d\72\62\60\x70\x78\x3b\42\76\74\x70\76\x3c\x73\164\x72\157\x6e\x67\x3e\x45\x72\x72\x6f\162\x3a\x20\x3c\x2f\163\x74\162\157\156\147\x3e\x20\111\156\x76\x61\x6c\x69\x64\40\123\x41\115\x4c\40\122\x65\x73\x70\x6f\156\x73\x65\x20\x53\164\x61\x74\165\163\x2e\x3c\57\160\x3e\xd\12\x20\x20\40\40\x20\x20\40\40\40\x20\x20\x20\74\160\x3e\x3c\163\164\162\x6f\x6e\x67\x3e\x43\x61\165\163\x65\x73\x3c\x2f\x73\164\162\157\x6e\147\x3e\72\x20\111\144\145\x6e\x74\151\164\x79\40\x50\162\157\166\x69\144\x65\x72\40\150\141\x73\40\163\145\x6e\164\40\x27" . $i8 . "\x27\x20\x73\x74\141\x74\165\x73\x20\143\x6f\x64\x65\x20\x69\x6e\x20\x53\101\x4d\114\x20\122\x65\x73\160\x6f\156\163\145\56\x20\x3c\x2f\x70\76\15\12\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\x3c\160\76\74\163\x74\x72\x6f\156\x67\76\x52\x65\x61\163\x6f\x6e\x3c\x2f\x73\x74\162\x6f\156\x67\x3e\72\40" . get_status_message($i8) . "\74\x2f\x70\76\74\x62\162\76";
    if (empty($M_)) {
        goto vRj;
    }
    echo "\x3c\x70\76\74\163\164\x72\157\x6e\147\x3e\x53\164\141\164\165\x73\x20\115\x65\163\x73\141\x67\145\x20\151\156\x20\164\x68\x65\x20\x53\x41\x4d\x4c\40\x52\145\163\x70\157\156\163\x65\x3a\74\57\x73\x74\162\x6f\156\147\x3e\40\x3c\x62\162\57\76" . $M_ . "\74\57\160\76\x3c\142\162\x3e";
    vRj:
    echo "\15\xa\x20\x20\x20\x20\40\x20\x20\x20\74\57\144\151\166\x3e\15\12\15\xa\x20\40\x20\x20\40\40\x20\x20\x3c\144\151\x76\40\163\x74\x79\x6c\145\75\x22\x6d\x61\162\x67\x69\x6e\x3a\x33\x25\73\x64\151\163\160\154\x61\x79\x3a\142\x6c\x6f\x63\153\x3b\x74\x65\x78\x74\x2d\x61\x6c\151\x67\x6e\72\x63\145\x6e\x74\145\x72\73\x22\x3e\xd\12\x20\x20\x20\x20\x20\40\40\x20\40\x20\40\40\74\144\151\166\x20\163\164\x79\x6c\x65\x3d\x22\x6d\141\162\x67\151\156\72\63\45\x3b\x64\x69\163\160\x6c\x61\x79\x3a\142\154\157\143\x6b\73\164\145\x78\164\x2d\x61\154\151\147\156\x3a\143\x65\156\x74\145\162\x3b\x22\x3e\x3c\151\x6e\x70\165\164\40\163\x74\171\154\145\75\x22\x70\x61\x64\144\151\x6e\x67\x3a\x31\x25\x3b\x77\151\x64\164\150\x3a\x31\x30\x30\x70\170\x3b\142\x61\143\x6b\x67\162\x6f\x75\156\x64\72\x20\x23\x30\60\x39\61\103\104\x20\156\157\x6e\x65\40\162\145\x70\x65\141\164\x20\163\143\162\x6f\x6c\154\x20\60\45\x20\60\45\73\143\165\x72\x73\157\162\72\x20\160\x6f\151\156\x74\145\162\x3b\x66\157\x6e\164\55\163\x69\172\145\x3a\61\65\x70\170\73\x62\x6f\162\x64\145\162\x2d\x77\x69\x64\164\150\72\40\x31\x70\x78\73\x62\x6f\162\x64\x65\x72\x2d\163\164\x79\154\145\72\x20\163\157\154\x69\144\x3b\x62\157\x72\144\x65\x72\x2d\x72\x61\x64\151\165\x73\72\40\63\x70\x78\x3b\x77\x68\x69\x74\145\x2d\163\x70\141\x63\x65\x3a\40\156\157\167\x72\x61\x70\x3b\x62\x6f\170\55\x73\151\x7a\151\156\147\x3a\x20\142\157\x72\x64\x65\162\55\x62\x6f\x78\73\142\x6f\x72\x64\x65\162\x2d\143\157\154\157\162\72\x20\x23\x30\x30\x37\63\x41\101\73\x62\x6f\x78\x2d\163\150\141\x64\157\x77\x3a\40\x30\160\170\40\x31\x70\170\40\60\x70\170\x20\x72\147\x62\x61\x28\61\x32\60\54\40\62\60\60\54\x20\62\x33\x30\54\40\60\x2e\x36\51\x20\151\x6e\163\x65\x74\73\143\157\154\157\x72\72\x20\x23\106\106\106\73\x22\164\x79\160\145\x3d\x22\142\165\164\x74\x6f\x6e\x22\x20\x76\x61\x6c\x75\145\75\42\104\157\156\145\42\x20\x6f\156\x43\154\151\x63\x6b\75\42\163\x65\154\x66\x2e\x63\154\157\163\x65\50\51\x3b\42\76\x3c\57\144\151\x76\x3e";
    exit;
    EEv:
}
function get_status_message($i8)
{
    switch ($i8) {
        case "\122\x65\x71\165\x65\x73\x74\x65\x72":
            return "\x54\x68\145\x20\162\x65\161\165\145\163\164\40\143\157\x75\x6c\x64\x20\x6e\157\164\x20\142\x65\40\160\145\x72\x66\157\162\x6d\145\144\x20\144\165\x65\x20\164\157\x20\x61\156\40\145\x72\x72\157\x72\40\x6f\156\x20\164\150\145\x20\x70\x61\162\164\40\157\x66\x20\x74\150\145\40\162\145\161\x75\x65\163\x74\x65\162\x2e";
            goto pyZ;
        case "\x52\x65\163\x70\157\x6e\144\145\x72":
            return "\124\x68\145\x20\x72\145\x71\165\145\x73\164\x20\x63\157\x75\x6c\144\40\x6e\157\164\x20\142\x65\x20\x70\145\162\x66\x6f\x72\155\x65\x64\x20\x64\165\145\40\164\157\x20\141\156\40\145\x72\162\157\x72\40\157\156\40\x74\150\145\40\x70\x61\x72\164\40\x6f\146\x20\x74\150\145\x20\123\101\x4d\114\x20\162\x65\x73\x70\157\x6e\x64\145\x72\40\x6f\x72\x20\x53\x41\115\114\x20\x61\x75\x74\150\x6f\x72\x69\164\171\x2e";
            goto pyZ;
        case "\x56\x65\162\x73\x69\157\x6e\x4d\x69\163\x6d\x61\164\143\150":
            return "\124\x68\145\x20\x53\101\x4d\114\x20\162\145\163\160\x6f\x6e\144\145\162\x20\x63\x6f\165\x6c\144\x20\156\157\164\x20\x70\x72\x6f\x63\x65\x73\x73\40\x74\150\x65\x20\162\145\161\x75\145\x73\164\40\142\x65\x63\141\165\163\x65\x20\164\x68\145\x20\166\145\x72\163\x69\x6f\156\40\x6f\146\x20\x74\150\145\40\162\145\x71\165\145\163\164\x20\x6d\x65\x73\163\141\147\145\x20\167\x61\163\x20\151\156\x63\157\x72\x72\x65\143\164\56";
            goto pyZ;
        default:
            return "\125\x6e\x6b\x6e\x6f\x77\x6e";
    }
    gr_:
    pyZ:
}
function mo_saml_show_test_result($V0, $iQ, $Hj, $e2, $eS)
{
    ob_end_clean();
    echo "\x3c\144\x69\166\40\x73\164\171\154\145\x3d\x22\146\157\x6e\x74\x2d\146\141\155\151\154\x79\x3a\x43\x61\x6c\x69\x62\x72\x69\x3b\x70\141\x64\144\151\156\147\x3a\60\x20\x33\x25\x3b\42\76";
    if (!empty($Hj)) {
        goto NRu;
    }
    echo "\x3c\144\x69\x76\40\x73\x74\x79\154\x65\x3d\x22\143\157\x6c\157\x72\x3a\40\43\141\x39\64\64\64\62\x3b\142\141\x63\153\147\162\x6f\x75\156\x64\x2d\143\157\154\157\x72\x3a\x20\x23\146\x32\144\145\144\x65\73\x70\x61\144\x64\151\x6e\x67\72\x20\x31\65\160\170\x3b\x6d\x61\x72\x67\151\x6e\55\x62\x6f\164\x74\x6f\155\72\x20\62\60\160\170\x3b\164\x65\170\x74\x2d\141\154\151\147\x6e\72\x63\145\156\164\145\162\x3b\x62\157\162\x64\x65\x72\72\x31\x70\x78\x20\x73\x6f\x6c\151\x64\x20\x23\105\66\102\63\102\x32\73\146\x6f\x6e\164\55\163\x69\172\x65\72\x31\x38\x70\x74\x3b\x22\76\x54\105\123\124\x20\x46\101\111\x4c\105\x44\x3c\x2f\144\151\x76\x3e\xd\xa\11\x9\11\11\74\144\151\x76\x20\163\x74\x79\x6c\x65\75\x22\143\157\154\x6f\x72\x3a\x20\43\x61\71\64\64\x34\62\x3b\x66\x6f\x6e\x74\55\x73\151\172\145\72\61\x34\x70\164\73\x20\x6d\x61\x72\147\x69\156\x2d\142\157\x74\x74\x6f\155\72\x32\x30\160\x78\73\x22\76\x57\101\x52\x4e\111\x4e\x47\x3a\40\123\x6f\x6d\x65\x20\101\164\x74\x72\151\x62\165\x74\145\x73\40\104\151\x64\40\x4e\157\164\40\115\x61\x74\x63\x68\56\74\57\x64\x69\166\x3e\15\12\x9\x9\x9\11\x3c\x64\x69\x76\40\x73\164\171\154\x65\x3d\42\x64\x69\x73\x70\x6c\x61\171\x3a\x62\154\x6f\x63\153\73\x74\145\170\164\55\x61\154\151\147\156\72\x63\145\156\x74\145\162\73\x6d\x61\162\x67\151\156\x2d\142\x6f\x74\164\x6f\155\x3a\64\x25\x3b\42\76\74\x69\x6d\147\40\163\x74\171\x6c\x65\75\42\167\x69\144\x74\150\72\x31\65\45\73\x22\163\162\143\x3d\42" . plugin_dir_url(__FILE__) . "\151\x6d\141\147\x65\x73\57\x77\162\x6f\156\147\56\x70\x6e\x67\42\76\x3c\x2f\x64\x69\x76\x3e";
    goto WEV;
    NRu:
    echo "\x3c\x64\x69\166\x20\163\164\171\x6c\145\75\42\x63\157\x6c\x6f\162\72\40\43\63\x63\x37\66\63\x64\x3b\xd\12\11\x9\11\x9\x62\x61\x63\153\x67\x72\157\165\156\144\55\x63\157\154\x6f\x72\x3a\x20\x23\x64\x66\146\60\x64\70\73\40\160\141\144\144\x69\156\x67\x3a\x32\45\73\x6d\141\162\x67\x69\x6e\x2d\142\x6f\x74\164\x6f\155\x3a\x32\x30\x70\170\73\164\x65\x78\164\x2d\141\x6c\x69\x67\156\x3a\x63\145\x6e\x74\x65\162\x3b\x20\x62\x6f\x72\x64\145\162\x3a\x31\x70\x78\40\163\157\154\151\x64\40\x23\x41\x45\x44\x42\x39\x41\x3b\x20\146\157\156\x74\55\163\151\172\x65\72\61\x38\x70\x74\73\x22\x3e\124\105\123\x54\x20\123\x55\x43\103\x45\x53\123\106\125\x4c\x3c\x2f\144\151\x76\76\15\12\x9\11\x9\x9\x3c\x64\151\166\x20\x73\164\x79\154\x65\x3d\42\x64\x69\x73\160\154\x61\x79\x3a\x62\x6c\157\143\x6b\73\x74\x65\x78\164\55\141\x6c\151\x67\x6e\72\143\145\156\x74\145\x72\x3b\155\x61\x72\x67\x69\x6e\x2d\x62\157\x74\164\x6f\155\72\x34\45\x3b\x22\76\74\151\155\x67\40\x73\164\x79\x6c\x65\75\42\167\x69\x64\164\x68\72\61\x35\x25\73\x22\x73\x72\143\75\42" . plugin_dir_url(__FILE__) . "\151\155\141\x67\x65\163\x2f\x67\x72\145\x65\x6e\137\x63\x68\145\x63\153\x2e\160\x6e\x67\42\x3e\x3c\x2f\x64\x69\166\76";
    WEV:
    echo "\x3c\163\x70\x61\x6e\x20\163\x74\x79\x6c\145\x3d\42\146\157\156\x74\x2d\x73\x69\172\x65\72\61\64\160\x74\73\x22\76\x3c\142\x3e\x48\x65\x6c\x6c\157\74\x2f\x62\76\54\x20" . $Hj . "\x3c\x2f\163\160\x61\x6e\76\74\142\x72\57\x3e\74\160\x20\x73\x74\x79\x6c\x65\75\42\x66\x6f\156\x74\55\x77\145\151\x67\x68\x74\72\x62\157\154\144\73\x66\157\x6e\164\x2d\x73\x69\x7a\145\x3a\61\64\160\x74\73\x6d\x61\x72\147\151\x6e\55\x6c\x65\x66\164\72\x31\45\73\x22\76\x41\124\x54\x52\111\102\125\x54\x45\123\40\122\x45\103\x45\111\x56\105\104\72\74\57\x70\76\xd\xa\11\11\x9\11\74\x74\x61\142\x6c\145\40\163\164\x79\x6c\145\x3d\x22\142\157\x72\144\145\162\55\x63\x6f\154\x6c\141\160\x73\145\x3a\x63\x6f\x6c\x6c\141\x70\163\145\73\142\x6f\162\x64\x65\x72\55\163\160\141\x63\x69\x6e\147\x3a\x30\73\x20\144\x69\x73\160\x6c\x61\171\x3a\x74\141\x62\x6c\145\x3b\x77\151\x64\x74\x68\72\61\x30\x30\x25\x3b\x20\x66\157\156\164\x2d\163\151\172\145\72\61\64\x70\164\x3b\142\141\143\x6b\147\162\x6f\x75\x6e\144\x2d\143\157\x6c\x6f\x72\72\x23\x45\104\105\104\x45\x44\x3b\42\x3e\xd\12\x9\11\x9\x9\74\164\162\40\163\164\171\x6c\x65\x3d\x22\x74\x65\x78\x74\55\x61\x6c\x69\147\x6e\72\x63\145\x6e\x74\x65\162\x3b\42\x3e\x3c\164\144\x20\x73\x74\171\154\x65\75\42\x66\157\x6e\x74\55\167\x65\x69\147\x68\x74\72\142\x6f\x6c\144\73\142\157\162\x64\x65\x72\72\62\160\x78\x20\163\157\x6c\x69\x64\x20\x23\x39\x34\x39\60\x39\x30\x3b\x70\x61\x64\144\151\156\147\x3a\x32\45\73\42\x3e\x41\x54\x54\122\111\102\x55\x54\105\x20\x4e\x41\115\105\74\57\164\144\x3e\x3c\164\144\40\x73\x74\171\154\145\x3d\42\x66\157\x6e\x74\x2d\x77\x65\151\147\150\x74\72\142\157\154\144\73\x70\141\144\x64\151\x6e\147\72\62\45\73\142\x6f\162\x64\x65\162\x3a\x32\160\x78\x20\x73\157\x6c\x69\144\40\x23\x39\x34\71\60\71\x30\73\40\x77\157\x72\x64\55\x77\162\x61\x70\72\x62\162\x65\141\153\x2d\x77\157\x72\144\x3b\42\76\101\124\124\x52\x49\102\x55\124\105\40\126\101\114\x55\105\x3c\x2f\x74\x64\x3e\74\57\164\162\76";
    if (!empty($eS)) {
        goto iAc;
    }
    echo "\x4e\157\40\x41\x74\164\162\x69\142\x75\x74\145\x73\40\x52\x65\143\145\x69\x76\x65\144\x2e";
    goto nxs;
    iAc:
    foreach ($eS as $N1 => $jG) {
        echo "\x3c\164\x72\76\74\x74\144\x20\x73\164\171\x6c\x65\75\x27\x66\x6f\156\164\x2d\167\145\151\147\150\x74\72\142\157\x6c\144\73\142\x6f\x72\144\145\x72\x3a\62\x70\170\x20\163\157\x6c\151\144\x20\x23\71\64\71\60\71\x30\x3b\160\141\144\144\151\x6e\147\x3a\62\45\73\x27\x3e" . $N1 . "\x3c\x2f\x74\x64\x3e\x3c\x74\144\x20\163\x74\x79\154\x65\75\47\160\141\x64\x64\151\x6e\147\72\62\45\73\x62\157\162\x64\145\162\72\x32\160\x78\x20\x73\x6f\x6c\151\x64\40\x23\x39\64\71\x30\71\60\73\x20\167\x6f\162\x64\x2d\167\162\x61\x70\x3a\x62\x72\x65\141\153\x2d\x77\x6f\x72\x64\x3b\x27\76" . implode("\x3c\x68\x72\57\x3e", $jG) . "\74\57\x74\x64\76\x3c\57\164\162\x3e";
        Iqm:
    }
    xF2:
    nxs:
    echo "\x3c\57\164\x61\142\x6c\145\76\x3c\57\144\151\166\x3e";
    echo "\x3c\x64\151\166\x20\x73\x74\x79\154\x65\75\x22\155\141\162\x67\x69\156\x3a\x33\45\73\144\151\x73\x70\x6c\141\171\72\x62\x6c\157\143\153\x3b\x74\145\x78\x74\55\141\154\151\147\156\72\x63\145\156\164\145\x72\x3b\42\x3e\74\x69\x6e\160\x75\164\x20\163\x74\x79\154\145\75\42\160\141\x64\144\151\156\x67\x3a\x31\45\x3b\x77\x69\144\164\150\72\61\x30\x30\x70\170\73\142\x61\x63\153\147\x72\x6f\x75\x6e\x64\x3a\40\43\x30\60\71\x31\x43\104\40\x6e\x6f\156\x65\40\x72\x65\x70\x65\x61\164\x20\163\143\x72\x6f\x6c\154\40\60\45\x20\x30\45\73\143\165\x72\x73\x6f\162\x3a\x20\160\x6f\151\x6e\x74\145\162\x3b\146\x6f\156\x74\x2d\163\x69\172\x65\x3a\61\65\160\x78\x3b\142\x6f\162\144\145\x72\x2d\167\151\144\164\150\72\x20\x31\x70\x78\x3b\x62\x6f\x72\144\145\x72\x2d\x73\x74\x79\x6c\x65\x3a\40\x73\157\154\x69\144\73\142\x6f\x72\x64\x65\x72\x2d\162\x61\144\x69\165\163\x3a\x20\x33\x70\170\x3b\167\150\151\164\x65\55\x73\x70\x61\143\x65\72\x20\x6e\x6f\167\162\x61\x70\73\142\157\x78\55\163\151\172\x69\x6e\x67\72\x20\142\x6f\162\144\145\x72\55\142\x6f\170\73\142\x6f\x72\x64\x65\x72\55\x63\157\x6c\x6f\x72\x3a\x20\43\x30\60\67\63\101\101\x3b\x62\157\170\x2d\163\x68\x61\x64\157\167\x3a\x20\60\160\x78\40\61\x70\x78\x20\x30\160\170\x20\x72\x67\x62\141\x28\61\x32\x30\54\40\62\x30\x30\54\x20\x32\63\x30\x2c\x20\60\56\x36\51\x20\151\x6e\x73\145\164\x3b\143\157\154\x6f\x72\72\40\43\x46\106\x46\73\x22\164\171\160\145\75\x22\142\x75\164\x74\157\x6e\x22\40\166\x61\154\x75\x65\x3d\42\x44\x6f\x6e\x65\x22\40\157\156\x43\x6c\x69\x63\153\x3d\x22\x73\x65\x6c\x66\x2e\x63\x6c\x6f\x73\x65\x28\x29\73\x22\x3e\74\57\x64\151\166\x3e";
    exit;
}
function mo_saml_convert_to_windows_iconv($Yc)
{
    $x7 = get_site_option("\x73\x61\x6d\154\x5f\151\x64\x65\156\164\151\164\x79\x5f\160\x72\x6f\166\151\x64\145\x72\x73");
    $x7 = maybe_unserialize($x7);
    $jX = '';
    if (empty(get_site_option("\163\145\x6c\145\143\164\x65\144\x5f\151\144\x70"))) {
        goto EYM;
    }
    $jX = get_site_option("\x73\x65\154\x65\143\164\x65\144\137\x69\144\x70");
    EYM:
    $JY = $x7[$jX]["\x6d\157\137\x73\141\155\x6c\137\145\x6e\x63\x6f\x64\x69\x6e\147\137\x65\156\141\142\x6c\x65\144"];
    if (!($JY === '')) {
        goto x3I;
    }
    return $Yc;
    x3I:
    return iconv("\x55\x54\106\55\70", "\103\120\x31\x32\x35\62\x2f\57\111\107\116\117\122\105", $Yc);
}
function mo_saml_login_user($Hj, $V0, $iQ, $k8, $e2, $aK, $C5 = null, $UV = '', $ZK = '', $bJ = '', $eS = null)
{
    check_if_user_allowed_to_login_due_to_role_restriction($e2);
    $ED = get_site_option("\155\x6f\137\x73\141\155\154\137\x73\160\137\x62\141\x73\x65\137\165\162\x6c");
    global $wpdb;
    $W4 = get_current_blog_id();
    $x1 = "\x75\156\x63\150\145\143\153\x65\144";
    if (!empty($ED)) {
        goto iqF;
    }
    $ED = network_site_url();
    if (!(substr($ED, -1) == "\x2f")) {
        goto Mg6;
    }
    $ED = substr($ED, 0, -1);
    Mg6:
    iqF:
    if (username_exists($k8) || email_exists($Hj)) {
        goto bvU;
    }
    $y2 = NULL;
    $cz = $wpdb->get_col("\123\105\114\x45\x43\x54\x20\x62\x6c\157\147\137\x69\144\40\x46\122\117\115\40{$wpdb->blogs}");
    $Uy = get_site_option("\x73\x61\155\154\x5f\x69\x64\x70\x5f\x72\157\x6c\x65\137\155\x61\x70\x70\151\156\x67");
    $Uy = maybe_unserialize($Uy);
    $Q1 = $C5["\x69\144\160\137\x6e\141\x6d\x65"];
    foreach ($cz as $blog_id) {
        $Vb = TRUE;
        if (empty($Uy)) {
            goto VAH;
        }
        if (!array_key_exists($Q1, $Uy)) {
            goto D2b;
        }
        if (!empty($Uy[$Q1][$blog_id])) {
            goto h6Y;
        }
        if (!empty($Uy[$Q1]["\104\105\106\x41\125\x4c\x54"])) {
            goto rki;
        }
        goto yUz;
        h6Y:
        $e8 = $Uy[$Q1][$blog_id]["\144\x65\x66\x61\x75\154\164\x5f\162\157\x6c\x65"];
        $N7 = $Uy[$Q1][$blog_id]["\x64\x6f\156\164\x5f\x61\154\x6c\157\x77\x5f\165\x6e\x6c\x69\x73\164\x65\x64\137\x75\x73\x65\x72"];
        $yO = $Uy[$Q1][$blog_id]["\153\x65\145\160\x5f\x65\170\151\x73\x74\151\156\147\x5f\165\163\x65\x72\163\x5f\x72\x6f\x6c\145"];
        $FT = get_saml_roles_to_assign($Uy, $Q1, $blog_id, $e2);
        if (!(empty($FT) && strcmp($Uy[$Q1][$blog_id]["\144\157\156\x74\x5f\143\x72\x65\x61\164\145\x5f\x75\x73\145\x72"], "\143\150\145\x63\153\145\x64") == 0)) {
            goto fJM;
        }
        $Vb = FALSE;
        fJM:
        goto yUz;
        rki:
        $e8 = $Uy[$Q1]["\104\105\x46\x41\125\x4c\x54"]["\x64\x65\146\141\165\x6c\x74\137\162\x6f\154\x65"];
        $N7 = $Uy[$Q1]["\x44\x45\x46\101\x55\x4c\x54"]["\144\157\156\164\x5f\x61\154\x6c\157\x77\x5f\165\x6e\154\x69\x73\164\145\x64\137\165\163\145\162"];
        $yO = $Uy[$Q1]["\x44\x45\x46\101\x55\x4c\124"]["\153\145\145\x70\137\145\170\x69\x73\164\x69\156\x67\x5f\165\163\x65\x72\x73\137\x72\x6f\154\145"];
        $FT = get_saml_roles_to_assign($Uy, $Q1, $blog_id, $e2);
        if (!(empty($FT) && strcmp($Uy[$Q1]["\x44\x45\106\x41\x55\114\124"]["\144\157\x6e\x74\137\143\x72\145\141\x74\145\x5f\x75\163\x65\x72"], "\x63\x68\145\143\x6b\x65\x64") == 0)) {
            goto Jrc;
        }
        $Vb = FALSE;
        Jrc:
        yUz:
        D2b:
        VAH:
        if (!empty($FT)) {
            goto geF;
        }
        $u3 = get_site_option("\x6d\157\x5f\163\x61\155\154\x5f\x73\165\160\x65\162\x5f\x61\144\155\x69\x6e\137\162\x6f\x6c\x65\137\155\141\x70\160\151\x6e\x67");
        if (!in_array($u3, $e2)) {
            goto wGz;
        }
        $Vb = TRUE;
        wGz:
        geF:
        $Mq = get_site_option("\x65\156\x61\142\x6c\145\x5f\163\x61\x6d\154\137\x73\x73\157\x5f\x66\x6f\x72\137\x73\151\164\x65\x73");
        $Mq = maybe_unserialize($Mq);
        $RF = substr($aK, 0, strpos($aK, "\57\167\x70\55\x61\144\x6d\x69\x6e\x2f"));
        $NI = get_blog_details($blog_id);
        $NI = $NI->siteurl;
        $xZ = FALSE;
        if (!(!empty($Mq) && array_key_exists($blog_id, $Mq) && !strcmp($RF, $NI))) {
            goto qpH;
        }
        $xZ = TRUE;
        qpH:
        if (!($Vb && $xZ)) {
            goto jfM;
        }
        $jt = NULL;
        switch_to_blog($blog_id);
        if (email_exists($Hj)) {
            goto mbO;
        }
        $QP = wp_generate_password(10, false);
        if (!empty($k8)) {
            goto FD0;
        }
        if (username_exists($Hj)) {
            goto Df8;
        }
        $jt = wp_create_user($Hj, $QP, $Hj);
        goto hQs;
        Df8:
        $user = get_user_by("\x6c\x6f\147\x69\156", $Hj);
        $jt = $user->ID;
        add_user_to_blog($blog_id, $jt, false);
        hQs:
        if (!is_wp_error($jt)) {
            goto OZY;
        }
        echo "\74\163\164\x72\157\156\147\x3e\105\122\122\117\122\74\57\x73\x74\162\157\x6e\x67\x3e\x3a\x20\x45\155\x70\164\x79\40\125\163\145\x72\x20\x4e\141\155\145\40\141\x6e\x64\x20\105\155\x61\x69\x6c\56\40\120\x6c\145\x61\x73\145\40\143\x6f\x6e\x74\x61\143\x74\x20\171\x6f\165\x72\40\x61\x64\x6d\151\156\x69\163\x74\x72\141\x74\157\x72\x2e";
        exit;
        OZY:
        goto TSq;
        FD0:
        if (username_exists($k8)) {
            goto F5m;
        }
        $jt = wp_create_user($k8, $QP, $Hj);
        goto zfD;
        F5m:
        $user = get_user_by("\154\x6f\x67\x69\156", $k8);
        $jt = $user->ID;
        add_user_to_blog($blog_id, $jt, false);
        zfD:
        if (!is_wp_error($jt)) {
            goto eca;
        }
        echo "\x3c\163\x74\x72\157\156\147\x3e\105\x52\x52\117\122\74\x2f\163\x74\x72\x6f\156\x67\76\x3a\40\105\155\x70\164\171\x20\x55\x73\145\162\x20\x4e\141\155\145\x20\x61\x6e\144\x20\105\x6d\x61\151\x6c\56\40\120\x6c\x65\x61\x73\x65\40\143\157\x6e\164\141\x63\x74\x20\171\x6f\x75\162\x20\141\144\x6d\151\x6e\151\163\x74\x72\x61\x74\x6f\162\56";
        exit;
        eca:
        TSq:
        goto m53;
        mbO:
        $user = get_user_by("\x65\x6d\x61\x69\x6c", $Hj);
        $jt = $user->ID;
        add_user_to_blog($blog_id, $jt, false);
        m53:
        $user = get_user_by("\x69\x64", $jt);
        $y2 = $user;
        $Lq = !empty(get_site_option("\x6d\x6f\x5f\x73\141\x6d\154\x5f\x69\x64\x70\137\x72\145\147\151\x73\164\145\x72\145\144\137\165\x73\x65\x72\x73")) ? get_site_option("\155\x6f\137\x73\141\x6d\x6c\137\151\x64\x70\x5f\x72\x65\147\x69\x73\164\x65\162\145\x64\x5f\165\163\145\162\x73") : array();
        $Lq[$jt] = $Q1;
        update_site_option("\x6d\157\x5f\163\x61\x6d\154\x5f\x69\x64\x70\137\x72\145\x67\151\x73\x74\x65\162\x65\x64\137\x75\x73\145\162\x73", $Lq);
        $TB = assign_roles_to_user($user, $Uy, $Q1, $blog_id, $e2);
        if ($TB !== true && !empty($yO) && $yO == "\x20\143\150\x65\x63\153\x65\x64") {
            goto Qt1;
        }
        if ($TB !== true && !empty($N7) && $N7 == "\x63\150\x65\143\153\x65\144") {
            goto YjK;
        }
        if ($TB !== true && !empty($e8) && $e8 !== "\x66\141\154\163\145") {
            goto Orq;
        }
        if ($TB !== true) {
            goto PvO;
        }
        goto v34;
        Qt1:
        $jt = wp_update_user(array("\x49\104" => $jt));
        goto v34;
        YjK:
        $jt = wp_update_user(array("\x49\104" => $jt, "\162\157\x6c\145" => false));
        goto v34;
        Orq:
        $jt = wp_update_user(array("\111\x44" => $jt, "\162\x6f\x6c\x65" => $e8));
        goto v34;
        PvO:
        $L3 = $Uy[$Q1][$blog_id]["\144\x65\146\x61\x75\154\164\137\x72\157\x6c\145"];
        $jt = wp_update_user(array("\x49\x44" => $jt, "\162\157\154\145" => $L3));
        v34:
        $la = $user->{$wpdb->prefix . "\x63\141\160\x61\x62\x69\154\x69\x74\151\x65\163"};
        if (isset($wp_roles)) {
            goto sjM;
        }
        $wp_roles = new WP_Roles($blog_id);
        sjM:
        if (empty($V0)) {
            goto cql;
        }
        $jt = wp_update_user(array("\x49\104" => $jt, "\x66\x69\x72\x73\164\137\x6e\141\x6d\145" => $V0));
        cql:
        if (empty($iQ)) {
            goto b_5;
        }
        $jt = wp_update_user(array("\x49\x44" => $jt, "\154\x61\163\x74\x5f\x6e\141\155\x65" => $iQ));
        b_5:
        if (is_null($eS)) {
            goto TUz;
        }
        update_user_meta($jt, "\x6d\x6f\x5f\x73\141\155\x6c\137\165\163\x65\x72\x5f\x61\164\x74\x72\151\x62\165\x74\x65\x73", $eS);
        if (empty($bJ)) {
            goto Qvb;
        }
        if (strcmp($bJ, "\x55\x53\105\122\x4e\101\x4d\105") == 0) {
            goto G3Z;
        }
        if (strcmp($bJ, "\106\116\x41\x4d\x45") == 0 && !empty($V0)) {
            goto wYv;
        }
        if (strcmp($bJ, "\114\116\x41\115\x45") == 0 && !empty($iQ)) {
            goto Y2p;
        }
        if (strcmp($bJ, "\106\116\101\115\105\x5f\x4c\x4e\x41\115\x45") == 0 && !empty($iQ) && !empty($V0)) {
            goto XKu;
        }
        if (strcmp($bJ, "\x4c\x4e\x41\x4d\105\137\x46\116\101\115\105") == 0 && !empty($iQ) && !empty($V0)) {
            goto w0H;
        }
        goto CUg;
        G3Z:
        $jt = wp_update_user(array("\x49\x44" => $jt, "\144\x69\x73\160\154\141\x79\x5f\x6e\x61\x6d\x65" => $user->user_login));
        goto CUg;
        wYv:
        $jt = wp_update_user(array("\111\104" => $jt, "\144\151\163\160\154\x61\171\137\156\141\155\145" => $V0));
        goto CUg;
        Y2p:
        $jt = wp_update_user(array("\111\x44" => $jt, "\144\x69\x73\160\x6c\141\171\x5f\x6e\x61\x6d\x65" => $iQ));
        goto CUg;
        XKu:
        $jt = wp_update_user(array("\x49\x44" => $jt, "\144\x69\x73\x70\154\x61\x79\x5f\x6e\141\x6d\x65" => $V0 . "\40" . $iQ));
        goto CUg;
        w0H:
        $jt = wp_update_user(array("\111\x44" => $jt, "\x64\151\x73\x70\154\141\x79\x5f\x6e\x61\x6d\x65" => $iQ . "\x20" . $V0));
        CUg:
        Qvb:
        if (!get_site_option("\155\x6f\137\163\141\x6d\154\137\143\x75\x73\x74\157\155\x5f\x61\164\164\x72\163\137\x6d\141\160\160\x69\156\147")) {
            goto siA;
        }
        $Z0 = get_site_option("\x6d\x6f\137\x73\x61\x6d\x6c\x5f\143\x75\x73\164\157\x6d\x5f\141\164\164\162\x73\137\x6d\x61\x70\160\151\156\147");
        $Z0 = maybe_unserialize($Z0);
        if (empty($Z0)) {
            goto eMT;
        }
        if (!array_key_exists($Q1, $Z0)) {
            goto ApP;
        }
        foreach ($Z0[$Q1] as $N1 => $jG) {
            if (!array_key_exists($jG, $eS)) {
                goto qz5;
            }
            $p5 = false;
            if (!(count($eS[$jG]) == 1)) {
                goto M4U;
            }
            $p5 = true;
            M4U:
            if (!$p5) {
                goto h9y;
            }
            update_user_meta($jt, $N1, $eS[$jG][0]);
            goto sGX;
            h9y:
            $wU = array();
            foreach ($eS[$jG] as $mX) {
                array_push($wU, $mX);
                PD1:
            }
            AHy:
            update_user_meta($jt, $N1, $wU);
            sGX:
            qz5:
            RRF:
        }
        Q_Q:
        ApP:
        eMT:
        siA:
        TUz:
        jfM:
        jNn:
    }
    IO8:
    switch_to_blog($W4);
    if ($y2 !== null) {
        goto vAq;
    }
    $DR = get_site_option("\155\x6f\x5f\x73\x61\155\x6c\x5f\x61\143\143\157\165\x6e\x74\137\143\162\x65\x61\x74\x69\x6f\156\137\x64\x69\x73\x61\x62\x6c\x65\x64\x5f\155\163\x67");
    if (!empty($DR)) {
        goto ioF;
    }
    $DR = "\x57\145\40\x63\x6f\165\154\x64\x20\156\157\164\x20\163\x69\x67\156\x20\x79\157\165\40\x69\156\56\x20\120\154\x65\141\163\x65\x20\x63\157\x6e\x74\141\143\x74\x20\x79\x6f\x75\x72\40\101\x64\x6d\151\156\151\163\164\162\x61\164\x6f\x72\56";
    ioF:
    wp_die($DR, "\x45\x72\x72\157\162\x3a\x20\x4e\157\x74\x20\x61\x20\127\157\162\x64\x50\x72\x65\x73\x73\40\x4d\x65\155\142\x65\x72");
    exit;
    goto ddd;
    vAq:
    $jt = $y2->ID;
    wp_set_current_user($jt);
    wp_set_auth_cookie($jt, true);
    $user = get_user_by("\151\144", $jt);
    do_action("\167\x70\137\x6c\157\147\151\x6e", $user->user_login, $user);
    if (empty($UV)) {
        goto A9t;
    }
    update_user_meta($jt, "\155\157\137\x73\x61\155\154\x5f\x73\x65\x73\x73\151\x6f\156\x5f\x69\x6e\144\x65\170", $UV);
    A9t:
    if (empty($ZK)) {
        goto xXU;
    }
    update_user_meta($jt, "\x6d\157\137\163\141\155\x6c\137\156\x61\x6d\x65\x5f\x69\x64", $ZK);
    xXU:
    if (!(!session_id() || session_id() == '' || !isset($_SESSION))) {
        goto Ng1;
    }
    session_start();
    Ng1:
    $_SESSION["\x6d\x6f\x5f\163\141\x6d\x6c"]["\x6c\x6f\147\x67\x65\144\137\151\156\137\x77\x69\164\150\137\x69\x64\x70"] = $Q1;
    ddd:
    $jS = get_site_option("\x6d\157\x5f\163\141\155\154\137\162\145\154\141\x79\137\163\x74\x61\x74\145");
    if (!empty($jS)) {
        goto Mig;
    }
    if (!empty($aK)) {
        goto t6T;
    }
    wp_redirect($ED);
    goto qyc;
    Mig:
    wp_redirect($jS);
    goto qyc;
    t6T:
    wp_redirect($aK);
    qyc:
    exit;
    goto kJW;
    bvU:
    if (email_exists($Hj)) {
        goto nbL;
    }
    $user = get_user_by("\154\157\147\151\x6e", $k8);
    goto nsG;
    nbL:
    $user = get_user_by("\145\155\x61\x69\x6c", $Hj);
    nsG:
    $jt = $user->ID;
    if (empty($V0)) {
        goto J3w;
    }
    $jt = wp_update_user(array("\x49\104" => $jt, "\x66\x69\x72\163\164\137\156\x61\x6d\145" => $V0));
    J3w:
    if (empty($iQ)) {
        goto Ars;
    }
    $jt = wp_update_user(array("\x49\104" => $jt, "\x6c\141\163\164\137\156\141\155\x65" => $iQ));
    Ars:
    if (empty($Hj)) {
        goto vod;
    }
    $jt = wp_update_user(array("\x49\104" => $jt, "\x75\163\x65\162\x5f\145\155\x61\x69\x6c" => $Hj));
    vod:
    $Q1 = $C5["\151\144\x70\137\x6e\x61\x6d\x65"];
    if (!get_site_option("\155\157\x5f\163\x61\155\154\137\143\165\163\164\157\155\x5f\x61\x74\x74\x72\163\x5f\x6d\x61\x70\x70\x69\156\x67")) {
        goto g47;
    }
    $Z0 = get_site_option("\x6d\157\137\x73\x61\155\x6c\x5f\143\165\x73\164\x6f\155\x5f\141\x74\164\x72\163\137\x6d\x61\160\160\151\x6e\147");
    $Z0 = maybe_unserialize($Z0);
    if (empty($Z0)) {
        goto G1b;
    }
    if (!array_key_exists($Q1, $Z0)) {
        goto aR2;
    }
    foreach ($Z0[$Q1] as $N1 => $jG) {
        if (!array_key_exists($jG, $eS)) {
            goto F5E;
        }
        $p5 = false;
        if (!(count($eS[$jG]) == 1)) {
            goto aFj;
        }
        $p5 = true;
        aFj:
        if (!$p5) {
            goto Fz1;
        }
        update_user_meta($jt, $N1, $eS[$jG][0]);
        goto XpI;
        Fz1:
        $wU = array();
        foreach ($eS[$jG] as $mX) {
            array_push($wU, $mX);
            FVl:
        }
        zkl:
        update_user_meta($jt, $N1, $wU);
        XpI:
        F5E:
        wWx:
    }
    c56:
    aR2:
    G1b:
    g47:
    global $wpdb;
    $cz = $wpdb->get_col("\123\x45\114\x45\x43\x54\40\142\x6c\x6f\147\137\x69\144\40\x46\122\117\115\40{$wpdb->blogs}");
    $Uy = get_site_option("\x73\x61\x6d\154\x5f\x69\144\160\x5f\162\x6f\x6c\x65\x5f\x6d\141\160\x70\151\156\x67");
    $Uy = maybe_unserialize($Uy);
    foreach ($cz as $blog_id) {
        switch_to_blog($blog_id);
        $user = get_user_by("\x69\x64", $jt);
        $RF = substr($aK, 0, strpos($aK, "\57\167\x70\55\x61\144\x6d\151\x6e\x2f"));
        $NI = get_blog_details($blog_id);
        $NI = $NI->siteurl;
        if (strcmp($RF, $NI) == 0) {
            goto imW;
        }
        goto Sx_;
        goto AVI;
        imW:
        if (empty($Uy)) {
            goto iku;
        }
        if (!array_key_exists($Q1, $Uy)) {
            goto Wje;
        }
        if (!empty($Uy[$Q1][$blog_id])) {
            goto eXd;
        }
        if (!empty($Uy[$Q1]["\x44\x45\x46\x41\125\114\x54"])) {
            goto Rlf;
        }
        goto yfV;
        eXd:
        $e8 = $Uy[$Q1][$blog_id]["\144\x65\x66\x61\x75\x6c\164\137\x72\157\x6c\x65"];
        $N7 = $Uy[$Q1][$blog_id]["\144\x6f\x6e\164\137\x61\x6c\x6c\x6f\x77\x5f\165\156\x6c\151\163\164\x65\x64\137\x75\163\x65\x72"];
        $x1 = $Uy[$Q1][$blog_id]["\x64\157\x6e\x74\x5f\x63\162\145\x61\164\x65\x5f\165\163\x65\162"];
        $yO = $Uy[$Q1][$blog_id]["\153\x65\145\160\137\x65\x78\x69\163\x74\x69\x6e\147\x5f\x75\x73\145\x72\163\137\x72\x6f\154\x65"];
        goto yfV;
        Rlf:
        $e8 = $Uy[$Q1]["\x44\x45\x46\101\125\114\x54"]["\x64\145\146\141\165\154\164\x5f\162\x6f\154\x65"];
        $N7 = $Uy[$Q1]["\x44\x45\x46\x41\x55\x4c\x54"]["\144\x6f\156\x74\137\x61\154\x6c\x6f\x77\x5f\x75\156\x6c\x69\x73\164\x65\144\137\165\163\145\x72"];
        $x1 = $Uy[$Q1]["\104\105\x46\101\x55\114\x54"]["\x64\x6f\x6e\x74\137\x63\x72\145\x61\164\x65\137\x75\x73\x65\x72"];
        $yO = $Uy[$Q1]["\104\105\106\101\x55\114\124"]["\x6b\145\145\160\x5f\145\x78\151\163\x74\151\156\x67\137\x75\163\145\x72\163\137\162\x6f\x6c\x65"];
        yfV:
        Wje:
        iku:
        if (!is_user_member_of_blog($jt, $blog_id) && !strcmp($RF, $NI)) {
            goto HpJ;
        }
        if (isset($yO) && $yO == "\x63\x68\145\x63\153\145\x64") {
            goto aJi;
        }
        $TB = assign_roles_to_user($user, $Uy, $Q1, $blog_id, $e2);
        goto SiA;
        aJi:
        $TB = false;
        SiA:
        if (!(!is_administrator_user($user) && !empty($x1) && $x1 == "\165\156\x63\x68\145\143\153\x65\144")) {
            goto h4M;
        }
        if (isset($yO) && $yO == "\143\x68\x65\x63\x6b\x65\144") {
            goto kn_;
        }
        if ($TB !== true && !empty($N7) && $N7 == "\143\x68\145\143\153\145\x64") {
            goto Z_A;
        }
        if ($TB !== true && !empty($e8) && $e8 !== "\x66\x61\x6c\x73\x65") {
            goto XBc;
        }
        if ($TB !== true && is_user_member_of_blog($jt, $blog_id)) {
            goto EPZ;
        }
        goto f6q;
        kn_:
        $jt = wp_update_user(array("\x49\x44" => $jt));
        goto f6q;
        Z_A:
        $jt = wp_update_user(array("\x49\x44" => $jt, "\162\x6f\x6c\x65" => false));
        goto f6q;
        XBc:
        $jt = wp_update_user(array("\111\x44" => $jt, "\162\157\x6c\x65" => $e8));
        goto f6q;
        EPZ:
        $L3 = $Uy[$Q1][$blog_id]["\x64\x65\146\141\x75\x6c\164\x5f\162\157\x6c\x65"];
        $jt = wp_update_user(array("\x49\104" => $jt, "\162\x6f\x6c\x65" => $L3));
        f6q:
        h4M:
        goto MrB;
        HpJ:
        $xZ = true;
        if (empty($Uy)) {
            goto fNe;
        }
        if (array_key_exists($blog_id, $Uy)) {
            goto q6h;
        }
        if (array_key_exists("\x44\x45\x46\101\125\x4c\124", $Uy)) {
            goto rn8;
        }
        goto gU5;
        q6h:
        $FT = get_saml_roles_to_assign($Uy, $Q1, $blog_id, $e2);
        if (!(empty($FT) && strcmp($Uy[$Q1][$blog_id]["\144\x6f\x6e\x74\137\x63\162\145\x61\164\145\x5f\x75\163\x65\x72"], "\143\x68\x65\x63\x6b\145\144") == 0)) {
            goto FK3;
        }
        $xZ = false;
        FK3:
        goto gU5;
        rn8:
        $FT = get_saml_roles_to_assign($Uy, $Q1, $blog_id, $e2);
        if (!(empty($FT) && strcmp($Uy[$Q1]["\104\105\106\101\x55\114\124"]["\x64\x6f\156\x74\137\143\162\145\x61\164\x65\137\165\163\x65\162"], "\x63\150\x65\143\x6b\145\144") == 0)) {
            goto p4K;
        }
        $xZ = false;
        p4K:
        gU5:
        fNe:
        $Mq = get_site_option("\x65\x6e\141\x62\x6c\x65\x5f\163\x61\x6d\154\137\163\163\157\x5f\146\x6f\x72\137\163\151\x74\x65\163");
        $Mq = maybe_unserialize($Mq);
        if (empty($Mq)) {
            goto Fdl;
        }
        if (!array_key_exists($blog_id, $Mq)) {
            goto rvU;
        }
        $Vb = true;
        goto DGX;
        rvU:
        $Vb = false;
        DGX:
        Fdl:
        if (!($xZ && $Vb)) {
            goto XJz;
        }
        add_user_to_blog($blog_id, $jt, false);
        $TB = assign_roles_to_user($user, $Uy, $Q1, $blog_id, $e2);
        if ($TB !== true && !empty($N7) && $N7 == "\143\x68\x65\x63\153\x65\144") {
            goto Woo;
        }
        if ($TB !== true && !empty($e8) && $e8 !== "\146\141\154\163\x65") {
            goto lOH;
        }
        if ($TB !== true) {
            goto oeY;
        }
        goto HyK;
        Woo:
        $jt = wp_update_user(array("\111\104" => $jt, "\x72\157\x6c\x65" => false));
        goto HyK;
        lOH:
        $jt = wp_update_user(array("\111\104" => $jt, "\x72\157\x6c\145" => $e8));
        goto HyK;
        oeY:
        $L3 = $Uy[$Q1][$blog_id]["\144\145\146\141\165\154\164\137\162\x6f\x6c\x65"];
        $jt = wp_update_user(array("\x49\104" => $jt, "\162\x6f\154\x65" => $L3));
        HyK:
        XJz:
        MrB:
        AVI:
        Sx_:
    }
    MtY:
    switch_to_blog($W4);
    if (is_null($eS)) {
        goto Hlc;
    }
    update_user_meta($jt, "\x6d\x6f\137\x73\141\x6d\x6c\x5f\165\x73\145\162\x5f\141\x74\x74\x72\151\142\165\x74\x65\163", $eS);
    if (empty($bJ)) {
        goto Hlb;
    }
    if (strcmp($bJ, "\x55\x53\x45\x52\116\101\115\x45") == 0) {
        goto xh2;
    }
    if (strcmp($bJ, "\x46\116\x41\115\x45") == 0 && !empty($V0)) {
        goto uvT;
    }
    if (strcmp($bJ, "\x4c\116\101\115\x45") == 0 && !empty($iQ)) {
        goto DIU;
    }
    if (strcmp($bJ, "\x46\x4e\x41\x4d\x45\137\114\116\x41\x4d\x45") == 0 && !empty($iQ) && !empty($V0)) {
        goto PpZ;
    }
    if (strcmp($bJ, "\114\x4e\x41\115\x45\x5f\x46\x4e\x41\x4d\105") == 0 && !empty($iQ) && !empty($V0)) {
        goto Dos;
    }
    goto MTD;
    xh2:
    $jt = wp_update_user(array("\111\104" => $jt, "\x64\x69\x73\160\x6c\x61\171\137\156\141\x6d\x65" => $user->user_login));
    goto MTD;
    uvT:
    $jt = wp_update_user(array("\x49\104" => $jt, "\144\151\x73\160\154\141\x79\x5f\x6e\141\155\145" => $V0));
    goto MTD;
    DIU:
    $jt = wp_update_user(array("\111\104" => $jt, "\x64\151\163\x70\154\141\x79\137\156\141\155\145" => $iQ));
    goto MTD;
    PpZ:
    $jt = wp_update_user(array("\111\104" => $jt, "\x64\151\163\160\x6c\141\171\137\x6e\141\155\145" => $V0 . "\40" . $iQ));
    goto MTD;
    Dos:
    $jt = wp_update_user(array("\x49\x44" => $jt, "\x64\151\163\160\154\x61\x79\x5f\x6e\x61\155\145" => $iQ . "\40" . $V0));
    MTD:
    Hlb:
    Hlc:
    wp_set_current_user($jt);
    wp_set_auth_cookie($jt, true);
    $user = get_user_by("\x69\x64", $jt);
    do_action("\x77\160\x5f\154\x6f\147\151\x6e", $user->user_login, $user);
    if (empty($UV)) {
        goto GqA;
    }
    update_user_meta($jt, "\x6d\x6f\137\x73\141\155\x6c\137\x73\x65\x73\x73\151\157\x6e\x5f\x69\156\144\145\170", $UV);
    GqA:
    if (empty($ZK)) {
        goto xDe;
    }
    update_user_meta($jt, "\x6d\x6f\x5f\163\141\155\154\137\156\x61\155\x65\137\x69\144", $ZK);
    xDe:
    if (!(!session_id() || session_id() == '' || !isset($_SESSION))) {
        goto XcI;
    }
    session_start();
    XcI:
    $_SESSION["\x6d\157\137\x73\x61\155\x6c"]["\x6c\157\x67\x67\x65\x64\x5f\x69\x6e\137\167\x69\x74\150\x5f\151\144\160"] = $Q1;
    $jS = get_site_option("\155\x6f\x5f\163\x61\155\154\x5f\x72\x65\x6c\x61\171\137\x73\x74\141\x74\x65");
    if (!empty($jS)) {
        goto E1Z;
    }
    if (!empty($aK)) {
        goto jCK;
    }
    wp_redirect($ED);
    goto X3G;
    E1Z:
    wp_redirect($jS);
    goto X3G;
    jCK:
    wp_redirect($aK);
    X3G:
    exit;
    kJW:
}
function check_if_user_allowed_to_login($user, $ED)
{
    $jt = $user->ID;
    global $wpdb;
    if (get_user_meta($jt, "\x6d\157\x5f\163\x61\155\154\x5f\x75\163\145\x72\137\164\171\x70\x65", true)) {
        goto c3L;
    }
    if (get_site_option("\155\x6f\x5f\x73\x61\155\154\x5f\165\163\x72\x5f\x6c\155\x74")) {
        goto u9R;
    }
    update_user_meta($jt, "\x6d\x6f\x5f\x73\141\155\x6c\x5f\165\x73\x65\x72\137\x74\x79\x70\x65", "\163\163\x6f\137\x75\x73\x65\x72");
    goto khF;
    u9R:
    $N1 = get_site_option("\155\157\x5f\x73\141\x6d\x6c\137\x63\165\163\164\157\155\x65\162\x5f\x74\157\x6b\x65\x6e");
    $GE = AESEncryption::decrypt_data(get_site_option("\155\x6f\137\163\141\155\154\137\x75\x73\162\137\x6c\155\x74"), $N1);
    $Hy = "\123\105\x4c\x45\103\124\x20\x43\x4f\x55\116\x54\50\52\x29\40\x46\122\x4f\x4d\x20" . $wpdb->prefix . "\165\x73\145\x72\x6d\145\x74\141\40\x57\x48\105\x52\105\40\155\x65\x74\141\137\153\145\171\x3d\47\x6d\157\137\163\x61\155\154\137\165\163\145\162\137\x74\171\160\145\x27";
    $XP = $wpdb->get_var($Hy);
    if ($XP >= $GE) {
        goto rRN;
    }
    update_user_meta($jt, "\155\157\137\x73\141\155\154\x5f\165\163\145\162\x5f\164\x79\x70\x65", "\x73\163\157\137\165\163\145\162");
    goto oJD;
    rRN:
    if (get_site_option("\x75\x73\145\162\x5f\x61\154\145\162\164\137\145\155\141\x69\x6c\x5f\x73\145\156\164")) {
        goto tt0;
    }
    $ar = new Customersaml();
    $ar->mo_saml_send_user_exceeded_alert_email($GE);
    tt0:
    if (is_administrator_user($user)) {
        goto qw9;
    }
    wp_redirect($ED);
    exit;
    goto vAi;
    qw9:
    update_user_meta($jt, "\155\157\x5f\163\141\x6d\154\x5f\x75\163\145\x72\137\164\171\160\x65", "\x73\163\157\137\x75\x73\x65\162");
    vAi:
    oJD:
    khF:
    c3L:
}
function check_if_user_allowed_to_login_due_to_role_restriction($e2)
{
    $Uy = get_site_option("\x73\141\x6d\x6c\137\x69\144\160\x5f\x72\x6f\x6c\x65\137\x6d\141\160\x70\x69\156\x67");
    $Uy = maybe_unserialize($Uy);
    global $wpdb;
    $u2 = get_site_option("\163\x65\x6c\145\x63\x74\x65\x64\137\151\x64\x70");
    if (!(!empty($Uy) && array_key_exists($u2, $Uy))) {
        goto xUV;
    }
    $cz = $wpdb->get_col("\x53\x45\x4c\x45\103\124\x20\x62\x6c\157\x67\137\x69\144\40\106\x52\x4f\x4d\x20{$wpdb->blogs}");
    foreach ($cz as $blog_id) {
        if (!isset($Uy[$u2][$blog_id])) {
            goto LMg;
        }
        $Zg = $Uy[$u2][$blog_id]["\x6d\157\x5f\x73\141\x6d\x6c\137\x64\157\x6e\164\x5f\x61\x6c\x6c\157\167\x5f\x75\163\145\162\137\164\157\154\x6f\147\151\x6e\x5f\x63\x72\x65\141\x74\x65\137\x77\x69\164\150\x5f\x67\151\x76\145\156\137\x67\x72\x6f\x75\160\x73"];
        if (!($Zg == "\143\x68\x65\143\153\x65\144")) {
            goto N5Q;
        }
        if (empty($e2)) {
            goto Qrx;
        }
        $HJ = $Uy[$u2][$blog_id]["\155\x6f\x5f\163\x61\x6d\x6c\x5f\162\145\163\164\x72\151\143\164\137\165\163\145\x72\163\x5f\x77\151\x74\x68\x5f\x67\x72\157\165\x70\163"];
        $rk = explode("\73", $HJ);
        foreach ($rk as $cX) {
            foreach ($e2 as $lb) {
                $lb = trim($lb);
                if (!(!empty($lb) && $lb == $cX)) {
                    goto KqM;
                }
                wp_die("\131\x6f\165\x20\141\162\145\40\156\x6f\164\x20\141\x75\164\150\157\162\x69\x7a\145\144\x20\x74\x6f\40\154\157\x67\151\156\x2e\40\120\x6c\x65\x61\163\145\x20\143\x6f\x6e\164\x61\143\164\x20\x79\157\165\162\x20\x61\x64\155\151\156\x69\x73\164\x72\x61\164\x6f\x72\x2e", "\105\x72\162\x6f\x72");
                KqM:
                Xkc:
            }
            ben:
            Ym_:
        }
        XpK:
        Qrx:
        N5Q:
        LMg:
        OTj:
    }
    zRq:
    xUV:
}
function assign_roles_to_user($user, $Uy, $Q1, $blog_id, $e2)
{
    $TB = false;
    if (!empty($Uy) && !is_administrator_user($user) && !empty($Uy[$Q1]) && is_user_member_of_blog($user->ID, $blog_id)) {
        goto rM4;
    }
    if (empty($Uy[$Q1]["\104\105\106\101\125\114\x54"])) {
        goto x02;
    }
    $Eg = $Uy[$Q1];
    $b0 = $Eg["\x44\105\x46\x41\125\x4c\x54"]["\144\x6f\156\x74\x5f\x63\162\x65\141\164\x65\x5f\165\x73\145\x72"];
    $yO = $Eg["\104\x45\x46\x41\x55\114\124"]["\x6b\145\145\160\x5f\145\170\151\x73\x74\151\156\x67\x5f\x75\163\x65\x72\x73\137\x72\157\x6c\145"];
    $user->set_role(false);
    $Nf = '';
    $Td = false;
    unset($Eg["\x44\105\106\101\x55\x4c\124"]["\144\145\146\x61\165\154\x74\137\x72\x6f\154\x65"]);
    unset($Eg["\104\105\x46\101\125\114\124"]["\144\157\156\x74\137\x63\162\145\x61\x74\x65\137\165\163\145\162"]);
    unset($Eg["\104\x45\106\101\125\x4c\124"]["\x64\x6f\x6e\x74\x5f\141\x6c\x6c\157\167\137\165\x6e\154\x69\x73\164\x65\144\137\x75\163\145\162"]);
    foreach ($Eg["\104\x45\x46\x41\125\114\x54"] as $P0 => $A2) {
        $rk = explode("\x3b", $A2);
        foreach ($rk as $cX) {
            if (!in_array($cX, $e2)) {
                goto JW9;
            }
            $TB = true;
            $user->add_role($P0);
            JW9:
            IYz:
        }
        fBy:
        h62:
    }
    bpN:
    x02:
    goto M28;
    rM4:
    if (empty($Uy[$Q1][$blog_id])) {
        goto SD1;
    }
    $Eg = $Uy[$Q1];
    $b0 = $Eg[$blog_id]["\x64\x6f\156\164\137\x63\x72\x65\x61\x74\x65\x5f\165\x73\x65\162"];
    $yO = $Eg[$blog_id]["\x6b\x65\145\160\x5f\x65\170\x69\163\164\151\x6e\x67\x5f\165\x73\145\x72\x73\137\x72\157\154\x65"];
    $user->set_role(false);
    $Nf = '';
    $Td = false;
    unset($Eg[$blog_id]["\144\x65\146\141\x75\154\x74\x5f\162\x6f\154\x65"]);
    unset($Eg[$blog_id]["\x64\x6f\x6e\164\x5f\x63\x72\x65\x61\164\x65\x5f\x75\x73\x65\162"]);
    unset($Eg[$blog_id]["\144\x6f\x6e\164\137\x61\x6c\154\x6f\x77\x5f\165\x6e\x6c\151\163\x74\x65\144\x5f\165\x73\x65\162"]);
    foreach ($Eg[$blog_id] as $P0 => $A2) {
        $rk = explode("\73", $A2);
        foreach ($rk as $cX) {
            if (!in_array($cX, $e2)) {
                goto j0Q;
            }
            $TB = true;
            $user->add_role($P0);
            j0Q:
            yWK:
        }
        aHV:
        o_u:
    }
    PLY:
    SD1:
    M28:
    $MD = get_site_option("\x6d\157\137\163\141\x6d\154\137\163\x75\x70\x65\162\x5f\141\x64\155\151\156\x5f\162\x6f\x6c\145\137\x6d\x61\x70\160\151\x6e\147");
    $Sl = explode("\73", $MD);
    if (!(!empty(array_filter($e2)) && !empty(array_filter($Sl)))) {
        goto U_b;
    }
    foreach ($Sl as $cX) {
        if (!in_array($cX, $e2)) {
            goto wDu;
        }
        grant_super_admin($user->ID);
        wDu:
        UPW:
    }
    vf_:
    U_b:
    return $TB;
}
function get_saml_roles_to_assign($Uy, $Q1, $blog_id, $e2)
{
    $FT = array();
    $Uy = get_site_option("\163\x61\155\x6c\137\x69\144\x70\137\162\x6f\x6c\145\137\155\x61\x70\x70\x69\x6e\147");
    $Uy = maybe_unserialize($Uy);
    if (!(!empty($e2) && !empty($Uy) && !empty($Uy[$Q1]))) {
        goto u8k;
    }
    if (!empty($Uy[$Q1][$blog_id])) {
        goto ceq;
    }
    if (empty($Uy[$Q1]["\104\x45\x46\101\125\114\124"])) {
        goto CWl;
    }
    unset($Uy[$Q1]["\104\x45\x46\101\x55\x4c\x54"]["\144\145\146\141\165\x6c\164\x5f\162\157\154\145"]);
    unset($Uy[$Q1]["\x44\x45\x46\x41\x55\x4c\x54"]["\x64\x6f\x6e\x74\x5f\x63\x72\x65\x61\164\145\x5f\165\x73\x65\x72"]);
    unset($Uy[$Q1]["\104\105\x46\x41\x55\x4c\x54"]["\144\x6f\x6e\x74\x5f\x61\x6c\154\x6f\167\x5f\165\156\154\x69\163\x74\145\x64\x5f\x75\163\x65\162"]);
    foreach ($Uy[$Q1]["\104\105\x46\101\125\x4c\124"] as $P0 => $A2) {
        $rk = explode("\x3b", $A2);
        foreach ($rk as $cX) {
            if (!in_array($cX, $e2)) {
                goto lD_;
            }
            array_push($FT, $P0);
            lD_:
            R2j:
        }
        kTq:
        WEI:
    }
    tCr:
    CWl:
    goto b3Z;
    ceq:
    unset($Uy[$Q1][$blog_id]["\144\145\146\141\165\154\x74\137\162\157\x6c\x65"]);
    unset($Uy[$Q1][$blog_id]["\x64\x6f\156\164\x5f\143\x72\x65\141\164\145\x5f\165\163\145\162"]);
    unset($Uy[$Q1][$blog_id]["\x64\157\x6e\164\x5f\141\x6c\x6c\x6f\x77\x5f\165\x6e\154\x69\x73\x74\x65\144\137\165\163\x65\162"]);
    unset($Uy[$Q1][$blog_id]["\153\x65\145\x70\x5f\x65\170\151\163\x74\151\x6e\x67\137\x75\x73\145\x72\x73\137\x72\x6f\154\x65"]);
    unset($Uy[$Q1][$blog_id]["\144\x6f\156\164\x5f\141\154\x6c\x6f\x77\x5f\x75\x73\x65\x72\x5f\x74\157\154\x6f\147\x69\x6e\x5f\x63\x72\145\141\164\145\x5f\x77\x69\164\x68\137\147\151\x76\145\x6e\x5f\147\162\157\x75\160\163"]);
    unset($Uy[$Q1][$blog_id]["\155\x6f\x5f\x73\x61\x6d\154\137\144\157\x6e\x74\x5f\x61\154\x6c\157\x77\x5f\165\163\145\162\137\x74\x6f\x6c\157\147\151\156\137\143\x72\x65\x61\x74\145\137\167\151\164\x68\137\147\151\x76\145\x6e\137\147\x72\157\165\160\163"]);
    foreach ($Uy[$Q1][$blog_id] as $P0 => $A2) {
        $rk = explode("\x3b", $A2);
        foreach ($rk as $cX) {
            if (!in_array($cX, $e2)) {
                goto A1W;
            }
            array_push($FT, $P0);
            A1W:
            P3u:
        }
        EYm:
        E5J:
    }
    TqU:
    b3Z:
    u8k:
    return $FT;
}
function is_administrator_user($user)
{
    $Dz = $user->roles;
    if (!is_null($Dz) && in_array("\141\x64\155\x69\x6e\151\x73\164\162\141\x74\x6f\x72", $Dz)) {
        goto vpA;
    }
    return false;
    goto dpu;
    vpA:
    return true;
    dpu:
}
function mo_saml_is_customer_registered()
{
    $oI = get_site_option("\x6d\x6f\x5f\x73\x61\155\x6c\x5f\141\x64\155\x69\x6e\137\x65\155\x61\x69\x6c");
    $BX = get_site_option("\155\x6f\137\x73\141\155\154\137\x61\x64\155\151\156\137\x63\x75\x73\x74\x6f\x6d\x65\162\137\153\145\x79");
    if (!$oI || !$BX || !is_numeric(trim($BX))) {
        goto XBj;
    }
    return 1;
    goto d5E;
    XBj:
    return 0;
    d5E:
}
function saml_get_current_page_url()
{
    $B2 = $_SERVER["\x48\124\x54\120\x5f\110\x4f\123\x54"];
    if (!(substr($B2, -1) == "\x2f")) {
        goto kw1;
    }
    $B2 = substr($B2, 0, -1);
    kw1:
    $eQ = $_SERVER["\122\105\x51\125\105\123\x54\137\x55\122\x49"];
    if (!(substr($eQ, 0, 1) == "\x2f")) {
        goto dY3;
    }
    $eQ = substr($eQ, 1);
    dY3:
    $Jr = isset($_SERVER["\110\x54\x54\x50\x53"]) && strcasecmp($_SERVER["\110\x54\124\x50\x53"], "\x6f\x6e") == 0;
    $V8 = "\150\x74\x74\160" . ($Jr ? "\163" : '') . "\x3a\x2f\57" . $B2 . "\57" . $eQ;
    return $V8;
}
function get_network_site_url()
{
    $qV = network_site_url();
    if (!(substr($qV, -1) == "\x2f")) {
        goto njz;
    }
    $qV = substr($qV, 0, -1);
    njz:
    return $qV;
}
function mo_saml_parse_url($aK)
{
    if (!($aK != "\164\145\x73\x74\x56\141\154\x69\x64\141\164\145" && $aK != "\x74\x65\x73\164\116\145\167\x43\x65\x72\164\151\146\151\x63\x61\164\145")) {
        goto xlG;
    }
    $ED = get_site_option("\155\157\137\163\141\155\154\x5f\163\x70\x5f\142\x61\163\145\x5f\x75\162\x6c");
    if (!empty($ED)) {
        goto cFA;
    }
    $ED = get_network_site_url();
    cFA:
    $i4 = parse_url($ED, PHP_URL_SCHEME);
    if (filter_var($aK, FILTER_VALIDATE_URL)) {
        goto nzQ;
    }
    $aK = $i4 . "\72\57\57" . $aK;
    nzQ:
    xlG:
    return $aK;
}
function get_current_base_url()
{
    return sprintf("\x25\x73\x3a\x2f\x2f\x25\163\57", isset($_SERVER["\110\x54\124\x50\123"]) && $_SERVER["\x48\124\124\120\x53"] != "\157\146\x66" ? "\150\x74\164\x70\x73" : "\x68\x74\164\160", $_SERVER["\x48\124\124\x50\x5f\x48\117\123\x54"]);
}
function mo_saml_relaystate_url($aK)
{
    $i4 = parse_url($aK, PHP_URL_SCHEME);
    $aK = str_replace($i4 . "\72\57\x2f", '', $aK);
    return $aK;
}
add_action("\167\151\144\x67\145\164\163\x5f\151\x6e\x69\164", function () {
    register_widget("\115\x6f\x5f\x53\x41\x4d\x4c\137\114\157\147\151\156\137\x57\x69\144\147\145\164");
});
add_action("\167\x70\x5f\x65\x6e\x71\x75\145\165\x65\x5f\163\143\162\151\x70\x74\x73", "\160\154\x75\147\x69\x6e\137\x73\145\164\x74\151\156\147\163\137\x73\164\x79\154\x65\x5f\x77\x69\144\147\x65\x74");
add_action("\x77\160\x5f\145\156\161\165\x65\165\x65\x5f\x73\x63\162\151\160\x74\163", "\160\x6c\165\147\x69\156\137\x73\x65\x74\164\151\156\147\163\137\x73\x63\x72\x69\x70\164\137\x77\x69\144\x67\145\164");
add_action("\151\x6e\x69\164", "\155\157\137\154\157\147\x69\x6e\137\166\x61\154\x69\x64\x61\164\145");

Function Calls

None

Variables

None

Stats

MD5 6f84cf2af6c132ab6481b6c4296a0720
Eval Count 0
Decode Time 98 ms