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 namespace Drupal\miniorange_oauth_client\Controller; use Drupal\user\Entity\..
Decoded Output download
<?php
namespace Drupal\miniorange_oauth_client\Controller;
use Drupal\user\Entity\User;
use Drupal\Component\Utility\Html;
use Drupal\Core\Controller\ControllerBase;
use Drupal\miniorange_oauth_client\Utilities;
use Symfony\Component\HttpFoundation\Response;
use Drupal\miniorange_oauth_client\DBQueries;
use Drupal\Core\Url;
use Drupal\miniorange_oauth_client\appValues;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Drupal\miniorange_oauth_client\GrantTypes\HandleJWT;
use Drupal\miniorange_oauth_client\MiniorangeOAuthClientCustomer;
use Drupal\profile\Entity\Profile;
use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Ajax\OpenModalDialogCommand;
use Drupal\miniorange_oauth_client\GrantTypes\ImplicitGrant;
use Drupal\miniorange_oauth_client\MiniorangeOAuthRoleRestriction;
use Drupal\miniorange_oauth_client\mOOAuthLogout;
use Drupal\miniorange_oauth_client\mOUserRegistration;
use Drupal\profile\Entity\ProfileType;
use Drupal\Core\Entity\EntityStorageException;
class miniorange_oauth_clientController extends ControllerBase
{
public static function miniorange_oauth_client_mo_login()
{
$et = \Drupal::service("session");
$R7 = \Drupal::moduleHandler();
$Za = \Drupal::service("current_route_match")->getParameter("app_name");
if (!(session_status() == PHP_SESSION_NONE)) {
goto R7;
}
session_start();
R7:
if (!(!empty($Za) && (new appValues($Za))->grantTypevalue == "implicit")) {
goto ur;
}
if (!(isset($_SERVER["QUERY_STRING"]) && !empty($_SERVER["QUERY_STRING"]))) {
goto bS;
}
$XG = $_GET;
bS:
if (!(!isset($_COOKIE["login_query"]) && empty($_SERVER["QUERY_STRING"]))) {
goto PN;
}
echo "<script type="text/javascript">\xd
var qfragment = window.location.hash;\xd\xa const currentpath = window.location.protocol + window.location.pathname;
\xa qfragment = qfragment.split("#")[1];
document.cookie = "login_query=" + qfragment;\xd
window.location.href = currentpath + "?" + qfragment;
</script>";
exit;
PN:
if (!(isset($_COOKIE["login_query"]) && !empty($_COOKIE["login_query"]))) {
goto Ir;
}
$Dv = $_COOKIE["login_query"];
$E7 = explode("&", $Dv);
$XG = [];
foreach ($E7 as $Le) {
$Rp = explode("=", $Le);
if (!(sizeof($Rp) > 1)) {
goto Oj;
}
$XG[$Rp[0]] = $Rp[1];
Oj:
t_:
}
Pk:
Ir:
$R7->invokeAll("mo_pre_auth_response_process", [$XG]);
ImplicitGrant::validate_token_and_state($XG);
$av = isset($XG["state"]) ? $XG["state"] : '';
$a5 = Utilities::decodeState($av);
$fY = isset($a5["testsso"]) ? $a5["testsso"] === true ? true : false : false;
$O_ = $et->get("appname");
$N0 = new appValues($O_);
$BO = $N0->get_appType();
$F3 = $N0->loginflowtype;
if ($BO == "Custom_Open_id" || $F3 == "OpenID") {
goto de;
}
$FT = isset($XG["access_token"]) && !empty($XG["access_token"]) ? $XG["access_token"] : '';
goto Xx;
de:
$FT = isset($XG["id_token"]) && !empty($XG["id_token"]) ? $XG["id_token"] : '';
Xx:
if (!(empty($FT) && isset($XG["token"]) && !empty($XG["token"]))) {
goto zl;
}
$FT = $XG["token"];
zl:
Utilities::save_tokens_in_cookie_and_session($XG, new appValues($O_), $fY);
$ag = new ImplicitGrant($O_);
return $ag->mo_oauth_client_mo_login($N0, $FT, $XG);
ur:
$R7->invokeAll("mo_pre_auth_response_process", [$_GET]);
$pv = isset($_GET["code"]) ? $_GET["code"] : '';
$pv = Html::escape($pv);
$av = isset($_GET["state"]) ? $_GET["state"] : '';
$av = Html::escape($av);
$a5 = Utilities::decodeState($av);
$fY = isset($a5["testsso"]) ? $a5["testsso"] === true ? true : false : false;
$Za = self::validate_code_and_state($pv, $av, $fY);
$et->remove("oauth2state");
$N0 = new appValues($Za);
$BO = $N0->get_appType();
$F3 = $N0->loginflowtype;
[$z1, $CJ] = $BO == "Custom_Open_id" || $F3 == "OpenID" ? self::implement_openid_flow($N0, $pv, '', $fY) : self::implement_oauth_flow($N0, $pv, '', $fY);
$H0 = self::flattenArray($CJ);
if (!$fY) {
goto ZL;
}
self::Test_Configuration($H0, $N0->appName);
ZL:
return self::performSSOinDrupal($CJ, $H0, $N0, $z1, $av);
}
public static function flattenArray($Af, $Aj = '')
{
$jw = array();
foreach ($Af as $Rp => $Le) {
$qH = $Aj . $Rp;
if (is_array($Le)) {
goto sK;
}
$jw[$qH] = $Le;
goto Zp;
sK:
$jw = array_merge($jw, self::flattenArray($Le, $qH . ">"));
Zp:
Qr:
}
g2:
return $jw;
}
public static function mo_oauth_attr_map($A1, $ti, $gf = "attr")
{
$Bu = array();
foreach ($A1 as $Rp => $Le) {
if (!(!empty($Le) && !empty($ti[$Rp]))) {
goto ge;
}
if (array_key_exists($Le, $Bu) && $gf == "role") {
goto VT;
}
$Bu[trim($Le, " ")] = $ti[$Rp];
goto My;
VT:
if ($Bu[$Le][-1] != ";") {
goto SC;
}
$Bu[trim($Le, " ")] = $Bu[$Le] . $ti[$Rp];
goto Rp;
SC:
$Bu[trim($Le, " ")] = $Bu[$Le] . ";" . $ti[$Rp];
Rp:
My:
ge:
dA:
}
p8:
return $Bu;
}
public static function to_explode_semicolon($oK)
{
$sQ = array();
foreach ($oK as $Rp => $kR) {
$kR = explode(";", $kR);
$sQ[$Rp] = $kR;
AO:
}
o5:
return $sQ;
}
public static function create_profile($gK, $kW, $N0)
{
if (\Drupal::service("module_handler")->moduleExists("profile")) {
goto Vm;
}
return new Response();
Vm:
$kp = $N0->enable_profile_mapping;
if ($kp) {
goto ws;
}
return new Response();
ws:
$aQ = $N0->profile_entity_type;
$xV = isset($kW->toArray()[$aQ . "_profiles"][0]) ? $kW->toArray()[$aQ . "_profiles"][0]["target_id"] : NULL;
$xB = ProfileType::load($aQ);
$fR = $xB->toArray()["roles"];
$zM = $kW->getRoles();
if (!(!empty(array_intersect($fR, $zM)) || empty($fR))) {
goto yR;
}
if (!is_null($xV)) {
goto GW;
}
try {
$XQ = Profile::create(["type" => $aQ, "uid" => $kW->id(), "field_agree_terms" => 1]);
$XQ->save();
$xV = $XQ->toArray()["profile_id"][0]["value"];
} catch (EntityStorageException $SD) {
\Drupal::logger("miniorange_oauth_client")->notice("EntityStorageException: Error while creating and saving the profile type.");
}
GW:
if (empty($gK)) {
goto CC;
}
foreach ($gK as $Rp => $Le) {
$XQ = Profile::load($xV);
$XQ->set($Rp, $Le);
SU:
}
v9:
$XQ->save();
CC:
yR:
}
public static function perform_role_mapping($N0, $Bj, $kW, $F6, $dr = '')
{
$TL = $N0->get_roleAttribute();
$Xk = $N0->get_enableRolemapping();
$lo = $N0->get_disableRoleUpdate();
$UZ = $N0->get_roleMap();
$UZ = !empty($UZ) ? $UZ : array();
$UU = array();
$Y0 = array();
foreach ($UZ as $Rp) {
if (!($Rp["user_sp_role_name"] != '' && $Rp["user_idp_role_name"] != '')) {
goto d1;
}
array_push($UU, $Rp["user_sp_role_name"]);
array_push($Y0, $Rp["user_idp_role_name"]);
d1:
AK:
}
DF:
$hl = self::mo_oauth_attr_map($UU, $Y0, "role");
$Fh = array();
if (!is_array($F6) && !empty($F6)) {
goto zX;
}
$Fh = is_array($F6) ? $F6 : [];
goto iJ;
zX:
$F6 = str_replace(["[", "]"], '', $F6);
$F6 = explode(",", $F6);
foreach ($F6 as $Rp => $Le) {
$Fh[] = str_replace(""", '', trim($Le));
w2:
}
ao:
iJ:
if (!($Xk && !is_null($TL) && !empty($TL))) {
goto nb;
}
$VD = $kW->getRoles();
if ($lo) {
goto Id;
}
foreach ($VD as $Rp => $Le) {
if (in_array($Le, array_keys($hl))) {
goto Ex;
}
if (!($Le != $N0->get_defaultRole())) {
goto sQ;
}
$kW->removeRole($Le);
$kW->save();
sQ:
Ex:
yt:
}
p2:
Id:
foreach ($hl as $Rp => $Le) {
$hk = FALSE;
$yR = explode(";", $Le);
foreach ($yR as $qz => $Re) {
if (strpos($Re, "&") !== false) {
goto T1;
}
if (!in_array($Re, $Fh)) {
goto JY;
}
$hk = TRUE;
goto bJ;
JY:
goto ST;
T1:
$rR = true;
$JT = explode("&", $Re);
foreach ($JT as $su => $Ox) {
if (in_array($Ox, $Fh)) {
goto aJ;
}
$rR = false;
goto q8;
aJ:
dg:
}
q8:
$hk = $rR ? TRUE : FALSE;
if (!$hk) {
goto r9;
}
goto bJ;
r9:
ST:
Yw:
}
bJ:
if ($hk && $Rp != "authenticated") {
goto Io;
}
$kW->removeRole($Rp);
$kW->save();
goto Qw;
Io:
$kW->addRole($Rp);
$kW->save();
Qw:
OS:
}
hJ:
nb:
}
public static function getToken($gB, $q3, $QT, $C5, $pv, $oH, $SU, $BA, $Za, $fY = false, $ga = '')
{
$base_url = \Drupal::request()->getSchemeAndHttpHost() . \Drupal::request()->getBasePath();
$et = \Drupal::service("session");
$N0 = new appValues($Za);
$ge = array();
$Hx = $N0->scope;
if ($q3 == "authorization_code_with_pkce") {
goto yP;
}
if ($q3 == "refresh_token") {
goto XA;
}
if ($SU && !$BA) {
goto Cv;
}
if (!$SU && $BA) {
goto Sk;
}
$ge = Utilities::callService($gB, "redirect_uri=" . urlencode($oH) . "&grant_type=" . $q3 . "&client_id=" . urlencode($QT) . "&client_secret=" . urlencode($C5) . "&code=" . $pv, array("Authorization" => "Basic " . base64_encode($QT . ":" . $C5), "Accept" => "application/json", "Content-Type" => "application/x-www-form-urlencoded"), '', $fY);
goto u4;
Sk:
$ge = Utilities::callService($gB, "redirect_uri=" . urlencode($oH) . "&grant_type=" . $q3 . "&client_id=" . urlencode($QT) . "&client_secret=" . urlencode($C5) . "&code=" . $pv, array("Accept" => "application/json", "Content-Type" => "application/x-www-form-urlencoded"), '', $fY);
u4:
goto Le;
Cv:
$ge = Utilities::callService($gB, "redirect_uri=" . urlencode($oH) . "&grant_type=" . $q3 . "&code=" . $pv, array("Authorization" => "Basic " . base64_encode($QT . ":" . $C5), "Accept" => "application/json", "Content-Type" => "application/x-www-form-urlencoded"), '', $fY);
Le:
goto Hm;
yP:
$E9 = $et->get("codeVerifier");
$et->remove("codeVerifier");
$ge = Utilities::callService($gB, "redirect_uri=" . urlencode($oH) . "&grant_type=authorization_code" . "&code=" . $pv . "&code_verifier=" . $E9 . "&client_id=" . urlencode($QT), array("Accept" => "application/json", "Content-Type" => "application/x-www-form-urlencoded", "Origin" => $base_url), '', $fY);
goto Hm;
XA:
$iM = [];
$Dn = "redirect_uri=" . urlencode($oH) . "&grant_type=" . $q3 . "&refresh_token=" . $ga;
if (!$SU) {
goto zr;
}
$iM = ["Authorization" => "Basic " . base64_encode($QT . ":" . $C5), "Accept" => "application/json", "Content-Type" => "application/x-www-form-urlencoded"];
zr:
if (!$BA) {
goto qS;
}
$Dn = $Dn . "&client_id=" . urlencode($QT) . "&client_secret=" . urlencode($C5);
qS:
$ge = Utilities::callService($gB, $Dn, $iM, '', $fY);
Hm:
$XL = json_decode($ge, true);
if (isset($XL["access_token"]) || isset($XL["id_token"])) {
goto xa;
}
\Drupal::logger("miniorange_oauth_client")->error("Invalid response received while fetching access token from url-<br> {$gB} <br><br> Response => <pre><code>" . print_r($XL, TRUE) . "<pre><code>");
if ($q3 == "refresh_token") {
goto Xf;
}
if ($fY) {
goto kY;
}
Utilities::anonymousRedirect('', '', "Something went wrong, Please contact the site administrator.");
goto bb;
Xf:
\Drupal::logger("mo_session_manager")->warning("access token renewal failed.<br> response = '%response' ", ["%response" => print_r($XL, TRUE)]);
goto bb;
kY:
Utilities::show_error_message_testconfig("Invalid response received while fetching access token from url-<br>{$gB} <br><br> Response => <pre><code>" . print_r($XL, TRUE) . "<pre><code>");
bb:
xa:
Utilities::save_tokens_in_cookie_and_session($XL, new appValues($Za), $fY);
return $XL;
}
public static function validate_code_and_state($pv, $av, $fY)
{
$et = \Drupal::service("session");
if (empty($pv)) {
goto tU;
}
if (empty($av)) {
goto zs;
}
$Za = '';
$av = Utilities::decodeState($av);
if (!empty($et->get("appname"))) {
goto u6;
}
if (!(isset($av["appname"]) && !empty($av["appname"]))) {
goto Yf;
}
$Za = $av["appname"];
Yf:
goto R5;
u6:
$Za = $et->get("appname");
R5:
if (!empty($Za)) {
goto mm;
}
\Drupal::logger("miniorange_oauth_client")->error("Invalid state parameter");
if ($fY) {
goto wC;
}
Utilities::anonymousRedirect();
goto wi;
wC:
Utilities::show_error_message_testconfig("Invalid state parameter");
wi:
mm:
goto um;
tU:
\Drupal::logger("miniorange_oauth_client")->error("<pre><code>" . print_r($_GET, true) . "<pre><code>");
if ($fY) {
goto y5;
}
Utilities::anonymousRedirect();
goto Cn;
y5:
Utilities::show_error_message_testconfig("<pre><code>" . print_r($_GET, true) . "<pre><code>");
Cn:
goto um;
zs:
$eL = DBQueries::get_all_app_names_with_oauth_login_enabled();
return $eL[0]->app_name;
um:
return $Za;
}
public static function implement_openid_flow($N0, $pW = '', $hc = '', $fY = false)
{
$pv = $pW;
$T5 = $N0->get_valuesInHeader();
$p_ = $N0->get_valuesInBody();
$q3 = $N0->grantTypevalue;
$pv = $pW;
$t0 = Utilities::getCallbackUrl($N0->appName);
if (!(!$T5 == TRUE || !$T5 == 1)) {
goto os;
}
$T5 = false;
os:
if (!(!$p_ == TRUE || !$p_ == 1)) {
goto ZB;
}
$p_ = false;
ZB:
if ($q3 == "password") {
goto a2;
}
$z1 = self::getToken($N0->get_accessTokenEndpoint(), $q3, $N0->get_clientId(), $N0->get_clientSecret(), $pv, $t0, $T5, $p_, $N0->appName, $fY);
goto Ko;
a2:
$z1 = $hc->getToken($N0, $fY);
Ko:
if (isset($z1["id_token"])) {
goto VG;
}
\Drupal::logger("miniorange_oauth_client")->error("The OAuth response doesn't contain an ID token. Please try selecting 'OAuth 2.0 Application' from the 'Select Application Type' radio button, if it contains an access token.<br><br><b>Response : </b><pre><code>" . print_r($z1, true) . "</code></pre>");
if ($fY) {
goto Rm;
}
Utilities::anonymousRedirect('', '', "Something went wrong, Please contact the site administrator.");
goto pH;
Rm:
Utilities::show_error_message_testconfig("The OAuth response doesn't contain an ID token. Please try selecting 'OAuth 2.0 Application' from the 'Select Application Type' radio button, if it contains an access token.<br><br><b>Response : </b><pre><code>" . print_r($z1, true) . "</code></pre>");
pH:
VG:
$sv = new HandleJWT($N0, $z1["id_token"], $fY);
$CJ = $sv->getUserAttributesFromIDToken();
return [$z1, $CJ];
}
public static function implement_oauth_flow($N0, $pW = '', $hc = '', $fY = false)
{
$T5 = $N0->get_valuesInHeader();
$p_ = $N0->get_valuesInBody();
$u3 = $N0->appName;
$q3 = $N0->grantTypevalue;
$pv = $pW;
$t0 = Utilities::getCallbackUrl($N0->appName);
$va = \Drupal::config("miniorange_oauth_client.settings")->get("miniorange_oauth_client_group_info_ep_" . $u3);
if (!(!$T5 == TRUE || !$T5 == 1)) {
goto uV;
}
$T5 = false;
uV:
if (!(!$p_ == TRUE || !$p_ == 1)) {
goto p9;
}
$p_ = false;
p9:
if ($q3 == "password" && !empty($hc)) {
goto Ho;
}
$z1 = self::getToken($N0->get_accessTokenEndpoint(), $q3, $N0->get_clientId(), $N0->get_clientSecret(), $pv, $t0, $T5, $p_, $u3, $fY);
goto ke;
Ho:
$z1 = $hc->getToken($N0, $fY);
ke:
if (isset($z1["access_token"])) {
goto XF;
}
\Drupal::logger("miniorange_oauth_client")->error("The OAuth response doesn't contain an access token. Please try selecting 'OpenID Connect Application' from the 'Select Application Type' radio button, if it contains an ID token.<br><br><b>Response : </b><pre><code>" . print_r($z1, true) . "</code></pre>");
if ($fY) {
goto ap;
}
Utilities::anonymousRedirect('', '', "Something went wrong, Please contact the site administrator.");
goto MH;
ap:
Utilities::show_error_message_testconfig("The OAuth response doesn't contain an access token. Please try selecting 'OpenID Connect Application' from the 'Select Application Type' radio button, if it contains an ID token.<br><br><b>Response : </b><pre><code>" . print_r($z1, true) . "</code></pre>");
MH:
goto qV;
XF:
$G5 = $z1["access_token"];
qV:
$Qs = $N0->get_userInfoEndpoint();
if (!(substr($Qs, -1) == "=")) {
goto aE;
}
$Qs .= $G5;
aE:
$CJ = self::getResourceOwner($Qs, $G5, $fY);
if (empty($va)) {
goto Qx;
}
$PL = Utilities::getGroupsInfo($va, $G5, $fY);
$PL = !empty($PL) ? $PL : [];
$CJ = array_merge($CJ, $PL);
Qx:
return [$z1, $CJ];
}
public static function final_redirect_url_after_login($av, $GB, $dQ)
{
$av = Utilities::decodeState($av);
$Id = '';
if (isset($av["destination"]) && !empty($av["destination"])) {
goto vT;
}
if (isset($av["restrictedpagedestination"]) && !empty($av["restrictedpagedestination"])) {
goto U9;
}
if ($GB != '') {
goto hC;
}
if (isset($av["referer"]) && !empty($av["referer"])) {
goto ch;
}
$Id = Url::fromRoute("entity.user.canonical", ["user" => $dQ])->toString();
goto wd;
ch:
$Id = $av["referer"];
wd:
goto YV;
hC:
$Id = $GB;
YV:
goto mV;
U9:
$Id = $av["restrictedpagedestination"];
mV:
goto qJ;
vT:
$Id = $av["destination"];
qJ:
return $Id;
}
public static function performSSOinDrupal($CJ, $H0, $N0, $z1, $av = '')
{
$et = \Drupal::service("session");
$R7 = \Drupal::moduleHandler();
$R7->invokeAll("mo_pre_user_login", [$CJ, $z1]);
$an = '';
$s9 = '';
$aS = '';
$gv = '';
if (empty($N0->get_emailAttr())) {
goto sV;
}
$s9 = $N0->get_emailAttr();
sV:
if (empty($N0->get_emailAttr())) {
goto bv;
}
$an = $N0->get_nameAttr();
bv:
if (!(!empty($s9) && isset($H0[$s9]))) {
goto La;
}
$gv = $H0[$s9];
La:
if (!($an != "Select" && isset($H0[$an]))) {
goto o0;
}
$aS = $H0[$an];
o0:
if (!empty($gv)) {
goto z4;
}
Utilities::save_SSO_report_data("FAILURE. Email not mapped", $N0->appName, $aS ? $aS : "-", "-");
Utilities::show_sso_error_message("Email address not received.", "Please ensure Email Attribute field is configured properly in the Attribute & Role Mapping tab of the module.");
z4:
$OS = Utilities::Is_Restricted_Domain($gv);
if (!$OS) {
goto aj;
}
Utilities::save_SSO_report_data("FAILURE. Domain Restricted", $N0->appName, $aS ? $aS : "-", $gv);
Utilities::anonymousRedirect('', "A user (email - <i>" . $gv . "</i>, username - <i>" . $aS . "</i>) with restricted domain is attemping to login", "You are not allowed to login to this site, please contact the site administrator.");
aj:
self::is_role_allowed($N0, $CJ);
$kW = user_load_by_mail($gv);
$Xk = $N0->get_enableRolemapping();
$w5 = $N0->get_defaultRole();
if (!empty($aS)) {
goto pn;
}
$aS = $gv;
pn:
$HE = \Drupal::config("miniorange_oauth_client.settings")->get("miniorange_oauth_require_profile_field");
if (isset($kW->uid)) {
goto mg;
}
$R7->invokeAll("mo_pre_user_register", [$CJ]);
$lk = new mOUserRegistration($N0->autocreateuser, $N0->create_disable_user, $N0->redirect_disable, $N0->redirect_unregister, $aS, $gv, $Xk, $w5, $N0->appName);
$kW = $lk->create_new_user($CJ);
mg:
$kW = User::load($kW->id());
if ($kW->isActive()) {
goto tv;
}
Utilities::anonymousRedirect($N0->redirect_disable, '', "The username <i>" . $kW->getAccountName() . "</i> has not been activated or is blocked.");
tv:
self::perform_attribute_mapping($kW, $N0, $H0);
self::implement_role_mapping($kW, $N0, $CJ);
self::perform_profile_mapping($kW, $N0, $CJ);
self::perform_group_mapping($kW, $N0, $CJ);
$Id = self::final_redirect_url_after_login($av, $N0->redirect_after_login, $kW->id());
Utilities::save_SSO_report_data("SUCCESS", $N0->appName, $aS, $gv, $Id);
$et->set("mo_sso_session", true);
$et->set("appname", $N0->appName);
if (!($N0->sendidtokeninslorequest && isset($z1["id_token"]))) {
goto kt;
}
$et->set("mo_id_token", $z1["id_token"]);
kt:
$ZD = array();
$ZD["redirect"] = $Id;
user_login_finalize($kW);
$et->set("mo_sso_session", true);
$et->set("appname", $N0->appName);
$R7->invokeAll("mo_post_user_login", [&$kW, $CJ]);
$R7->invokeAll("mo_oauth_user_token", [&$kW, $z1, $Id]);
if (!($HE == 1 && !Utilities::check_for_redirect_to_user_profile_form($gv))) {
goto Z8;
}
Utilities::redirect_to_profile_form($kW->id());
Z8:
$ge = new RedirectResponse($ZD["redirect"]);
\Drupal::service("page_cache_kill_switch")->trigger();
return $ge;
}
public static function is_role_allowed($N0, $CJ)
{
$sR = $N0->enable_role_based_restriction;
$BE = $N0->role_restriction_attrname;
$Cp = $N0->list_of_roles;
$D1 = $N0->typeof_role_restriction;
$O6 = $N0->redirect_url_for_role_restriction;
if (!($sR && $Cp && $D1 && $BE)) {
goto oW;
}
$Cy = new MiniorangeOAuthRoleRestriction($CJ, $BE, $Cp, $O6);
if ($D1 === "whitelist") {
goto UK;
}
$Cy->validate_blacklisted_role_restriction();
goto I7;
UK:
$Cy->validate_whitelisted_role_restriction();
I7:
oW:
return new Response();
}
public static function perform_attribute_mapping($kW, $N0, $CJ)
{
$nF = $N0->get_attributeMap();
$nF = !empty($nF) ? $nF : array();
$A1 = array();
$ti = array();
foreach ($nF as $Rp) {
if (!($Rp["machine_name"] != '' && $Rp["attribute_name"] != '')) {
goto vU;
}
array_push($ti, $Rp["machine_name"]);
array_push($A1, $Rp["attribute_name"]);
vU:
TA:
}
tS:
$bd = self::mo_oauth_attr_map($A1, $ti);
$Pr = array();
if (!(isset($bd) && !empty($bd))) {
goto pD;
}
foreach ($bd as $qz => $Re) {
if (!isset($CJ[$qz])) {
goto Mn;
}
$Pr[$Re] = $CJ[$qz];
Mn:
W4:
}
e7:
foreach ($Pr as $Rp => $Le) {
$kW->{$Rp} = $Le;
$kW->save();
Ih:
}
oz:
pD:
}
public static function implement_role_mapping($kW, $N0, $CJ)
{
$m9 = $N0->get_roleAttribute();
if (!(isset($m9) && !empty($m9))) {
goto Yb;
}
$F6 = self::getnestedattribute($CJ, $m9);
if (is_null($kW)) {
goto k1;
}
self::perform_role_mapping($N0, $CJ, $kW, $F6, $N0->appName);
k1:
Yb:
}
public static function perform_profile_mapping($kW, $N0, $CJ)
{
$kP = $N0->get_profileMap();
$kP = !empty($kP) ? $kP : array();
$H4 = array();
$AG = array();
if (empty($kP)) {
goto VD;
}
foreach ($kP as $Rp) {
if (!($Rp["user_profile_field_name"] != '' && $Rp["user_profile_idp_attribute_name"] != '')) {
goto wj;
}
array_push($H4, $Rp["user_profile_field_name"]);
array_push($AG, $Rp["user_profile_idp_attribute_name"]);
wj:
mi:
}
Gg:
$bL = self::mo_oauth_attr_map($H4, $AG, "role");
$Ie = array();
if (!(isset($bL) && !empty($bL))) {
goto si;
}
$bL = self::to_explode_semicolon($bL);
foreach ($bL as $Rp => $kR) {
$Yv = array();
foreach ($kR as $Le) {
if (!array_key_exists($Le, $CJ)) {
goto jB;
}
array_push($Yv, $CJ[$Le]);
jB:
Ux:
}
nL:
$Ie[$Rp] = $Yv;
qC:
}
tG:
self::create_profile($Ie, $kW, $N0);
si:
VD:
}
public static function perform_group_mapping($kW, $N0, $CJ)
{
$EV = $N0->enablegroupmapping;
$Gx = $N0->keepExistingGroups;
$oV = $N0->groupAttribute;
$xi = !empty($N0->groupmap) ? json_decode($N0->groupmap, true) : [];
$LH = '';
if (empty($oV)) {
goto f7;
}
$LH = self::getnestedattribute($CJ, $oV);
f7:
$Sk = [];
if (!is_array($LH) && !empty($LH)) {
goto tw;
}
$Sk = is_array($LH) ? $LH : [];
goto KT;
tw:
$LH = str_replace(["[", "]"], '', $LH);
$LH = explode(",", $LH);
foreach ($LH as $Rp => $Le) {
$Sk[] = str_replace(""", '', trim($Le));
W0:
}
dy:
KT:
$GL = [];
$wJ = [];
foreach ($xi as $Rp) {
if (empty(trim($Rp["oauth_server_attrs"]))) {
goto M6;
}
array_push($GL, $Rp["group_name"]);
array_push($wJ, $Rp["oauth_server_attrs"]);
M6:
jM:
}
yZ:
$ly = self::mo_oauth_attr_map($GL, $wJ, "role");
if (!($EV && is_array($Sk) && !empty($ly) && $kW)) {
goto RT;
}
foreach ($ly as $Rp => $Le) {
$IU = false;
$CU = \Drupal::entityTypeManager()->getStorage("group");
$St = $CU->load($Rp);
if (!$St) {
goto I6;
}
if (!$St->getMember($kW)) {
goto oZ;
}
$IU = true;
oZ:
$X7 = explode(";", $Le);
if (!empty(array_intersect($Sk, $X7))) {
goto Yx;
}
if (!($IU && !$Gx)) {
goto CX;
}
$St->removeMember($kW);
$St->save();
CX:
goto FU;
Yx:
if ($St->getMember($kW)) {
goto pw;
}
$St->addMember($kW);
$St->save();
pw:
FU:
I6:
xf:
}
NW:
RT:
}
public static function Test_Configuration($CJ, $Za)
{
$GC = \Drupal::service("extension.list.module")->getPath("miniorange_oauth_client");
$base_url = \Drupal::request()->getSchemeAndHttpHost() . \Drupal::request()->getBasePath();
$C8 = isset($CJ["email"]) ? $CJ["email"] : "User";
$r2 = '';
Utilities::show_attr($CJ, $r2, 0, '', "<tr style="text-align:center;">", "<td style='font-weight:bold;padding:2%;border:2px solid #949090; word-wrap:break-word;'>");
$zZ = is_array($CJ) ? json_encode($CJ) : '';
\Drupal::configFactory()->getEditable("miniorange_oauth_client.settings")->set("miniorange_oauth_client_attr_list_from_server_" . $Za, $zZ)->save();
$pO = [];
if (!is_array($CJ)) {
goto t5;
}
$pO = array_combine(array_keys($CJ), array_keys($CJ));
t5:
$pO = is_array($pO) ? json_encode($pO) : '';
\Drupal::configFactory()->getEditable("miniorange_oauth_client.settings")->set("miniorange_oauth_client_attr_list_from_server_mapping_" . $Za, $pO)->save();
echo "<div style="font-family:Calibri;padding:0 3%;">";
echo "<div style="color: #3c763d;background-color: #dff0d8; padding:2%;margin-bottom:20px;text-align:center; border:1px solid #AEDB9A;
font-size:15pt;">\xd
TEST SUCCESSFUL\xd\xa </div>\xd\xa <div style="display:block;text-align:center;margin-bottom:4%;">
<img style="width:15%;"src="" . $base_url . "/" . $GC . "/assets/img/green_check.png">\xd\xa </div>";
echo "<span style="font-size:13pt;"><b>Hello</b>, " . $C8 . "</span><br/>
<p style="font-weight:bold;font-size:13pt;margin-left:1%;">ATTRIBUTES RECEIVED:</p>
<table style="border-collapse:collapse;border-spacing:0; display:table;width:100%; font-size:13pt;background-color:#EDEDED;">\xd\xa <tr style="text-align:center;">
\xa <td style="font-weight:bold;border:2px solid #949090;padding:2%;">ATTRIBUTE NAME</td>
\xa <td style="font-weight:bold;padding:2%;border:2px solid #949090; word-wrap:break-word;">ATTRIBUTE VALUE</td>
\xa </tr>";
echo $r2;
echo "</table></div>";
echo "<div style="margin:3%;display:block;text-align:center;">\xd
<input style="padding:1%;width:37%;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;
\xa border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;\xd
box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Configure Attribute/Role Mapping"
onClick="close_and_redirect();">
\xd
<input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;
\xa 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();">
\xa </div>
\xa <script>\xd\xa function close_and_redirect(){\xd
window.opener.location.href = "" . Url::fromRoute("miniorange_oauth_client.mapping")->toString() . "";
self.close();\xd\xa }\xd
</script>";
exit;
return new Response();
}
public static function getResourceOwner($Qs, $A0, $fY = false)
{
$ge = Utilities::callService($Qs, NULL, array("Authorization" => "Bearer " . $A0), "GET", $fY);
$XL = json_decode($ge, true);
if (isset($XL["error_description"])) {
goto ZG;
}
if (!isset($XL["error"])) {
goto Rs;
}
if (is_array($XL["error"])) {
goto aY;
}
echo $XL["error"];
goto NO;
aY:
print_r($XL["error"]);
NO:
exit;
Rs:
goto NK;
ZG:
if (is_array($XL["error_description"])) {
goto qy;
}
echo $XL["error_description"];
goto w0;
qy:
print_r($XL["error_description"]);
w0:
exit;
NK:
return $XL;
}
public static function testattrmappingconfig($r0, $ow)
{
foreach ($ow as $Rp => $cm) {
if (is_array($cm) || is_object($cm)) {
goto PI;
}
echo "<tr style='text-align:center;'><td style='font-weight:bold;border:2px solid #949090;padding:2%;'>";
if (empty($r0)) {
goto r_;
}
echo $r0 . ".";
r_:
echo $Rp . "</td><td style='font-weight:bold;padding:2%;border:2px solid #949090; word-wrap:break-word;'>" . $cm . "</td></tr>";
goto FZ;
PI:
if (empty($r0)) {
goto v1;
}
$r0 .= ".";
v1:
self::testattrmappingconfig($r0 . $Rp, $cm);
FZ:
D3:
}
l2:
return new Response();
}
public static function getnestedattribute($cm, $Rp)
{
if (isset($Rp)) {
goto Wl;
}
return '';
Wl:
$Yf = explode(">", $Rp);
$a2 = '';
if (sizeof($Yf) > 1) {
goto xb;
}
$a2 = $Yf[0];
if (isset($cm[$a2]) && !is_array($cm[$a2])) {
goto UJ;
}
if (!isset($cm[$a2])) {
goto pF;
}
return self::extractLeafNodes($cm[$a2]);
pF:
goto pj;
UJ:
return $cm[$a2];
pj:
goto JC;
xb:
$a2 = $Yf[0];
if (!isset($cm[$a2])) {
goto ps;
}
return self::getnestedattribute($cm[$a2], str_replace($a2 . ">", '', $Rp));
ps:
JC:
}
public static function extractLeafNodes($Af)
{
$jw = array();
foreach ($Af as $Rp => $Le) {
if (is_array($Le)) {
goto WL;
}
$jw[] = $Le;
goto kx;
WL:
$jw = array_merge($jw, self::extractLeafNodes($Le));
kx:
Mk:
}
Zo:
return $jw;
}
public static function mo_oauth_client_initiateLogin($fY = false, $TR = '')
{
\Drupal::service("page_cache_kill_switch")->trigger();
Utilities::checkUpgradeUrlStatus();
$R7 = \Drupal::moduleHandler();
if (isset($_GET["appname"]) && !empty($_GET["appname"])) {
goto ow;
}
$A7 = \Drupal::config("miniorange_oauth_client.settings")->get("auto_redirect_app_name");
goto N2;
ow:
$A7 = trim(Html::escape($_GET["appname"]));
N2:
$N0 = new appValues($A7);
$Mx = $N0->getAllConfig();
$t0 = Utilities::getCallbackUrl($A7);
$JE = $Mx["authorizeEndpoint"];
$av = Utilities::generateState($Mx["appName"], $TR, $fY);
$q3 = $Mx["grantTypevalue"];
if (!($q3 == "implicit")) {
goto eS;
}
$HU = new ImplicitGrant($Mx["appName"]);
$HU->mo_oauth_client_initiateLogin($N0, $TR, $fY);
eS:
if (strpos($JE, "?") !== false) {
goto tY;
}
$JE = $JE . "?client_id=" . $N0->get_clientId() . "&scope=" . $Mx["scope"] . "&redirect_uri=" . $t0 . "&response_type=code&state=" . $av;
goto nQ;
tY:
$JE = $JE . "&client_id=" . $N0->get_clientId() . "&scope=" . $Mx["scope"] . "&redirect_uri=" . $t0 . "&response_type=code&state=" . $av;
nQ:
if (!(session_status() == PHP_SESSION_NONE)) {
goto oh;
}
session_start();
oh:
$et = \Drupal::service("session");
$et->set("oauth2state", $av);
$et->set("appname", $Mx["appName"]);
if (!($q3 == "authorization_code_with_pkce")) {
goto q2;
}
$fK = random_bytes(64);
$E9 = rtrim(strtr(base64_encode($fK), "+/", "-_"), "=");
$Fk = hash("sha256", $E9, true);
$Jc = rtrim(strtr(base64_encode($Fk), "+/", "-_"), "=");
$JE = $JE . "&code_challenge=" . $Jc . "&code_challenge_method=S256";
$et->set("codeVerifier", $E9);
q2:
$R7->invokeAll("mo_pre_authorization_request", [&$JE, $_GET]);
$ge = new RedirectResponse($JE);
$ge->send();
exit;
}
public static function test_mo_config()
{
miniorange_oauth_clientController::miniorange_oauth_client_mologin("testOAuthConfig");
}
public static function miniorange_oauth_client_mologin($TR = '')
{
$kE = \Drupal::request();
$base_url = $kE->getSchemeAndHttpHost() . $kE->getBasePath();
$iT = \Drupal::config("miniorange_oauth_client.settings");
$IX = $iT->get("miniorange_oauth_client_customer_admin_fraud_check");
$A_ = $iT->get("miniorange_oauth_client_customer_admin_token");
$Ma = $iT->get("miniorange_oauth_client_customer_admin_email");
$VH = $iT->get("miniorange_oauth_client_license_key");
$jZ = $iT->get("auto_redirect_app_name");
$AB = $iT->get("miniorange_oauth_isMultiSitePluginRequested") == true;
$xo = $iT->get("mo_last_license_fetch_time");
$Xo = time();
if (!($Xo - $xo > 604800)) {
goto Xq;
}
self::moOAuthLicenseFetch(true);
Xq:
$Ze = \Drupal::state()->get("miniorange_oauth_is_trial");
$Ti = $iT->get("miniorange_oauth_licenseExpiry") ?? '';
$u3 = $kE->query->get("appname", $jZ);
$BK = DBQueries::get_all_apps_from_db();
$qo = in_array($u3, $BK) ? (new appValues($u3))->enable_login_with_oauth : 0;
$AM = str_ireplace("http:", "https:", $base_url);
$jS = $AM . $A_;
if (empty($Ma)) {
goto pO;
}
if (empty($VH)) {
goto Ad;
}
if (!$AB && $jS == Utilities::decrypt_data($IX, $A_) || $jS == Utilities::decrypt_data($IX, $A_, "AES-128-ECB")) {
goto IL;
}
if ($Ze && (!$Ti || strtotime($Ti) < $Xo)) {
goto Lq;
}
if ($TR === "testOAuthConfig" && isset($_GET["appname"]) && !empty($_GET["appname"])) {
goto X3;
}
if ($TR !== "testOAuthConfig" && $qo) {
goto Nz;
}
Utilities::show_sso_error_message("Configurations not found or Login using OAuth provider is disabled.", "Please ensure the SSO or Test Connection URL is correct and Login with OAuth is enabled.");
goto B_;
pO:
Utilities::show_sso_error_message("It appears that you are not logged into the module.", "Please log in to the module.");
goto B_;
Ad:
Utilities::show_sso_error_message("It appears that you have not verified your license key", "Please verify your license key.");
goto B_;
IL:
Utilities::show_sso_error_message("The license key you have entered has already been used.", "Please enter a key which has not been used before on any other instance or if you have exhausted all your keys, you can purchase more licenses.");
goto B_;
Lq:
Utilities::show_sso_error_message("Your trial license has expired on " . date("l M j, Y", strtotime($Ti)), ". Reach out to us at <a href="mailto::[email protected]">[email protected]</a> to upgrade your license.");
goto B_;
X3:
return self::mo_oauth_client_initiateLogin(true);
goto B_;
Nz:
return self::mo_oauth_client_initiateLogin(false, $TR);
B_:
}
public function oauth_client_logout()
{
$rM = new mOOAuthLogout();
return $rM->mo_oauth_logout();
}
public static function openCustomerRequestForm()
{
$ge = new AjaxResponse();
$ii = \Drupal::formBuilder()->getForm("\Drupal\miniorange_oauth_client\Form\MiniorangeCustomerRequest");
$ge->addCommand(new OpenModalDialogCommand("miniOrange OAuth Client Customer Support", $ii, ["width" => "45%"]));
return $ge;
}
public static function moOAuthLicenseFetch($OP = FALSE)
{
$iT = \Drupal::config("miniorange_oauth_client.settings");
$Ib = \Drupal::configFactory()->getEditable("miniorange_oauth_client.settings");
$C8 = $iT->get("miniorange_oauth_client_customer_admin_email");
$Nc = new MiniorangeOAuthClientCustomer($C8, null);
$y0 = json_decode($Nc->ccl(), true);
if (isset($y0["status"]) && $y0["status"] == "SUCCESS") {
goto OZ;
}
$TT = t("Failed to fetch licensing update");
$fr = "error";
goto ph;
OZ:
$Ib->set("mo_last_license_fetch_time", time())->save();
$Ib->set("miniorange_oauth_licenseExpiry", $y0["licenseExpiry"])->save();
$Ib->set("miniorange_oauth_supportExpiry", $y0["supportExpiry"])->save();
$Ib->set("miniorange_oauth_isMultiSitePluginRequested", isset($y0["isMultiSitePluginRequested"]) ? $y0["isMultiSitePluginRequested"] : false)->save();
$Xh = isset($y0["noOfSP"]) ? $y0["noOfSP"] : 1;
$Ib->set("miniorange_oauth_noOfSP", $Xh)->save();
$BB = isset($y0["trial"]) ? $y0["trial"] : false;
\Drupal::state()->set("miniorange_oauth_is_trial", $BB);
$TT = t("Successfully fetched the licensing update");
$fr = "status";
ph:
$fr == "status" ? \Drupal::logger("miniorange_oauth_client")->notice($TT) : \Drupal::logger("miniorange_oauth_client")->error($TT);
if ($OP) {
goto dj;
}
$fr == "status" ? \Drupal::messenger()->addStatus($TT) : \Drupal::messenger()->addError($TT);
return new RedirectResponse(Url::fromRoute("miniorange_oauth_client.customer_setup")->toString());
dj:
return new Response();
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Drupal\miniorange_oauth_client\Controller;
use Drupal\user\Entity\User;
use Drupal\Component\Utility\Html;
use Drupal\Core\Controller\ControllerBase;
use Drupal\miniorange_oauth_client\Utilities;
use Symfony\Component\HttpFoundation\Response;
use Drupal\miniorange_oauth_client\DBQueries;
use Drupal\Core\Url;
use Drupal\miniorange_oauth_client\appValues;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Drupal\miniorange_oauth_client\GrantTypes\HandleJWT;
use Drupal\miniorange_oauth_client\MiniorangeOAuthClientCustomer;
use Drupal\profile\Entity\Profile;
use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Ajax\OpenModalDialogCommand;
use Drupal\miniorange_oauth_client\GrantTypes\ImplicitGrant;
use Drupal\miniorange_oauth_client\MiniorangeOAuthRoleRestriction;
use Drupal\miniorange_oauth_client\mOOAuthLogout;
use Drupal\miniorange_oauth_client\mOUserRegistration;
use Drupal\profile\Entity\ProfileType;
use Drupal\Core\Entity\EntityStorageException;
class miniorange_oauth_clientController extends ControllerBase
{
public static function miniorange_oauth_client_mo_login()
{
$et = \Drupal::service("\x73\x65\163\163\x69\x6f\x6e");
$R7 = \Drupal::moduleHandler();
$Za = \Drupal::service("\x63\165\x72\162\145\156\164\x5f\162\157\x75\x74\145\137\x6d\141\x74\143\x68")->getParameter("\141\160\160\x5f\x6e\x61\155\145");
if (!(session_status() == PHP_SESSION_NONE)) {
goto R7;
}
session_start();
R7:
if (!(!empty($Za) && (new appValues($Za))->grantTypevalue == "\x69\155\160\154\151\143\151\164")) {
goto ur;
}
if (!(isset($_SERVER["\121\x55\x45\122\x59\x5f\x53\124\x52\111\116\x47"]) && !empty($_SERVER["\121\x55\105\x52\x59\137\123\124\122\111\x4e\107"]))) {
goto bS;
}
$XG = $_GET;
bS:
if (!(!isset($_COOKIE["\154\157\x67\151\x6e\137\161\x75\x65\162\171"]) && empty($_SERVER["\x51\125\x45\x52\131\137\123\x54\x52\111\116\107"]))) {
goto PN;
}
echo "\74\163\143\162\x69\160\164\x20\164\x79\x70\x65\x3d\42\164\145\170\164\57\x6a\x61\166\x61\163\143\162\x69\x70\x74\x22\x3e\xd\12\x20\x20\40\40\40\x20\40\40\40\40\40\40\166\141\x72\x20\161\x66\x72\x61\147\x6d\145\156\x74\x20\x3d\40\167\151\156\x64\x6f\x77\56\154\x6f\143\x61\164\x69\x6f\x6e\56\x68\141\163\x68\x3b\xd\xa\40\x20\x20\x20\40\x20\40\x20\40\x20\40\x20\143\157\x6e\x73\164\40\x63\x75\162\x72\145\x6e\x74\x70\x61\164\x68\40\x3d\40\x77\x69\156\144\x6f\x77\56\154\x6f\x63\x61\x74\151\x6f\x6e\x2e\x70\x72\x6f\x74\x6f\x63\157\154\x20\53\40\167\151\x6e\x64\157\167\x2e\154\x6f\x63\141\x74\x69\157\156\x2e\160\x61\164\150\156\141\x6d\145\73\15\xa\x20\40\40\x20\x20\40\x20\40\40\x20\x20\x20\161\x66\x72\141\147\155\x65\x6e\164\x20\x3d\x20\x71\146\x72\141\x67\155\x65\156\164\56\163\160\154\151\x74\x28\x22\x23\42\51\133\x31\135\x3b\15\12\x20\40\x20\40\x20\40\40\x20\40\x20\40\40\x64\157\143\x75\x6d\x65\156\x74\x2e\x63\157\157\x6b\x69\145\40\x3d\x20\42\154\157\147\x69\x6e\137\161\165\x65\x72\x79\75\42\x20\53\x20\161\x66\x72\x61\x67\155\145\x6e\x74\x3b\xd\12\40\40\x20\x20\x20\40\x20\40\x20\x20\40\40\x77\151\156\144\x6f\167\x2e\154\x6f\143\141\164\x69\157\x6e\56\x68\162\145\146\40\75\x20\x63\165\x72\x72\145\x6e\x74\x70\141\x74\150\x20\53\40\x22\77\42\x20\x2b\x20\x71\x66\x72\141\147\155\145\156\164\73\15\12\x20\x20\x20\40\40\x20\40\x20\x3c\57\163\x63\162\151\x70\164\x3e";
exit;
PN:
if (!(isset($_COOKIE["\x6c\157\147\151\x6e\137\161\165\x65\162\171"]) && !empty($_COOKIE["\x6c\157\x67\151\x6e\137\161\165\x65\162\171"]))) {
goto Ir;
}
$Dv = $_COOKIE["\154\x6f\x67\151\156\137\x71\x75\x65\x72\x79"];
$E7 = explode("\x26", $Dv);
$XG = [];
foreach ($E7 as $Le) {
$Rp = explode("\x3d", $Le);
if (!(sizeof($Rp) > 1)) {
goto Oj;
}
$XG[$Rp[0]] = $Rp[1];
Oj:
t_:
}
Pk:
Ir:
$R7->invokeAll("\x6d\x6f\x5f\160\x72\x65\x5f\x61\x75\x74\150\137\x72\x65\x73\x70\x6f\156\x73\x65\137\160\162\x6f\143\145\x73\x73", [$XG]);
ImplicitGrant::validate_token_and_state($XG);
$av = isset($XG["\163\x74\x61\x74\x65"]) ? $XG["\x73\x74\141\164\x65"] : '';
$a5 = Utilities::decodeState($av);
$fY = isset($a5["\164\145\x73\x74\163\x73\x6f"]) ? $a5["\164\x65\x73\x74\x73\163\157"] === true ? true : false : false;
$O_ = $et->get("\141\x70\x70\156\x61\x6d\145");
$N0 = new appValues($O_);
$BO = $N0->get_appType();
$F3 = $N0->loginflowtype;
if ($BO == "\103\165\x73\164\x6f\x6d\137\117\160\145\156\x5f\151\144" || $F3 == "\x4f\160\x65\x6e\x49\x44") {
goto de;
}
$FT = isset($XG["\141\143\143\145\x73\x73\x5f\x74\x6f\x6b\145\156"]) && !empty($XG["\141\143\x63\145\x73\x73\x5f\x74\157\x6b\x65\156"]) ? $XG["\x61\143\143\145\x73\x73\137\x74\157\x6b\145\x6e"] : '';
goto Xx;
de:
$FT = isset($XG["\151\x64\x5f\164\x6f\x6b\x65\156"]) && !empty($XG["\x69\x64\137\x74\157\x6b\x65\x6e"]) ? $XG["\151\x64\137\164\x6f\x6b\145\156"] : '';
Xx:
if (!(empty($FT) && isset($XG["\164\x6f\153\x65\x6e"]) && !empty($XG["\x74\157\153\145\x6e"]))) {
goto zl;
}
$FT = $XG["\x74\157\153\x65\x6e"];
zl:
Utilities::save_tokens_in_cookie_and_session($XG, new appValues($O_), $fY);
$ag = new ImplicitGrant($O_);
return $ag->mo_oauth_client_mo_login($N0, $FT, $XG);
ur:
$R7->invokeAll("\x6d\157\137\160\162\145\137\x61\x75\x74\150\x5f\162\145\163\x70\x6f\x6e\x73\x65\x5f\x70\162\x6f\x63\x65\163\163", [$_GET]);
$pv = isset($_GET["\143\157\144\x65"]) ? $_GET["\x63\157\x64\145"] : '';
$pv = Html::escape($pv);
$av = isset($_GET["\x73\164\x61\x74\x65"]) ? $_GET["\163\x74\x61\x74\145"] : '';
$av = Html::escape($av);
$a5 = Utilities::decodeState($av);
$fY = isset($a5["\164\x65\x73\164\163\163\x6f"]) ? $a5["\164\145\163\x74\163\163\x6f"] === true ? true : false : false;
$Za = self::validate_code_and_state($pv, $av, $fY);
$et->remove("\157\141\x75\x74\x68\62\x73\x74\x61\x74\x65");
$N0 = new appValues($Za);
$BO = $N0->get_appType();
$F3 = $N0->loginflowtype;
[$z1, $CJ] = $BO == "\103\165\163\x74\x6f\155\137\x4f\160\145\x6e\x5f\x69\144" || $F3 == "\117\160\x65\156\x49\x44" ? self::implement_openid_flow($N0, $pv, '', $fY) : self::implement_oauth_flow($N0, $pv, '', $fY);
$H0 = self::flattenArray($CJ);
if (!$fY) {
goto ZL;
}
self::Test_Configuration($H0, $N0->appName);
ZL:
return self::performSSOinDrupal($CJ, $H0, $N0, $z1, $av);
}
public static function flattenArray($Af, $Aj = '')
{
$jw = array();
foreach ($Af as $Rp => $Le) {
$qH = $Aj . $Rp;
if (is_array($Le)) {
goto sK;
}
$jw[$qH] = $Le;
goto Zp;
sK:
$jw = array_merge($jw, self::flattenArray($Le, $qH . "\x3e"));
Zp:
Qr:
}
g2:
return $jw;
}
public static function mo_oauth_attr_map($A1, $ti, $gf = "\141\x74\x74\x72")
{
$Bu = array();
foreach ($A1 as $Rp => $Le) {
if (!(!empty($Le) && !empty($ti[$Rp]))) {
goto ge;
}
if (array_key_exists($Le, $Bu) && $gf == "\x72\157\x6c\x65") {
goto VT;
}
$Bu[trim($Le, "\x20")] = $ti[$Rp];
goto My;
VT:
if ($Bu[$Le][-1] != "\73") {
goto SC;
}
$Bu[trim($Le, "\x20")] = $Bu[$Le] . $ti[$Rp];
goto Rp;
SC:
$Bu[trim($Le, "\x20")] = $Bu[$Le] . "\x3b" . $ti[$Rp];
Rp:
My:
ge:
dA:
}
p8:
return $Bu;
}
public static function to_explode_semicolon($oK)
{
$sQ = array();
foreach ($oK as $Rp => $kR) {
$kR = explode("\73", $kR);
$sQ[$Rp] = $kR;
AO:
}
o5:
return $sQ;
}
public static function create_profile($gK, $kW, $N0)
{
if (\Drupal::service("\x6d\x6f\144\165\x6c\145\x5f\x68\x61\x6e\144\154\x65\162")->moduleExists("\160\x72\x6f\x66\x69\x6c\x65")) {
goto Vm;
}
return new Response();
Vm:
$kp = $N0->enable_profile_mapping;
if ($kp) {
goto ws;
}
return new Response();
ws:
$aQ = $N0->profile_entity_type;
$xV = isset($kW->toArray()[$aQ . "\137\x70\162\x6f\x66\151\154\145\x73"][0]) ? $kW->toArray()[$aQ . "\x5f\160\x72\157\x66\151\x6c\x65\163"][0]["\164\141\162\147\x65\164\137\151\144"] : NULL;
$xB = ProfileType::load($aQ);
$fR = $xB->toArray()["\x72\x6f\154\145\x73"];
$zM = $kW->getRoles();
if (!(!empty(array_intersect($fR, $zM)) || empty($fR))) {
goto yR;
}
if (!is_null($xV)) {
goto GW;
}
try {
$XQ = Profile::create(["\x74\x79\x70\x65" => $aQ, "\x75\151\144" => $kW->id(), "\x66\151\145\x6c\x64\x5f\141\147\162\x65\x65\137\x74\145\x72\x6d\x73" => 1]);
$XQ->save();
$xV = $XQ->toArray()["\160\162\x6f\146\x69\x6c\145\x5f\151\x64"][0]["\x76\x61\x6c\x75\x65"];
} catch (EntityStorageException $SD) {
\Drupal::logger("\155\x69\156\151\157\x72\x61\156\x67\x65\x5f\157\x61\x75\164\150\x5f\143\154\x69\145\x6e\x74")->notice("\x45\156\164\151\x74\171\x53\x74\157\162\141\x67\145\105\170\x63\x65\x70\164\x69\157\x6e\72\40\105\x72\162\157\162\x20\167\150\x69\x6c\145\x20\143\x72\x65\x61\164\x69\x6e\147\40\x61\156\x64\40\x73\141\x76\151\x6e\x67\x20\x74\x68\145\x20\160\x72\157\x66\151\x6c\145\40\164\x79\x70\x65\x2e");
}
GW:
if (empty($gK)) {
goto CC;
}
foreach ($gK as $Rp => $Le) {
$XQ = Profile::load($xV);
$XQ->set($Rp, $Le);
SU:
}
v9:
$XQ->save();
CC:
yR:
}
public static function perform_role_mapping($N0, $Bj, $kW, $F6, $dr = '')
{
$TL = $N0->get_roleAttribute();
$Xk = $N0->get_enableRolemapping();
$lo = $N0->get_disableRoleUpdate();
$UZ = $N0->get_roleMap();
$UZ = !empty($UZ) ? $UZ : array();
$UU = array();
$Y0 = array();
foreach ($UZ as $Rp) {
if (!($Rp["\165\163\x65\162\x5f\163\x70\x5f\x72\x6f\x6c\x65\137\156\x61\155\x65"] != '' && $Rp["\x75\x73\x65\x72\137\151\144\160\x5f\x72\157\x6c\x65\x5f\x6e\141\155\145"] != '')) {
goto d1;
}
array_push($UU, $Rp["\x75\x73\x65\162\x5f\163\x70\137\x72\157\x6c\x65\x5f\x6e\x61\155\x65"]);
array_push($Y0, $Rp["\x75\x73\145\x72\x5f\151\x64\160\137\x72\157\154\145\137\156\x61\155\145"]);
d1:
AK:
}
DF:
$hl = self::mo_oauth_attr_map($UU, $Y0, "\162\157\154\145");
$Fh = array();
if (!is_array($F6) && !empty($F6)) {
goto zX;
}
$Fh = is_array($F6) ? $F6 : [];
goto iJ;
zX:
$F6 = str_replace(["\133", "\135"], '', $F6);
$F6 = explode("\54", $F6);
foreach ($F6 as $Rp => $Le) {
$Fh[] = str_replace("\42", '', trim($Le));
w2:
}
ao:
iJ:
if (!($Xk && !is_null($TL) && !empty($TL))) {
goto nb;
}
$VD = $kW->getRoles();
if ($lo) {
goto Id;
}
foreach ($VD as $Rp => $Le) {
if (in_array($Le, array_keys($hl))) {
goto Ex;
}
if (!($Le != $N0->get_defaultRole())) {
goto sQ;
}
$kW->removeRole($Le);
$kW->save();
sQ:
Ex:
yt:
}
p2:
Id:
foreach ($hl as $Rp => $Le) {
$hk = FALSE;
$yR = explode("\73", $Le);
foreach ($yR as $qz => $Re) {
if (strpos($Re, "\x26") !== false) {
goto T1;
}
if (!in_array($Re, $Fh)) {
goto JY;
}
$hk = TRUE;
goto bJ;
JY:
goto ST;
T1:
$rR = true;
$JT = explode("\46", $Re);
foreach ($JT as $su => $Ox) {
if (in_array($Ox, $Fh)) {
goto aJ;
}
$rR = false;
goto q8;
aJ:
dg:
}
q8:
$hk = $rR ? TRUE : FALSE;
if (!$hk) {
goto r9;
}
goto bJ;
r9:
ST:
Yw:
}
bJ:
if ($hk && $Rp != "\x61\165\x74\150\145\x6e\164\151\x63\141\x74\x65\144") {
goto Io;
}
$kW->removeRole($Rp);
$kW->save();
goto Qw;
Io:
$kW->addRole($Rp);
$kW->save();
Qw:
OS:
}
hJ:
nb:
}
public static function getToken($gB, $q3, $QT, $C5, $pv, $oH, $SU, $BA, $Za, $fY = false, $ga = '')
{
$base_url = \Drupal::request()->getSchemeAndHttpHost() . \Drupal::request()->getBasePath();
$et = \Drupal::service("\163\145\x73\163\151\x6f\156");
$N0 = new appValues($Za);
$ge = array();
$Hx = $N0->scope;
if ($q3 == "\x61\165\164\x68\157\x72\x69\172\141\164\x69\x6f\156\x5f\143\157\144\145\x5f\x77\151\x74\150\137\160\x6b\143\x65") {
goto yP;
}
if ($q3 == "\162\x65\x66\x72\145\163\x68\137\x74\x6f\153\x65\156") {
goto XA;
}
if ($SU && !$BA) {
goto Cv;
}
if (!$SU && $BA) {
goto Sk;
}
$ge = Utilities::callService($gB, "\x72\x65\144\x69\162\x65\143\164\x5f\x75\x72\151\75" . urlencode($oH) . "\46\x67\x72\x61\x6e\x74\137\x74\x79\160\x65\x3d" . $q3 . "\x26\143\154\151\145\156\x74\137\151\144\75" . urlencode($QT) . "\x26\x63\154\151\x65\156\x74\x5f\x73\145\143\162\x65\164\x3d" . urlencode($C5) . "\46\143\157\x64\x65\75" . $pv, array("\x41\165\164\150\157\x72\151\172\141\x74\x69\x6f\x6e" => "\x42\x61\163\x69\x63\x20" . base64_encode($QT . "\x3a" . $C5), "\101\143\x63\145\x70\x74" => "\x61\160\160\x6c\x69\x63\141\x74\151\157\156\x2f\x6a\x73\x6f\156", "\103\x6f\x6e\164\x65\156\164\x2d\x54\171\160\x65" => "\141\x70\160\154\151\143\x61\164\151\157\x6e\57\170\55\167\167\167\x2d\146\x6f\x72\155\55\x75\162\x6c\145\156\x63\x6f\x64\x65\x64"), '', $fY);
goto u4;
Sk:
$ge = Utilities::callService($gB, "\162\145\144\x69\x72\145\x63\x74\137\x75\162\151\x3d" . urlencode($oH) . "\46\147\162\141\x6e\x74\137\164\171\x70\x65\75" . $q3 . "\46\143\154\x69\145\156\x74\137\151\x64\75" . urlencode($QT) . "\x26\x63\x6c\x69\x65\156\x74\x5f\163\145\x63\x72\x65\164\75" . urlencode($C5) . "\x26\x63\157\x64\x65\x3d" . $pv, array("\101\x63\143\145\x70\164" => "\x61\x70\160\x6c\151\143\141\x74\x69\x6f\x6e\57\152\x73\x6f\x6e", "\x43\157\156\164\145\156\x74\55\x54\x79\x70\145" => "\141\160\x70\x6c\151\x63\x61\x74\151\x6f\x6e\57\170\55\167\167\167\x2d\x66\x6f\x72\x6d\x2d\x75\162\154\x65\x6e\143\157\x64\x65\144"), '', $fY);
u4:
goto Le;
Cv:
$ge = Utilities::callService($gB, "\162\145\x64\151\162\145\143\164\x5f\x75\x72\x69\75" . urlencode($oH) . "\x26\x67\162\141\x6e\x74\137\x74\x79\160\145\x3d" . $q3 . "\46\x63\157\x64\x65\x3d" . $pv, array("\x41\165\x74\x68\x6f\162\151\x7a\x61\x74\151\x6f\x6e" => "\x42\141\x73\151\143\x20" . base64_encode($QT . "\72" . $C5), "\101\x63\x63\x65\x70\x74" => "\141\x70\x70\154\x69\143\x61\x74\x69\157\x6e\57\152\x73\157\x6e", "\x43\x6f\156\164\145\156\x74\55\x54\x79\x70\x65" => "\141\x70\x70\x6c\151\x63\x61\x74\151\157\x6e\x2f\170\55\x77\167\x77\55\x66\157\x72\155\55\165\162\154\145\x6e\143\x6f\x64\145\144"), '', $fY);
Le:
goto Hm;
yP:
$E9 = $et->get("\x63\157\144\x65\x56\145\x72\x69\x66\151\x65\x72");
$et->remove("\x63\x6f\x64\x65\126\145\x72\x69\x66\x69\145\x72");
$ge = Utilities::callService($gB, "\162\145\144\151\x72\145\x63\x74\137\x75\x72\x69\75" . urlencode($oH) . "\x26\x67\162\141\x6e\164\x5f\x74\x79\x70\145\75\x61\165\164\150\157\x72\x69\172\x61\x74\151\x6f\156\x5f\x63\x6f\144\145" . "\x26\143\157\144\145\75" . $pv . "\46\x63\157\x64\145\137\x76\145\x72\x69\x66\x69\x65\x72\x3d" . $E9 . "\46\143\154\151\145\156\164\137\151\144\75" . urlencode($QT), array("\x41\143\143\145\x70\164" => "\x61\160\x70\x6c\151\143\141\x74\x69\157\x6e\57\x6a\163\157\x6e", "\x43\x6f\156\x74\145\x6e\164\x2d\x54\x79\160\145" => "\141\160\x70\x6c\x69\x63\x61\164\x69\157\x6e\57\170\x2d\167\x77\x77\x2d\x66\x6f\x72\x6d\x2d\x75\x72\x6c\x65\156\143\157\x64\145\x64", "\117\162\151\x67\x69\156" => $base_url), '', $fY);
goto Hm;
XA:
$iM = [];
$Dn = "\162\x65\x64\151\x72\145\x63\x74\137\165\162\151\x3d" . urlencode($oH) . "\46\x67\x72\x61\x6e\164\x5f\164\171\x70\x65\75" . $q3 . "\46\162\145\146\x72\145\163\x68\137\164\157\x6b\x65\156\x3d" . $ga;
if (!$SU) {
goto zr;
}
$iM = ["\x41\x75\164\x68\157\162\151\x7a\141\x74\x69\157\x6e" => "\102\141\163\x69\143\40" . base64_encode($QT . "\x3a" . $C5), "\101\x63\x63\x65\160\164" => "\x61\160\x70\154\151\143\x61\164\151\157\x6e\x2f\152\163\x6f\x6e", "\103\157\156\x74\x65\156\x74\55\x54\171\160\x65" => "\x61\160\x70\154\x69\143\x61\164\151\157\156\57\x78\55\167\x77\167\55\x66\157\x72\x6d\x2d\165\162\154\145\x6e\x63\x6f\144\x65\144"];
zr:
if (!$BA) {
goto qS;
}
$Dn = $Dn . "\x26\143\x6c\151\145\156\164\x5f\x69\x64\75" . urlencode($QT) . "\x26\x63\154\151\x65\156\x74\137\163\x65\x63\x72\145\x74\75" . urlencode($C5);
qS:
$ge = Utilities::callService($gB, $Dn, $iM, '', $fY);
Hm:
$XL = json_decode($ge, true);
if (isset($XL["\x61\143\143\145\163\163\x5f\164\157\x6b\x65\156"]) || isset($XL["\x69\144\137\x74\x6f\x6b\x65\156"])) {
goto xa;
}
\Drupal::logger("\x6d\151\156\151\157\162\141\156\x67\145\x5f\157\141\x75\x74\150\x5f\143\154\x69\145\x6e\x74")->error("\x49\156\166\x61\x6c\x69\x64\40\x72\x65\163\160\157\156\x73\x65\40\x72\145\x63\x65\151\x76\x65\144\40\x77\x68\x69\154\x65\x20\x66\145\164\x63\150\x69\x6e\x67\x20\141\143\143\x65\163\x73\40\x74\157\x6b\145\156\40\146\162\x6f\x6d\40\165\x72\x6c\55\74\x62\x72\x3e\40{$gB}\40\x3c\142\162\x3e\x3c\142\x72\76\x20\122\x65\x73\160\x6f\x6e\x73\x65\40\x3d\76\40\74\x70\x72\145\76\74\x63\x6f\x64\145\76" . print_r($XL, TRUE) . "\x3c\160\162\x65\76\x3c\x63\x6f\x64\x65\76");
if ($q3 == "\x72\x65\146\x72\x65\x73\x68\x5f\164\x6f\x6b\x65\156") {
goto Xf;
}
if ($fY) {
goto kY;
}
Utilities::anonymousRedirect('', '', "\123\x6f\155\x65\164\x68\x69\x6e\x67\40\x77\x65\x6e\x74\x20\167\162\x6f\156\147\54\x20\x50\154\x65\x61\163\x65\40\143\x6f\x6e\164\x61\x63\x74\x20\x74\150\145\40\x73\151\164\145\40\141\x64\155\x69\156\151\163\x74\162\141\x74\x6f\x72\x2e");
goto bb;
Xf:
\Drupal::logger("\x6d\x6f\137\x73\x65\163\x73\x69\x6f\156\137\155\141\156\141\147\145\162")->warning("\x61\143\143\145\163\163\x20\164\157\x6b\x65\156\x20\x72\145\156\145\167\x61\x6c\40\x66\141\151\154\145\x64\x2e\74\142\162\76\x20\x72\x65\x73\160\x6f\x6e\163\145\x20\75\40\47\x25\162\145\x73\160\157\156\x73\x65\47\40", ["\45\162\145\163\160\x6f\156\x73\x65" => print_r($XL, TRUE)]);
goto bb;
kY:
Utilities::show_error_message_testconfig("\x49\x6e\166\141\154\151\144\40\x72\x65\x73\160\157\x6e\x73\145\x20\x72\145\143\x65\x69\166\x65\x64\40\167\150\151\x6c\145\x20\x66\145\164\x63\x68\x69\x6e\147\x20\141\143\143\145\x73\163\x20\164\x6f\x6b\145\156\x20\146\162\x6f\x6d\40\165\x72\x6c\55\x3c\x62\162\76{$gB}\x20\74\142\x72\76\74\142\x72\x3e\x20\122\145\x73\x70\x6f\x6e\x73\145\40\x3d\76\40\74\160\x72\x65\76\74\143\x6f\x64\x65\76" . print_r($XL, TRUE) . "\x3c\x70\162\145\76\74\x63\157\x64\145\x3e");
bb:
xa:
Utilities::save_tokens_in_cookie_and_session($XL, new appValues($Za), $fY);
return $XL;
}
public static function validate_code_and_state($pv, $av, $fY)
{
$et = \Drupal::service("\x73\x65\x73\x73\x69\157\x6e");
if (empty($pv)) {
goto tU;
}
if (empty($av)) {
goto zs;
}
$Za = '';
$av = Utilities::decodeState($av);
if (!empty($et->get("\141\x70\x70\x6e\141\155\145"))) {
goto u6;
}
if (!(isset($av["\x61\x70\x70\156\x61\155\145"]) && !empty($av["\x61\x70\x70\156\x61\x6d\145"]))) {
goto Yf;
}
$Za = $av["\x61\x70\160\x6e\141\155\145"];
Yf:
goto R5;
u6:
$Za = $et->get("\x61\160\x70\x6e\141\x6d\145");
R5:
if (!empty($Za)) {
goto mm;
}
\Drupal::logger("\155\x69\156\x69\157\162\x61\156\147\x65\137\157\141\x75\x74\150\x5f\143\154\151\145\156\x74")->error("\111\156\x76\141\x6c\151\144\40\x73\164\141\164\x65\40\160\141\162\x61\155\145\x74\x65\162");
if ($fY) {
goto wC;
}
Utilities::anonymousRedirect();
goto wi;
wC:
Utilities::show_error_message_testconfig("\x49\x6e\166\x61\x6c\151\144\x20\x73\164\141\164\145\x20\x70\x61\x72\x61\155\145\164\145\x72");
wi:
mm:
goto um;
tU:
\Drupal::logger("\155\x69\156\151\x6f\x72\x61\156\147\145\137\157\x61\x75\x74\150\x5f\143\154\151\x65\x6e\x74")->error("\x3c\x70\x72\145\x3e\x3c\x63\157\x64\145\x3e" . print_r($_GET, true) . "\74\160\x72\145\76\74\143\x6f\x64\x65\76");
if ($fY) {
goto y5;
}
Utilities::anonymousRedirect();
goto Cn;
y5:
Utilities::show_error_message_testconfig("\x3c\x70\x72\x65\76\74\143\x6f\x64\145\x3e" . print_r($_GET, true) . "\x3c\x70\x72\145\76\x3c\x63\157\x64\145\76");
Cn:
goto um;
zs:
$eL = DBQueries::get_all_app_names_with_oauth_login_enabled();
return $eL[0]->app_name;
um:
return $Za;
}
public static function implement_openid_flow($N0, $pW = '', $hc = '', $fY = false)
{
$pv = $pW;
$T5 = $N0->get_valuesInHeader();
$p_ = $N0->get_valuesInBody();
$q3 = $N0->grantTypevalue;
$pv = $pW;
$t0 = Utilities::getCallbackUrl($N0->appName);
if (!(!$T5 == TRUE || !$T5 == 1)) {
goto os;
}
$T5 = false;
os:
if (!(!$p_ == TRUE || !$p_ == 1)) {
goto ZB;
}
$p_ = false;
ZB:
if ($q3 == "\x70\141\x73\x73\167\x6f\x72\144") {
goto a2;
}
$z1 = self::getToken($N0->get_accessTokenEndpoint(), $q3, $N0->get_clientId(), $N0->get_clientSecret(), $pv, $t0, $T5, $p_, $N0->appName, $fY);
goto Ko;
a2:
$z1 = $hc->getToken($N0, $fY);
Ko:
if (isset($z1["\x69\144\137\164\157\153\145\156"])) {
goto VG;
}
\Drupal::logger("\155\x69\x6e\x69\x6f\x72\x61\x6e\147\145\137\157\x61\165\x74\x68\137\x63\154\151\x65\x6e\164")->error("\124\150\145\40\x4f\x41\x75\x74\x68\x20\x72\x65\x73\x70\x6f\156\x73\145\x20\x64\157\x65\163\x6e\47\164\40\x63\x6f\x6e\164\x61\151\156\40\141\x6e\x20\x49\x44\x20\164\x6f\x6b\x65\156\56\x20\x50\154\x65\x61\163\x65\x20\x74\x72\171\40\163\145\154\145\143\x74\151\156\147\40\47\x4f\x41\165\x74\x68\40\62\56\60\x20\x41\160\x70\x6c\151\143\x61\x74\151\x6f\x6e\47\40\146\x72\157\x6d\x20\x74\150\x65\40\x27\x53\145\x6c\x65\x63\x74\x20\x41\x70\x70\154\x69\143\141\164\151\x6f\x6e\x20\x54\171\160\x65\47\x20\162\x61\144\x69\157\x20\142\165\164\x74\157\x6e\54\x20\151\x66\40\x69\164\x20\143\157\x6e\x74\141\151\156\x73\40\x61\x6e\x20\141\143\x63\145\163\x73\40\x74\157\x6b\x65\156\x2e\74\142\x72\x3e\74\x62\x72\76\x3c\142\x3e\122\145\163\160\x6f\x6e\163\145\40\72\x20\74\57\142\76\74\x70\x72\145\x3e\74\143\157\x64\145\x3e" . print_r($z1, true) . "\x3c\57\143\x6f\144\x65\76\x3c\x2f\160\x72\145\x3e");
if ($fY) {
goto Rm;
}
Utilities::anonymousRedirect('', '', "\x53\157\155\145\164\150\x69\x6e\147\x20\167\145\156\164\40\167\162\x6f\x6e\x67\x2c\x20\x50\154\145\x61\163\x65\40\x63\x6f\x6e\x74\141\143\x74\40\164\150\x65\x20\163\151\x74\x65\x20\x61\x64\155\151\156\x69\163\x74\162\141\x74\x6f\162\56");
goto pH;
Rm:
Utilities::show_error_message_testconfig("\x54\150\145\40\117\101\x75\x74\x68\x20\162\x65\163\160\x6f\x6e\163\x65\x20\144\x6f\x65\163\x6e\47\x74\40\143\157\156\x74\x61\x69\156\40\x61\156\40\111\x44\x20\164\157\153\x65\x6e\x2e\40\120\x6c\145\141\x73\145\40\x74\x72\x79\40\x73\x65\x6c\x65\x63\x74\x69\156\x67\x20\47\x4f\x41\x75\164\x68\x20\x32\x2e\x30\x20\x41\x70\160\154\x69\x63\141\164\x69\x6f\x6e\47\40\146\x72\157\155\x20\164\x68\x65\x20\47\x53\145\154\145\x63\x74\40\x41\160\160\154\x69\x63\x61\x74\151\157\156\40\124\171\160\145\x27\x20\162\141\144\x69\x6f\x20\x62\165\x74\x74\x6f\156\x2c\x20\x69\x66\40\x69\x74\x20\143\x6f\156\x74\141\x69\156\163\x20\x61\x6e\x20\141\143\x63\x65\163\x73\x20\x74\157\153\145\x6e\56\74\x62\162\76\74\x62\x72\76\74\142\x3e\122\145\x73\x70\x6f\156\x73\145\x20\x3a\40\74\57\x62\x3e\74\x70\x72\x65\x3e\74\143\x6f\x64\x65\76" . print_r($z1, true) . "\x3c\x2f\x63\157\144\145\x3e\x3c\x2f\160\162\x65\76");
pH:
VG:
$sv = new HandleJWT($N0, $z1["\x69\144\x5f\164\157\x6b\x65\x6e"], $fY);
$CJ = $sv->getUserAttributesFromIDToken();
return [$z1, $CJ];
}
public static function implement_oauth_flow($N0, $pW = '', $hc = '', $fY = false)
{
$T5 = $N0->get_valuesInHeader();
$p_ = $N0->get_valuesInBody();
$u3 = $N0->appName;
$q3 = $N0->grantTypevalue;
$pv = $pW;
$t0 = Utilities::getCallbackUrl($N0->appName);
$va = \Drupal::config("\x6d\151\x6e\151\x6f\x72\x61\156\x67\x65\x5f\x6f\141\x75\x74\x68\137\x63\154\x69\x65\156\164\x2e\x73\145\x74\164\151\x6e\147\163")->get("\x6d\x69\x6e\x69\x6f\x72\x61\156\147\145\x5f\157\141\x75\x74\150\x5f\143\x6c\151\x65\x6e\x74\x5f\x67\162\157\165\160\x5f\151\x6e\146\157\x5f\x65\160\x5f" . $u3);
if (!(!$T5 == TRUE || !$T5 == 1)) {
goto uV;
}
$T5 = false;
uV:
if (!(!$p_ == TRUE || !$p_ == 1)) {
goto p9;
}
$p_ = false;
p9:
if ($q3 == "\160\141\163\x73\x77\157\x72\144" && !empty($hc)) {
goto Ho;
}
$z1 = self::getToken($N0->get_accessTokenEndpoint(), $q3, $N0->get_clientId(), $N0->get_clientSecret(), $pv, $t0, $T5, $p_, $u3, $fY);
goto ke;
Ho:
$z1 = $hc->getToken($N0, $fY);
ke:
if (isset($z1["\141\143\x63\x65\163\x73\137\x74\x6f\153\145\x6e"])) {
goto XF;
}
\Drupal::logger("\x6d\x69\156\x69\157\x72\x61\156\147\x65\137\157\x61\165\x74\150\137\143\154\151\145\156\164")->error("\x54\x68\145\40\x4f\101\165\x74\150\x20\x72\145\x73\160\x6f\156\163\x65\x20\144\157\x65\x73\156\x27\x74\40\x63\157\x6e\x74\x61\151\156\x20\141\x6e\40\x61\x63\x63\x65\163\163\x20\x74\157\153\x65\156\x2e\40\x50\x6c\x65\x61\163\x65\40\164\x72\171\40\x73\145\154\x65\x63\x74\x69\156\x67\40\x27\x4f\x70\145\156\111\x44\x20\103\157\x6e\156\x65\143\164\x20\x41\160\x70\x6c\151\143\141\164\x69\157\156\x27\x20\146\162\157\x6d\x20\164\x68\145\x20\x27\x53\145\x6c\145\143\164\x20\101\x70\160\154\151\143\x61\164\151\x6f\156\40\x54\x79\x70\x65\x27\40\162\141\144\151\x6f\40\x62\x75\x74\x74\x6f\156\x2c\40\x69\146\40\151\164\40\x63\x6f\x6e\x74\141\x69\x6e\163\40\x61\156\x20\111\104\40\164\x6f\x6b\145\x6e\x2e\x3c\x62\162\76\74\142\162\x3e\x3c\142\x3e\122\x65\163\160\157\156\163\145\x20\x3a\x20\74\x2f\142\x3e\74\x70\x72\145\x3e\74\143\x6f\x64\145\x3e" . print_r($z1, true) . "\x3c\x2f\x63\157\x64\x65\x3e\x3c\57\x70\x72\x65\76");
if ($fY) {
goto ap;
}
Utilities::anonymousRedirect('', '', "\x53\157\155\145\x74\x68\151\x6e\x67\40\167\x65\156\x74\x20\x77\162\157\156\147\x2c\40\120\x6c\145\x61\x73\x65\40\143\x6f\156\x74\141\143\164\x20\164\x68\x65\40\163\x69\x74\x65\x20\141\144\155\x69\x6e\x69\163\x74\x72\141\164\x6f\x72\x2e");
goto MH;
ap:
Utilities::show_error_message_testconfig("\124\x68\145\40\117\101\165\164\150\40\162\x65\163\160\157\156\163\145\40\x64\157\x65\163\156\x27\x74\x20\143\157\x6e\x74\x61\x69\x6e\40\x61\x6e\x20\141\x63\x63\145\x73\x73\40\x74\x6f\x6b\145\156\56\40\120\154\x65\141\163\145\x20\164\162\x79\x20\163\x65\154\x65\143\x74\x69\x6e\x67\x20\x27\117\160\145\x6e\x49\x44\40\103\x6f\156\156\x65\143\x74\40\101\160\160\x6c\x69\x63\141\x74\151\x6f\156\47\40\146\162\x6f\x6d\40\164\150\x65\40\x27\123\145\x6c\145\143\164\40\101\160\x70\x6c\x69\x63\141\x74\x69\157\156\40\124\x79\x70\145\x27\x20\x72\141\144\x69\x6f\x20\142\x75\x74\x74\x6f\156\54\40\151\x66\40\x69\x74\x20\143\157\156\x74\141\151\156\x73\x20\x61\x6e\x20\111\104\x20\164\x6f\x6b\145\x6e\56\x3c\142\x72\76\74\142\162\76\74\x62\x3e\122\145\x73\x70\x6f\x6e\163\145\x20\72\40\x3c\57\x62\76\74\x70\162\x65\x3e\x3c\x63\157\144\x65\76" . print_r($z1, true) . "\74\x2f\143\157\x64\145\x3e\x3c\57\160\x72\x65\x3e");
MH:
goto qV;
XF:
$G5 = $z1["\141\143\143\145\163\x73\x5f\164\x6f\153\x65\x6e"];
qV:
$Qs = $N0->get_userInfoEndpoint();
if (!(substr($Qs, -1) == "\75")) {
goto aE;
}
$Qs .= $G5;
aE:
$CJ = self::getResourceOwner($Qs, $G5, $fY);
if (empty($va)) {
goto Qx;
}
$PL = Utilities::getGroupsInfo($va, $G5, $fY);
$PL = !empty($PL) ? $PL : [];
$CJ = array_merge($CJ, $PL);
Qx:
return [$z1, $CJ];
}
public static function final_redirect_url_after_login($av, $GB, $dQ)
{
$av = Utilities::decodeState($av);
$Id = '';
if (isset($av["\x64\145\163\164\x69\x6e\x61\164\x69\x6f\156"]) && !empty($av["\x64\145\163\164\x69\x6e\x61\x74\x69\157\x6e"])) {
goto vT;
}
if (isset($av["\x72\x65\163\x74\162\151\x63\x74\145\144\160\141\x67\x65\x64\x65\x73\164\x69\x6e\x61\164\x69\x6f\156"]) && !empty($av["\x72\x65\x73\x74\x72\x69\x63\x74\x65\144\x70\x61\147\x65\144\x65\163\x74\151\156\141\x74\151\157\156"])) {
goto U9;
}
if ($GB != '') {
goto hC;
}
if (isset($av["\x72\145\x66\145\x72\x65\162"]) && !empty($av["\162\145\146\145\162\145\162"])) {
goto ch;
}
$Id = Url::fromRoute("\145\x6e\x74\x69\x74\171\x2e\x75\x73\145\x72\x2e\143\141\156\x6f\x6e\151\143\x61\x6c", ["\165\163\145\x72" => $dQ])->toString();
goto wd;
ch:
$Id = $av["\x72\x65\146\145\162\145\162"];
wd:
goto YV;
hC:
$Id = $GB;
YV:
goto mV;
U9:
$Id = $av["\x72\x65\163\x74\x72\151\143\x74\x65\x64\x70\141\147\145\144\145\163\x74\151\156\141\x74\x69\157\x6e"];
mV:
goto qJ;
vT:
$Id = $av["\x64\145\x73\x74\x69\156\x61\164\151\157\x6e"];
qJ:
return $Id;
}
public static function performSSOinDrupal($CJ, $H0, $N0, $z1, $av = '')
{
$et = \Drupal::service("\163\x65\163\x73\x69\157\x6e");
$R7 = \Drupal::moduleHandler();
$R7->invokeAll("\x6d\157\137\x70\162\145\137\165\x73\x65\x72\x5f\154\157\147\151\x6e", [$CJ, $z1]);
$an = '';
$s9 = '';
$aS = '';
$gv = '';
if (empty($N0->get_emailAttr())) {
goto sV;
}
$s9 = $N0->get_emailAttr();
sV:
if (empty($N0->get_emailAttr())) {
goto bv;
}
$an = $N0->get_nameAttr();
bv:
if (!(!empty($s9) && isset($H0[$s9]))) {
goto La;
}
$gv = $H0[$s9];
La:
if (!($an != "\x53\x65\x6c\x65\143\164" && isset($H0[$an]))) {
goto o0;
}
$aS = $H0[$an];
o0:
if (!empty($gv)) {
goto z4;
}
Utilities::save_SSO_report_data("\x46\101\111\114\x55\x52\x45\56\40\x45\155\141\151\x6c\x20\156\x6f\x74\40\x6d\x61\160\x70\145\x64", $N0->appName, $aS ? $aS : "\55", "\55");
Utilities::show_sso_error_message("\x45\x6d\141\x69\x6c\x20\141\x64\144\162\145\163\163\40\156\x6f\164\x20\x72\x65\143\x65\x69\166\145\x64\56", "\120\154\x65\x61\163\145\40\x65\x6e\x73\x75\162\x65\40\x45\155\x61\x69\x6c\40\101\164\164\162\151\x62\x75\x74\x65\40\x66\x69\145\x6c\144\x20\x69\x73\40\143\157\156\x66\151\147\165\x72\145\x64\x20\x70\x72\157\160\145\x72\x6c\x79\x20\151\156\x20\164\x68\x65\40\x41\164\164\162\151\x62\x75\164\x65\40\x26\40\x52\157\x6c\145\x20\115\141\x70\160\x69\156\147\x20\x74\141\142\x20\157\146\x20\x74\150\x65\x20\x6d\157\x64\x75\x6c\x65\x2e");
z4:
$OS = Utilities::Is_Restricted_Domain($gv);
if (!$OS) {
goto aj;
}
Utilities::save_SSO_report_data("\x46\x41\111\114\x55\x52\x45\56\40\x44\x6f\x6d\141\x69\x6e\x20\122\145\163\x74\x72\x69\x63\164\145\144", $N0->appName, $aS ? $aS : "\x2d", $gv);
Utilities::anonymousRedirect('', "\x41\40\x75\x73\x65\162\x20\50\145\155\141\x69\154\x20\x2d\40\74\x69\76" . $gv . "\x3c\57\x69\76\54\x20\x75\163\145\162\x6e\141\x6d\x65\x20\55\40\x3c\151\76" . $aS . "\x3c\57\151\x3e\51\x20\167\x69\164\150\x20\x72\x65\163\164\x72\x69\143\x74\x65\x64\40\x64\x6f\155\141\151\156\x20\151\x73\40\141\164\x74\145\x6d\160\x69\x6e\x67\x20\x74\157\40\154\157\147\151\x6e", "\x59\157\165\40\141\x72\145\x20\156\157\x74\x20\141\154\x6c\x6f\167\145\x64\40\164\x6f\x20\154\157\x67\x69\x6e\40\x74\x6f\x20\164\x68\x69\163\x20\163\x69\x74\x65\54\x20\160\x6c\x65\141\x73\x65\40\x63\157\x6e\164\x61\143\x74\40\164\x68\145\x20\x73\x69\164\x65\x20\141\144\x6d\151\156\x69\163\x74\162\x61\164\157\x72\x2e");
aj:
self::is_role_allowed($N0, $CJ);
$kW = user_load_by_mail($gv);
$Xk = $N0->get_enableRolemapping();
$w5 = $N0->get_defaultRole();
if (!empty($aS)) {
goto pn;
}
$aS = $gv;
pn:
$HE = \Drupal::config("\x6d\x69\x6e\151\x6f\162\141\x6e\147\145\137\157\x61\x75\x74\x68\x5f\143\154\x69\x65\x6e\x74\x2e\163\145\x74\164\x69\x6e\147\x73")->get("\155\x69\156\x69\157\162\x61\156\x67\x65\x5f\157\x61\x75\164\x68\x5f\162\x65\x71\x75\151\x72\x65\x5f\x70\x72\x6f\x66\151\154\145\137\146\151\x65\x6c\x64");
if (isset($kW->uid)) {
goto mg;
}
$R7->invokeAll("\x6d\157\x5f\160\x72\145\x5f\x75\163\x65\162\x5f\162\145\x67\151\x73\x74\x65\162", [$CJ]);
$lk = new mOUserRegistration($N0->autocreateuser, $N0->create_disable_user, $N0->redirect_disable, $N0->redirect_unregister, $aS, $gv, $Xk, $w5, $N0->appName);
$kW = $lk->create_new_user($CJ);
mg:
$kW = User::load($kW->id());
if ($kW->isActive()) {
goto tv;
}
Utilities::anonymousRedirect($N0->redirect_disable, '', "\124\x68\x65\40\x75\163\145\162\x6e\141\155\145\40\x3c\x69\76" . $kW->getAccountName() . "\74\x2f\151\76\40\150\141\163\40\156\157\164\x20\x62\x65\145\x6e\40\x61\143\x74\151\166\x61\x74\x65\144\40\157\x72\40\x69\x73\x20\142\x6c\157\143\153\x65\144\56");
tv:
self::perform_attribute_mapping($kW, $N0, $H0);
self::implement_role_mapping($kW, $N0, $CJ);
self::perform_profile_mapping($kW, $N0, $CJ);
self::perform_group_mapping($kW, $N0, $CJ);
$Id = self::final_redirect_url_after_login($av, $N0->redirect_after_login, $kW->id());
Utilities::save_SSO_report_data("\123\x55\x43\103\x45\123\123", $N0->appName, $aS, $gv, $Id);
$et->set("\x6d\157\137\x73\163\157\137\163\145\163\163\x69\157\x6e", true);
$et->set("\x61\160\160\156\x61\x6d\x65", $N0->appName);
if (!($N0->sendidtokeninslorequest && isset($z1["\151\144\137\x74\x6f\x6b\145\156"]))) {
goto kt;
}
$et->set("\155\157\137\151\x64\137\164\157\x6b\145\x6e", $z1["\x69\x64\137\x74\157\x6b\145\x6e"]);
kt:
$ZD = array();
$ZD["\162\145\144\151\x72\x65\143\164"] = $Id;
user_login_finalize($kW);
$et->set("\x6d\157\137\163\163\157\137\x73\145\x73\x73\151\157\156", true);
$et->set("\141\x70\160\x6e\141\155\x65", $N0->appName);
$R7->invokeAll("\x6d\157\137\x70\x6f\x73\x74\137\x75\163\145\162\137\x6c\x6f\x67\151\x6e", [&$kW, $CJ]);
$R7->invokeAll("\x6d\x6f\x5f\157\141\165\164\150\137\x75\x73\145\162\137\164\157\153\145\x6e", [&$kW, $z1, $Id]);
if (!($HE == 1 && !Utilities::check_for_redirect_to_user_profile_form($gv))) {
goto Z8;
}
Utilities::redirect_to_profile_form($kW->id());
Z8:
$ge = new RedirectResponse($ZD["\x72\x65\144\151\162\x65\143\x74"]);
\Drupal::service("\x70\141\x67\145\137\x63\141\143\150\145\137\153\x69\154\154\137\163\167\151\x74\x63\150")->trigger();
return $ge;
}
public static function is_role_allowed($N0, $CJ)
{
$sR = $N0->enable_role_based_restriction;
$BE = $N0->role_restriction_attrname;
$Cp = $N0->list_of_roles;
$D1 = $N0->typeof_role_restriction;
$O6 = $N0->redirect_url_for_role_restriction;
if (!($sR && $Cp && $D1 && $BE)) {
goto oW;
}
$Cy = new MiniorangeOAuthRoleRestriction($CJ, $BE, $Cp, $O6);
if ($D1 === "\x77\150\x69\x74\x65\154\x69\x73\164") {
goto UK;
}
$Cy->validate_blacklisted_role_restriction();
goto I7;
UK:
$Cy->validate_whitelisted_role_restriction();
I7:
oW:
return new Response();
}
public static function perform_attribute_mapping($kW, $N0, $CJ)
{
$nF = $N0->get_attributeMap();
$nF = !empty($nF) ? $nF : array();
$A1 = array();
$ti = array();
foreach ($nF as $Rp) {
if (!($Rp["\x6d\x61\143\150\151\156\145\x5f\x6e\x61\x6d\145"] != '' && $Rp["\x61\164\164\162\x69\x62\x75\164\x65\x5f\x6e\141\155\x65"] != '')) {
goto vU;
}
array_push($ti, $Rp["\155\141\x63\x68\x69\x6e\x65\137\156\141\x6d\x65"]);
array_push($A1, $Rp["\141\x74\164\162\151\142\x75\164\x65\x5f\x6e\141\x6d\x65"]);
vU:
TA:
}
tS:
$bd = self::mo_oauth_attr_map($A1, $ti);
$Pr = array();
if (!(isset($bd) && !empty($bd))) {
goto pD;
}
foreach ($bd as $qz => $Re) {
if (!isset($CJ[$qz])) {
goto Mn;
}
$Pr[$Re] = $CJ[$qz];
Mn:
W4:
}
e7:
foreach ($Pr as $Rp => $Le) {
$kW->{$Rp} = $Le;
$kW->save();
Ih:
}
oz:
pD:
}
public static function implement_role_mapping($kW, $N0, $CJ)
{
$m9 = $N0->get_roleAttribute();
if (!(isset($m9) && !empty($m9))) {
goto Yb;
}
$F6 = self::getnestedattribute($CJ, $m9);
if (is_null($kW)) {
goto k1;
}
self::perform_role_mapping($N0, $CJ, $kW, $F6, $N0->appName);
k1:
Yb:
}
public static function perform_profile_mapping($kW, $N0, $CJ)
{
$kP = $N0->get_profileMap();
$kP = !empty($kP) ? $kP : array();
$H4 = array();
$AG = array();
if (empty($kP)) {
goto VD;
}
foreach ($kP as $Rp) {
if (!($Rp["\x75\163\145\x72\x5f\160\x72\x6f\146\x69\154\x65\137\146\x69\145\x6c\144\x5f\156\x61\x6d\145"] != '' && $Rp["\165\x73\x65\162\137\160\162\157\146\x69\x6c\145\x5f\151\x64\160\137\x61\x74\x74\x72\x69\x62\x75\x74\x65\137\x6e\141\155\145"] != '')) {
goto wj;
}
array_push($H4, $Rp["\x75\163\145\x72\137\x70\x72\157\x66\151\154\x65\x5f\x66\151\x65\154\144\x5f\x6e\x61\x6d\x65"]);
array_push($AG, $Rp["\x75\x73\x65\x72\137\x70\x72\157\146\x69\154\145\137\151\144\160\x5f\141\164\164\x72\151\142\165\164\145\137\x6e\x61\x6d\x65"]);
wj:
mi:
}
Gg:
$bL = self::mo_oauth_attr_map($H4, $AG, "\x72\157\154\x65");
$Ie = array();
if (!(isset($bL) && !empty($bL))) {
goto si;
}
$bL = self::to_explode_semicolon($bL);
foreach ($bL as $Rp => $kR) {
$Yv = array();
foreach ($kR as $Le) {
if (!array_key_exists($Le, $CJ)) {
goto jB;
}
array_push($Yv, $CJ[$Le]);
jB:
Ux:
}
nL:
$Ie[$Rp] = $Yv;
qC:
}
tG:
self::create_profile($Ie, $kW, $N0);
si:
VD:
}
public static function perform_group_mapping($kW, $N0, $CJ)
{
$EV = $N0->enablegroupmapping;
$Gx = $N0->keepExistingGroups;
$oV = $N0->groupAttribute;
$xi = !empty($N0->groupmap) ? json_decode($N0->groupmap, true) : [];
$LH = '';
if (empty($oV)) {
goto f7;
}
$LH = self::getnestedattribute($CJ, $oV);
f7:
$Sk = [];
if (!is_array($LH) && !empty($LH)) {
goto tw;
}
$Sk = is_array($LH) ? $LH : [];
goto KT;
tw:
$LH = str_replace(["\x5b", "\x5d"], '', $LH);
$LH = explode("\54", $LH);
foreach ($LH as $Rp => $Le) {
$Sk[] = str_replace("\x22", '', trim($Le));
W0:
}
dy:
KT:
$GL = [];
$wJ = [];
foreach ($xi as $Rp) {
if (empty(trim($Rp["\x6f\141\x75\x74\x68\x5f\x73\x65\x72\166\x65\162\x5f\141\x74\x74\x72\163"]))) {
goto M6;
}
array_push($GL, $Rp["\x67\x72\157\165\160\137\156\x61\x6d\x65"]);
array_push($wJ, $Rp["\157\141\165\164\150\x5f\x73\x65\162\166\145\x72\x5f\x61\164\x74\162\163"]);
M6:
jM:
}
yZ:
$ly = self::mo_oauth_attr_map($GL, $wJ, "\162\x6f\154\x65");
if (!($EV && is_array($Sk) && !empty($ly) && $kW)) {
goto RT;
}
foreach ($ly as $Rp => $Le) {
$IU = false;
$CU = \Drupal::entityTypeManager()->getStorage("\147\x72\x6f\165\x70");
$St = $CU->load($Rp);
if (!$St) {
goto I6;
}
if (!$St->getMember($kW)) {
goto oZ;
}
$IU = true;
oZ:
$X7 = explode("\73", $Le);
if (!empty(array_intersect($Sk, $X7))) {
goto Yx;
}
if (!($IU && !$Gx)) {
goto CX;
}
$St->removeMember($kW);
$St->save();
CX:
goto FU;
Yx:
if ($St->getMember($kW)) {
goto pw;
}
$St->addMember($kW);
$St->save();
pw:
FU:
I6:
xf:
}
NW:
RT:
}
public static function Test_Configuration($CJ, $Za)
{
$GC = \Drupal::service("\x65\170\164\x65\x6e\x73\151\x6f\156\56\x6c\x69\x73\x74\x2e\x6d\157\x64\165\x6c\145")->getPath("\x6d\x69\x6e\x69\157\162\141\x6e\147\145\x5f\x6f\x61\x75\x74\150\x5f\x63\154\151\x65\156\164");
$base_url = \Drupal::request()->getSchemeAndHttpHost() . \Drupal::request()->getBasePath();
$C8 = isset($CJ["\x65\155\x61\x69\x6c"]) ? $CJ["\x65\x6d\141\x69\154"] : "\x55\x73\x65\x72";
$r2 = '';
Utilities::show_attr($CJ, $r2, 0, '', "\74\x74\x72\40\163\164\x79\x6c\145\x3d\x22\x74\x65\170\164\55\141\154\151\147\156\72\143\x65\156\164\x65\x72\73\x22\x3e", "\x3c\164\x64\x20\163\x74\171\154\x65\x3d\47\146\x6f\156\164\x2d\167\x65\x69\147\150\x74\x3a\x62\157\x6c\x64\73\160\x61\144\x64\151\x6e\147\72\x32\45\73\142\x6f\162\x64\x65\162\x3a\62\160\x78\x20\x73\x6f\154\151\x64\x20\x23\71\x34\x39\x30\71\60\73\40\167\157\162\144\55\167\x72\141\x70\72\142\162\145\141\x6b\x2d\x77\157\x72\144\x3b\47\76");
$zZ = is_array($CJ) ? json_encode($CJ) : '';
\Drupal::configFactory()->getEditable("\155\x69\x6e\x69\157\x72\x61\x6e\x67\145\137\x6f\x61\x75\x74\150\137\143\x6c\x69\145\156\164\x2e\163\x65\x74\x74\x69\156\147\x73")->set("\155\x69\156\x69\157\x72\141\x6e\147\x65\x5f\157\x61\x75\164\150\x5f\143\154\x69\145\x6e\164\137\141\164\164\162\x5f\x6c\x69\163\164\137\x66\x72\157\155\137\x73\145\162\166\x65\162\x5f" . $Za, $zZ)->save();
$pO = [];
if (!is_array($CJ)) {
goto t5;
}
$pO = array_combine(array_keys($CJ), array_keys($CJ));
t5:
$pO = is_array($pO) ? json_encode($pO) : '';
\Drupal::configFactory()->getEditable("\155\151\156\x69\157\162\x61\x6e\147\145\137\157\141\165\x74\x68\x5f\x63\154\151\145\x6e\164\x2e\x73\145\x74\x74\x69\156\147\x73")->set("\x6d\x69\x6e\x69\x6f\x72\x61\156\147\x65\137\157\141\165\164\x68\x5f\x63\154\x69\145\x6e\164\137\x61\164\x74\x72\x5f\154\x69\x73\164\137\x66\x72\x6f\155\137\x73\x65\162\166\145\162\137\155\x61\160\x70\151\x6e\147\x5f" . $Za, $pO)->save();
echo "\74\x64\x69\x76\40\x73\164\171\154\145\75\42\146\x6f\156\x74\x2d\x66\x61\155\x69\154\x79\72\x43\x61\x6c\151\x62\x72\151\73\x70\x61\x64\x64\x69\x6e\x67\x3a\x30\x20\x33\x25\73\42\76";
echo "\74\x64\x69\166\x20\x73\x74\x79\x6c\x65\75\x22\143\x6f\154\157\162\x3a\x20\x23\x33\x63\x37\66\63\x64\x3b\x62\141\x63\x6b\147\x72\157\165\x6e\x64\x2d\143\157\154\157\162\72\x20\43\x64\146\x66\60\144\x38\x3b\40\160\x61\144\x64\x69\x6e\147\x3a\x32\x25\x3b\155\x61\x72\x67\x69\156\x2d\x62\157\164\x74\x6f\155\x3a\x32\60\160\170\73\164\x65\x78\x74\x2d\141\154\x69\x67\156\72\x63\145\156\164\x65\x72\73\x20\142\157\162\144\145\x72\x3a\x31\160\x78\40\163\157\x6c\x69\x64\40\43\101\105\x44\102\x39\x41\73\15\12\40\40\40\x20\40\40\x20\x20\40\x20\40\x20\40\x20\x20\40\40\40\40\40\x20\x20\x20\40\40\40\x20\x20\40\x20\x66\157\156\164\55\x73\x69\x7a\x65\72\x31\65\160\164\x3b\x22\x3e\xd\12\40\x20\40\x20\x20\x20\40\40\40\40\40\40\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x20\40\40\40\x20\x20\x20\40\124\x45\x53\x54\x20\x53\x55\x43\x43\x45\123\123\106\x55\x4c\xd\xa\40\x20\40\40\40\x20\x20\x20\40\40\x20\40\40\40\x20\40\x20\40\40\40\40\40\x20\40\x20\x20\40\x20\74\x2f\x64\151\166\76\xd\xa\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\40\40\40\x20\x20\40\x3c\144\151\166\40\163\164\171\154\x65\75\42\x64\x69\163\x70\x6c\141\x79\x3a\x62\x6c\x6f\x63\x6b\x3b\164\145\170\164\x2d\141\154\151\147\x6e\x3a\143\145\x6e\164\145\162\x3b\x6d\x61\162\x67\151\156\55\142\157\164\x74\x6f\155\x3a\x34\x25\x3b\x22\x3e\15\12\x20\40\x20\40\x20\x20\40\x20\40\x20\x20\40\x20\40\40\40\x20\40\x20\40\x20\x20\x20\x20\40\40\40\x20\40\40\74\x69\155\x67\40\x73\x74\171\154\145\x3d\x22\167\x69\144\164\150\x3a\61\65\x25\73\42\163\x72\x63\75\42" . $base_url . "\57" . $GC . "\57\141\x73\163\x65\x74\163\57\x69\x6d\147\57\x67\x72\x65\145\x6e\137\x63\x68\x65\x63\153\56\x70\156\147\42\x3e\xd\xa\40\40\40\40\x20\40\40\40\x20\40\40\40\x20\40\x20\40\40\40\x20\x20\x20\40\x20\x20\40\x20\40\40\74\57\144\151\166\x3e";
echo "\74\163\x70\x61\156\x20\x73\x74\171\154\x65\x3d\x22\146\157\156\x74\x2d\x73\x69\x7a\145\x3a\x31\63\160\x74\x3b\x22\76\74\x62\76\x48\x65\x6c\154\157\74\57\x62\x3e\54\40" . $C8 . "\74\x2f\x73\x70\x61\156\76\x3c\x62\x72\x2f\x3e\15\12\40\x20\40\40\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\x20\x20\x20\40\x20\x20\40\x20\40\40\40\x20\x20\74\x70\40\163\x74\171\x6c\145\x3d\42\x66\157\x6e\x74\55\167\x65\151\x67\x68\x74\72\142\x6f\154\144\73\146\157\156\164\55\163\151\x7a\x65\72\x31\x33\160\164\x3b\x6d\141\x72\147\x69\x6e\55\x6c\x65\146\x74\72\x31\45\73\x22\76\x41\124\124\122\111\102\125\x54\x45\x53\40\122\x45\x43\x45\111\126\x45\104\72\x3c\x2f\x70\76\15\12\x20\x20\x20\40\x20\40\x20\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\x20\40\40\40\x20\40\x20\40\x20\x20\74\x74\141\x62\x6c\x65\x20\163\164\171\154\x65\75\x22\x62\157\162\144\145\162\55\143\157\154\154\141\x70\163\145\x3a\x63\157\154\154\141\x70\x73\145\x3b\142\157\162\x64\145\x72\55\x73\160\x61\x63\151\156\147\x3a\x30\x3b\40\x64\151\x73\160\x6c\141\171\72\164\x61\142\x6c\x65\73\167\151\x64\164\150\x3a\x31\60\60\45\x3b\x20\146\157\156\x74\x2d\163\151\172\145\72\x31\63\160\164\x3b\142\141\x63\153\x67\162\x6f\165\x6e\x64\55\143\x6f\154\157\162\72\x23\105\104\x45\104\x45\104\73\x22\x3e\xd\xa\x20\40\x20\40\40\40\x20\x20\40\40\x20\x20\x20\40\40\40\40\40\40\40\40\x20\x20\40\x20\x20\40\40\x20\x20\40\x20\x3c\x74\162\x20\163\164\171\x6c\x65\75\x22\x74\x65\x78\164\x2d\141\x6c\151\147\x6e\72\x63\145\x6e\x74\x65\x72\73\x22\x3e\15\xa\x20\40\x20\x20\40\x20\40\x20\x20\40\40\40\40\40\x20\40\x20\x20\x20\40\40\x20\x20\40\40\40\40\40\40\40\x20\40\x20\40\x20\40\74\x74\x64\x20\x73\164\171\x6c\145\x3d\42\x66\x6f\x6e\x74\55\167\145\x69\147\x68\x74\x3a\142\157\x6c\x64\73\142\157\162\144\x65\x72\72\62\160\170\x20\163\x6f\x6c\151\x64\40\43\x39\x34\x39\x30\x39\x30\73\160\x61\x64\x64\x69\x6e\x67\x3a\62\45\73\x22\x3e\101\124\124\122\111\x42\x55\124\105\x20\x4e\101\x4d\105\x3c\57\164\x64\76\15\xa\x20\x20\x20\40\x20\x20\x20\40\x20\x20\x20\40\40\40\40\x20\x20\40\x20\x20\40\40\x20\x20\40\40\x20\40\40\x20\40\x20\40\x20\x20\40\74\x74\x64\40\163\x74\171\x6c\145\x3d\x22\x66\x6f\156\164\55\167\145\x69\147\x68\x74\72\142\x6f\x6c\144\73\160\141\x64\144\151\x6e\x67\x3a\62\x25\x3b\142\157\x72\144\145\162\x3a\62\160\x78\40\163\x6f\x6c\151\x64\x20\43\71\x34\71\x30\71\60\73\x20\167\157\x72\x64\55\167\x72\x61\x70\72\x62\162\145\x61\153\x2d\x77\x6f\162\x64\73\42\x3e\101\124\x54\x52\111\102\125\124\x45\x20\x56\x41\x4c\x55\105\x3c\x2f\164\x64\76\15\xa\40\40\40\x20\x20\x20\40\40\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\40\40\x20\40\x20\40\40\x20\x20\x20\x20\x3c\x2f\164\x72\x3e";
echo $r2;
echo "\74\x2f\x74\141\142\x6c\145\x3e\x3c\57\144\x69\x76\x3e";
echo "\74\144\x69\166\x20\163\x74\171\x6c\145\x3d\42\x6d\x61\x72\x67\x69\x6e\x3a\63\x25\73\144\x69\163\x70\154\x61\x79\x3a\x62\x6c\157\x63\153\x3b\164\x65\170\164\x2d\x61\x6c\x69\x67\x6e\x3a\143\145\x6e\164\145\x72\x3b\42\76\xd\12\x20\40\40\40\x20\40\40\40\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\40\40\x20\40\40\x20\40\x20\x20\x20\x20\74\151\x6e\160\165\x74\40\x73\x74\x79\154\x65\x3d\x22\x70\x61\x64\x64\x69\156\147\x3a\61\45\73\167\x69\144\164\x68\72\63\67\45\x3b\x62\x61\x63\x6b\147\162\157\165\156\144\x3a\40\43\x30\60\x39\61\103\x44\x20\x6e\x6f\156\x65\x20\162\145\160\145\x61\164\40\163\143\x72\157\x6c\154\x20\x30\x25\40\60\x25\x3b\143\x75\x72\163\157\162\x3a\x20\x70\157\x69\x6e\x74\145\162\73\146\157\156\x74\55\x73\151\172\x65\72\61\65\x70\x78\x3b\15\xa\40\x20\x20\40\x20\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\x20\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\x62\x6f\162\x64\145\x72\x2d\167\151\144\x74\150\72\40\61\160\x78\73\142\x6f\x72\144\145\162\x2d\163\164\171\x6c\145\x3a\x20\x73\157\x6c\151\144\x3b\x62\157\x72\x64\x65\x72\55\x72\x61\x64\151\x75\x73\72\40\63\160\x78\x3b\x77\x68\151\x74\145\55\163\160\x61\x63\x65\72\40\x6e\157\167\x72\141\160\73\142\x6f\x78\x2d\163\151\172\x69\156\x67\x3a\x20\x62\157\162\144\x65\162\x2d\142\x6f\170\x3b\x62\x6f\162\x64\x65\162\55\x63\x6f\154\x6f\162\x3a\x20\x23\60\x30\67\x33\101\101\73\xd\12\40\x20\x20\x20\40\x20\40\40\40\40\40\40\40\x20\x20\x20\x20\x20\40\40\x20\40\40\x20\x20\40\x20\40\x20\x20\40\x20\x20\40\x62\x6f\x78\55\163\x68\x61\x64\157\167\72\x20\60\x70\170\40\x31\x70\x78\40\60\160\x78\x20\162\147\x62\141\50\61\x32\60\x2c\x20\x32\x30\60\54\x20\x32\x33\x30\54\40\60\56\x36\51\x20\151\156\x73\x65\164\x3b\x63\x6f\154\x6f\162\72\40\x23\106\106\x46\73\x22\x74\x79\x70\145\75\x22\142\165\x74\x74\x6f\x6e\42\40\x76\x61\x6c\x75\x65\x3d\x22\x43\x6f\156\146\151\147\165\x72\145\x20\101\x74\164\162\151\x62\x75\164\145\x2f\x52\157\154\145\40\x4d\x61\160\160\x69\156\x67\x22\15\12\40\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\x20\40\x20\x20\x20\40\40\40\40\x20\40\40\x20\x20\x20\157\156\x43\x6c\151\143\x6b\75\x22\143\x6c\x6f\163\x65\137\141\x6e\144\x5f\162\x65\144\x69\x72\x65\143\x74\50\x29\73\x22\76\15\12\xd\12\x20\40\40\x20\40\40\40\x20\x20\x20\40\40\40\40\40\40\40\x20\x20\x20\40\40\x20\40\40\x20\40\x20\x20\x20\x3c\x69\156\160\x75\x74\x20\x73\x74\171\x6c\x65\x3d\x22\160\x61\144\x64\151\156\x67\x3a\61\x25\x3b\x77\x69\x64\x74\150\x3a\x31\60\x30\x70\170\73\x62\141\x63\x6b\x67\x72\157\165\156\144\x3a\x20\43\60\x30\71\61\103\x44\40\156\x6f\x6e\145\x20\x72\145\160\x65\141\164\40\x73\x63\x72\157\x6c\154\40\x30\45\x20\60\x25\73\143\165\162\163\157\x72\x3a\40\160\x6f\x69\x6e\164\x65\162\x3b\x66\157\x6e\164\55\163\151\x7a\x65\x3a\61\65\160\x78\73\15\xa\x20\x20\x20\x20\40\40\x20\x20\40\x20\40\40\40\x20\40\40\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\x20\40\142\x6f\162\x64\x65\162\x2d\167\151\x64\164\x68\x3a\40\61\x70\x78\x3b\x62\157\x72\x64\145\x72\55\x73\164\x79\x6c\145\x3a\40\163\157\154\151\x64\73\142\157\x72\x64\x65\162\55\x72\x61\x64\151\165\x73\72\x20\x33\160\170\x3b\167\x68\151\164\145\x2d\x73\160\x61\143\x65\72\40\x6e\157\x77\x72\141\x70\73\142\x6f\x78\55\163\151\x7a\x69\x6e\x67\x3a\x20\142\x6f\162\x64\x65\x72\x2d\x62\157\170\73\x62\157\162\x64\x65\162\x2d\x63\157\154\157\162\72\x20\x23\x30\x30\67\x33\x41\x41\x3b\15\12\40\x20\x20\x20\x20\x20\40\x20\40\40\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\40\40\x20\40\x20\40\40\x20\x20\40\40\x20\40\x62\157\170\55\163\x68\x61\144\x6f\167\72\x20\x30\x70\x78\x20\61\x70\x78\x20\60\x70\x78\40\x72\x67\x62\x61\50\x31\62\x30\x2c\x20\62\x30\60\54\x20\62\63\x30\54\x20\x30\x2e\x36\51\40\151\156\163\145\164\x3b\143\157\x6c\157\x72\x3a\x20\43\x46\106\106\73\x22\164\x79\x70\145\x3d\42\x62\x75\x74\x74\157\x6e\42\x20\x76\141\x6c\x75\x65\x3d\42\104\157\x6e\x65\x22\x20\x6f\x6e\103\x6c\151\x63\153\75\x22\163\x65\154\x66\56\x63\x6c\x6f\x73\x65\50\x29\x3b\42\x3e\15\xa\40\40\40\x20\40\x20\x20\x20\x20\40\x20\x20\40\40\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\x3c\57\144\151\x76\76\15\xa\x20\x20\x20\40\40\x20\x20\40\x20\40\40\x20\x20\40\40\40\40\40\40\40\x20\x20\40\x20\x20\x20\74\163\143\162\151\160\x74\x3e\xd\xa\40\x20\x20\40\40\40\x20\40\40\40\x20\40\40\40\40\40\x20\x20\x20\x20\x20\40\x20\40\40\x20\40\40\40\40\146\x75\x6e\143\x74\151\x6f\x6e\40\x63\x6c\x6f\x73\x65\137\141\156\x64\137\x72\145\x64\151\162\x65\143\164\50\51\x7b\xd\12\40\40\40\x20\x20\40\40\x20\40\x20\40\40\x20\40\x20\40\40\40\x20\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\x20\40\40\40\40\x77\151\156\x64\157\167\56\x6f\x70\145\156\145\162\x2e\x6c\x6f\143\x61\x74\151\157\156\56\x68\162\145\146\40\75\x20\x22" . Url::fromRoute("\x6d\x69\x6e\151\157\x72\141\156\147\145\x5f\x6f\x61\x75\164\150\137\143\154\151\145\156\164\x2e\x6d\141\x70\160\x69\x6e\x67")->toString() . "\x22\x3b\15\12\40\40\x20\40\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\40\40\40\x20\40\40\40\40\x20\40\40\40\163\x65\154\146\56\x63\154\157\163\145\x28\x29\73\xd\xa\40\x20\40\x20\40\x20\40\40\40\40\x20\x20\40\x20\x20\40\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\40\x20\40\175\xd\12\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\40\x20\x20\x20\40\40\x20\40\40\x20\x20\x20\x20\x20\x20\x3c\57\163\x63\162\151\x70\x74\76";
exit;
return new Response();
}
public static function getResourceOwner($Qs, $A0, $fY = false)
{
$ge = Utilities::callService($Qs, NULL, array("\101\165\164\150\x6f\162\x69\x7a\141\164\x69\157\156" => "\102\145\141\162\145\162\x20" . $A0), "\x47\x45\124", $fY);
$XL = json_decode($ge, true);
if (isset($XL["\145\162\x72\157\x72\x5f\144\145\163\143\162\151\160\x74\151\157\156"])) {
goto ZG;
}
if (!isset($XL["\x65\162\x72\x6f\162"])) {
goto Rs;
}
if (is_array($XL["\x65\162\x72\157\x72"])) {
goto aY;
}
echo $XL["\145\162\162\157\x72"];
goto NO;
aY:
print_r($XL["\145\162\x72\x6f\162"]);
NO:
exit;
Rs:
goto NK;
ZG:
if (is_array($XL["\145\x72\162\157\x72\137\x64\x65\x73\x63\x72\151\x70\164\x69\x6f\156"])) {
goto qy;
}
echo $XL["\145\x72\x72\157\162\x5f\144\x65\163\x63\x72\x69\160\x74\151\x6f\156"];
goto w0;
qy:
print_r($XL["\x65\162\162\x6f\162\x5f\144\145\x73\x63\x72\x69\160\164\x69\x6f\156"]);
w0:
exit;
NK:
return $XL;
}
public static function testattrmappingconfig($r0, $ow)
{
foreach ($ow as $Rp => $cm) {
if (is_array($cm) || is_object($cm)) {
goto PI;
}
echo "\74\164\x72\x20\x73\164\x79\x6c\145\x3d\47\164\x65\x78\164\x2d\x61\x6c\151\x67\156\72\x63\145\156\x74\x65\x72\x3b\47\x3e\x3c\x74\x64\40\x73\x74\x79\x6c\145\x3d\47\146\157\x6e\x74\55\x77\145\x69\147\150\164\x3a\142\157\154\144\x3b\x62\x6f\162\x64\145\162\72\x32\x70\x78\x20\x73\x6f\154\x69\x64\x20\x23\x39\64\71\60\x39\60\73\160\141\144\144\151\x6e\147\72\x32\45\73\47\x3e";
if (empty($r0)) {
goto r_;
}
echo $r0 . "\x2e";
r_:
echo $Rp . "\x3c\57\x74\x64\x3e\x3c\164\144\x20\163\x74\171\154\x65\75\x27\146\157\156\x74\x2d\x77\145\x69\147\x68\164\72\x62\157\154\144\x3b\x70\141\x64\144\x69\156\147\x3a\x32\x25\x3b\142\157\x72\144\145\162\72\x32\x70\170\x20\163\157\154\151\x64\40\x23\71\x34\71\x30\x39\x30\x3b\40\167\x6f\x72\144\x2d\167\x72\141\x70\x3a\142\x72\145\x61\153\55\x77\157\x72\144\x3b\47\x3e" . $cm . "\74\x2f\x74\x64\76\x3c\x2f\x74\x72\76";
goto FZ;
PI:
if (empty($r0)) {
goto v1;
}
$r0 .= "\x2e";
v1:
self::testattrmappingconfig($r0 . $Rp, $cm);
FZ:
D3:
}
l2:
return new Response();
}
public static function getnestedattribute($cm, $Rp)
{
if (isset($Rp)) {
goto Wl;
}
return '';
Wl:
$Yf = explode("\x3e", $Rp);
$a2 = '';
if (sizeof($Yf) > 1) {
goto xb;
}
$a2 = $Yf[0];
if (isset($cm[$a2]) && !is_array($cm[$a2])) {
goto UJ;
}
if (!isset($cm[$a2])) {
goto pF;
}
return self::extractLeafNodes($cm[$a2]);
pF:
goto pj;
UJ:
return $cm[$a2];
pj:
goto JC;
xb:
$a2 = $Yf[0];
if (!isset($cm[$a2])) {
goto ps;
}
return self::getnestedattribute($cm[$a2], str_replace($a2 . "\76", '', $Rp));
ps:
JC:
}
public static function extractLeafNodes($Af)
{
$jw = array();
foreach ($Af as $Rp => $Le) {
if (is_array($Le)) {
goto WL;
}
$jw[] = $Le;
goto kx;
WL:
$jw = array_merge($jw, self::extractLeafNodes($Le));
kx:
Mk:
}
Zo:
return $jw;
}
public static function mo_oauth_client_initiateLogin($fY = false, $TR = '')
{
\Drupal::service("\160\141\147\x65\x5f\143\x61\x63\150\x65\137\153\151\154\x6c\x5f\163\x77\x69\164\143\x68")->trigger();
Utilities::checkUpgradeUrlStatus();
$R7 = \Drupal::moduleHandler();
if (isset($_GET["\x61\x70\160\156\141\155\145"]) && !empty($_GET["\x61\160\x70\156\x61\155\145"])) {
goto ow;
}
$A7 = \Drupal::config("\x6d\x69\156\x69\x6f\162\x61\156\147\145\137\x6f\141\165\x74\150\137\143\154\x69\x65\156\164\56\163\145\x74\164\151\x6e\147\x73")->get("\x61\x75\164\x6f\x5f\x72\x65\144\x69\162\145\x63\x74\x5f\x61\160\160\x5f\156\x61\x6d\x65");
goto N2;
ow:
$A7 = trim(Html::escape($_GET["\x61\160\x70\x6e\x61\x6d\x65"]));
N2:
$N0 = new appValues($A7);
$Mx = $N0->getAllConfig();
$t0 = Utilities::getCallbackUrl($A7);
$JE = $Mx["\x61\165\164\x68\157\162\151\172\145\105\x6e\144\x70\x6f\151\156\x74"];
$av = Utilities::generateState($Mx["\x61\x70\160\x4e\141\155\145"], $TR, $fY);
$q3 = $Mx["\x67\x72\141\x6e\x74\x54\x79\x70\x65\x76\141\154\x75\145"];
if (!($q3 == "\151\x6d\160\154\x69\143\151\164")) {
goto eS;
}
$HU = new ImplicitGrant($Mx["\141\160\160\x4e\141\x6d\x65"]);
$HU->mo_oauth_client_initiateLogin($N0, $TR, $fY);
eS:
if (strpos($JE, "\77") !== false) {
goto tY;
}
$JE = $JE . "\x3f\143\154\x69\x65\156\164\x5f\x69\144\x3d" . $N0->get_clientId() . "\x26\163\x63\157\160\x65\x3d" . $Mx["\163\143\x6f\160\x65"] . "\x26\162\145\144\x69\162\x65\x63\164\137\x75\162\151\75" . $t0 . "\46\x72\x65\x73\160\157\x6e\x73\145\x5f\164\x79\x70\x65\75\x63\x6f\144\x65\x26\x73\164\x61\x74\145\x3d" . $av;
goto nQ;
tY:
$JE = $JE . "\46\143\x6c\151\x65\x6e\x74\137\x69\x64\x3d" . $N0->get_clientId() . "\x26\163\x63\x6f\x70\x65\x3d" . $Mx["\163\143\157\160\x65"] . "\x26\162\145\144\151\162\x65\143\x74\x5f\165\x72\151\75" . $t0 . "\46\162\x65\x73\x70\157\156\163\145\137\164\x79\x70\145\75\143\x6f\144\145\46\x73\x74\x61\x74\145\x3d" . $av;
nQ:
if (!(session_status() == PHP_SESSION_NONE)) {
goto oh;
}
session_start();
oh:
$et = \Drupal::service("\163\x65\x73\163\x69\x6f\156");
$et->set("\157\141\x75\x74\x68\62\163\164\141\x74\x65", $av);
$et->set("\x61\x70\160\156\x61\x6d\145", $Mx["\x61\x70\x70\x4e\141\155\145"]);
if (!($q3 == "\x61\x75\164\150\x6f\x72\x69\x7a\x61\x74\x69\157\156\137\143\157\x64\x65\x5f\x77\151\164\150\x5f\x70\x6b\143\145")) {
goto q2;
}
$fK = random_bytes(64);
$E9 = rtrim(strtr(base64_encode($fK), "\53\x2f", "\x2d\137"), "\x3d");
$Fk = hash("\163\150\x61\62\x35\66", $E9, true);
$Jc = rtrim(strtr(base64_encode($Fk), "\53\57", "\55\x5f"), "\75");
$JE = $JE . "\x26\143\x6f\x64\x65\x5f\143\150\x61\154\x6c\x65\156\x67\x65\x3d" . $Jc . "\46\143\x6f\x64\x65\137\143\150\x61\154\x6c\x65\156\147\145\137\155\x65\x74\x68\x6f\x64\x3d\123\x32\x35\x36";
$et->set("\143\157\144\x65\x56\x65\162\151\x66\151\x65\x72", $E9);
q2:
$R7->invokeAll("\x6d\157\x5f\160\x72\145\137\141\x75\164\x68\x6f\x72\x69\x7a\141\x74\151\x6f\156\x5f\162\x65\161\165\x65\x73\x74", [&$JE, $_GET]);
$ge = new RedirectResponse($JE);
$ge->send();
exit;
}
public static function test_mo_config()
{
miniorange_oauth_clientController::miniorange_oauth_client_mologin("\x74\x65\x73\x74\117\101\165\164\x68\x43\157\x6e\x66\x69\147");
}
public static function miniorange_oauth_client_mologin($TR = '')
{
$kE = \Drupal::request();
$base_url = $kE->getSchemeAndHttpHost() . $kE->getBasePath();
$iT = \Drupal::config("\155\x69\x6e\x69\x6f\x72\x61\x6e\147\x65\x5f\157\141\x75\x74\x68\137\143\x6c\151\145\x6e\164\x2e\x73\145\x74\x74\x69\x6e\x67\x73");
$IX = $iT->get("\155\151\x6e\x69\x6f\162\141\x6e\147\145\137\157\141\x75\164\150\x5f\143\x6c\x69\145\156\164\137\143\x75\x73\x74\x6f\155\x65\x72\137\141\x64\x6d\151\156\137\x66\162\141\x75\144\137\x63\x68\x65\143\153");
$A_ = $iT->get("\x6d\151\156\x69\157\x72\x61\156\x67\x65\x5f\157\x61\165\164\x68\x5f\143\x6c\151\x65\x6e\164\x5f\143\165\x73\x74\x6f\x6d\145\x72\x5f\x61\144\155\x69\x6e\137\x74\157\153\145\156");
$Ma = $iT->get("\x6d\151\x6e\x69\157\x72\x61\156\x67\x65\x5f\157\141\x75\x74\x68\137\x63\154\151\x65\156\x74\137\x63\165\x73\164\x6f\x6d\145\x72\x5f\141\144\x6d\x69\156\137\145\x6d\141\151\154");
$VH = $iT->get("\155\x69\156\x69\x6f\x72\x61\156\x67\x65\137\x6f\x61\165\x74\150\x5f\143\154\x69\x65\x6e\164\137\154\x69\x63\x65\156\x73\x65\137\153\145\x79");
$jZ = $iT->get("\141\165\164\x6f\137\162\145\x64\x69\x72\145\x63\x74\137\141\x70\160\137\x6e\x61\155\x65");
$AB = $iT->get("\155\151\156\151\157\162\x61\x6e\x67\x65\x5f\x6f\141\165\164\150\137\151\163\115\165\154\164\x69\123\x69\x74\145\x50\x6c\x75\147\x69\156\122\145\161\165\145\x73\x74\x65\x64") == true;
$xo = $iT->get("\x6d\x6f\137\154\141\163\x74\x5f\154\151\x63\x65\x6e\163\x65\137\x66\145\x74\x63\150\x5f\x74\151\155\x65");
$Xo = time();
if (!($Xo - $xo > 604800)) {
goto Xq;
}
self::moOAuthLicenseFetch(true);
Xq:
$Ze = \Drupal::state()->get("\x6d\151\156\x69\x6f\162\141\156\147\x65\x5f\x6f\141\x75\164\x68\137\151\x73\137\x74\162\151\141\x6c");
$Ti = $iT->get("\155\151\156\151\x6f\x72\x61\x6e\147\145\x5f\x6f\x61\165\164\150\137\x6c\151\x63\145\156\x73\145\105\170\x70\x69\162\171") ?? '';
$u3 = $kE->query->get("\141\x70\x70\156\x61\x6d\x65", $jZ);
$BK = DBQueries::get_all_apps_from_db();
$qo = in_array($u3, $BK) ? (new appValues($u3))->enable_login_with_oauth : 0;
$AM = str_ireplace("\x68\x74\x74\160\72", "\150\164\164\160\x73\x3a", $base_url);
$jS = $AM . $A_;
if (empty($Ma)) {
goto pO;
}
if (empty($VH)) {
goto Ad;
}
if (!$AB && $jS == Utilities::decrypt_data($IX, $A_) || $jS == Utilities::decrypt_data($IX, $A_, "\x41\x45\x53\x2d\61\x32\x38\55\x45\x43\x42")) {
goto IL;
}
if ($Ze && (!$Ti || strtotime($Ti) < $Xo)) {
goto Lq;
}
if ($TR === "\164\x65\163\x74\117\101\165\x74\150\103\x6f\156\x66\151\147" && isset($_GET["\141\x70\160\x6e\141\155\145"]) && !empty($_GET["\141\x70\160\x6e\x61\155\x65"])) {
goto X3;
}
if ($TR !== "\164\x65\x73\x74\117\x41\165\x74\150\x43\157\156\146\x69\147" && $qo) {
goto Nz;
}
Utilities::show_sso_error_message("\103\157\x6e\x66\x69\147\x75\162\141\x74\x69\x6f\x6e\163\x20\x6e\157\x74\40\146\157\165\156\144\x20\157\162\x20\x4c\157\x67\151\x6e\x20\165\x73\x69\156\x67\40\117\101\165\x74\x68\40\x70\162\x6f\x76\x69\144\145\162\40\151\x73\40\144\151\163\x61\142\154\145\144\x2e", "\120\x6c\x65\x61\x73\x65\x20\x65\156\163\x75\x72\145\x20\164\150\x65\x20\123\123\x4f\40\157\162\x20\124\x65\163\164\x20\x43\x6f\x6e\x6e\x65\x63\164\x69\x6f\x6e\40\x55\x52\114\40\151\x73\x20\143\157\x72\x72\145\143\x74\40\x61\x6e\x64\x20\114\157\x67\x69\156\40\x77\151\x74\150\40\117\101\165\x74\x68\40\x69\163\x20\145\156\x61\x62\154\x65\x64\x2e");
goto B_;
pO:
Utilities::show_sso_error_message("\111\164\x20\x61\160\x70\145\x61\162\x73\40\164\150\141\x74\40\171\x6f\x75\x20\141\x72\x65\x20\x6e\x6f\x74\40\x6c\157\147\x67\x65\144\40\151\156\x74\x6f\x20\164\150\145\40\155\157\x64\x75\154\x65\56", "\x50\x6c\145\x61\163\x65\40\x6c\x6f\147\x20\151\156\40\x74\x6f\40\x74\150\145\40\155\x6f\x64\x75\154\x65\x2e");
goto B_;
Ad:
Utilities::show_sso_error_message("\111\x74\40\x61\160\x70\x65\x61\x72\163\x20\164\x68\x61\164\x20\x79\157\x75\x20\x68\x61\x76\x65\x20\x6e\157\164\x20\x76\x65\162\151\146\151\x65\x64\40\x79\x6f\165\x72\x20\154\x69\143\145\x6e\x73\145\40\x6b\145\x79", "\x50\154\145\x61\163\145\x20\x76\145\x72\x69\146\x79\x20\171\157\165\x72\40\154\151\143\145\156\163\x65\40\x6b\145\171\x2e");
goto B_;
IL:
Utilities::show_sso_error_message("\x54\x68\145\40\x6c\151\143\145\x6e\x73\145\40\153\x65\x79\40\x79\157\x75\x20\150\141\x76\x65\x20\145\156\164\145\162\145\x64\x20\150\x61\x73\40\141\x6c\x72\145\x61\x64\171\40\142\145\x65\156\x20\165\163\145\144\x2e", "\x50\x6c\145\x61\x73\145\x20\x65\x6e\x74\145\x72\x20\x61\x20\153\x65\171\40\x77\150\x69\x63\150\x20\x68\x61\x73\x20\156\x6f\164\x20\142\145\x65\156\x20\x75\x73\x65\144\40\142\145\x66\157\x72\x65\x20\x6f\x6e\40\x61\x6e\x79\40\157\x74\x68\145\x72\x20\x69\156\163\164\x61\x6e\143\145\40\157\x72\x20\x69\x66\x20\171\x6f\165\40\150\x61\166\145\40\x65\x78\150\141\165\163\x74\x65\144\40\141\154\x6c\x20\x79\x6f\165\x72\x20\153\x65\x79\163\x2c\x20\x79\x6f\165\40\143\x61\156\40\x70\x75\162\x63\x68\141\163\145\40\155\x6f\162\x65\40\154\151\143\145\156\x73\145\x73\x2e");
goto B_;
Lq:
Utilities::show_sso_error_message("\x59\157\x75\x72\40\164\x72\151\141\154\40\x6c\151\143\x65\156\x73\x65\40\150\x61\x73\x20\x65\x78\160\151\162\x65\144\40\157\x6e\40" . date("\x6c\40\115\x20\x6a\x2c\40\x59", strtotime($Ti)), "\56\x20\122\x65\x61\x63\x68\x20\x6f\165\x74\x20\x74\157\40\x75\163\x20\141\x74\40\x3c\141\40\150\162\145\146\75\42\x6d\141\x69\154\x74\157\x3a\72\144\162\165\160\x61\154\163\x75\160\x70\x6f\x72\x74\100\170\145\143\x75\162\x69\146\171\x2e\x63\157\x6d\42\x3e\x64\162\165\x70\x61\x6c\163\x75\x70\160\x6f\162\x74\x40\170\145\143\165\162\151\x66\x79\56\x63\157\155\x3c\x2f\141\x3e\40\164\x6f\40\x75\160\147\162\141\x64\145\40\x79\x6f\165\x72\40\x6c\151\143\145\156\x73\145\56");
goto B_;
X3:
return self::mo_oauth_client_initiateLogin(true);
goto B_;
Nz:
return self::mo_oauth_client_initiateLogin(false, $TR);
B_:
}
public function oauth_client_logout()
{
$rM = new mOOAuthLogout();
return $rM->mo_oauth_logout();
}
public static function openCustomerRequestForm()
{
$ge = new AjaxResponse();
$ii = \Drupal::formBuilder()->getForm("\134\x44\x72\165\x70\141\154\x5c\x6d\x69\156\x69\157\x72\141\x6e\147\145\137\157\x61\165\164\x68\x5f\143\x6c\x69\x65\x6e\x74\134\106\157\162\155\x5c\115\151\x6e\151\157\162\141\156\x67\145\x43\x75\163\x74\157\x6d\145\x72\x52\145\161\165\x65\x73\x74");
$ge->addCommand(new OpenModalDialogCommand("\x6d\x69\x6e\151\x4f\162\141\156\x67\x65\x20\x4f\x41\165\164\150\40\x43\154\x69\145\x6e\164\x20\x43\x75\163\x74\157\x6d\145\162\x20\x53\165\x70\160\x6f\162\x74", $ii, ["\167\x69\x64\164\150" => "\64\x35\45"]));
return $ge;
}
public static function moOAuthLicenseFetch($OP = FALSE)
{
$iT = \Drupal::config("\155\151\156\x69\x6f\162\x61\156\x67\x65\137\157\x61\165\164\150\137\143\x6c\151\x65\156\164\56\163\x65\x74\x74\151\x6e\147\x73");
$Ib = \Drupal::configFactory()->getEditable("\155\x69\x6e\x69\157\162\141\x6e\x67\x65\x5f\157\141\165\164\x68\137\x63\x6c\151\x65\156\x74\x2e\163\145\x74\164\x69\x6e\x67\x73");
$C8 = $iT->get("\x6d\151\x6e\x69\x6f\x72\x61\x6e\x67\145\137\x6f\x61\165\164\x68\137\143\154\151\145\x6e\x74\x5f\x63\x75\163\164\x6f\x6d\x65\162\x5f\x61\144\x6d\151\156\x5f\x65\155\x61\x69\x6c");
$Nc = new MiniorangeOAuthClientCustomer($C8, null);
$y0 = json_decode($Nc->ccl(), true);
if (isset($y0["\x73\x74\x61\164\x75\163"]) && $y0["\x73\x74\x61\x74\165\163"] == "\x53\x55\103\103\105\x53\x53") {
goto OZ;
}
$TT = t("\x46\141\151\x6c\x65\144\x20\x74\157\x20\x66\145\x74\x63\150\x20\154\151\143\x65\156\163\x69\x6e\147\x20\165\x70\x64\x61\x74\145");
$fr = "\145\x72\162\x6f\162";
goto ph;
OZ:
$Ib->set("\x6d\x6f\x5f\x6c\x61\x73\164\x5f\154\x69\x63\x65\x6e\163\145\x5f\x66\145\x74\x63\x68\x5f\164\x69\x6d\145", time())->save();
$Ib->set("\155\x69\x6e\151\x6f\162\141\x6e\147\x65\x5f\x6f\141\x75\164\150\137\154\151\x63\x65\x6e\x73\145\x45\170\160\x69\x72\x79", $y0["\154\151\143\x65\156\163\x65\x45\170\x70\x69\x72\x79"])->save();
$Ib->set("\x6d\151\156\151\157\162\x61\156\147\145\137\157\x61\x75\x74\x68\137\x73\165\x70\x70\x6f\x72\x74\105\x78\160\x69\x72\171", $y0["\x73\165\x70\160\157\162\x74\105\x78\x70\x69\162\171"])->save();
$Ib->set("\155\151\156\151\x6f\x72\141\x6e\x67\x65\x5f\x6f\x61\x75\x74\150\137\x69\x73\115\165\154\164\151\x53\x69\164\x65\x50\x6c\x75\x67\x69\x6e\x52\x65\161\x75\x65\163\x74\145\144", isset($y0["\x69\163\x4d\165\154\164\x69\x53\151\x74\145\120\x6c\x75\x67\x69\156\x52\145\x71\165\145\x73\x74\x65\x64"]) ? $y0["\151\x73\x4d\165\x6c\x74\151\123\151\164\145\120\154\x75\x67\x69\156\122\x65\x71\165\x65\x73\x74\x65\x64"] : false)->save();
$Xh = isset($y0["\x6e\x6f\x4f\146\123\120"]) ? $y0["\156\157\x4f\x66\123\x50"] : 1;
$Ib->set("\x6d\x69\x6e\x69\157\x72\x61\156\147\145\x5f\x6f\x61\x75\164\150\x5f\156\x6f\x4f\146\x53\x50", $Xh)->save();
$BB = isset($y0["\x74\x72\151\141\x6c"]) ? $y0["\x74\162\151\141\x6c"] : false;
\Drupal::state()->set("\155\x69\156\151\157\162\141\156\x67\145\x5f\x6f\141\165\164\150\137\x69\x73\137\x74\x72\151\141\x6c", $BB);
$TT = t("\x53\x75\x63\x63\145\x73\x73\146\x75\154\x6c\171\x20\x66\x65\164\x63\x68\145\x64\40\x74\150\145\40\x6c\x69\143\145\x6e\163\151\x6e\x67\40\x75\160\144\141\164\x65");
$fr = "\x73\x74\x61\x74\165\163";
ph:
$fr == "\x73\x74\x61\x74\165\163" ? \Drupal::logger("\155\151\156\x69\157\162\x61\156\147\x65\x5f\157\x61\x75\164\150\137\143\154\151\145\156\x74")->notice($TT) : \Drupal::logger("\155\x69\x6e\x69\x6f\x72\x61\x6e\x67\145\137\157\141\165\164\150\137\143\154\151\x65\x6e\164")->error($TT);
if ($OP) {
goto dj;
}
$fr == "\163\164\x61\164\x75\x73" ? \Drupal::messenger()->addStatus($TT) : \Drupal::messenger()->addError($TT);
return new RedirectResponse(Url::fromRoute("\155\x69\156\x69\157\x72\141\x6e\x67\x65\x5f\157\x61\x75\x74\150\137\x63\154\x69\x65\x6e\x74\x2e\x63\165\163\x74\x6f\155\x65\162\x5f\x73\x65\x74\x75\160")->toString());
dj:
return new Response();
}
}
Function Calls
None |
Stats
MD5 | 698d5de386caaac9a1768541d910a9cb |
Eval Count | 0 |
Decode Time | 106 ms |