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 /* Plugin Name: miniOrange SSO Login Restriction Plugin URI: https://miniorange.c..

Decoded Output download

<?php 
/* 
Plugin Name: miniOrange SSO Login Restriction 
Plugin URI: https://miniorange.com 
Description: Allow / Restrict users to log in via SAML Single Sign On based on the user's tenant. 
Author: miniOrange 
Version: 1.0.0 
Author URI: https://miniorange.com 
 */ 
 
 
require_once "AttributeRedirectClass.php"; 
require_once "mo_sso_login_restrict_pages.php"; 
require_once "mo_sso_login_restrict_util.php"; 
class Mo_SSO_Login_Restrict 
{ 
    public function __construct() 
    { 
        register_activation_hook(__FILE__, array($this, "mo_sso_login_restrict_activate")); 
        register_deactivation_hook(__FILE__, array($this, "mo_sso_login_restrict_deactivate")); 
        add_action("admin_menu", array($this, "mo_ssologinrestrict_widget_menu")); 
        add_action("admin_enqueue_scripts", array($this, "mo_ssologinrestrict_settings_style")); 
        add_action("admin_init", array($this, "mo_ssologinrestrict_save_option")); 
        add_action("mo_saml_process_response", array($this, "mo_saml_azure_multitenant"), 10, 2); 
        add_filter("mo_saml_filter_identity_providers", array($this, "mo_saml_multitenant_configuration_update"), 10, 2); 
    } 
    public function mo_sso_login_restrict_activate() 
    { 
        add_role("mo_saml_allow_login", "Allowed Login"); 
    } 
    public function mo_sso_login_restrict_deactivate() 
    { 
        delete_option("mo_propic_enable_attr_mapping"); 
        delete_option("mo_local_profile_photo_attribute"); 
        delete_option("mo_user_profile_photo"); 
    } 
    public function mo_ssologinrestrict_widget_menu() 
    { 
        if (!(function_exists("mo_saml_is_customer_license_key_verified") && mo_saml_is_customer_license_key_verified())) { 
            goto YI; 
        } 
        add_menu_page("Azure Multitenant SSO", "Azure Multitenant SSO", "activate_plugins", "mo_ssologinrestrict", array($this, "mo_ssologinrestrict_widget_options"), plugin_dir_url(__FILE__) . "includes/images/miniorange_icon.png"); 
        YI: 
    } 
    public function mo_ssologinrestrict_settings_style() 
    { 
        wp_enqueue_style("mo_ssologinrestrict_settings_style", plugins_url("includes/css/style_settings.css", __FILE__)); 
    } 
    public function mo_ssologinrestrict_widget_options() 
    { 
        mo_ssologinrestrict_settings(); 
    } 
    public function mo_ssologinrestrict_save_option() 
    { 
        $Of = array(); 
        if (!isset($_POST["mo_abr_regex_value"])) { 
            goto Ev; 
        } 
        $UE = $_POST["mo_abr_regex_value"]; 
        $NP = $_POST["multitenant_idp_name"]; 
        if (empty($UE)) { 
            goto fm; 
        } 
        $c4 = 0; 
        Pg: 
        if (!($c4 < sizeof($UE))) { 
            goto yN; 
        } 
        $QI = "https://login.microsoftonline.com/" . $UE[$c4] . "/federationmetadata/2007-06/federationmetadata.xml"; 
        $ez = $UE[$c4]; 
        $qH = wp_remote_get($QI); 
        $Yb = new DOMDocument(); 
        $Yb->loadXML($qH["body"]); 
        $Gz = $Yb->firstChild; 
        if (empty($Gz)) { 
            goto lg; 
        } 
        $Km = new IDPMetadataReader($Yb); 
        $cW = $Km->getIdentityProviders(); 
        lg: 
        $Oo = $cW[0]->getEntityID(); 
        $Ia = $cW[0]->getSigningCertificate(); 
        $Of[$ez] = array("tenant_id" => $UE[$c4], "entity_id" => $Oo, "signing_certificate" => $Ia); 
        EN: 
        $c4++; 
        goto Pg; 
        yN: 
        update_option("azure_multitenant_configurations", $Of); 
        update_option("mo_saml_multitenant_idp", $NP); 
        fm: 
        Ev: 
    } 
    public function error_message() 
    { 
        $YB = "error"; 
        $FQ = get_option("mo_local_message"); 
        echo "<div class='" . $YB . "'> <p>" . $FQ . "</p></div>"; 
    } 
    public function success_message() 
    { 
        $YB = "updated"; 
        $FQ = get_option("mo_local_message"); 
        echo "<div class='" . $YB . "'> <p>" . $FQ . "</p></div>"; 
    } 
    public function show_success_message() 
    { 
        remove_action("admin_notices", array($this, "error_message")); 
        add_action("admin_notices", array($this, "success_message")); 
    } 
    public function show_error_message() 
    { 
        remove_action("admin_notices", array($this, "success_message")); 
        add_action("admin_notices", array($this, "error_message")); 
    } 
    public function mo_saml_azure_multitenant($Ye) 
    { 
    } 
    function mo_saml_multitenant_configuration_update($cW, $Yf) 
    { 
        $NP = get_option("mo_saml_multitenant_idp"); 
        $DG = get_option("azure_multitenant_configurations"); 
        $cQ = explode("/", $Yf); 
        $uK = $cQ[3]; 
        if ($DG[$uK]) { 
            goto nZ; 
        } 
        wp_die("We could not sign you in. You are not from the allowed tenant, please contact your administrator"); 
        goto G1; 
        nZ: 
        $cW[$NP]["idp_entity_id"] = $DG[$uK]["entity_id"]; 
        $cW[$NP]["x509_certificate"] = $DG[$uK]["signing_certificate"]; 
        G1: 
        return $cW[$NP]; 
    } 
} 
new Mo_SSO_Login_Restrict(); 
 ?>

Did this file decode correctly?

Original Code

<?php
/*
Plugin Name: miniOrange SSO Login Restriction
Plugin URI: https://miniorange.com
Description: Allow / Restrict users to log in via SAML Single Sign On based on the user's tenant.
Author: miniOrange
Version: 1.0.0
Author URI: https://miniorange.com
 */


require_once "\x41\x74\164\162\x69\142\x75\x74\x65\x52\x65\x64\151\162\145\143\x74\103\x6c\141\163\163\x2e\x70\x68\x70";
require_once "\x6d\157\x5f\x73\163\157\137\x6c\x6f\x67\x69\156\x5f\162\x65\163\x74\x72\x69\x63\x74\137\x70\141\147\x65\x73\x2e\x70\150\x70";
require_once "\155\157\x5f\163\163\x6f\137\154\x6f\x67\151\x6e\137\162\x65\163\164\162\x69\x63\164\x5f\165\x74\151\154\56\160\150\160";
class Mo_SSO_Login_Restrict
{
    public function __construct()
    {
        register_activation_hook(__FILE__, array($this, "\155\157\x5f\163\x73\x6f\x5f\154\157\147\x69\156\137\x72\x65\163\164\162\151\x63\164\137\x61\143\164\x69\166\x61\164\145"));
        register_deactivation_hook(__FILE__, array($this, "\x6d\157\x5f\x73\x73\157\137\154\157\147\151\156\137\162\145\163\164\162\151\x63\164\x5f\144\145\141\143\x74\x69\166\x61\x74\145"));
        add_action("\141\144\x6d\151\156\x5f\155\x65\156\165", array($this, "\155\x6f\137\163\163\157\x6c\157\x67\x69\156\x72\x65\x73\x74\162\151\x63\x74\137\167\x69\x64\147\x65\164\137\155\145\156\x75"));
        add_action("\141\x64\155\x69\x6e\x5f\145\x6e\x71\165\x65\165\x65\x5f\x73\143\x72\151\x70\x74\163", array($this, "\x6d\157\x5f\163\x73\x6f\154\x6f\x67\x69\x6e\x72\x65\163\164\x72\x69\x63\164\137\163\145\164\x74\x69\x6e\147\163\x5f\163\164\171\154\x65"));
        add_action("\141\144\x6d\151\x6e\x5f\151\156\151\164", array($this, "\x6d\x6f\137\x73\x73\x6f\x6c\157\147\151\156\x72\x65\163\x74\x72\x69\143\164\x5f\163\141\x76\145\x5f\157\160\164\151\x6f\x6e"));
        add_action("\x6d\157\x5f\163\x61\155\154\x5f\160\162\157\143\145\163\163\x5f\x72\x65\163\x70\157\x6e\x73\145", array($this, "\x6d\x6f\137\163\141\155\x6c\x5f\141\x7a\x75\x72\145\x5f\155\x75\154\x74\151\x74\x65\x6e\141\156\164"), 10, 2);
        add_filter("\x6d\x6f\x5f\163\x61\x6d\154\137\x66\x69\154\164\145\162\x5f\x69\144\x65\156\x74\x69\x74\x79\137\160\162\157\166\151\x64\145\162\x73", array($this, "\155\157\x5f\163\141\155\154\x5f\x6d\165\x6c\x74\151\x74\x65\x6e\141\156\x74\x5f\143\157\156\146\x69\x67\x75\x72\141\x74\151\157\x6e\x5f\165\x70\x64\x61\164\x65"), 10, 2);
    }
    public function mo_sso_login_restrict_activate()
    {
        add_role("\x6d\157\x5f\163\x61\x6d\x6c\137\x61\154\x6c\x6f\167\137\x6c\x6f\x67\x69\x6e", "\x41\154\154\157\x77\x65\x64\x20\114\x6f\147\x69\156");
    }
    public function mo_sso_login_restrict_deactivate()
    {
        delete_option("\x6d\157\137\x70\162\x6f\160\151\143\x5f\x65\x6e\141\x62\154\145\x5f\x61\164\x74\x72\x5f\x6d\x61\160\x70\151\156\147");
        delete_option("\155\157\137\x6c\157\x63\141\154\137\160\162\157\x66\x69\154\145\x5f\x70\x68\x6f\x74\157\137\x61\x74\x74\x72\x69\142\x75\x74\x65");
        delete_option("\x6d\157\x5f\x75\163\145\x72\137\x70\162\157\146\x69\154\145\137\x70\x68\157\x74\157");
    }
    public function mo_ssologinrestrict_widget_menu()
    {
        if (!(function_exists("\x6d\157\x5f\163\x61\155\154\x5f\151\163\x5f\143\165\163\x74\157\155\x65\x72\137\x6c\151\143\x65\156\x73\145\x5f\153\x65\x79\x5f\166\x65\x72\x69\146\151\145\x64") && mo_saml_is_customer_license_key_verified())) {
            goto YI;
        }
        add_menu_page("\101\172\165\x72\x65\40\x4d\165\154\164\151\x74\x65\156\141\156\x74\40\123\123\x4f", "\101\x7a\x75\162\145\x20\115\165\154\x74\x69\x74\145\x6e\x61\156\x74\x20\x53\x53\x4f", "\x61\x63\164\x69\166\x61\164\145\x5f\x70\x6c\x75\147\x69\x6e\163", "\x6d\157\137\x73\163\157\x6c\157\x67\x69\x6e\x72\x65\x73\164\162\x69\x63\164", array($this, "\x6d\x6f\x5f\x73\x73\x6f\154\157\147\x69\x6e\162\145\x73\x74\162\151\143\164\137\167\x69\144\x67\x65\x74\x5f\x6f\160\164\x69\157\x6e\x73"), plugin_dir_url(__FILE__) . "\151\x6e\x63\154\165\x64\145\163\57\x69\x6d\x61\147\x65\x73\x2f\155\x69\156\151\x6f\162\141\x6e\x67\x65\137\x69\143\157\x6e\56\160\x6e\x67");
        YI:
    }
    public function mo_ssologinrestrict_settings_style()
    {
        wp_enqueue_style("\x6d\x6f\x5f\163\x73\157\154\x6f\x67\x69\x6e\x72\x65\163\164\x72\x69\143\x74\x5f\x73\x65\x74\164\x69\156\147\x73\137\163\x74\x79\154\145", plugins_url("\151\x6e\143\x6c\x75\x64\145\x73\57\143\163\x73\57\x73\164\x79\x6c\x65\x5f\x73\x65\164\x74\151\156\x67\163\56\x63\163\163", __FILE__));
    }
    public function mo_ssologinrestrict_widget_options()
    {
        mo_ssologinrestrict_settings();
    }
    public function mo_ssologinrestrict_save_option()
    {
        $Of = array();
        if (!isset($_POST["\155\x6f\137\x61\142\162\137\x72\x65\x67\x65\170\137\x76\x61\x6c\165\145"])) {
            goto Ev;
        }
        $UE = $_POST["\155\x6f\137\141\x62\162\x5f\162\x65\147\145\x78\x5f\166\x61\x6c\165\145"];
        $NP = $_POST["\155\x75\x6c\164\x69\x74\145\156\141\156\x74\137\151\144\x70\x5f\x6e\141\155\145"];
        if (empty($UE)) {
            goto fm;
        }
        $c4 = 0;
        Pg:
        if (!($c4 < sizeof($UE))) {
            goto yN;
        }
        $QI = "\150\164\164\x70\x73\x3a\57\x2f\154\x6f\x67\x69\x6e\56\155\151\143\x72\x6f\163\157\x66\164\157\x6e\x6c\x69\156\x65\x2e\x63\157\x6d\57" . $UE[$c4] . "\57\x66\145\144\x65\x72\x61\x74\151\157\156\x6d\x65\164\x61\144\141\164\x61\57\62\x30\60\x37\55\60\66\57\146\145\x64\145\162\x61\x74\151\157\x6e\155\145\x74\x61\144\x61\x74\141\x2e\170\155\154";
        $ez = $UE[$c4];
        $qH = wp_remote_get($QI);
        $Yb = new DOMDocument();
        $Yb->loadXML($qH["\142\157\x64\171"]);
        $Gz = $Yb->firstChild;
        if (empty($Gz)) {
            goto lg;
        }
        $Km = new IDPMetadataReader($Yb);
        $cW = $Km->getIdentityProviders();
        lg:
        $Oo = $cW[0]->getEntityID();
        $Ia = $cW[0]->getSigningCertificate();
        $Of[$ez] = array("\x74\145\x6e\x61\156\x74\137\x69\144" => $UE[$c4], "\145\156\x74\151\164\171\x5f\x69\144" => $Oo, "\163\x69\147\x6e\151\156\147\x5f\x63\x65\x72\x74\x69\x66\151\x63\x61\164\x65" => $Ia);
        EN:
        $c4++;
        goto Pg;
        yN:
        update_option("\x61\x7a\x75\x72\145\x5f\x6d\x75\x6c\164\151\164\x65\156\x61\x6e\x74\x5f\143\157\x6e\x66\151\x67\x75\162\141\164\151\157\156\163", $Of);
        update_option("\x6d\x6f\x5f\x73\141\x6d\154\x5f\x6d\165\x6c\164\151\164\x65\x6e\x61\156\164\x5f\151\x64\160", $NP);
        fm:
        Ev:
    }
    public function error_message()
    {
        $YB = "\x65\x72\162\x6f\162";
        $FQ = get_option("\x6d\x6f\137\x6c\157\143\x61\x6c\137\x6d\x65\163\163\x61\x67\145");
        echo "\x3c\144\151\x76\40\x63\x6c\x61\x73\x73\x3d\x27" . $YB . "\x27\x3e\40\x3c\160\x3e" . $FQ . "\74\57\x70\76\x3c\57\x64\x69\166\76";
    }
    public function success_message()
    {
        $YB = "\x75\x70\144\x61\x74\145\144";
        $FQ = get_option("\x6d\157\x5f\x6c\157\x63\x61\x6c\137\155\145\x73\163\x61\147\145");
        echo "\x3c\144\x69\166\40\x63\x6c\x61\x73\x73\x3d\47" . $YB . "\x27\76\x20\x3c\160\76" . $FQ . "\74\x2f\x70\76\x3c\57\144\151\x76\x3e";
    }
    public function show_success_message()
    {
        remove_action("\141\x64\155\151\x6e\137\156\x6f\164\151\x63\x65\163", array($this, "\x65\x72\x72\x6f\162\x5f\155\x65\163\x73\x61\x67\145"));
        add_action("\x61\144\155\x69\156\137\156\157\x74\151\x63\x65\163", array($this, "\163\165\x63\x63\145\163\163\x5f\x6d\x65\x73\163\x61\147\x65"));
    }
    public function show_error_message()
    {
        remove_action("\141\x64\x6d\151\x6e\137\x6e\157\x74\151\x63\x65\x73", array($this, "\x73\x75\143\x63\145\163\x73\137\155\x65\x73\x73\141\x67\x65"));
        add_action("\x61\144\x6d\x69\156\137\156\x6f\164\151\143\x65\163", array($this, "\145\162\162\x6f\x72\x5f\155\x65\163\x73\141\x67\145"));
    }
    public function mo_saml_azure_multitenant($Ye)
    {
    }
    function mo_saml_multitenant_configuration_update($cW, $Yf)
    {
        $NP = get_option("\155\x6f\137\163\x61\x6d\154\x5f\x6d\165\154\x74\151\x74\x65\156\141\x6e\x74\137\x69\144\x70");
        $DG = get_option("\x61\172\x75\162\x65\137\155\x75\154\164\x69\164\145\x6e\x61\x6e\x74\x5f\x63\157\x6e\x66\x69\x67\165\x72\141\x74\151\157\156\163");
        $cQ = explode("\x2f", $Yf);
        $uK = $cQ[3];
        if ($DG[$uK]) {
            goto nZ;
        }
        wp_die("\x57\x65\x20\143\157\x75\154\144\40\156\x6f\x74\x20\x73\151\147\x6e\40\x79\x6f\x75\40\151\x6e\x2e\40\131\157\x75\x20\141\162\x65\x20\156\157\x74\x20\x66\x72\x6f\155\x20\164\150\x65\x20\x61\154\154\x6f\x77\145\x64\40\164\x65\x6e\141\x6e\164\54\40\160\154\145\x61\163\x65\40\x63\157\x6e\x74\x61\143\164\40\171\157\165\162\40\141\x64\x6d\151\156\x69\x73\164\x72\x61\x74\157\162");
        goto G1;
        nZ:
        $cW[$NP]["\151\x64\160\137\x65\156\164\x69\x74\x79\137\151\x64"] = $DG[$uK]["\x65\156\164\151\164\171\137\x69\144"];
        $cW[$NP]["\170\65\x30\x39\x5f\143\145\x72\x74\151\x66\151\143\x61\x74\x65"] = $DG[$uK]["\163\151\147\156\151\156\x67\137\143\145\x72\164\x69\x66\151\143\x61\164\x65"];
        G1:
        return $cW[$NP];
    }
}
new Mo_SSO_Login_Restrict();

Function Calls

None

Variables

None

Stats

MD5 d1e34dd6b03252dffba47e80cba91af6
Eval Count 0
Decode Time 58 ms