Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
Only in C:\Users\wkaifer\OneDrive - POWERTRAIN INC\Plugins\drupal_miniorange_saml: .git O..
Decoded Output download
<? Only in C:\Users\wkaifer\OneDrive - POWERTRAIN INC\Plugins\drupal_miniorange_saml: .git
Only in C:\Users\wkaifer\OneDrive - POWERTRAIN INC\Plugins\drupal_miniorange_saml: .idea
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/includes/Acs.php" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/includes/Acs.php"
6c6
< public function processSamlResponse($post, $base_url, $Ho, $ym, $FQ, $im)
---
> public function processSamlResponse($post, $base_url, $nW, $FL, $mm, $Nt)
8,9c8,9
< if (array_key_exists("SAMLResponse", $post)) {
< goto T7;
---
> if (array_key_exists("SAMLResponse", $post)) {
> goto Ju;
11,80c11,80
< throw new Exception("Missing SAMLRequest or SAMLResponse parameter.");
< goto bQ;
< T7:
< $JY = $post["SAMLResponse"];
< bQ:
< if (array_key_exists("RelayState", $post)) {
< goto wV;
< }
< $gB = '';
< goto oU;
< wV:
< $gB = $post["RelayState"];
< oU:
< $JY = base64_decode($JY);
< if (!($gB == "showSamlResponse")) {
< goto nB;
< }
< Utilities::Print_SAML_Request($JY, "displaySamlResponse");
< nB:
< $Ej = new DOMDocument();
< $Ej->loadXML($JY);
< $aQ = $Ej->firstChild;
< $JY = new SAML2_Response($aQ);
< $u1 = current($JY->getAssertions())->getIssuer();
< $ZQ = db_query("SELECT * FROM {miniorange_saml_idp_list} WHERE mo_idp_issuer = '{$u1}'");
< $IX = $ZQ->fetchAssoc();
< if (!empty($IX)) {
< goto b_;
< }
< throw new Exception("Identity Provider not configured. If you have configured the IDP then please make sure you are using correct Issuer Value");
< b_:
< $_SESSION["IDP_ISSUER"] = $u1;
< $yu = Utilities::miniorange_get_baseURL();
< $NA = $yu . "/?q=samlassertion";
< $Uf = $IX["mo_idp_cert"];
< $u1 = $IX["mo_idp_issuer"];
< $OZ = $Ej->documentElement;
< $Ec = new DOMXpath($Ej);
< $Ec->registerNamespace("samlp", "urn:oasis:names:tc:SAML:2.0:protocol");
< $Ec->registerNamespace("saml", "urn:oasis:names:tc:SAML:2.0:assertion");
< $o7 = $Ec->query("/samlp:Response/samlp:Status/samlp:StatusCode", $OZ);
< $lh = $o7->item(0)->getAttribute("Value");
< $aq = '';
< if (!($o7->item(0)->firstChild !== null)) {
< goto pW;
< }
< $aq = $o7->item(0)->firstChild->getAttribute("Value");
< pW:
< $o7 = explode(":", $lh)[7];
< if (!($o7 != "Success")) {
< goto lF;
< }
< if (empty($aq)) {
< goto Cn;
< }
< $o7 = explode(":", $aq)[7];
< Cn:
< $this->show_error_message($o7, $gB);
< lF:
< if (is_null($Uf)) {
< goto vF;
< }
< $Jl = XMLSecurityKey::getRawThumbprint($Uf);
< $W1 = preg_replace("/\s+/", '', $Jl);
< $Uf = iconv("UTF-8", "CP1252//IGNORE", $W1);
< vF:
< $NX = $JY->getSignatureData();
< $UZ = current($JY->getAssertions())->getSignatureData();
< if (!(is_null($NX) && is_null($UZ))) {
< goto ZY;
---
> throw new Exception("Missing SAMLRequest or SAMLResponse parameter.");
> goto UF;
> Ju:
> $KV = $post["SAMLResponse"];
> UF:
> if (array_key_exists("RelayState", $post)) {
> goto pb;
> }
> $dV = '';
> goto wG;
> pb:
> $dV = $post["RelayState"];
> wG:
> $KV = base64_decode($KV);
> if (!($dV == "showSamlResponse")) {
> goto St;
> }
> Utilities::Print_SAML_Request($KV, "displaySamlResponse");
> St:
> $nD = new DOMDocument();
> $nD->loadXML($KV);
> $wi = $nD->firstChild;
> $KV = new SAML2_Response($wi);
> $jm = current($KV->getAssertions())->getIssuer();
> $rX = db_query("SELECT * FROM {miniorange_saml_idp_list} WHERE mo_idp_issuer = '{$jm}'");
> $zN = $rX->fetchAssoc();
> if (!empty($zN)) {
> goto Ob;
> }
> throw new Exception("Identity Provider not configured. If you have configured the IDP then please make sure you are using correct Issuer Value");
> Ob:
> $_SESSION["IDP_ISSUER"] = $jm;
> $Gx = Utilities::miniorange_get_baseURL();
> $XZ = $Gx . "/?q=samlassertion";
> $YX = $zN["mo_idp_cert"];
> $jm = $zN["mo_idp_issuer"];
> $je = $nD->documentElement;
> $BF = new DOMXpath($nD);
> $BF->registerNamespace("samlp", "urn:oasis:names:tc:SAML:2.0:protocol");
> $BF->registerNamespace("saml", "urn:oasis:names:tc:SAML:2.0:assertion");
> $dG = $BF->query("/samlp:Response/samlp:Status/samlp:StatusCode", $je);
> $Ri = $dG->item(0)->getAttribute("Value");
> $JD = '';
> if (!($dG->item(0)->firstChild !== null)) {
> goto wf;
> }
> $JD = $dG->item(0)->firstChild->getAttribute("Value");
> wf:
> $dG = explode(":", $Ri)[7];
> if (!($dG != "Success")) {
> goto xD;
> }
> if (empty($JD)) {
> goto q6;
> }
> $dG = explode(":", $JD)[7];
> q6:
> $this->show_error_message($dG, $dV);
> xD:
> if (is_null($YX)) {
> goto Av;
> }
> $H8 = XMLSecurityKey::getRawThumbprint($YX);
> $EU = preg_replace("/\s+/", '', $H8);
> $YX = iconv("UTF-8", "CP1252//IGNORE", $EU);
> Av:
> $ud = $KV->getSignatureData();
> $zn = current($KV->getAssertions())->getSignatureData();
> if (!(is_null($ud) && is_null($zn))) {
> goto ou;
82c82
< echo "Neither response nor assertion is signed";
---
> echo "Neither response nor assertion is signed";
84,90c84,90
< ZY:
< if (is_null($NX)) {
< goto Vz;
< }
< $rq = Utilities::processResponse($NA, $Uf, $NX, $JY, $gB);
< if ($rq) {
< goto Tp;
---
> ou:
> if (is_null($ud)) {
> goto xk;
> }
> $p0 = Utilities::processResponse($XZ, $YX, $ud, $KV, $dV);
> if ($p0) {
> goto ND;
92c92
< echo "Invalid Signature in SAML Response";
---
> echo "Invalid Signature in SAML Response";
94,101c94,101
< Tp:
< Vz:
< if (is_null($UZ)) {
< goto qX;
< }
< $uS = Utilities::processResponse($NA, $Uf, $UZ, $JY, $gB);
< if ($uS) {
< goto y2;
---
> ND:
> xk:
> if (is_null($zn)) {
> goto MX;
> }
> $ju = Utilities::processResponse($XZ, $YX, $zn, $KV, $dV);
> if ($ju) {
> goto TJ;
103c103
< echo "Invalid Signature in SAML Assertion";
---
> echo "Invalid Signature in SAML Assertion";
105,244c105,244
< y2:
< qX:
< $Px = current($JY->getAssertions())->getNotOnOrAfter();
< $hl = current($JY->getAssertions())->getNotBefore();
< if (empty($Px)) {
< goto sN;
< }
< variable_set("miniorange_saml_assertion_not_after", $Px);
< if (!(gmdate(time()) >= $Px)) {
< goto g2;
< }
< $this->show_error_message("AssertionNotAfter", $gB);
< g2:
< sN:
< if (empty($hl)) {
< goto mJ;
< }
< variable_set("miniorange_saml_assertion_not_before", $hl);
< if (!(gmdate(time()) < $hl)) {
< goto HA;
< }
< $this->show_error_message("AssertionNotBefore", $gB);
< HA:
< mJ:
< $NA = substr($NA, 0, strpos($NA, "?"));
< Utilities::validateIssuerAndAudience($JY, $Ho, $u1, $base_url, $gB);
< $Ci = current($JY->getAssertions())->getAttributes();
< variable_set("miniorange_saml_attrs_list", $Ci);
< if ($ym != "NameID") {
< goto WD;
< }
< $Ea = current(current($JY->getAssertions())->getNameId());
< goto uZ;
< WD:
< if (array_key_exists($ym, $Ci)) {
< goto NA;
< }
< $Ea = current(current($JY->getAssertions())->getNameId());
< goto iT;
< NA:
< $Ea = $Ci[$ym][0];
< iT:
< uZ:
< $UB = variable_get("miniorange_saml_email_attribute", "NameID");
< if ($UB == "NameID") {
< goto c4;
< }
< $uj = $Ci[$UB][0];
< goto k4;
< c4:
< $uj = current(current($JY->getAssertions())->getNameId());
< k4:
< variable_set("miniorange_saml_email_id_value", $uj);
< $qG = '';
< if (!array_key_exists("RelayState", $post)) {
< goto rM;
< }
< if ($post["RelayState"] == "testValidate") {
< goto GM;
< }
< $qG = $post["RelayState"];
< goto RO;
< GM:
< $this->showTestResults($Ea, $Ci);
< RO:
< rM:
< $gF = current($JY->getAssertions())->getSessionIndex();
< $b3 = current(current($JY->getAssertions())->getNameId());
< $Tr = array();
< foreach ($FQ as $mz => $rE) {
< if (!array_key_exists($rE, $Ci)) {
< goto kb;
< }
< $zc = $Ci[$rE][0];
< $Tr[$mz] = $zc;
< kb:
< eH:
< }
< zW:
< $MB = variable_get("miniorange_saml_idp_attr1_name", '');
< if (!(isset($MB) && !empty($MB) && isset($Ci[$MB]))) {
< goto uM;
< }
< $vJ = $Ci[$MB];
< $vJ[0] = preg_replace("/\s+/", '', $vJ[0]);
< $Er = strpos($vJ[0], ",");
< if (!(sizeof($Ci[$MB]) == 1 && $Er !== false)) {
< goto un;
< }
< $eH = explode(",", $vJ[0]);
< $Ci[$MB] = $eH;
< un:
< $Eo = 0;
< mM:
< if (!($Eo < sizeof($Ci[$MB]))) {
< goto tz;
< }
< $QL[$Eo] = $Ci[$MB][$Eo];
< Q0:
< $Eo++;
< goto mM;
< tz:
< $VQ = array();
< if (variable_get("miniorange_saml_disable_role_update")) {
< goto Tx;
< }
< $Eo = 0;
< QP:
< if (!($Eo < sizeof($QL))) {
< goto Bc;
< }
< foreach ($im as $mz => $rE) {
< if (!(!empty($mz) && !is_null($mz) && !strcasecmp($QL[$Eo], $mz))) {
< goto lZ;
< }
< $RJ = array_search($rE, user_roles());
< $VQ[$RJ] = $rE;
< lZ:
< NI:
< }
< W9:
< I8:
< $Eo++;
< goto QP;
< Bc:
< Tx:
< uM:
< $Dj = array();
< $Dj["email"] = isset($uj) ? $uj : '';
< $Dj["username"] = isset($Ea) ? $Ea : '';
< $Dj["NameID"] = isset($b3) ? $b3 : '';
< $Dj["sessionIndex"] = isset($gF) ? $gF : '';
< $Dj["customFieldAttributes"] = isset($Tr) ? $Tr : '';
< $Dj["customFieldRoles"] = isset($VQ) ? $VQ : '';
< if (empty($qG)) {
< goto fH;
< }
< $Dj["relay_state"] = $qG;
< fH:
< return $Dj;
---
> TJ:
> MX:
> $DI = current($KV->getAssertions())->getNotOnOrAfter();
> $og = current($KV->getAssertions())->getNotBefore();
> if (empty($DI)) {
> goto Ug;
> }
> variable_set("miniorange_saml_assertion_not_after", $DI);
> if (!(gmdate(time()) >= $DI)) {
> goto xw;
> }
> $this->show_error_message("AssertionNotAfter", $dV);
> xw:
> Ug:
> if (empty($og)) {
> goto vK;
> }
> variable_set("miniorange_saml_assertion_not_before", $og);
> if (!(gmdate(time()) < $og)) {
> goto lB;
> }
> $this->show_error_message("AssertionNotBefore", $dV);
> lB:
> vK:
> $XZ = substr($XZ, 0, strpos($XZ, "?"));
> Utilities::validateIssuerAndAudience($KV, $nW, $jm, $base_url, $dV);
> $S_ = current($KV->getAssertions())->getAttributes();
> variable_set("miniorange_saml_attrs_list", $S_);
> if ($FL != "NameID") {
> goto pS;
> }
> $q1 = current(current($KV->getAssertions())->getNameId());
> goto p2;
> pS:
> if (array_key_exists($FL, $S_)) {
> goto Ph;
> }
> $q1 = current(current($KV->getAssertions())->getNameId());
> goto tL;
> Ph:
> $q1 = $S_[$FL][0];
> tL:
> p2:
> $Au = variable_get("miniorange_saml_email_attribute", "NameID");
> if ($Au == "NameID") {
> goto C1;
> }
> $An = $S_[$Au][0];
> goto hU;
> C1:
> $An = current(current($KV->getAssertions())->getNameId());
> hU:
> variable_set("miniorange_saml_email_id_value", $An);
> $e1 = '';
> if (!array_key_exists("RelayState", $post)) {
> goto sW;
> }
> if ($post["RelayState"] == "testValidate") {
> goto t9;
> }
> $e1 = $post["RelayState"];
> goto Fb;
> t9:
> $this->showTestResults($q1, $S_);
> Fb:
> sW:
> $Hr = current($KV->getAssertions())->getSessionIndex();
> $Jb = current(current($KV->getAssertions())->getNameId());
> $BK = array();
> foreach ($mm as $ZE => $ND) {
> if (!array_key_exists($ND, $S_)) {
> goto nE;
> }
> $oP = $S_[$ND][0];
> $BK[$ZE] = $oP;
> nE:
> Iz:
> }
> Y_:
> $dp = variable_get("miniorange_saml_idp_attr1_name", '');
> if (!(isset($dp) && !empty($dp) && isset($S_[$dp]))) {
> goto U8;
> }
> $Ro = $S_[$dp];
> $Ro[0] = preg_replace("/\s+/", '', $Ro[0]);
> $E_ = strpos($Ro[0], ",");
> if (!(sizeof($S_[$dp]) == 1 && $E_ !== false)) {
> goto eE;
> }
> $Bm = explode(",", $Ro[0]);
> $S_[$dp] = $Bm;
> eE:
> $Xc = 0;
> vI:
> if (!($Xc < sizeof($S_[$dp]))) {
> goto up;
> }
> $SK[$Xc] = $S_[$dp][$Xc];
> Lm:
> $Xc++;
> goto vI;
> up:
> $j_ = array();
> if (variable_get("miniorange_saml_disable_role_update")) {
> goto YN;
> }
> $Xc = 0;
> v4:
> if (!($Xc < sizeof($SK))) {
> goto vg;
> }
> foreach ($Nt as $ZE => $ND) {
> if (!(!empty($ZE) && !is_null($ZE) && !strcasecmp($SK[$Xc], $ZE))) {
> goto Tl;
> }
> $G9 = array_search($ND, user_roles());
> $j_[$G9] = $ND;
> Tl:
> m6:
> }
> Xc:
> F2:
> $Xc++;
> goto v4;
> vg:
> YN:
> U8:
> $yH = array();
> $yH["email"] = isset($An) ? $An : '';
> $yH["username"] = isset($q1) ? $q1 : '';
> $yH["NameID"] = isset($Jb) ? $Jb : '';
> $yH["sessionIndex"] = isset($Hr) ? $Hr : '';
> $yH["customFieldAttributes"] = isset($BK) ? $BK : '';
> $yH["customFieldRoles"] = isset($j_) ? $j_ : '';
> if (empty($e1)) {
> goto E7;
> }
> $yH["relay_state"] = $e1;
> E7:
> return $yH;
246c246
< function show_error_message($HP, $vd)
---
> function show_error_message($vV, $vA)
248,249c248,249
< if ($vd == "testValidate") {
< goto Tf;
---
> if ($vA == "testValidate") {
> goto Wm;
251,252c251,252
< if ($HP == "RequestDenied") {
< goto Mt;
---
> if ($vV == "RequestDenied") {
> goto oo;
254c254
< echo "We could not sign you in. Please contact your Administrator.";
---
> echo "We could not sign you in. Please contact your Administrator.";
256,258c256,258
< goto Hm;
< Mt:
< echo "You are not allowed to login into the site. Please contact your Administrator.";
---
> goto ud;
> oo:
> echo "You are not allowed to login into the site. Please contact your Administrator.";
260,264c260,264
< Hm:
< goto kq;
< Tf:
< echo "<div style="font-family:Calibri;padding:0 3%;">";
< echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>\xd\xa\x9 <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong> Invalid SAML Response Status.</p>
\xa\x9\x9 <p><strong>Causes</strong>: Identity Provider has sent '" . $HP . "' status code in SAML Response. </p>\xd
\x9 \x9\x9<p><strong>Reason</strong>: " . $this->get_status_message($HP) . "</p><br>\xd\xa \x9</div>
\xa
\x9\x9<div style="margin:3%;display:block;text-align:center;">\xd
<div style="margin:3%;display:block;text-align:center;"><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"></div>";
---
> ud:
> goto Ae;
> Wm:
> echo "<div style="font-family:Calibri;padding:0 3%;">";
> echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>
\xa\x9 \x9<div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong> Invalid SAML Response Status.</p>\xd
\x9\x9 <p><strong>Causes</strong>: Identity Provider has sent '" . $vV . "' status code in SAML Response. </p>
\xa\x9\x9\x9 \x9 \x9<p><strong>Reason</strong>: " . $this->get_status_message($vV) . "</p><br>
\x9\x9\x9</div>\xd
\xd\xa \x9 <div style="margin:3%;display:block;text-align:center;">\xd\xa \x9<div style="margin:3%;display:block;text-align:center;"><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"></div>";
266c266
< kq:
---
> Ae:
268c268
< function get_status_message($HP)
---
> function get_status_message($vV)
270,290c270,290
< switch ($HP) {
< case "RequestDenied":
< return "You are not allowed to login into the site. Please contact your Administrator.";
< goto t_;
< case "Requester":
< return "The request could not be performed due to an error on the part of the requester.";
< goto t_;
< case "Responder":
< return "The request could not be performed due to an error on the part of the SAML responder or SAML authority.";
< goto t_;
< case "VersionMismatch":
< return "The SAML responder could not process the request because the version of the request message was incorrect.";
< goto t_;
< case "AssertionNotAfter":
< $Px = variable_get("miniorange_saml_assertion_not_after", '');
< return "SAML Assertion is expired on " . date("M j, Y g:i a.", $Px);
< goto t_;
< case "AssertionNotBefore":
< $hl = variable_get("miniorange_saml_assertion_not_before", '');
< return "SAML Assertion is not valid before " . date("M j, Y g:i a.", $hl);
< goto t_;
---
> switch ($vV) {
> case "RequestDenied":
> return "You are not allowed to login into the site. Please contact your Administrator.";
> goto qq;
> case "Requester":
> return "The request could not be performed due to an error on the part of the requester.";
> goto qq;
> case "Responder":
> return "The request could not be performed due to an error on the part of the SAML responder or SAML authority.";
> goto qq;
> case "VersionMismatch":
> return "The SAML responder could not process the request because the version of the request message was incorrect.";
> goto qq;
> case "AssertionNotAfter":
> $DI = variable_get("miniorange_saml_assertion_not_after", '');
> return "SAML Assertion is expired on " . date("M j, Y g:i a.", $DI);
> goto qq;
> case "AssertionNotBefore":
> $og = variable_get("miniorange_saml_assertion_not_before", '');
> return "SAML Assertion is not valid before " . date("M j, Y g:i a.", $og);
> goto qq;
292c292
< return "Unknown";
---
> return "Unknown";
294,295c294,295
< kk:
< t_:
---
> t3:
> qq:
297c297
< public function showTestResults($Ea, $Ci)
---
> public function showTestResults($q1, $S_)
300,325c300,325
< $n8 = drupal_get_path("module", "miniorange_saml");
< echo "<div style="font-family:Calibri;padding:0 3%;">";
< if (!empty($Ea)) {
< goto T1;
< }
< echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;">TEST FAILED</div>\xd\xa <div style="color: #a94442;font-size:14pt; margin-bottom:20px;">WARNING: Some Attributes Did Not Match.</div>\xd\xa <div style="display:block;text-align:center;margin-bottom:4%;"><img style="width:15%;"src="" . $n8 . "includes/images/wrong.png"></div>";
< goto DN;
< T1:
< echo "<div style="color: #3c763d;background-color: #dff0d8; padding:2%;margin-bottom:20px;text-align:center; border:1px solid #AEDB9A; font-size:18pt;">TEST SUCCESSFUL</div>\xd\xa <div style="display:block;text-align:center;margin-bottom:4%;"><img style="width:15%;"src="" . $n8 . "/includes/images/green_check.png"></div>";
< DN:
< echo "<span style="font-size:14pt;"><b>Hello</b>, " . $Ea . "</span><br/><p style="font-weight:bold;font-size:14pt;margin-left:1%;">ATTRIBUTES RECEIVED:</p>\xd
<table style="border-collapse:collapse;border-spacing:0; display:table;width:100%; font-size:14pt;background-color:#EDEDED;">
<tr style="text-align:center;"><td style="font-weight:bold;border:2px solid #949090;padding:2%;">ATTRIBUTE NAME</td><td style="font-weight:bold;padding:2%;border:2px solid #949090; word-wrap:break-word;">ATTRIBUTE VALUE</td></tr>";
< if (!empty($Ci)) {
< goto cF;
< }
< echo "<tr><td style='font-weight:bold;border:2px solid #949090;padding:2%;'>NameID</td><td style='padding:2%;border:2px solid #949090; word-wrap:break-word;'>" . $Ea . "</td></tr>";
< goto DP;
< cF:
< echo "<tr><td style='font-weight:bold;border:2px solid #949090;padding:2%;'>NameID</td><td style='padding:2%;border:2px solid #949090; word-wrap:break-word;'>" . $Ea . "</td></tr>";
< foreach ($Ci as $mz => $rE) {
< echo "<tr><td style='font-weight:bold;border:2px solid #949090;padding:2%;'>" . $mz . "</td><td style='padding:2%;border:2px solid #949090; word-wrap:break-word;'>" . implode("<br/>", $rE) . "</td></tr>";
< gt:
< }
< Yf:
< DP:
< echo "</table></div>";
< echo "<div style="margin:3%;display:block;text-align:center;">
<input style="padding:1%;width:37%;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;\xd\xa border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;
\xa 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;\xd\xa border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;\xd\xa box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();">\xd\xa </div>
\xa <script>\xd\xa function close_and_redirect(){\xd
window.opener.redirect_to_attribute_mapping();\xd\xa self.close();
}
</script>";
---
> $Ip = drupal_get_path("module", "miniorange_saml");
> echo "<div style="font-family:Calibri;padding:0 3%;">";
> if (!empty($q1)) {
> goto FM;
> }
> echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;">TEST FAILED</div>\xd
<div style="color: #a94442;font-size:14pt; margin-bottom:20px;">WARNING: Some Attributes Did Not Match.</div>
\xa <div style="display:block;text-align:center;margin-bottom:4%;"><img style="width:15%;"src="" . $Ip . "includes/images/wrong.png"></div>";
> goto Qr;
> FM:
> echo "<div style="color: #3c763d;background-color: #dff0d8; padding:2%;margin-bottom:20px;text-align:center; border:1px solid #AEDB9A; font-size:18pt;">TEST SUCCESSFUL</div>\xd\xa <div style="display:block;text-align:center;margin-bottom:4%;"><img style="width:15%;"src="" . $Ip . "/includes/images/green_check.png"></div>";
> Qr:
> echo "<span style="font-size:14pt;"><b>Hello</b>, " . $q1 . "</span><br/><p style="font-weight:bold;font-size:14pt;margin-left:1%;">ATTRIBUTES RECEIVED:</p>
\xa <table style="border-collapse:collapse;border-spacing:0; display:table;width:100%; font-size:14pt;background-color:#EDEDED;">
<tr style="text-align:center;"><td style="font-weight:bold;border:2px solid #949090;padding:2%;">ATTRIBUTE NAME</td><td style="font-weight:bold;padding:2%;border:2px solid #949090; word-wrap:break-word;">ATTRIBUTE VALUE</td></tr>";
> if (!empty($S_)) {
> goto IA;
> }
> echo "<tr><td style='font-weight:bold;border:2px solid #949090;padding:2%;'>NameID</td><td style='padding:2%;border:2px solid #949090; word-wrap:break-word;'>" . $q1 . "</td></tr>";
> goto gk;
> IA:
> echo "<tr><td style='font-weight:bold;border:2px solid #949090;padding:2%;'>NameID</td><td style='padding:2%;border:2px solid #949090; word-wrap:break-word;'>" . $q1 . "</td></tr>";
> foreach ($S_ as $ZE => $ND) {
> echo "<tr><td style='font-weight:bold;border:2px solid #949090;padding:2%;'>" . $ZE . "</td><td style='padding:2%;border:2px solid #949090; word-wrap:break-word;'>" . implode("<br/>", $ND) . "</td></tr>";
> o_:
> }
> x1:
> gk:
> 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;\xd
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="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;
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();">\xd\xa </div>
\xa <script>\xd
function close_and_redirect(){
\xa window.opener.redirect_to_attribute_mapping();\xd
self.close();
}\xd\xa </script>";
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/includes/Assertion.php" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/includes/Assertion.php"
4c4
< include_once "Utilities.php";
---
> include_once "Utilities.php";
32c32
< public function __construct(DOMElement $gp = NULL)
---
> public function __construct(DOMElement $nV = NULL)
39c39
< $this->nameFormat = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified";
---
> $this->nameFormat = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified";
43,44c43,44
< if (!($gp === NULL)) {
< goto tw;
---
> if (!($nV === NULL)) {
> goto pg;
47,113c47,113
< tw:
< if (!($gp->localName === "EncryptedAssertion")) {
< goto F3;
< }
< $IX = Utilities::xpQuery($gp, "./xenc:EncryptedData");
< $Qe = Utilities::xpQuery($gp, "./xenc:EncryptedData/ds:KeyInfo/xenc:EncryptedKey");
< $GA = '';
< if (empty($Qe)) {
< goto ow;
< }
< $GA = $Qe[0]->firstChild->getAttribute("Algorithm");
< goto Zp;
< ow:
< $Qe = Utilities::xpQuery($gp, "./xenc:EncryptedKey/xenc:EncryptionMethod");
< $GA = $Qe[0]->getAttribute("Algorithm");
< Zp:
< $pq = Utilities::getEncryptionAlgorithm($GA);
< if (count($IX) === 0) {
< goto T8;
< }
< if (count($IX) > 1) {
< goto ei;
< }
< goto sK;
< T8:
< throw new Exception("Missing encrypted data in <saml:EncryptedAssertion>.");
< goto sK;
< ei:
< throw new Exception("More than one encrypted data element in <saml:EncryptedAssertion>.");
< sK:
< $gS = Utilities::getPrivateKey();
< $mz = new XMLSecurityKey($pq, array("type" => "private"));
< $mz->loadKey($gS, FALSE);
< $uB = array();
< $gp = Utilities::decryptElement($IX[0], $mz, $uB);
< F3:
< if ($gp->hasAttribute("ID")) {
< goto l4;
< }
< throw new Exception("Missing ID attribute on SAML assertion.");
< l4:
< $this->id = $gp->getAttribute("ID");
< if (!($gp->getAttribute("Version") !== "2.0")) {
< goto LX;
< }
< throw new Exception("Unsupported version: " . $gp->getAttribute("Version"));
< LX:
< $this->issueInstant = Utilities::xsDateTimeToTimestamp($gp->getAttribute("IssueInstant"));
< $u1 = Utilities::xpQuery($gp, "./saml_assertion:Issuer");
< if (!empty($u1)) {
< goto D7;
< }
< throw new Exception("Missing <saml:Issuer> in assertion.");
< D7:
< $this->issuer = trim($u1[0]->textContent);
< $this->parseConditions($gp);
< $this->parseAuthnStatement($gp);
< $this->parseAttributes($gp);
< $this->parseEncryptedAttributes($gp);
< $this->parseSignature($gp);
< $this->parseSubject($gp);
< }
< private function parseSubject(DOMElement $gp)
< {
< $sU = Utilities::xpQuery($gp, "./saml_assertion:Subject");
< if (empty($sU)) {
< goto Ge;
---
> pg:
> if (!($nV->localName === "EncryptedAssertion")) {
> goto vi;
> }
> $zN = Utilities::xpQuery($nV, "./xenc:EncryptedData");
> $E8 = Utilities::xpQuery($nV, "./xenc:EncryptedData/ds:KeyInfo/xenc:EncryptedKey");
> $LM = '';
> if (empty($E8)) {
> goto CZ;
> }
> $LM = isset($E8[0]->firstChild) ? $E8[0]->firstChild->getAttribute("Algorithm") : "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p";
> goto RM;
> CZ:
> $E8 = Utilities::xpQuery($nV, "./xenc:EncryptedKey/xenc:EncryptionMethod");
> $LM = $E8[0]->getAttribute("Algorithm");
> RM:
> $Py = Utilities::getEncryptionAlgorithm($LM);
> if (count($zN) === 0) {
> goto q2;
> }
> if (count($zN) > 1) {
> goto NS;
> }
> goto BC;
> q2:
> throw new Exception("Missing encrypted data in <saml:EncryptedAssertion>.");
> goto BC;
> NS:
> throw new Exception("More than one encrypted data element in <saml:EncryptedAssertion>.");
> BC:
> $ID = Utilities::getPrivateKey();
> $ZE = new XMLSecurityKey($Py, array("type" => "private"));
> $ZE->loadKey($ID, FALSE);
> $zI = array();
> $nV = Utilities::decryptElement($zN[0], $ZE, $zI);
> vi:
> if ($nV->hasAttribute("ID")) {
> goto w5;
> }
> throw new Exception("Missing ID attribute on SAML assertion.");
> w5:
> $this->id = $nV->getAttribute("ID");
> if (!($nV->getAttribute("Version") !== "2.0")) {
> goto wq;
> }
> throw new Exception("Unsupported version: " . $nV->getAttribute("Version"));
> wq:
> $this->issueInstant = Utilities::xsDateTimeToTimestamp($nV->getAttribute("IssueInstant"));
> $jm = Utilities::xpQuery($nV, "./saml_assertion:Issuer");
> if (!empty($jm)) {
> goto Ku;
> }
> throw new Exception("Missing <saml:Issuer> in assertion.");
> Ku:
> $this->issuer = trim($jm[0]->textContent);
> $this->parseConditions($nV);
> $this->parseAuthnStatement($nV);
> $this->parseAttributes($nV);
> $this->parseEncryptedAttributes($nV);
> $this->parseSignature($nV);
> $this->parseSubject($nV);
> }
> private function parseSubject(DOMElement $nV)
> {
> $Vw = Utilities::xpQuery($nV, "./saml_assertion:Subject");
> if (empty($Vw)) {
> goto IX;
115,116c115,116
< if (count($sU) > 1) {
< goto xh;
---
> if (count($Vw) > 1) {
> goto m9;
118,119c118,119
< goto mo;
< Ge:
---
> goto oW;
> IX:
121,154c121,154
< goto mo;
< xh:
< throw new Exception("More than one <saml:Subject> in <saml:Assertion>.");
< mo:
< $sU = $sU[0];
< $b3 = Utilities::xpQuery($sU, "./saml_assertion:NameID | ./saml_assertion:EncryptedID/xenc:EncryptedData");
< if (empty($b3)) {
< goto aR;
< }
< if (count($b3) > 1) {
< goto KN;
< }
< goto MW;
< aR:
< throw new Exception("Missing <saml:NameID> or <saml:EncryptedID> in <saml:Subject>.");
< goto MW;
< KN:
< throw new Exception("More than one <saml:NameID> or <saml:EncryptedD> in <saml:Subject>.");
< MW:
< $b3 = $b3[0];
< if ($b3->localName === "EncryptedData") {
< goto aC;
< }
< $this->nameId = Utilities::parseNameId($b3);
< goto CQ;
< aC:
< $this->encryptedNameId = $b3;
< CQ:
< }
< private function parseConditions(DOMElement $gp)
< {
< $Rh = Utilities::xpQuery($gp, "./saml_assertion:Conditions");
< if (empty($Rh)) {
< goto yM;
---
> goto oW;
> m9:
> throw new Exception("More than one <saml:Subject> in <saml:Assertion>.");
> oW:
> $Vw = $Vw[0];
> $Jb = Utilities::xpQuery($Vw, "./saml_assertion:NameID | ./saml_assertion:EncryptedID/xenc:EncryptedData");
> if (empty($Jb)) {
> goto w8;
> }
> if (count($Jb) > 1) {
> goto wd;
> }
> goto sy;
> w8:
> throw new Exception("Missing <saml:NameID> or <saml:EncryptedID> in <saml:Subject>.");
> goto sy;
> wd:
> throw new Exception("More than one <saml:NameID> or <saml:EncryptedD> in <saml:Subject>.");
> sy:
> $Jb = $Jb[0];
> if ($Jb->localName === "EncryptedData") {
> goto os;
> }
> $this->nameId = Utilities::parseNameId($Jb);
> goto lX;
> os:
> $this->encryptedNameId = $Jb;
> lX:
> }
> private function parseConditions(DOMElement $nV)
> {
> $GK = Utilities::xpQuery($nV, "./saml_assertion:Conditions");
> if (empty($GK)) {
> goto a0;
156,157c156,157
< if (count($Rh) > 1) {
< goto p_;
---
> if (count($GK) > 1) {
> goto QY;
159,160c159,160
< goto rn;
< yM:
---
> goto fC;
> a0:
162,204c162,204
< goto rn;
< p_:
< throw new Exception("More than one <saml:Conditions> in <saml:Assertion>.");
< rn:
< $Rh = $Rh[0];
< if (!$Rh->hasAttribute("NotBefore")) {
< goto Iu;
< }
< $pa = Utilities::xsDateTimeToTimestamp($Rh->getAttribute("NotBefore"));
< if (!($this->notBefore === NULL || $this->notBefore < $pa)) {
< goto o7;
< }
< $this->notBefore = $pa;
< o7:
< Iu:
< if (!$Rh->hasAttribute("NotOnOrAfter")) {
< goto LT;
< }
< $DA = Utilities::xsDateTimeToTimestamp($Rh->getAttribute("NotOnOrAfter"));
< if (!($this->notOnOrAfter === NULL || $this->notOnOrAfter > $DA)) {
< goto rK;
< }
< $this->notOnOrAfter = $DA;
< rK:
< LT:
< $HF = $Rh->firstChild;
< Ph:
< if (!($HF !== NULL)) {
< goto tV;
< }
< if (!$HF instanceof DOMText) {
< goto R9;
< }
< goto zX;
< R9:
< if (!($HF->namespaceURI !== "urn:oasis:names:tc:SAML:2.0:assertion")) {
< goto ko;
< }
< throw new Exception("Unknown namespace of condition: " . var_export($HF->namespaceURI, TRUE));
< ko:
< switch ($HF->localName) {
< case "AudienceRestriction":
< $gg = Utilities::extractStrings($HF, "urn:oasis:names:tc:SAML:2.0:assertion", "Audience");
---
> goto fC;
> QY:
> throw new Exception("More than one <saml:Conditions> in <saml:Assertion>.");
> fC:
> $GK = $GK[0];
> if (!$GK->hasAttribute("NotBefore")) {
> goto tr;
> }
> $g8 = Utilities::xsDateTimeToTimestamp($GK->getAttribute("NotBefore"));
> if (!($this->notBefore === NULL || $this->notBefore < $g8)) {
> goto rt;
> }
> $this->notBefore = $g8;
> rt:
> tr:
> if (!$GK->hasAttribute("NotOnOrAfter")) {
> goto SD;
> }
> $wk = Utilities::xsDateTimeToTimestamp($GK->getAttribute("NotOnOrAfter"));
> if (!($this->notOnOrAfter === NULL || $this->notOnOrAfter > $wk)) {
> goto Ky;
> }
> $this->notOnOrAfter = $wk;
> Ky:
> SD:
> $Dx = $GK->firstChild;
> BG:
> if (!($Dx !== NULL)) {
> goto YJ;
> }
> if (!$Dx instanceof DOMText) {
> goto Wx;
> }
> goto Op;
> Wx:
> if (!($Dx->namespaceURI !== "urn:oasis:names:tc:SAML:2.0:assertion")) {
> goto Go;
> }
> throw new Exception("Unknown namespace of condition: " . var_export($Dx->namespaceURI, TRUE));
> Go:
> switch ($Dx->localName) {
> case "AudienceRestriction":
> $sI = Utilities::extractStrings($Dx, "urn:oasis:names:tc:SAML:2.0:assertion", "Audience");
206c206
< goto OW;
---
> goto Bx;
208,217c208,217
< $this->validAudiences = array_intersect($this->validAudiences, $gg);
< goto w4;
< OW:
< $this->validAudiences = $gg;
< w4:
< goto N2;
< case "OneTimeUse":
< goto N2;
< case "ProxyRestriction":
< goto N2;
---
> $this->validAudiences = array_intersect($this->validAudiences, $sI);
> goto uT;
> Bx:
> $this->validAudiences = $sI;
> uT:
> goto P5;
> case "OneTimeUse":
> goto P5;
> case "ProxyRestriction":
> goto P5;
219c219
< throw new Exception("Unknown condition: " . var_export($HF->localName, TRUE));
---
> throw new Exception("Unknown condition: " . var_export($Dx->localName, TRUE));
221,232c221,232
< d1:
< N2:
< zX:
< $HF = $HF->nextSibling;
< goto Ph;
< tV:
< }
< private function parseAuthnStatement(DOMElement $gp)
< {
< $gj = Utilities::xpQuery($gp, "./saml_assertion:AuthnStatement");
< if (empty($gj)) {
< goto LA;
---
> l1:
> P5:
> Op:
> $Dx = $Dx->nextSibling;
> goto BG;
> YJ:
> }
> private function parseAuthnStatement(DOMElement $nV)
> {
> $MJ = Utilities::xpQuery($nV, "./saml_assertion:AuthnStatement");
> if (empty($MJ)) {
> goto E4;
234,235c234,235
< if (count($gj) > 1) {
< goto Rk;
---
> if (count($MJ) > 1) {
> goto ya;
237,238c237,238
< goto Kh;
< LA:
---
> goto JI;
> E4:
241,324c241,262
< goto Kh;
< Rk:
< throw new Exception("More that one <saml:AuthnStatement> in <saml:Assertion> not supported.");
< Kh:
< $pB = $gj[0];
< if ($pB->hasAttribute("AuthnInstant")) {
< goto by;
< }
< throw new Exception("Missing required AuthnInstant attribute on <saml:AuthnStatement>.");
< by:
< $this->authnInstant = Utilities::xsDateTimeToTimestamp($pB->getAttribute("AuthnInstant"));
< if (!$pB->hasAttribute("SessionNotOnOrAfter")) {
< goto Hl;
< }
< $this->sessionNotOnOrAfter = Utilities::xsDateTimeToTimestamp($pB->getAttribute("SessionNotOnOrAfter"));
< Hl:
< if (!$pB->hasAttribute("SessionIndex")) {
< goto fM;
< }
< $this->sessionIndex = $pB->getAttribute("SessionIndex");
< fM:
< $this->parseAuthnContext($pB);
< }
< private function parseAuthnContext(DOMElement $Yp)
< {
< $w5 = Utilities::xpQuery($Yp, "./saml_assertion:AuthnContext");
< if (count($w5) > 1) {
< goto vG;
< }
< if (empty($w5)) {
< goto HE;
< }
< goto NV;
< vG:
< throw new Exception("More than one <saml:AuthnContext> in <saml:AuthnStatement>.");
< goto NV;
< HE:
< throw new Exception("Missing required <saml:AuthnContext> in <saml:AuthnStatement>.");
< NV:
< $Ht = $w5[0];
< $iG = Utilities::xpQuery($Ht, "./saml_assertion:AuthnContextDeclRef");
< if (count($iG) > 1) {
< goto it;
< }
< if (count($iG) === 1) {
< goto LQ;
< }
< goto at;
< it:
< throw new Exception("More than one <saml:AuthnContextDeclRef> found?");
< goto at;
< LQ:
< $this->setAuthnContextDeclRef(trim($iG[0]->textContent));
< at:
< $Xx = Utilities::xpQuery($Ht, "./saml_assertion:AuthnContextDecl");
< if (count($Xx) > 1) {
< goto pV;
< }
< if (count($Xx) === 1) {
< goto ic;
< }
< goto k0;
< pV:
< throw new Exception("More than one <saml:AuthnContextDecl> found?");
< goto k0;
< ic:
< $this->setAuthnContextDecl(new SAML2_XML_Chunk($Xx[0]));
< k0:
< $SO = Utilities::xpQuery($Ht, "./saml_assertion:AuthnContextClassRef");
< if (count($SO) > 1) {
< goto rb;
< }
< if (count($SO) === 1) {
< goto hN;
< }
< goto jT;
< rb:
< throw new Exception("More than one <saml:AuthnContextClassRef> in <saml:AuthnContext>.");
< goto jT;
< hN:
< $this->setAuthnContextClassRef(trim($SO[0]->textContent));
< jT:
< if (!(empty($this->authnContextClassRef) && empty($this->authnContextDecl) && empty($this->authnContextDeclRef))) {
< goto ZB;
---
> goto JI;
> ya:
> throw new Exception("More that one <saml:AuthnStatement> in <saml:Assertion> not supported.");
> JI:
> $EP = $MJ[0];
> if ($EP->hasAttribute("AuthnInstant")) {
> goto m3;
> }
> throw new Exception("Missing required AuthnInstant attribute on <saml:AuthnStatement>.");
> m3:
> $this->authnInstant = Utilities::xsDateTimeToTimestamp($EP->getAttribute("AuthnInstant"));
> if (!$EP->hasAttribute("SessionNotOnOrAfter")) {
> goto HG;
> }
> $this->sessionNotOnOrAfter = Utilities::xsDateTimeToTimestamp($EP->getAttribute("SessionNotOnOrAfter"));
> HG:
> if (!$EP->hasAttribute("SessionIndex")) {
> goto Uo;
> }
> $this->sessionIndex = $EP->getAttribute("SessionIndex");
> Uo:
> $this->parseAuthnContext($EP);
326,344c264,267
< throw new Exception("Missing either <saml:AuthnContextClassRef> or <saml:AuthnContextDeclRef> or <saml:AuthnContextDecl>");
< ZB:
< $this->AuthenticatingAuthority = Utilities::extractStrings($Ht, "urn:oasis:names:tc:SAML:2.0:assertion", "AuthenticatingAuthority");
< }
< private function parseAttributes(DOMElement $gp)
< {
< $BC = TRUE;
< $AZ = Utilities::xpQuery($gp, "./saml_assertion:AttributeStatement/saml_assertion:Attribute");
< foreach ($AZ as $IB) {
< if ($IB->hasAttribute("Name")) {
< goto N8;
< }
< throw new Exception("Missing name on <saml:Attribute> element.");
< N8:
< $SS = $IB->getAttribute("Name");
< if ($IB->hasAttribute("NameFormat")) {
< goto zd;
< }
< $AB = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified";
---
> private function parseAuthnContext(DOMElement $XX)
> {
> $H_ = Utilities::xpQuery($XX, "./saml_assertion:AuthnContext");
> if (count($H_) > 1) {
346,350d268
< zd:
< $AB = $IB->getAttribute("NameFormat");
< vo:
< if ($BC) {
< goto nD;
352,353c270,271
< if (!($this->nameFormat !== $AB)) {
< goto Nr;
---
> if (empty($H_)) {
> goto bh;
355,370c273,311
< $this->nameFormat = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified";
< Nr:
< goto EC;
< nD:
< $this->nameFormat = $AB;
< $BC = FALSE;
< EC:
< if (array_key_exists($SS, $this->attributes)) {
< goto GP;
< }
< $this->attributes[$SS] = array();
< GP:
< $Wj = Utilities::xpQuery($IB, "./saml_assertion:AttributeValue");
< foreach ($Wj as $rE) {
< $this->attributes[$SS][] = trim($rE->textContent);
< BB:
---
> goto R9;
> vo:
> throw new Exception("More than one <saml:AuthnContext> in <saml:AuthnStatement>.");
> goto R9;
> bh:
> throw new Exception("Missing required <saml:AuthnContext> in <saml:AuthnStatement>.");
> R9:
> $lO = $H_[0];
> $Pw = Utilities::xpQuery($lO, "./saml_assertion:AuthnContextDeclRef");
> if (count($Pw) > 1) {
> goto vV;
> }
> if (count($Pw) === 1) {
> goto Hp;
> }
> goto UR;
> vV:
> throw new Exception("More than one <saml:AuthnContextDeclRef> found?");
> goto UR;
> Hp:
> $this->setAuthnContextDeclRef(trim($Pw[0]->textContent));
> UR:
> $Uv = Utilities::xpQuery($lO, "./saml_assertion:AuthnContextDecl");
> if (count($Uv) > 1) {
> goto MR;
> }
> if (count($Uv) === 1) {
> goto va;
> }
> goto Q2;
> MR:
> throw new Exception("More than one <saml:AuthnContextDecl> found?");
> goto Q2;
> va:
> $this->setAuthnContextDecl(new SAML2_XML_Chunk($Uv[0]));
> Q2:
> $pe = Utilities::xpQuery($lO, "./saml_assertion:AuthnContextClassRef");
> if (count($pe) > 1) {
> goto Ni;
372,373c313,314
< Tc:
< TK:
---
> if (count($pe) === 1) {
> goto yb;
375c316,324
< R8:
---
> goto k8;
> Ni:
> throw new Exception("More than one <saml:AuthnContextClassRef> in <saml:AuthnContext>.");
> goto k8;
> yb:
> $this->setAuthnContextClassRef(trim($pe[0]->textContent));
> k8:
> if (!(empty($this->authnContextClassRef) && empty($this->authnContextDecl) && empty($this->authnContextDeclRef))) {
> goto BB;
377,379c326,328
< private function parseEncryptedAttributes(DOMElement $gp)
< {
< $this->encryptedAttribute = Utilities::xpQuery($gp, "./saml_assertion:AttributeStatement/saml_assertion:EncryptedAttribute");
---
> throw new Exception("Missing either <saml:AuthnContextClassRef> or <saml:AuthnContextDeclRef> or <saml:AuthnContextDecl>");
> BB:
> $this->AuthenticatingAuthority = Utilities::extractStrings($lO, "urn:oasis:names:tc:SAML:2.0:assertion", "AuthenticatingAuthority");
381c330
< private function parseSignature(DOMElement $gp)
---
> private function parseAttributes(DOMElement $nV)
383,385c332,385
< $tw = Utilities::validateElement($gp);
< if (!($tw !== FALSE)) {
< goto S7;
---
> $Zn = TRUE;
> $D1 = Utilities::xpQuery($nV, "./saml_assertion:AttributeStatement/saml_assertion:Attribute");
> foreach ($D1 as $nK) {
> if ($nK->hasAttribute("Name")) {
> goto WE;
> }
> throw new Exception("Missing name on <saml:Attribute> element.");
> WE:
> $l2 = $nK->getAttribute("Name");
> if ($nK->hasAttribute("NameFormat")) {
> goto FC;
> }
> $OJ = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified";
> goto JW;
> FC:
> $OJ = $nK->getAttribute("NameFormat");
> JW:
> if ($Zn) {
> goto Rj;
> }
> if (!($this->nameFormat !== $OJ)) {
> goto nJ;
> }
> $this->nameFormat = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified";
> nJ:
> goto wJ;
> Rj:
> $this->nameFormat = $OJ;
> $Zn = FALSE;
> wJ:
> if (array_key_exists($l2, $this->attributes)) {
> goto hp;
> }
> $this->attributes[$l2] = array();
> hp:
> $tm = Utilities::xpQuery($nK, "./saml_assertion:AttributeValue");
> foreach ($tm as $ND) {
> $this->attributes[$l2][] = trim($ND->textContent);
> oq:
> }
> c1:
> O2:
> }
> Dx:
> }
> private function parseEncryptedAttributes(DOMElement $nV)
> {
> $this->encryptedAttribute = Utilities::xpQuery($nV, "./saml_assertion:AttributeStatement/saml_assertion:EncryptedAttribute");
> }
> private function parseSignature(DOMElement $nV)
> {
> $TI = Utilities::validateElement($nV);
> if (!($TI !== FALSE)) {
> goto HD;
388,390c388,390
< $this->certificates = $tw["Certificates"];
< $this->signatureData = $tw;
< S7:
---
> $this->certificates = $TI["Certificates"];
> $this->signatureData = $TI;
> HD:
392c392
< public function validate(XMLSecurityKey $mz)
---
> public function validate(XMLSecurityKey $ZE)
395c395
< goto kp;
---
> goto r8;
398,399c398,399
< kp:
< Utilities::validateSignature($this->signatureData, $mz);
---
> r8:
> Utilities::validateSignature($this->signatureData, $ZE);
406c406
< public function setId($BA)
---
> public function setId($jj)
408c408
< $this->id = $BA;
---
> $this->id = $jj;
414c414
< public function setIssueInstant($xw)
---
> public function setIssueInstant($zU)
416c416
< $this->issueInstant = $xw;
---
> $this->issueInstant = $zU;
422c422
< public function setIssuer($u1)
---
> public function setIssuer($jm)
424c424
< $this->issuer = $u1;
---
> $this->issuer = $jm;
429c429
< goto nU;
---
> goto ez;
431,432c431,432
< throw new Exception("Attempted to retrieve encrypted NameID without decrypting it first.");
< nU:
---
> throw new Exception("Attempted to retrieve encrypted NameID without decrypting it first.");
> ez:
435c435
< public function setNameId($b3)
---
> public function setNameId($Jb)
437c437
< $this->nameId = $b3;
---
> $this->nameId = $Jb;
442c442
< goto yb;
---
> goto UX;
445c445
< yb:
---
> UX:
448c448
< public function encryptNameId(XMLSecurityKey $mz)
---
> public function encryptNameId(XMLSecurityKey $ZE)
450,462c450,462
< $OZ = new DOMDocument();
< $rZ = $OZ->createElement("root");
< $OZ->appendChild($rZ);
< Utilities::addNameId($rZ, $this->nameId);
< $b3 = $rZ->firstChild;
< Utilities::getContainer()->debugMessage($b3, "encrypt");
< $kF = new XMLSecEnc();
< $kF->setNode($b3);
< $kF->type = XMLSecEnc::Element;
< $Gg = new XMLSecurityKey(XMLSecurityKey::AES128_CBC);
< $Gg->generateSessionKey();
< $kF->encryptKey($mz, $Gg);
< $this->encryptedNameId = $kF->encryptNode($Gg);
---
> $je = new DOMDocument();
> $bF = $je->createElement("root");
> $je->appendChild($bF);
> Utilities::addNameId($bF, $this->nameId);
> $Jb = $bF->firstChild;
> Utilities::getContainer()->debugMessage($Jb, "encrypt");
> $Ma = new XMLSecEnc();
> $Ma->setNode($Jb);
> $Ma->type = XMLSecEnc::Element;
> $s1 = new XMLSecurityKey(XMLSecurityKey::AES128_CBC);
> $s1->generateSessionKey();
> $Ma->encryptKey($ZE, $s1);
> $this->encryptedNameId = $Ma->encryptNode($s1);
465c465
< public function decryptNameId(XMLSecurityKey $mz, array $uB = array())
---
> public function decryptNameId(XMLSecurityKey $ZE, array $zI = array())
468c468
< goto o5;
---
> goto MV;
471,474c471,474
< o5:
< $b3 = Utilities::decryptElement($this->encryptedNameId, $mz, $uB);
< Utilities::getContainer()->debugMessage($b3, "decrypt");
< $this->nameId = Utilities::parseNameId($b3);
---
> MV:
> $Jb = Utilities::decryptElement($this->encryptedNameId, $ZE, $zI);
> Utilities::getContainer()->debugMessage($Jb, "decrypt");
> $this->nameId = Utilities::parseNameId($Jb);
477c477
< public function decryptAttributes(XMLSecurityKey $mz, array $uB = array())
---
> public function decryptAttributes(XMLSecurityKey $ZE, array $zI = array())
480c480
< goto NQ;
---
> goto b0;
483,523c483,516
< NQ:
< $BC = TRUE;
< $AZ = $this->encryptedAttribute;
< foreach ($AZ as $bx) {
< $IB = Utilities::decryptElement($bx->getElementsByTagName("EncryptedData")->item(0), $mz, $uB);
< if ($IB->hasAttribute("Name")) {
< goto KD;
< }
< throw new Exception("Missing name on <saml:Attribute> element.");
< KD:
< $SS = $IB->getAttribute("Name");
< if ($IB->hasAttribute("NameFormat")) {
< goto qj;
< }
< $AB = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified";
< goto ox;
< qj:
< $AB = $IB->getAttribute("NameFormat");
< ox:
< if ($BC) {
< goto Us;
< }
< if (!($this->nameFormat !== $AB)) {
< goto QR;
< }
< $this->nameFormat = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified";
< QR:
< goto sS;
< Us:
< $this->nameFormat = $AB;
< $BC = FALSE;
< sS:
< if (array_key_exists($SS, $this->attributes)) {
< goto OX;
< }
< $this->attributes[$SS] = array();
< OX:
< $Wj = Utilities::xpQuery($IB, "./saml_assertion:AttributeValue");
< foreach ($Wj as $rE) {
< $this->attributes[$SS][] = trim($rE->textContent);
< W4:
---
> b0:
> $Zn = TRUE;
> $D1 = $this->encryptedAttribute;
> foreach ($D1 as $gX) {
> $nK = Utilities::decryptElement($gX->getElementsByTagName("EncryptedData")->item(0), $ZE, $zI);
> if ($nK->hasAttribute("Name")) {
> goto tH;
> }
> throw new Exception("Missing name on <saml:Attribute> element.");
> tH:
> $l2 = $nK->getAttribute("Name");
> if ($nK->hasAttribute("NameFormat")) {
> goto Mp;
> }
> $OJ = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified";
> goto oi;
> Mp:
> $OJ = $nK->getAttribute("NameFormat");
> oi:
> if ($Zn) {
> goto Uq;
> }
> if (!($this->nameFormat !== $OJ)) {
> goto kY;
> }
> $this->nameFormat = "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified";
> kY:
> goto fV;
> Uq:
> $this->nameFormat = $OJ;
> $Zn = FALSE;
> fV:
> if (array_key_exists($l2, $this->attributes)) {
> goto H9;
525,526c518,526
< UT:
< BP:
---
> $this->attributes[$l2] = array();
> H9:
> $tm = Utilities::xpQuery($nK, "./saml_assertion:AttributeValue");
> foreach ($tm as $ND) {
> $this->attributes[$l2][] = trim($ND->textContent);
> Gv:
> }
> FW:
> vm:
528c528
< Kt:
---
> xV:
534c534
< public function setNotBefore($pa)
---
> public function setNotBefore($g8)
536c536
< $this->notBefore = $pa;
---
> $this->notBefore = $g8;
542c542
< public function setNotOnOrAfter($DA)
---
> public function setNotOnOrAfter($wk)
544c544
< $this->notOnOrAfter = $DA;
---
> $this->notOnOrAfter = $wk;
546c546
< public function setEncryptedAttributes($Ga)
---
> public function setEncryptedAttributes($V0)
548c548
< $this->requiredEncAttributes = $Ga;
---
> $this->requiredEncAttributes = $V0;
554c554
< public function setValidAudiences(array $ws = NULL)
---
> public function setValidAudiences(array $qJ = NULL)
556c556
< $this->validAudiences = $ws;
---
> $this->validAudiences = $qJ;
562c562
< public function setAuthnInstant($yv)
---
> public function setAuthnInstant($Zm)
564c564
< $this->authnInstant = $yv;
---
> $this->authnInstant = $Zm;
570c570
< public function setSessionNotOnOrAfter($Cp)
---
> public function setSessionNotOnOrAfter($Tz)
572c572
< $this->sessionNotOnOrAfter = $Cp;
---
> $this->sessionNotOnOrAfter = $Tz;
578c578
< public function setSessionIndex($gF)
---
> public function setSessionIndex($Hr)
580c580
< $this->sessionIndex = $gF;
---
> $this->sessionIndex = $Hr;
585c585
< goto h3;
---
> goto YP;
588c588
< h3:
---
> YP:
590c590
< goto m1;
---
> goto Vy;
593c593
< m1:
---
> Vy:
596c596
< public function setAuthnContext($CJ)
---
> public function setAuthnContext($ul)
598c598
< $this->setAuthnContextClassRef($CJ);
---
> $this->setAuthnContextClassRef($ul);
604c604
< public function setAuthnContextClassRef($sg)
---
> public function setAuthnContextClassRef($xQ)
606c606
< $this->authnContextClassRef = $sg;
---
> $this->authnContextClassRef = $xQ;
608c608
< public function setAuthnContextDecl(SAML2_XML_Chunk $yc)
---
> public function setAuthnContextDecl(SAML2_XML_Chunk $s_)
611c611
< goto xR;
---
> goto tx;
613,615c613,615
< throw new Exception("AuthnContextDeclRef is already registered! May only have either a Decl or a DeclRef, not both!");
< xR:
< $this->authnContextDecl = $yc;
---
> throw new Exception("AuthnContextDeclRef is already registered! May only have either a Decl or a DeclRef, not both!");
> tx:
> $this->authnContextDecl = $s_;
621c621
< public function setAuthnContextDeclRef($zh)
---
> public function setAuthnContextDeclRef($MP)
624c624
< goto mK;
---
> goto i8;
626,628c626,628
< throw new Exception("AuthnContextDecl is already registered! May only have either a Decl or a DeclRef, not both!");
< mK:
< $this->authnContextDeclRef = $zh;
---
> throw new Exception("AuthnContextDecl is already registered! May only have either a Decl or a DeclRef, not both!");
> i8:
> $this->authnContextDeclRef = $MP;
638c638
< public function setAuthenticatingAuthority($zG)
---
> public function setAuthenticatingAuthority($DK)
640c640
< $this->AuthenticatingAuthority = $zG;
---
> $this->AuthenticatingAuthority = $DK;
646c646
< public function setAttributes(array $AZ)
---
> public function setAttributes(array $D1)
648c648
< $this->attributes = $AZ;
---
> $this->attributes = $D1;
654c654
< public function setAttributeNameFormat($AB)
---
> public function setAttributeNameFormat($OJ)
656c656
< $this->nameFormat = $AB;
---
> $this->nameFormat = $OJ;
662c662
< public function setSubjectConfirmation(array $wB)
---
> public function setSubjectConfirmation(array $b1)
664c664
< $this->SubjectConfirmation = $wB;
---
> $this->SubjectConfirmation = $b1;
674c674
< public function setSignatureKey(XMLsecurityKey $ew = NULL)
---
> public function setSignatureKey(XMLsecurityKey $tc = NULL)
676c676
< $this->signatureKey = $ew;
---
> $this->signatureKey = $tc;
682c682
< public function setEncryptionKey(XMLSecurityKey $Aq = NULL)
---
> public function setEncryptionKey(XMLSecurityKey $uW = NULL)
684c684
< $this->encryptionKey = $Aq;
---
> $this->encryptionKey = $uW;
686c686
< public function setCertificates(array $MI)
---
> public function setCertificates(array $By)
688c688
< $this->certificates = $MI;
---
> $this->certificates = $By;
698c698
< public function toXML(DOMNode $Z1 = NULL)
---
> public function toXML(DOMNode $Vb = NULL)
700,701c700,701
< if ($Z1 === NULL) {
< goto JF;
---
> if ($Vb === NULL) {
> goto gb;
703,723c703,723
< $Ej = $Z1->ownerDocument;
< goto lh;
< JF:
< $Ej = new DOMDocument();
< $Z1 = $Ej;
< lh:
< $rZ = $Ej->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:" . "Assertion");
< $Z1->appendChild($rZ);
< $rZ->setAttributeNS("urn:oasis:names:tc:SAML:2.0:protocol", "samlp:tmp", "tmp");
< $rZ->removeAttributeNS("urn:oasis:names:tc:SAML:2.0:protocol", "tmp");
< $rZ->setAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:tmp", "tmp");
< $rZ->removeAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "tmp");
< $rZ->setAttributeNS("http://www.w3.org/2001/XMLSchema", "xs:tmp", "tmp");
< $rZ->removeAttributeNS("http://www.w3.org/2001/XMLSchema", "tmp");
< $rZ->setAttribute("ID", $this->id);
< $rZ->setAttribute("Version", "2.0");
< $rZ->setAttribute("IssueInstant", gmdate("Y-m-d\TH:i:s\Z", $this->issueInstant));
< $u1 = Utilities::addString($rZ, "urn:oasis:names:tc:SAML:2.0:assertion", "saml:Issuer", $this->issuer);
< $this->addSubject($rZ);
< $this->addConditions($rZ);
< $this->addAuthnStatement($rZ);
---
> $nD = $Vb->ownerDocument;
> goto BH;
> gb:
> $nD = new DOMDocument();
> $Vb = $nD;
> BH:
> $bF = $nD->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:" . "Assertion");
> $Vb->appendChild($bF);
> $bF->setAttributeNS("urn:oasis:names:tc:SAML:2.0:protocol", "samlp:tmp", "tmp");
> $bF->removeAttributeNS("urn:oasis:names:tc:SAML:2.0:protocol", "tmp");
> $bF->setAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:tmp", "tmp");
> $bF->removeAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "tmp");
> $bF->setAttributeNS("http://www.w3.org/2001/XMLSchema", "xs:tmp", "tmp");
> $bF->removeAttributeNS("http://www.w3.org/2001/XMLSchema", "tmp");
> $bF->setAttribute("ID", $this->id);
> $bF->setAttribute("Version", "2.0");
> $bF->setAttribute("IssueInstant", gmdate("Y-m-d\TH:i:s\Z", $this->issueInstant));
> $jm = Utilities::addString($bF, "urn:oasis:names:tc:SAML:2.0:assertion", "saml:Issuer", $this->issuer);
> $this->addSubject($bF);
> $this->addConditions($bF);
> $this->addAuthnStatement($bF);
725c725
< goto Gm;
---
> goto nj;
727,731c727,731
< $this->addEncryptedAttributeStatement($rZ);
< goto O0;
< Gm:
< $this->addAttributeStatement($rZ);
< O0:
---
> $this->addEncryptedAttributeStatement($bF);
> goto gO;
> nj:
> $this->addAttributeStatement($bF);
> gO:
733c733
< goto bv;
---
> goto Wr;
735,737c735,737
< Utilities::insertSignature($this->signatureKey, $this->certificates, $rZ, $u1->nextSibling);
< bv:
< return $rZ;
---
> Utilities::insertSignature($this->signatureKey, $this->certificates, $bF, $jm->nextSibling);
> Wr:
> return $bF;
739c739
< private function addSubject(DOMElement $rZ)
---
> private function addSubject(DOMElement $bF)
742c742
< goto II;
---
> goto vB;
745,747c745,747
< II:
< $sU = $rZ->ownerDocument->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:Subject");
< $rZ->appendChild($sU);
---
> vB:
> $Vw = $bF->ownerDocument->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:Subject");
> $bF->appendChild($Vw);
749c749
< goto Ew;
---
> goto jy;
751,768c751,768
< $fm = $sU->ownerDocument->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:" . "EncryptedID");
< $sU->appendChild($fm);
< $fm->appendChild($sU->ownerDocument->importNode($this->encryptedNameId, TRUE));
< goto zY;
< Ew:
< Utilities::addNameId($sU, $this->nameId);
< zY:
< foreach ($this->SubjectConfirmation as $z5) {
< $z5->toXML($sU);
< ov:
< }
< sG:
< }
< private function addConditions(DOMElement $rZ)
< {
< $Ej = $rZ->ownerDocument;
< $Rh = $Ej->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:Conditions");
< $rZ->appendChild($Rh);
---
> $ko = $Vw->ownerDocument->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:" . "EncryptedID");
> $Vw->appendChild($ko);
> $ko->appendChild($Vw->ownerDocument->importNode($this->encryptedNameId, TRUE));
> goto fb;
> jy:
> Utilities::addNameId($Vw, $this->nameId);
> fb:
> foreach ($this->SubjectConfirmation as $cu) {
> $cu->toXML($Vw);
> Vz:
> }
> Et:
> }
> private function addConditions(DOMElement $bF)
> {
> $nD = $bF->ownerDocument;
> $GK = $nD->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:Conditions");
> $bF->appendChild($GK);
770c770
< goto xj;
---
> goto g5;
772,773c772,773
< $Rh->setAttribute("NotBefore", gmdate("Y-m-d\TH:i:s\Z", $this->notBefore));
< xj:
---
> $GK->setAttribute("NotBefore", gmdate("Y-m-d\TH:i:s\Z", $this->notBefore));
> g5:
775c775
< goto Uv;
---
> goto SG;
777,778c777,778
< $Rh->setAttribute("NotOnOrAfter", gmdate("Y-m-d\TH:i:s\Z", $this->notOnOrAfter));
< Uv:
---
> $GK->setAttribute("NotOnOrAfter", gmdate("Y-m-d\TH:i:s\Z", $this->notOnOrAfter));
> SG:
780c780
< goto sF;
---
> goto gL;
782,785c782,785
< $JQ = $Ej->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AudienceRestriction");
< $Rh->appendChild($JQ);
< Utilities::addStrings($JQ, "urn:oasis:names:tc:SAML:2.0:assertion", "saml:Audience", FALSE, $this->validAudiences);
< sF:
---
> $P0 = $nD->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AudienceRestriction");
> $GK->appendChild($P0);
> Utilities::addStrings($P0, "urn:oasis:names:tc:SAML:2.0:assertion", "saml:Audience", FALSE, $this->validAudiences);
> gL:
787c787
< private function addAuthnStatement(DOMElement $rZ)
---
> private function addAuthnStatement(DOMElement $bF)
790c790
< goto lK;
---
> goto jJ;
793,797c793,797
< lK:
< $Ej = $rZ->ownerDocument;
< $Yp = $Ej->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AuthnStatement");
< $rZ->appendChild($Yp);
< $Yp->setAttribute("AuthnInstant", gmdate("Y-m-d\TH:i:s\Z", $this->authnInstant));
---
> jJ:
> $nD = $bF->ownerDocument;
> $XX = $nD->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AuthnStatement");
> $bF->appendChild($XX);
> $XX->setAttribute("AuthnInstant", gmdate("Y-m-d\TH:i:s\Z", $this->authnInstant));
799c799
< goto hX;
---
> goto VE;
801,802c801,802
< $Yp->setAttribute("SessionNotOnOrAfter", gmdate("Y-m-d\TH:i:s\Z", $this->sessionNotOnOrAfter));
< hX:
---
> $XX->setAttribute("SessionNotOnOrAfter", gmdate("Y-m-d\TH:i:s\Z", $this->sessionNotOnOrAfter));
> VE:
804c804
< goto KW;
---
> goto WO;
806,809c806,809
< $Yp->setAttribute("SessionIndex", $this->sessionIndex);
< KW:
< $Ht = $Ej->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AuthnContext");
< $Yp->appendChild($Ht);
---
> $XX->setAttribute("SessionIndex", $this->sessionIndex);
> WO:
> $lO = $nD->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AuthnContext");
> $XX->appendChild($lO);
811c811
< goto FA;
---
> goto Gk;
813,814c813,814
< Utilities::addString($Ht, "urn:oasis:names:tc:SAML:2.0:assertion", "saml:AuthnContextClassRef", $this->authnContextClassRef);
< FA:
---
> Utilities::addString($lO, "urn:oasis:names:tc:SAML:2.0:assertion", "saml:AuthnContextClassRef", $this->authnContextClassRef);
> Gk:
816c816
< goto ED;
---
> goto j3;
818,819c818,819
< $this->authnContextDecl->toXML($Ht);
< ED:
---
> $this->authnContextDecl->toXML($lO);
> j3:
821c821
< goto bj;
---
> goto gR;
823,825c823,825
< Utilities::addString($Ht, "urn:oasis:names:tc:SAML:2.0:assertion", "saml:AuthnContextDeclRef", $this->authnContextDeclRef);
< bj:
< Utilities::addStrings($Ht, "urn:oasis:names:tc:SAML:2.0:assertion", "saml:AuthenticatingAuthority", FALSE, $this->AuthenticatingAuthority);
---
> Utilities::addString($lO, "urn:oasis:names:tc:SAML:2.0:assertion", "saml:AuthnContextDeclRef", $this->authnContextDeclRef);
> gR:
> Utilities::addStrings($lO, "urn:oasis:names:tc:SAML:2.0:assertion", "saml:AuthenticatingAuthority", FALSE, $this->AuthenticatingAuthority);
827c827
< private function addAttributeStatement(DOMElement $rZ)
---
> private function addAttributeStatement(DOMElement $bF)
830c830
< goto UI;
---
> goto Pm;
833,891c833,891
< UI:
< $Ej = $rZ->ownerDocument;
< $if = $Ej->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AttributeStatement");
< $rZ->appendChild($if);
< foreach ($this->attributes as $SS => $Wj) {
< $IB = $Ej->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:Attribute");
< $if->appendChild($IB);
< $IB->setAttribute("Name", $SS);
< if (!($this->nameFormat !== "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified")) {
< goto ec;
< }
< $IB->setAttribute("NameFormat", $this->nameFormat);
< ec:
< foreach ($Wj as $rE) {
< if (is_string($rE)) {
< goto y4;
< }
< if (is_int($rE)) {
< goto gc;
< }
< $Ak = NULL;
< goto H9;
< y4:
< $Ak = "xs:string";
< goto H9;
< gc:
< $Ak = "xs:integer";
< H9:
< $TQ = $Ej->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AttributeValue");
< $IB->appendChild($TQ);
< if (!($Ak !== NULL)) {
< goto MD;
< }
< $TQ->setAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:type", $Ak);
< MD:
< if (!is_null($rE)) {
< goto k3;
< }
< $TQ->setAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:nil", "true");
< k3:
< if ($rE instanceof DOMNodeList) {
< goto Vj;
< }
< $TQ->appendChild($Ej->createTextNode($rE));
< goto li;
< Vj:
< $Eo = 0;
< ib:
< if (!($Eo < $rE->length)) {
< goto pp;
< }
< $HF = $Ej->importNode($rE->item($Eo), TRUE);
< $TQ->appendChild($HF);
< ZS:
< $Eo++;
< goto ib;
< pp:
< li:
< rE:
---
> Pm:
> $nD = $bF->ownerDocument;
> $ev = $nD->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AttributeStatement");
> $bF->appendChild($ev);
> foreach ($this->attributes as $l2 => $tm) {
> $nK = $nD->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:Attribute");
> $ev->appendChild($nK);
> $nK->setAttribute("Name", $l2);
> if (!($this->nameFormat !== "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified")) {
> goto Kd;
> }
> $nK->setAttribute("NameFormat", $this->nameFormat);
> Kd:
> foreach ($tm as $ND) {
> if (is_string($ND)) {
> goto dE;
> }
> if (is_int($ND)) {
> goto HQ;
> }
> $rV = NULL;
> goto pR;
> dE:
> $rV = "xs:string";
> goto pR;
> HQ:
> $rV = "xs:integer";
> pR:
> $dX = $nD->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AttributeValue");
> $nK->appendChild($dX);
> if (!($rV !== NULL)) {
> goto Kr;
> }
> $dX->setAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:type", $rV);
> Kr:
> if (!is_null($ND)) {
> goto pY;
> }
> $dX->setAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:nil", "true");
> pY:
> if ($ND instanceof DOMNodeList) {
> goto zU;
> }
> $dX->appendChild($nD->createTextNode($ND));
> goto IZ;
> zU:
> $Xc = 0;
> La:
> if (!($Xc < $ND->length)) {
> goto R0;
> }
> $Dx = $nD->importNode($ND->item($Xc), TRUE);
> $dX->appendChild($Dx);
> i6:
> $Xc++;
> goto La;
> R0:
> IZ:
> MZ:
893,894c893,894
< DI:
< ss:
---
> m_:
> dw:
896c896
< p2:
---
> CO:
898c898
< private function addEncryptedAttributeStatement(DOMElement $rZ)
---
> private function addEncryptedAttributeStatement(DOMElement $bF)
901c901
< goto rW;
---
> goto UB;
904,972c904,972
< rW:
< $Ej = $rZ->ownerDocument;
< $if = $Ej->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AttributeStatement");
< $rZ->appendChild($if);
< foreach ($this->attributes as $SS => $Wj) {
< $e1 = new DOMDocument();
< $IB = $e1->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:Attribute");
< $IB->setAttribute("Name", $SS);
< $e1->appendChild($IB);
< if (!($this->nameFormat !== "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified")) {
< goto Xz;
< }
< $IB->setAttribute("NameFormat", $this->nameFormat);
< Xz:
< foreach ($Wj as $rE) {
< if (is_string($rE)) {
< goto bK;
< }
< if (is_int($rE)) {
< goto jm;
< }
< $Ak = NULL;
< goto Je;
< bK:
< $Ak = "xs:string";
< goto Je;
< jm:
< $Ak = "xs:integer";
< Je:
< $TQ = $e1->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AttributeValue");
< $IB->appendChild($TQ);
< if (!($Ak !== NULL)) {
< goto av;
< }
< $TQ->setAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:type", $Ak);
< av:
< if ($rE instanceof DOMNodeList) {
< goto RL;
< }
< $TQ->appendChild($e1->createTextNode($rE));
< goto Aw;
< RL:
< $Eo = 0;
< qy:
< if (!($Eo < $rE->length)) {
< goto r1;
< }
< $HF = $e1->importNode($rE->item($Eo), TRUE);
< $TQ->appendChild($HF);
< fF:
< $Eo++;
< goto qy;
< r1:
< Aw:
< BU:
< }
< x1:
< $ha = new XMLSecEnc();
< $ha->setNode($e1->documentElement);
< $ha->type = "http://www.w3.org/2001/04/xmlenc#Element";
< $Gg = new XMLSecurityKey(XMLSecurityKey::AES256_CBC);
< $Gg->generateSessionKey();
< $ha->encryptKey($this->encryptionKey, $Gg);
< $qM = $ha->encryptNode($Gg);
< $kw = $Ej->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:EncryptedAttribute");
< $if->appendChild($kw);
< $dN = $Ej->importNode($qM, TRUE);
< $kw->appendChild($dN);
< JJ:
---
> UB:
> $nD = $bF->ownerDocument;
> $ev = $nD->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AttributeStatement");
> $bF->appendChild($ev);
> foreach ($this->attributes as $l2 => $tm) {
> $E4 = new DOMDocument();
> $nK = $E4->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:Attribute");
> $nK->setAttribute("Name", $l2);
> $E4->appendChild($nK);
> if (!($this->nameFormat !== "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified")) {
> goto F5;
> }
> $nK->setAttribute("NameFormat", $this->nameFormat);
> F5:
> foreach ($tm as $ND) {
> if (is_string($ND)) {
> goto gi;
> }
> if (is_int($ND)) {
> goto vA;
> }
> $rV = NULL;
> goto dU;
> gi:
> $rV = "xs:string";
> goto dU;
> vA:
> $rV = "xs:integer";
> dU:
> $dX = $E4->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:AttributeValue");
> $nK->appendChild($dX);
> if (!($rV !== NULL)) {
> goto Yl;
> }
> $dX->setAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:type", $rV);
> Yl:
> if ($ND instanceof DOMNodeList) {
> goto dt;
> }
> $dX->appendChild($E4->createTextNode($ND));
> goto UZ;
> dt:
> $Xc = 0;
> hl:
> if (!($Xc < $ND->length)) {
> goto XV;
> }
> $Dx = $E4->importNode($ND->item($Xc), TRUE);
> $dX->appendChild($Dx);
> eo:
> $Xc++;
> goto hl;
> XV:
> UZ:
> hB:
> }
> oQ:
> $Jp = new XMLSecEnc();
> $Jp->setNode($E4->documentElement);
> $Jp->type = "http://www.w3.org/2001/04/xmlenc#Element";
> $s1 = new XMLSecurityKey(XMLSecurityKey::AES256_CBC);
> $s1->generateSessionKey();
> $Jp->encryptKey($this->encryptionKey, $s1);
> $z1 = $Jp->encryptNode($s1);
> $cB = $nD->createElementNS("urn:oasis:names:tc:SAML:2.0:assertion", "saml:EncryptedAttribute");
> $ev->appendChild($cB);
> $ug = $nD->importNode($z1, TRUE);
> $cB->appendChild($ug);
> Hr:
974c974
< yi:
---
> BV:
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/includes/AuthnRequest.php" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/includes/AuthnRequest.php"
6c6
< public function initiateLogin($NA, $Kk, $u1, $RE, $qG, $uF, $yr, $uy)
---
> public function initiateLogin($XZ, $U3, $jm, $VC, $e1, $YT, $h7, $hH)
8,9c8,9
< $Mr = Utilities::createAuthnRequest($NA, $u1, $Kk, $RE, $uF, "false");
< $this->sendSamlRequestByBindingType($Mr, $uF, $qG, $Kk, $yr, $uy);
---
> $UK = Utilities::createAuthnRequest($XZ, $jm, $U3, $VC, $YT, "false");
> $this->sendSamlRequestByBindingType($UK, $YT, $e1, $U3, $h7, $hH);
11c11
< function sendSamlRequestByBindingType($bA, $uF, $ih, $zM, $yr, $uy)
---
> function sendSamlRequestByBindingType($JW, $YT, $KN, $Gr, $h7, $hH)
13,14c13,14
< if (empty($uF) || $uF == "HTTP-Redirect") {
< goto xw;
---
> if (empty($YT) || $YT == "HTTP-Redirect") {
> goto j9;
16,17c16,17
< if ($yr) {
< goto WK;
---
> if ($h7) {
> goto Hi;
19,20c19,20
< $P7 = base64_encode($bA);
< Utilities::postSAMLRequest($zM, $P7, $ih);
---
> $Ao = base64_encode($JW);
> Utilities::postSAMLRequest($Gr, $Ao, $KN);
22,67c22,67
< WK:
< $P7 = Utilities::signXML($bA, Utilities::getPublicCertificate(), Utilities::getPrivateKey(), $uy, "NameIDPolicy");
< Utilities::postSAMLRequest($zM, $P7, $ih);
< goto Vt;
< xw:
< $Ax = $zM;
< if (strpos($zM, "?") !== false) {
< goto C5;
< }
< $Ax .= "?";
< goto ho;
< C5:
< $Ax .= "&";
< ho:
< $bA = "SAMLRequest=" . $bA . "&RelayState=" . urlencode($ih);
< if (!$yr) {
< goto lO;
< }
< $sK = array("type" => "private");
< switch ($uy) {
< case "RSA_SHA256":
< $bA .= "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA256);
< $mz = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, $sK);
< goto f_;
< case "RSA_SHA384":
< $bA .= "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA384);
< $mz = new XMLSecurityKey(XMLSecurityKey::RSA_SHA384, $sK);
< goto f_;
< case "RSA_SHA512":
< $bA .= "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA512);
< $mz = new XMLSecurityKey(XMLSecurityKey::RSA_SHA512, $sK);
< goto f_;
< case "RSA_SHA1":
< $bA .= "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA1);
< $mz = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, $sK);
< goto f_;
< }
< mT:
< f_:
< $mz->loadKey(Utilities::getPrivateKey(), FALSE);
< $DX = $mz->signData($bA);
< $DX = base64_encode($DX);
< $bA .= "&Signature=" . urlencode($DX);
< lO:
< $Ax .= $bA;
< header("Location: " . $Ax);
---
> Hi:
> $Ao = Utilities::signXML($JW, Utilities::getPublicCertificate(), Utilities::getPrivateKey(), $hH, "NameIDPolicy");
> Utilities::postSAMLRequest($Gr, $Ao, $KN);
> goto Ty;
> j9:
> $zE = $Gr;
> if (strpos($Gr, "?") !== false) {
> goto wz;
> }
> $zE .= "?";
> goto oh;
> wz:
> $zE .= "&";
> oh:
> $JW = "SAMLRequest=" . $JW . "&RelayState=" . urlencode($KN);
> if (!$h7) {
> goto QN;
> }
> $ex = array("type" => "private");
> switch ($hH) {
> case "RSA_SHA256":
> $JW .= "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA256);
> $ZE = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, $ex);
> goto nD;
> case "RSA_SHA384":
> $JW .= "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA384);
> $ZE = new XMLSecurityKey(XMLSecurityKey::RSA_SHA384, $ex);
> goto nD;
> case "RSA_SHA512":
> $JW .= "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA512);
> $ZE = new XMLSecurityKey(XMLSecurityKey::RSA_SHA512, $ex);
> goto nD;
> case "RSA_SHA1":
> $JW .= "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA1);
> $ZE = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, $ex);
> goto nD;
> }
> vs:
> nD:
> $ZE->loadKey(Utilities::getPrivateKey(), FALSE);
> $ge = $ZE->signData($JW);
> $ge = base64_encode($ge);
> $JW .= "&Signature=" . urlencode($ge);
> QN:
> $zE .= $JW;
> header("Location: " . $zE);
69c69
< Vt:
---
> Ty:
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/includes/MetadataReader.php" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/includes/MetadataReader.php"
8c8
< public function __construct(DOMNode $gp = NULL)
---
> public function __construct(DOMNode $nV = NULL)
12,20c12,20
< $X0 = Utilities::xpQuery($gp, "./saml_metadata:EntityDescriptor");
< foreach ($X0 as $ey) {
< $fl = Utilities::xpQuery($ey, "./saml_metadata:IDPSSODescriptor");
< if (!(isset($fl) && !empty($fl))) {
< goto wO;
< }
< array_push($this->identityProviders, new IdentityProviders($ey));
< wO:
< cp:
---
> $id = Utilities::xpQuery($nV, "./saml_metadata:EntityDescriptor");
> foreach ($id as $D6) {
> $Ii = Utilities::xpQuery($D6, "./saml_metadata:IDPSSODescriptor");
> if (!(isset($Ii) && !empty($Ii))) {
> goto xv;
> }
> array_push($this->identityProviders, new IdentityProviders($D6));
> xv:
> G5:
22c22
< Qe:
---
> tm:
42c42
< public function __construct(DOMElement $gp = NULL)
---
> public function __construct(DOMElement $nV = NULL)
49,50c49,50
< if (!$gp->hasAttribute("entityID")) {
< goto LR;
---
> if (!$nV->hasAttribute("entityID")) {
> goto lz;
52,134c52,91
< $this->entityID = $gp->getAttribute("entityID");
< LR:
< if (!$gp->hasAttribute("WantAuthnRequestsSigned")) {
< goto dD;
< }
< $this->signedRequest = $gp->getAttribute("WantAuthnRequestsSigned");
< dD:
< $fl = Utilities::xpQuery($gp, "./saml_metadata:IDPSSODescriptor");
< if (count($fl) > 1) {
< goto Hk;
< }
< if (empty($fl)) {
< goto Ro;
< }
< goto UL;
< Hk:
< throw new Exception("More than one <IDPSSODescriptor> in <EntityDescriptor>.");
< goto UL;
< Ro:
< throw new Exception("Missing required <IDPSSODescriptor> in <EntityDescriptor>.");
< UL:
< $JT = $fl[0];
< $oA = Utilities::xpQuery($gp, "./saml_metadata:Extensions");
< if (!$oA) {
< goto Jc;
< }
< $this->parseInfo($JT);
< Jc:
< $this->parseSSOService($JT);
< $this->parseSLOService($JT);
< $this->parsex509Certificate($JT);
< }
< private function parseInfo($gp)
< {
< $E8 = Utilities::xpQuery($gp, "./mdui:UIInfo/mdui:DisplayName");
< foreach ($E8 as $SS) {
< if (!($SS->hasAttribute("xml:lang") && $SS->getAttribute("xml:lang") == "en")) {
< goto Fw;
< }
< $this->idpName = $SS->textContent;
< Fw:
< nm:
< }
< hD:
< }
< private function parseSSOService($gp)
< {
< $Ex = Utilities::xpQuery($gp, "./saml_metadata:SingleSignOnService");
< foreach ($Ex as $up) {
< $ds = str_replace("urn:oasis:names:tc:SAML:2.0:bindings:", '', $up->getAttribute("Binding"));
< $this->loginDetails = array_merge($this->loginDetails, array($ds => $up->getAttribute("Location")));
< nl:
< }
< sC:
< }
< private function parseSLOService($gp)
< {
< $ue = Utilities::xpQuery($gp, "./saml_metadata:SingleLogoutService");
< foreach ($ue as $CK) {
< $ds = str_replace("urn:oasis:names:tc:SAML:2.0:bindings:", '', $CK->getAttribute("Binding"));
< $this->logoutDetails = array_merge($this->logoutDetails, array($ds => $CK->getAttribute("Location")));
< D0:
< }
< cG:
< }
< private function parsex509Certificate($gp)
< {
< foreach (Utilities::xpQuery($gp, "./saml_metadata:KeyDescriptor") as $gc) {
< if ($gc->hasAttribute("use")) {
< goto nk;
< }
< $this->parseSigningCertificate($gc);
< goto pu;
< nk:
< if ($gc->getAttribute("use") == "encryption") {
< goto RW;
< }
< $this->parseSigningCertificate($gc);
< goto wY;
< RW:
< $this->parseEncryptionCertificate($gc);
< wY:
< pu:
---
> $this->entityID = $nV->getAttribute("entityID");
> lz:
> if (!$nV->hasAttribute("WantAuthnRequestsSigned")) {
> goto E8;
> }
> $this->signedRequest = $nV->getAttribute("WantAuthnRequestsSigned");
> E8:
> $Ii = Utilities::xpQuery($nV, "./saml_metadata:IDPSSODescriptor");
> if (count($Ii) > 1) {
> goto Kn;
> }
> if (empty($Ii)) {
> goto wZ;
> }
> goto q3;
> Kn:
> throw new Exception("More than one <IDPSSODescriptor> in <EntityDescriptor>.");
> goto q3;
> wZ:
> throw new Exception("Missing required <IDPSSODescriptor> in <EntityDescriptor>.");
> q3:
> $jO = $Ii[0];
> $Bj = Utilities::xpQuery($nV, "./saml_metadata:Extensions");
> if (!$Bj) {
> goto mq;
> }
> $this->parseInfo($jO);
> mq:
> $this->parseSSOService($jO);
> $this->parseSLOService($jO);
> $this->parsex509Certificate($jO);
> }
> private function parseInfo($nV)
> {
> $pa = Utilities::xpQuery($nV, "./mdui:UIInfo/mdui:DisplayName");
> foreach ($pa as $l2) {
> if (!($l2->hasAttribute("xml:lang") && $l2->getAttribute("xml:lang") == "en")) {
> goto mW;
> }
> $this->idpName = $l2->textContent;
135a93,135
> JQ:
> }
> Sr:
> }
> private function parseSSOService($nV)
> {
> $eS = Utilities::xpQuery($nV, "./saml_metadata:SingleSignOnService");
> foreach ($eS as $SU) {
> $x_ = str_replace("urn:oasis:names:tc:SAML:2.0:bindings:", '', $SU->getAttribute("Binding"));
> $this->loginDetails = array_merge($this->loginDetails, array($x_ => $SU->getAttribute("Location")));
> mJ:
> }
> eB:
> }
> private function parseSLOService($nV)
> {
> $nI = Utilities::xpQuery($nV, "./saml_metadata:SingleLogoutService");
> foreach ($nI as $ww) {
> $x_ = str_replace("urn:oasis:names:tc:SAML:2.0:bindings:", '', $ww->getAttribute("Binding"));
> $this->logoutDetails = array_merge($this->logoutDetails, array($x_ => $ww->getAttribute("Location")));
> G2:
> }
> oJ:
> }
> private function parsex509Certificate($nV)
> {
> foreach (Utilities::xpQuery($nV, "./saml_metadata:KeyDescriptor") as $t2) {
> if ($t2->hasAttribute("use")) {
> goto Z6;
> }
> $this->parseSigningCertificate($t2);
> goto yq;
> Z6:
> if ($t2->getAttribute("use") == "encryption") {
> goto Xx;
> }
> $this->parseSigningCertificate($t2);
> goto PI;
> Xx:
> $this->parseEncryptionCertificate($t2);
> PI:
> yq:
> S7:
137c137
< rp:
---
> pX:
139c139
< private function parseSigningCertificate($gp)
---
> private function parseSigningCertificate($nV)
141,145c141,145
< $SD = Utilities::xpQuery($gp, "./ds:KeyInfo/ds:X509Data/ds:X509Certificate");
< $S3 = trim($SD[0]->textContent);
< $S3 = str_replace(array("
", "\xa", "\x9", " "), '', $S3);
< if (empty($SD)) {
< goto bT;
---
> $hI = Utilities::xpQuery($nV, "./ds:KeyInfo/ds:X509Data/ds:X509Certificate");
> $ci = trim($hI[0]->textContent);
> $ci = str_replace(array("\xd", "\xa", " ", " "), '', $ci);
> if (empty($hI)) {
> goto Bh;
147,148c147,148
< array_push($this->signingCertificate, Utilities::sanitize_certificate($S3));
< bT:
---
> array_push($this->signingCertificate, Utilities::sanitize_certificate($ci));
> Bh:
150c150
< private function parseEncryptionCertificate($gp)
---
> private function parseEncryptionCertificate($nV)
152,156c152,156
< $SD = Utilities::xpQuery($gp, "./ds:KeyInfo/ds:X509Data/ds:X509Certificate");
< $S3 = trim($SD[0]->textContent);
< $S3 = str_replace(array("
", "
", " ", " "), '', $S3);
< if (empty($SD)) {
< goto wS;
---
> $hI = Utilities::xpQuery($nV, "./ds:KeyInfo/ds:X509Data/ds:X509Certificate");
> $ci = trim($hI[0]->textContent);
> $ci = str_replace(array("\xd", "
", "\x9", " "), '', $ci);
> if (empty($hI)) {
> goto oX;
158,159c158,159
< array_push($this->encryptionCertificate, $S3);
< wS:
---
> array_push($this->encryptionCertificate, $ci);
> oX:
169c169
< public function getLoginURL($ds)
---
> public function getLoginURL($x_)
171c171
< return $this->loginDetails[$ds];
---
> return $this->loginDetails[$x_];
173c173
< public function getLogoutURL($ds)
---
> public function getLogoutURL($x_)
175c175
< return isset($this->logoutDetails[$ds]) ? $this->logoutDetails[$ds] : '';
---
> return isset($this->logoutDetails[$x_]) ? $this->logoutDetails[$x_] : '';
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/includes/Response.php" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/includes/Response.php"
10c10
< public function __construct(DOMElement $gp = NULL)
---
> public function __construct(DOMElement $nV = NULL)
14,15c14,15
< if (!($gp === NULL)) {
< goto vR;
---
> if (!($nV === NULL)) {
> goto X7;
18,49c18,49
< vR:
< $tw = Utilities::validateElement($gp);
< if (!($tw !== FALSE)) {
< goto Hr;
< }
< $this->certificates = $tw["Certificates"];
< $this->signatureData = $tw;
< Hr:
< if (!$gp->hasAttribute("Destination")) {
< goto c0;
< }
< $this->destination = $gp->getAttribute("Destination");
< c0:
< $HF = $gp->firstChild;
< pi:
< if (!($HF !== NULL)) {
< goto mw;
< }
< if (!($HF->namespaceURI !== "urn:oasis:names:tc:SAML:2.0:assertion")) {
< goto vh;
< }
< goto J0;
< vh:
< if (!($HF->localName === "Assertion" || $HF->localName === "EncryptedAssertion")) {
< goto iR;
< }
< $this->assertions[] = new SAML2_Assertion($HF);
< iR:
< J0:
< $HF = $HF->nextSibling;
< goto pi;
< mw:
---
> X7:
> $TI = Utilities::validateElement($nV);
> if (!($TI !== FALSE)) {
> goto gv;
> }
> $this->certificates = $TI["Certificates"];
> $this->signatureData = $TI;
> gv:
> if (!$nV->hasAttribute("Destination")) {
> goto Vw;
> }
> $this->destination = $nV->getAttribute("Destination");
> Vw:
> $Dx = $nV->firstChild;
> qb:
> if (!($Dx !== NULL)) {
> goto Hh;
> }
> if (!($Dx->namespaceURI !== "urn:oasis:names:tc:SAML:2.0:assertion")) {
> goto Pa;
> }
> goto x6;
> Pa:
> if (!($Dx->localName === "Assertion" || $Dx->localName === "EncryptedAssertion")) {
> goto ri;
> }
> $this->assertions[] = new SAML2_Assertion($Dx);
> ri:
> x6:
> $Dx = $Dx->nextSibling;
> goto qb;
> Hh:
55c55
< public function setAssertions(array $V8)
---
> public function setAssertions(array $aa)
57c57
< $this->assertions = $V8;
---
> $this->assertions = $aa;
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/includes/Utilities.php" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/includes/Utilities.php"
8,23c8,23
< $ZQ = db_query("SELECT mo_idp_name FROM miniorange_saml_idp_list");
< $IX = $ZQ->fetchAll();
< $fi = json_decode(json_encode($IX), TRUE);
< $Fy = count($fi);
< $pZ = array();
< $Eo = 0;
< F1:
< if (!($Eo < $Fy)) {
< goto Gz;
< }
< $pZ[$Eo] = $fi[$Eo]["mo_idp_name"];
< x8:
< $Eo++;
< goto F1;
< Gz:
< return $pZ;
---
> $rX = db_query("SELECT mo_idp_name FROM miniorange_saml_idp_list");
> $zN = $rX->fetchAll();
> $Q3 = json_decode(json_encode($zN), TRUE);
> $Vk = count($Q3);
> $lu = array();
> $Xc = 0;
> lj:
> if (!($Xc < $Vk)) {
> goto Gj;
> }
> $lu[$Xc] = $Q3[$Xc]["mo_idp_name"];
> uu:
> $Xc++;
> goto lj;
> Gj:
> return $lu;
27,31c27,31
< $XB = variable_get("miniorange_saml_attrs_list");
< $UB = variable_get("miniorange_saml_email_attribute", "NameID");
< $ym = variable_get("miniorange_saml_email_id_value");
< if (!empty($ym)) {
< goto mL;
---
> $dj = variable_get("miniorange_saml_attrs_list");
> $Au = variable_get("miniorange_saml_email_attribute", "NameID");
> $FL = variable_get("miniorange_saml_email_id_value");
> if (!empty($FL)) {
> goto yl;
35,72c35,72
< mL:
< $form["miniorange_idp_guide_link"] = array("#markup" => "<div class="mo_saml_table_layout mo_saml_table_layout_support_1">");
< $form["miniorange_saml_attr_header"] = array("#markup" => "<div style="font-size: 1.3em;font-weight: 600;font-family: sans-serif;">Attributes received from the Identity Provider:</div><br>");
< $form["mo_saml_attrs_list_idp"] = array("#markup" => "<div class="table-responsive mo_guide_text-center" style="font-family: sans-serif;font-size: 12px;">
<table class="mo_guide_table mo_guide_table-striped mo_guide_table-bordered" style="border: 1px solid #ddd;max-width: 100%;border-collapse: collapse;">\xd\xa <thead>
\xa <tr>\xd\xa <th class="mo_guide_text-center mo_td_values">ATTRIBUTE NAME</th>
<th class="mo_guide_text-center mo_td_values">ATTRIBUTE VALUE</th> \xd
</tr>
</thead>");
< $sN = '';
< if (!(isset($XB) && !empty($XB))) {
< goto Pw;
< }
< foreach ($XB as $gQ => $Nd) {
< $sN .= "<tr><td>" . $gQ . "</td><td>" . $Nd[0] . "</td></tr>";
< Lc:
< }
< Ga:
< Pw:
< $form["miniorange_saml_guide_table_list"] = array("#markup" => "<tbody style="font-weight:bold;font-size: 12px;color:gray;"><tr><td>" . $UB . "</td><td>" . $ym . "</td></tr>" . $sN . "</tbody></table>");
< $form["miniorange_saml_clear_attr_list"] = array("#type" => "submit", "#value" => t("Clear Attribute List"), "#submit" => array("clear_attr_list"), "#attributes" => array("style" => "border-radius:4px;background: #337ab7;color: #ffffff;text-shadow: 0 -1px 1px #337ab7, 1px 0 1px #337ab7, 0 1px 1px #337ab7, -1px 0 1px #337ab7;
\xa box-shadow: 0 2px 0 #006799;border-color: #337ab7 #337ab7 #337ab7;"));
< $form["miniorange_saml_guide_clear_list_note"] = array("#markup" => "<div style="font-size: 13px;"><b>NOTE : </b>Please clear this list after configuring the module to hide your confidential attributes.<br>
Click on <b>Test configuration</b> in <b> Service Provider</b> tab to populate the list again.</div>");
< $form["miniorange_saml_guide_table_end"] = array("#markup" => "</div>");
< }
< public static function generateCertificate($d2, $FL, $NV, $gJ)
< {
< $RZ = dirname(__FILE__, 2) . DIRECTORY_SEPARATOR . "resources" . DIRECTORY_SEPARATOR . "openssl.cnf";
< $FY = array("config" => $RZ, "digest_alg" => "{$FL}", "private_key_bits" => $NV, "private_key_type" => OPENSSL_KEYTYPE_RSA);
< $QH = openssl_pkey_new($FY);
< $db = openssl_csr_new($d2, $QH, $FY);
< $G0 = openssl_csr_sign($db, null, $QH, $gJ, $FY, time());
< openssl_x509_export($G0, $UU);
< openssl_pkey_export($QH, $Ge, null, $FY);
< openssl_csr_export($db, $S8);
< Dm:
< if (!(($Rk = openssl_error_string()) !== false)) {
< goto Ch;
< }
< error_log($Rk);
< goto Dm;
< Ch:
< variable_set("miniorange_saml_publ_certificate", $UU);
< variable_set("miniorange_saml_private_certificate", $Ge);
---
> yl:
> $form["miniorange_idp_guide_link"] = array("#markup" => "<div class="mo_saml_table_layout mo_saml_table_layout_support_1">");
> $form["miniorange_saml_attr_header"] = array("#markup" => "<div style="font-size: 1.3em;font-weight: 600;font-family: sans-serif;">Attributes received from the Identity Provider:</div><br>");
> $form["mo_saml_attrs_list_idp"] = array("#markup" => "<div class="table-responsive mo_guide_text-center" style="font-family: sans-serif;font-size: 12px;"> \xd
<table class="mo_guide_table mo_guide_table-striped mo_guide_table-bordered" style="border: 1px solid #ddd;max-width: 100%;border-collapse: collapse;">
<thead>
<tr>
\xa <th class="mo_guide_text-center mo_td_values">ATTRIBUTE NAME</th>\xd\xa <th class="mo_guide_text-center mo_td_values">ATTRIBUTE VALUE</th> \xd\xa </tr>\xd
</thead>");
> $xV = '';
> if (!(isset($dj) && !empty($dj))) {
> goto dV;
> }
> foreach ($dj as $O0 => $iT) {
> $xV .= "<tr><td>" . $O0 . "</td><td>" . $iT[0] . "</td></tr>";
> B6:
> }
> K0:
> dV:
> $form["miniorange_saml_guide_table_list"] = array("#markup" => "<tbody style="font-weight:bold;font-size: 12px;color:gray;"><tr><td>" . $Au . "</td><td>" . $FL . "</td></tr>" . $xV . "</tbody></table>");
> $form["miniorange_saml_clear_attr_list"] = array("#type" => "submit", "#value" => t("Clear Attribute List"), "#submit" => array("clear_attr_list"), "#attributes" => array("style" => "border-radius:4px;background: #337ab7;color: #ffffff;text-shadow: 0 -1px 1px #337ab7, 1px 0 1px #337ab7, 0 1px 1px #337ab7, -1px 0 1px #337ab7;
\xa box-shadow: 0 2px 0 #006799;border-color: #337ab7 #337ab7 #337ab7;"));
> $form["miniorange_saml_guide_clear_list_note"] = array("#markup" => "<div style="font-size: 13px;"><b>NOTE : </b>Please clear this list after configuring the module to hide your confidential attributes.<br>
\xa Click on <b>Test configuration</b> in <b> Service Provider</b> tab to populate the list again.</div>");
> $form["miniorange_saml_guide_table_end"] = array("#markup" => "</div>");
> }
> public static function generateCertificate($Np, $h3, $jB, $Bu)
> {
> $fo = dirname(__FILE__, 2) . DIRECTORY_SEPARATOR . "resources" . DIRECTORY_SEPARATOR . "openssl.cnf";
> $X2 = array("config" => $fo, "digest_alg" => "{$h3}", "private_key_bits" => $jB, "private_key_type" => OPENSSL_KEYTYPE_RSA);
> $HN = openssl_pkey_new($X2);
> $ks = openssl_csr_new($Np, $HN, $X2);
> $xF = openssl_csr_sign($ks, null, $HN, $Bu, $X2, time());
> openssl_x509_export($xF, $hu);
> openssl_pkey_export($HN, $SR, null, $X2);
> openssl_csr_export($ks, $N1);
> fm:
> if (!(($Ln = openssl_error_string()) !== false)) {
> goto VZ;
> }
> error_log($Ln);
> goto fm;
> VZ:
> variable_set("miniorange_saml_publ_certificate", $hu);
> variable_set("miniorange_saml_private_certificate", $SR);
77,79c77,79
< $vR = $base_url . "/admin/config/people/miniorange_saml/customer_setup/";
< if (variable_get("miniorange_saml_customer_admin_email", NULL) == NULL || variable_get("miniorange_saml_customer_id", NULL) == NULL || variable_get("miniorange_saml_customer_admin_token", NULL) == NULL || variable_get("miniorange_saml_customer_api_key", NULL) == NULL) {
< goto GZ;
---
> $zX = $base_url . "/admin/config/people/miniorange_saml/customer_setup/";
> if (variable_get("miniorange_saml_customer_admin_email", NULL) == NULL || variable_get("miniorange_saml_customer_id", NULL) == NULL || variable_get("miniorange_saml_customer_admin_token", NULL) == NULL || variable_get("miniorange_saml_customer_api_key", NULL) == NULL) {
> goto gJ;
81,82c81,82
< if (variable_get("miniorange_saml_license_key") == NULL && variable_get("miniorange_saml_customer_admin_email") != NULL) {
< goto G1;
---
> if (variable_get("miniorange_saml_license_key") == NULL && variable_get("miniorange_saml_customer_admin_email") != NULL) {
> goto F3;
85,87c85,87
< goto wj;
< G1:
< $form["markup_msg"] = array("#markup" => "<div class="mo_saml_register_message"><p>You need to <a href="" . $vR . "" >Verify</a> your license key before using this module.</a></p></div>");
---
> goto Uu;
> F3:
> $form["markup_msg"] = array("#markup" => "<div class="mo_saml_register_message"><p>You need to <a href="" . $zX . "" >Verify</a> your license key before using this module.</a></p></div>");
89,92c89,92
< wj:
< goto sJ;
< GZ:
< $form["markup_reg_msg"] = array("#markup" => "<div class="mo_saml_register_message">You need to <a href="" . $vR . "" >Register/Login</a> with miniOrange before using this module.</center></div>");
---
> Uu:
> goto rB;
> gJ:
> $form["markup_reg_msg"] = array("#markup" => "<div class="mo_saml_register_message">You need to <a href="" . $zX . "" >Register/Login</a> with miniOrange before using this module.</center></div>");
94c94
< sJ:
---
> rB:
98,117c98,117
< $cC = Utilities::getEmailandPhone();
< $form["markup_idp_attr_header_top_support"] = array("#markup" => "<div class="mo_saml_table_layout_support_1">");
< $form["markup_support_1"] = array("#markup" => "<h3><b>Support:</b></h3><div>Need any help? Just send us a query so we can help you.<br /></div>");
< $form["miniorange_saml_email_address"] = array("#title" => t("Email Address"), "#type" => "textfield", "#attributes" => array("style" => "width:100%", "placeholder" => "Enter your Email"), "#default_value" => $cC["email"]);
< $form["miniorange_saml_phone_number"] = array("#title" => t("Phone Number"), "#type" => "textfield", "#attributes" => array("style" => "width:100%", "placeholder" => "Enter your phone number with country code eg.(+1)"), "#default_value" => $cC["phone"]);
< $form["miniorange_saml_support_query"] = array("#title" => t("Query"), "#type" => "textarea", "#cols" => "10", "#rows" => "5", "#attributes" => array("style" => "width:100%", "placeholder" => "Write your query here."), "#resizable" => False);
< $form["miniorange_saml_support_submit_click"] = array("#type" => "submit", "#value" => t("Submit Query"), "#submit" => array("miniorange_saml_idp_send_query"), "#attributes" => array("style" => "display:block;margin-left:auto;margin-right:auto;"));
< $form["miniorange_saml_support_note"] = array("#markup" => "<div>If you want custom features in the module, just drop an email to <a href="mailto:[email protected]">[email protected]</a></div></div>");
< }
< public static function send_query($hE, $cA, $v5)
< {
< if (empty($hE) || empty($v5)) {
< goto Mk;
< }
< if (!valid_email_address($hE)) {
< goto i2;
< }
< goto Y4;
< Mk:
< drupal_set_message(t("The <b><u>Email</u></b> and <b><u>Query</u></b> fields are required."), "error");
---
> $Yg = Utilities::getEmailandPhone();
> $form["markup_idp_attr_header_top_support"] = array("#markup" => "<div class="mo_saml_table_layout_support_1">");
> $form["markup_support_1"] = array("#markup" => "<h3><b>Support:</b></h3><div>Need any help? Just send us a query so we can help you.<br /></div>");
> $form["miniorange_saml_email_address"] = array("#title" => t("Email Address"), "#type" => "textfield", "#attributes" => array("style" => "width:100%", "placeholder" => "Enter your Email"), "#default_value" => $Yg["email"]);
> $form["miniorange_saml_phone_number"] = array("#title" => t("Phone Number"), "#type" => "textfield", "#attributes" => array("style" => "width:100%", "placeholder" => "Enter your phone number with country code eg.(+1)"), "#default_value" => $Yg["phone"]);
> $form["miniorange_saml_support_query"] = array("#title" => t("Query"), "#type" => "textarea", "#cols" => "10", "#rows" => "5", "#attributes" => array("style" => "width:100%", "placeholder" => "Write your query here."), "#resizable" => False);
> $form["miniorange_saml_support_submit_click"] = array("#type" => "submit", "#value" => t("Submit Query"), "#submit" => array("miniorange_saml_idp_send_query"), "#attributes" => array("style" => "display:block;margin-left:auto;margin-right:auto;"));
> $form["miniorange_saml_support_note"] = array("#markup" => "<div>If you want custom features in the module, just drop an email to <a href="mailto:[email protected]">[email protected]</a></div></div>");
> }
> public static function send_query($fa, $PA, $Mp)
> {
> if (empty($fa) || empty($Mp)) {
> goto rW;
> }
> if (!valid_email_address($fa)) {
> goto KW;
> }
> goto gs;
> rW:
> drupal_set_message(t("The <b><u>Email</u></b> and <b><u>Query</u></b> fields are required."), "error");
119,121c119,121
< goto Y4;
< i2:
< drupal_set_message(t("The email address <b><i>" . $hE . "</i></b> is not valid."), "error");
---
> goto gs;
> KW:
> drupal_set_message(t("The email address <b><i>" . $fa . "</i></b> is not valid."), "error");
123,133c123,133
< Y4:
< $BO = new MiniOrangeSamlSupport($hE, $cA, $v5);
< $KH = $BO->sendSupportQuery();
< if ($KH) {
< goto lV;
< }
< drupal_set_message(t("Error sending support query."), "error");
< goto Vi;
< lV:
< drupal_set_message(t("Support query successfully sent."));
< Vi:
---
> gs:
> $cv = new MiniOrangeSamlSupport($fa, $PA, $Mp);
> $Jr = $cv->sendSupportQuery();
> if ($Jr) {
> goto BJ;
> }
> drupal_set_message(t("Error sending support query."), "error");
> goto sN;
> BJ:
> drupal_set_message(t("Support query successfully sent."));
> sN:
137,140c137,140
< $gm = variable_get("miniorange_saml_customer_admin_email", '');
< $Yk = variable_get("miniorange_saml_customer_admin_phone", '');
< $fi = array("email" => isset($gm) ? $gm : '', "phone" => isset($Yk) ? $Yk : '');
< return $fi;
---
> $NA = variable_get("miniorange_saml_customer_admin_email", '');
> $QV = variable_get("miniorange_saml_customer_admin_phone", '');
> $Q3 = array("email" => isset($NA) ? $NA : '', "phone" => isset($QV) ? $QV : '');
> return $Q3;
145,194c145,194
< $xc = variable_get("miniorange_saml_base_url", '');
< $q9 = isset($xc) && !empty($xc) ? $xc : $base_url;
< return $q9;
< }
< public static function set_idp_parameters($Pj)
< {
< if ($Pj != "new") {
< goto kx;
< }
< variable_set("miniorange_saml_idp_id", '');
< variable_set("miniorange_saml_idp_name", '');
< variable_set("miniorange_saml_idp_issuer", '');
< variable_set("miniorange_saml_idp_login_url", '');
< variable_set("miniorange_saml_idp_x509_certificate", '');
< variable_set("miniorange_nameid_format", '');
< variable_set("miniorange_saml_request_signed", '');
< variable_set("miniorange_saml_http_binding", '');
< variable_set("miniorange_saml_http_binding_slo", '');
< variable_set("miniorange_saml_idp_logout_url", '');
< goto sX;
< kx:
< $ZQ = db_query("SELECT * FROM {miniorange_saml_idp_list} WHERE id = {$Pj}");
< $IX = $ZQ->fetchAssoc();
< variable_set("miniorange_saml_idp_id", $Pj);
< variable_set("miniorange_saml_idp_name", $IX["mo_idp_name"]);
< variable_set("miniorange_saml_idp_issuer", $IX["mo_idp_issuer"]);
< variable_set("miniorange_saml_idp_login_url", $IX["mo_idp_sso_url"]);
< variable_set("miniorange_saml_idp_x509_certificate", $IX["mo_idp_cert"]);
< variable_set("miniorange_nameid_format", $IX["mo_idp_nameid_format"]);
< variable_set("miniorange_saml_request_signed", $IX["mo_idp_request_signed"]);
< variable_set("miniorange_saml_http_binding", $IX["mo_idp_http_binding_sso"]);
< variable_set("miniorange_saml_http_binding_slo", $IX["mo_idp_http_binding_slo"]);
< variable_set("miniorange_saml_idp_logout_url", $IX["mo_idp_slo_url"]);
< variable_set("miniorange_saml_fetch_metadata_time_intervals", $IX["miniorange_saml_fetch_metadata_time_intervals"]);
< variable_set("miniorange_saml_meta_data_url", $IX["miniorange_saml_meta_data_url"]);
< sX:
< }
< public static function delete_sp_parameters($Pj)
< {
< db_delete("miniorange_saml_idp_list")->condition("id", $Pj)->execute();
< variable_set("miniorange_saml_idp_id", '');
< variable_set("miniorange_saml_idp_name", '');
< variable_set("miniorange_saml_idp_issuer", '');
< variable_set("miniorange_saml_idp_login_url", '');
< variable_set("miniorange_saml_idp_x509_certificate", '');
< variable_set("miniorange_nameid_format", '');
< variable_set("miniorange_saml_request_signed", '');
< variable_set("miniorange_saml_http_binding", '');
< variable_set("miniorange_saml_http_binding_slo", '');
< variable_set("miniorange_saml_idp_logout_url", '');
---
> $Zj = variable_get("miniorange_saml_base_url", '');
> $gu = isset($Zj) && !empty($Zj) ? $Zj : $base_url;
> return $gu;
> }
> public static function set_idp_parameters($GX)
> {
> if ($GX != "new") {
> goto By;
> }
> variable_set("miniorange_saml_idp_id", '');
> variable_set("miniorange_saml_idp_name", '');
> variable_set("miniorange_saml_idp_issuer", '');
> variable_set("miniorange_saml_idp_login_url", '');
> variable_set("miniorange_saml_idp_x509_certificate", '');
> variable_set("miniorange_nameid_format", '');
> variable_set("miniorange_saml_request_signed", '');
> variable_set("miniorange_saml_http_binding", '');
> variable_set("miniorange_saml_http_binding_slo", '');
> variable_set("miniorange_saml_idp_logout_url", '');
> goto g3;
> By:
> $rX = db_query("SELECT * FROM {miniorange_saml_idp_list} WHERE id = {$GX}");
> $zN = $rX->fetchAssoc();
> variable_set("miniorange_saml_idp_id", $GX);
> variable_set("miniorange_saml_idp_name", $zN["mo_idp_name"]);
> variable_set("miniorange_saml_idp_issuer", $zN["mo_idp_issuer"]);
> variable_set("miniorange_saml_idp_login_url", $zN["mo_idp_sso_url"]);
> variable_set("miniorange_saml_idp_x509_certificate", $zN["mo_idp_cert"]);
> variable_set("miniorange_nameid_format", $zN["mo_idp_nameid_format"]);
> variable_set("miniorange_saml_request_signed", $zN["mo_idp_request_signed"]);
> variable_set("miniorange_saml_http_binding", $zN["mo_idp_http_binding_sso"]);
> variable_set("miniorange_saml_http_binding_slo", $zN["mo_idp_http_binding_slo"]);
> variable_set("miniorange_saml_idp_logout_url", $zN["mo_idp_slo_url"]);
> variable_set("miniorange_saml_fetch_metadata_time_intervals", $zN["miniorange_saml_fetch_metadata_time_intervals"]);
> variable_set("miniorange_saml_meta_data_url", $zN["miniorange_saml_meta_data_url"]);
> g3:
> }
> public static function delete_sp_parameters($GX)
> {
> db_delete("miniorange_saml_idp_list")->condition("id", $GX)->execute();
> variable_set("miniorange_saml_idp_id", '');
> variable_set("miniorange_saml_idp_name", '');
> variable_set("miniorange_saml_idp_issuer", '');
> variable_set("miniorange_saml_idp_login_url", '');
> variable_set("miniorange_saml_idp_x509_certificate", '');
> variable_set("miniorange_nameid_format", '');
> variable_set("miniorange_saml_request_signed", '');
> variable_set("miniorange_saml_http_binding", '');
> variable_set("miniorange_saml_http_binding_slo", '');
> variable_set("miniorange_saml_idp_logout_url", '');
198,201c198,201
< $form["miniorange_idp_guide_linkw"] = array("#markup" => "<div class="mo_saml_table_layout_support_1" style="margin-top: 5px;">");
< $form["miniorange_faq"] = array("#markup" => "<b></b><a class="btn btn-primary-faq btn-large btn_faq_buttons" style="float: left;padding: 3px 6px !important;color: #48a0dc;border: 2px solid #48a0dc;width:30%;" href="https://faq.miniorange.com/kb/drupal/saml-drupal/" target="_blank">" . "FAQs</a>");
< $form["miniorange_forum"] = array("#markup" => "<b></b><a class="btn btn-primary-faq btn-large btn_faq_buttons" style="float: right;padding: 3px 6px !important;color: #48a0dc;border: 2px solid #48a0dc;width:55%;" href="https://forum.miniorange.com/" target="_blank">" . "Ask questions on forum</a>");
< $form["markup_test_div"] = array("#markup" => "</div>");
---
> $form["miniorange_idp_guide_linkw"] = array("#markup" => "<div class="mo_saml_table_layout_support_1" style="margin-top: 5px;">");
> $form["miniorange_faq"] = array("#markup" => "<b></b><a class="btn btn-primary-faq btn-large btn_faq_buttons" style="float: left;padding: 3px 6px !important;color: #48a0dc;border: 2px solid #48a0dc;width:30%;" href="https://faq.miniorange.com/kb/drupal/saml-drupal/" target="_blank">" . "FAQs</a>");
> $form["miniorange_forum"] = array("#markup" => "<b></b><a class="btn btn-primary-faq btn-large btn_faq_buttons" style="float: right;padding: 3px 6px !important;color: #48a0dc;border: 2px solid #48a0dc;width:55%;" href="https://forum.miniorange.com/" target="_blank">" . "Ask questions on forum</a>");
> $form["markup_test_div"] = array("#markup" => "</div>");
205,206c205,206
< if (in_array("curl", get_loaded_extensions())) {
< goto PD;
---
> if (in_array("curl", get_loaded_extensions())) {
> goto Hn;
209,210c209,210
< goto v2;
< PD:
---
> goto CK;
> Hn:
212c212
< v2:
---
> CK:
216c216
< return "_" . self::stringToHex(self::generateRandomBytes(21));
---
> return "_" . self::stringToHex(self::generateRandomBytes(21));
218c218
< public static function stringToHex($rn)
---
> public static function stringToHex($jW)
220,224c220,224
< $hK = '';
< $Eo = 0;
< Hz:
< if (!($Eo < strlen($rn))) {
< goto dC;
---
> $t1 = '';
> $Xc = 0;
> y9:
> if (!($Xc < strlen($jW))) {
> goto vQ;
226,231c226,231
< $hK .= sprintf("%02x", ord($rn[$Eo]));
< H_:
< $Eo++;
< goto Hz;
< dC:
< return $hK;
---
> $t1 .= sprintf("%02x", ord($jW[$Xc]));
> fP:
> $Xc++;
> goto y9;
> vQ:
> return $t1;
233c233
< public static function generateRandomBytes($Y4, $vB = TRUE)
---
> public static function generateRandomBytes($J2, $Xu = TRUE)
235c235
< return openssl_random_pseudo_bytes($Y4);
---
> return openssl_random_pseudo_bytes($J2);
237c237
< public static function insertSignature(XMLSecurityKey $mz, array $MI, DOMElement $rZ = NULL, DOMNode $Kt = NULL)
---
> public static function insertSignature(XMLSecurityKey $ZE, array $By, DOMElement $bF = NULL, DOMNode $HH = NULL)
239,241c239,241
< $Ji = new XMLSecurityDSig();
< $Ji->setCanonicalMethod(XMLSecurityDSig::EXC_C14N);
< switch ($mz->type) {
---
> $hR = new XMLSecurityDSig();
> $hR->setCanonicalMethod(XMLSecurityDSig::EXC_C14N);
> switch ($ZE->type) {
243,244c243,244
< $Ak = XMLSecurityDSig::SHA256;
< goto QO;
---
> $rV = XMLSecurityDSig::SHA256;
> goto ZH;
246,247c246,247
< $Ak = XMLSecurityDSig::SHA384;
< goto QO;
---
> $rV = XMLSecurityDSig::SHA384;
> goto ZH;
249,250c249,250
< $Ak = XMLSecurityDSig::SHA512;
< goto QO;
---
> $rV = XMLSecurityDSig::SHA512;
> goto ZH;
252c252
< $Ak = XMLSecurityDSig::SHA1;
---
> $rV = XMLSecurityDSig::SHA1;
254,277c254,277
< L4:
< QO:
< $Ji->addReferenceList(array($rZ), $Ak, array("http://www.w3.org/2000/09/xmldsig#enveloped-signature", XMLSecurityDSig::EXC_C14N), array("id_name" => "ID", "overwrite" => FALSE));
< $Ji->sign($mz);
< foreach ($MI as $q5) {
< $Ji->add509Cert($q5, TRUE);
< Sd:
< }
< rm:
< $Ji->insertSignature($rZ, $Kt);
< }
< public static function signXML($gp, $gd, $gS, $uy, $WW = '')
< {
< $sK = array("type" => "private");
< switch ($uy) {
< case "RSA_SHA384":
< $mz = new XMLSecurityKey(XMLSecurityKey::RSA_SHA384, $sK);
< goto aL;
< case "RSA_SHA512":
< $mz = new XMLSecurityKey(XMLSecurityKey::RSA_SHA512, $sK);
< goto aL;
< case "RSA_SHA1":
< $mz = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, $sK);
< goto aL;
---
> Dn:
> ZH:
> $hR->addReferenceList(array($bF), $rV, array("http://www.w3.org/2000/09/xmldsig#enveloped-signature", XMLSecurityDSig::EXC_C14N), array("id_name" => "ID", "overwrite" => FALSE));
> $hR->sign($ZE);
> foreach ($By as $Dq) {
> $hR->add509Cert($Dq, TRUE);
> m4:
> }
> vh:
> $hR->insertSignature($bF, $HH);
> }
> public static function signXML($nV, $Iw, $ID, $hH, $qQ = '')
> {
> $ex = array("type" => "private");
> switch ($hH) {
> case "RSA_SHA384":
> $ZE = new XMLSecurityKey(XMLSecurityKey::RSA_SHA384, $ex);
> goto Cz;
> case "RSA_SHA512":
> $ZE = new XMLSecurityKey(XMLSecurityKey::RSA_SHA512, $ex);
> goto Cz;
> case "RSA_SHA1":
> $ZE = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, $ex);
> goto Cz;
279,280c279,280
< $mz = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, $sK);
< goto aL;
---
> $ZE = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, $ex);
> goto Cz;
282,333c282,333
< wr:
< aL:
< $mz->loadKey($gS, FALSE);
< $Ej = new DOMDocument();
< $Ej->loadXML($gp);
< $gT = $Ej->firstChild;
< if (!empty($WW)) {
< goto Uf;
< }
< self::insertSignature($mz, array($gd), $gT);
< goto pZ;
< Uf:
< $Ms = $Ej->getElementsByTagName($WW)->item(0);
< self::insertSignature($mz, array($gd), $gT, $Ms);
< pZ:
< $Ai = $gT->ownerDocument->saveXML($gT);
< return base64_encode($Ai);
< }
< public static function postSAMLRequest($xc, $t7, $vd)
< {
< echo "<html><head>
\xa <script src='https://code.jquery.com/jquery-1.11.3.min.js'></script>
\xa <script type="text/javascript">$(function(){document.forms['saml-request-form'].submit();});</script></head>
<body>Please wait...<form action="" . $xc . "" method="post" id="saml-request-form">\xd
<input type="hidden" name="SAMLRequest" value="" . $t7 . "" />\xd
<input type="hidden" name="RelayState" value="" . htmlentities($vd) . "" /></form>
\xa </body>
</html>";
< exit;
< }
< public static function createAuthnRequest($aG, $u1, $wH, $RE, $uF, $gn = "false")
< {
< $Tt = "<?xml version="1.0" encoding="UTF-8"?>" . "<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns="urn:oasis:names:tc:SAML:2.0:assertion" ID="" . self::generateID() . "" Version="2.0" IssueInstant="" . self::generateTimestamp() . """;
< if (!($gn == "true")) {
< goto Sl;
< }
< $Tt .= " ForceAuthn="true"";
< Sl:
< $Tt .= " ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" AssertionConsumerServiceURL="" . $aG . "" Destination="" . $wH . ""><saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">" . $u1 . "</saml:Issuer><samlp:NameIDPolicy AllowCreate="true" Format="" . $RE . ""
/></samlp:AuthnRequest>";
< if (!(empty($uF) || $uF == "HTTP-Redirect")) {
< goto Kp;
< }
< $cy = gzdeflate($Tt);
< $Mx = base64_encode($cy);
< $jm = urlencode($Mx);
< $Tt = $jm;
< Kp:
< return $Tt;
< }
< public static function createSAMLRequest($aG, $u1, $wH, $RE, $gn = "false")
< {
< $Tt = "<?xml version="1.0" encoding="UTF-8"?>" . "<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="" . self::generateID() . "" Version="2.0" IssueInstant="" . self::generateTimestamp() . """;
< if (!($gn == "true")) {
< goto kP;
< }
< $Tt .= " ForceAuthn="true"";
< kP:
< $Tt .= " ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" AssertionConsumerServiceURL="" . $aG . "" Destination="" . $wH . ""><saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">" . $u1 . "</saml:Issuer><samlp:NameIDPolicy AllowCreate="true" Format="" . $RE . ""\xd
/></samlp:AuthnRequest>";
< return $Tt;
---
> rE:
> Cz:
> $ZE->loadKey($ID, FALSE);
> $nD = new DOMDocument();
> $nD->loadXML($nV);
> $ub = $nD->firstChild;
> if (!empty($qQ)) {
> goto dB;
> }
> self::insertSignature($ZE, array($Iw), $ub);
> goto d5;
> dB:
> $K7 = $nD->getElementsByTagName($qQ)->item(0);
> self::insertSignature($ZE, array($Iw), $ub, $K7);
> d5:
> $qM = $ub->ownerDocument->saveXML($ub);
> return base64_encode($qM);
> }
> public static function postSAMLRequest($Zj, $QO, $vA)
> {
> echo "<html><head>\xd
<script src='https://code.jquery.com/jquery-1.11.3.min.js'></script>
<script type="text/javascript">$(function(){document.forms['saml-request-form'].submit();});</script></head>
\xa <body>Please wait...<form action="" . $Zj . "" method="post" id="saml-request-form">\xd
<input type="hidden" name="SAMLRequest" value="" . $QO . "" />\xd\xa <input type="hidden" name="RelayState" value="" . htmlentities($vA) . "" /></form>\xd\xa </body>\xd\xa </html>";
> exit;
> }
> public static function createAuthnRequest($eN, $jm, $Lm, $VC, $YT, $YS = "false")
> {
> $RW = "<?xml version="1.0" encoding="UTF-8"?>" . "<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns="urn:oasis:names:tc:SAML:2.0:assertion" ID="" . self::generateID() . "" Version="2.0" IssueInstant="" . self::generateTimestamp() . """;
> if (!($YS == "true")) {
> goto X5;
> }
> $RW .= " ForceAuthn="true"";
> X5:
> $RW .= " ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" AssertionConsumerServiceURL="" . $eN . "" Destination="" . $Lm . ""><saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">" . $jm . "</saml:Issuer><samlp:NameIDPolicy AllowCreate="true" Format="" . $VC . ""
\xa /></samlp:AuthnRequest>";
> if (!(empty($YT) || $YT == "HTTP-Redirect")) {
> goto AM;
> }
> $QM = gzdeflate($RW);
> $eV = base64_encode($QM);
> $FR = urlencode($eV);
> $RW = $FR;
> AM:
> return $RW;
> }
> public static function createSAMLRequest($eN, $jm, $Lm, $VC, $YS = "false")
> {
> $RW = "<?xml version="1.0" encoding="UTF-8"?>" . "<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="" . self::generateID() . "" Version="2.0" IssueInstant="" . self::generateTimestamp() . """;
> if (!($YS == "true")) {
> goto c6;
> }
> $RW .= " ForceAuthn="true"";
> c6:
> $RW .= " ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" AssertionConsumerServiceURL="" . $eN . "" Destination="" . $Lm . ""><saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">" . $jm . "</saml:Issuer><samlp:NameIDPolicy AllowCreate="true" Format="" . $VC . ""
/></samlp:AuthnRequest>";
> return $RW;
337,338c337,338
< if (!isset($_SESSION["IDP_ISSUER"])) {
< goto R3;
---
> if (!isset($_SESSION["IDP_ISSUER"])) {
> goto eQ;
340,348c340,348
< $u1 = $_SESSION["IDP_ISSUER"];
< R3:
< $ZQ = db_query("SELECT * FROM {miniorange_saml_idp_list} WHERE mo_idp_issuer = '{$u1}'");
< $IX = $ZQ->fetchAssoc();
< $fA = $IX["mo_idp_slo_url"];
< $p9 = $IX["mo_idp_http_binding_slo"];
< $uy = $IX["security_signature_algorithm"];
< if (empty($fA)) {
< goto yO;
---
> $jm = $_SESSION["IDP_ISSUER"];
> eQ:
> $rX = db_query("SELECT * FROM {miniorange_saml_idp_list} WHERE mo_idp_issuer = '{$jm}'");
> $zN = $rX->fetchAssoc();
> $m3 = $zN["mo_idp_slo_url"];
> $I2 = $zN["mo_idp_http_binding_slo"];
> $hH = $zN["security_signature_algorithm"];
> if (empty($m3)) {
> goto ib;
351c351
< goto lf;
---
> goto Ub;
354,364c354,364
< lf:
< if (isset($_SESSION["mo_saml_logout_request"])) {
< goto pK;
< }
< if (isset($_SESSION["mo_saml"]["logged_in_with_idp"])) {
< goto VI;
< }
< goto zM;
< pK:
< goto zM;
< VI:
---
> Ub:
> if (isset($_SESSION["mo_saml_logout_request"])) {
> goto j8;
> }
> if (isset($_SESSION["mo_saml"]["logged_in_with_idp"])) {
> goto pN;
> }
> goto eI;
> j8:
> goto eI;
> pN:
366,371c366,371
< unset($_SESSION["mo_saml"]);
< $gF = $_SESSION["sessionIndex"];
< $b3 = $_SESSION["NameID"];
< $zV = variable_get("miniorange_saml_enable_logout");
< if (!($zV == 1 || $zV)) {
< goto aa;
---
> unset($_SESSION["mo_saml"]);
> $Hr = $_SESSION["sessionIndex"];
> $Jb = $_SESSION["NameID"];
> $Yy = variable_get("miniorange_saml_enable_logout");
> if (!($Yy == 1 || $Yy)) {
> goto U2;
374,499c374,486
< aa:
< if (!isset($_SESSION["logout"]) && !empty($_SESSION["logout"])) {
< goto wF;
< }
< $rk = $base_url;
< goto Qw;
< wF:
< $rk = $_SESSION["logout"];
< Qw:
< $cr = $base_url;
< $gq = $IX["mo_idp_request_signed"];
< $wH = $fA;
< $ih = $rk;
< $bA = Utilities::createLogoutRequest($b3, $cr, $wH, $p9, $gF);
< $n8 = drupal_get_path("module", "miniorange_saml");
< if (empty($p9) || $p9 == "HTTP-Redirect") {
< goto ck;
< }
< if ($gq) {
< goto XE;
< }
< $P7 = base64_encode($bA);
< Utilities::postSAMLRequest($fA, $P7, $ih);
< exit;
< XE:
< $P7 = Utilities::signXML($bA, Utilities::getPublicCertificate(), Utilities::getPrivateKey(), "NameID", $uy);
< Utilities::postSAMLRequest($fA, $P7, $ih);
< goto iJ;
< ck:
< $Ax = $fA;
< if (strpos($fA, "?") !== false) {
< goto T9;
< }
< $Ax .= "?";
< goto SS;
< T9:
< $Ax .= "&";
< SS:
< if ($gq) {
< goto Xo;
< }
< $Ax .= "SAMLRequest=" . $bA . "&RelayState=" . urlencode($ih);
< header("Location: " . $Ax);
< exit;
< Xo:
< if ($uy == "RSA_SHA256") {
< goto Gi;
< }
< if ($uy == "RSA_SHA384") {
< goto n2;
< }
< if ($uy == "RSA_SHA512") {
< goto Ts;
< }
< if ($uy == "RSA_SHA1") {
< goto N0;
< }
< goto ut;
< Gi:
< $bA = "SAMLRequest=" . $bA . "&RelayState=" . urlencode($ih) . "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA256);
< goto ut;
< n2:
< $bA = "SAMLRequest=" . $bA . "&RelayState=" . urlencode($ih) . "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA384);
< goto ut;
< Ts:
< $bA = "SAMLRequest=" . $bA . "&RelayState=" . urlencode($ih) . "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA512);
< goto ut;
< N0:
< $bA = "SAMLRequest=" . $bA . "&RelayState=" . urlencode($ih) . "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA1);
< ut:
< $sK = array("type" => "private");
< if ($uy == "RSA_SHA256") {
< goto ex;
< }
< if ($uy == "RSA_SHA384") {
< goto qp;
< }
< if ($uy == "RSA_SHA512") {
< goto kN;
< }
< if ($uy == "RSA_SHA1") {
< goto jN;
< }
< goto dr;
< ex:
< $mz = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, $sK);
< goto dr;
< qp:
< $mz = new XMLSecurityKey(XMLSecurityKey::RSA_SHA384, $sK);
< goto dr;
< kN:
< $mz = new XMLSecurityKey(XMLSecurityKey::RSA_SHA512, $sK);
< goto dr;
< jN:
< $mz = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, $sK);
< dr:
< $kb = Utilities::getPrivateKey();
< $mz->loadKey($kb, FALSE);
< $s4 = new XMLSecurityDSig();
< $DX = $mz->signData($bA);
< $DX = base64_encode($DX);
< $Ax .= $bA . "&Signature=" . urlencode($DX);
< header("Location: " . $Ax);
< exit;
< iJ:
< zM:
< yO:
< }
< public static function createLogoutRequest($b3, $u1, $wH, $vm = "HttpRedirect", $gF = '')
< {
< $Tt = "<?xml version="1.0" encoding="UTF-8"?>" . "<samlp:LogoutRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ForceAuthn="true" ID="" . self::generateID() . "" IssueInstant="" . self::generateTimestamp() . "" Version="2.0" Destination="" . $wH . "">\xd\xa\x9 \x9 \x9<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">" . $u1 . "</saml:Issuer>\xd
\x9\x9\x9\x9<saml:NameID xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">" . $b3 . "</saml:NameID>";
< if (empty($gF)) {
< goto GT;
< }
< $Tt .= "<samlp:SessionIndex>" . $gF . "</samlp:SessionIndex>";
< GT:
< $Tt .= "</samlp:LogoutRequest>";
< if (!(empty($vm) || $vm == "HttpRedirect")) {
< goto Rj;
< }
< $cy = gzdeflate($Tt);
< $Mx = base64_encode($cy);
< $jm = urlencode($Mx);
< $Tt = $jm;
< Rj:
< return $Tt;
---
> U2:
> if (!isset($_SESSION["logout"]) && !empty($_SESSION["logout"])) {
> goto b6;
> }
> $Ur = $base_url;
> goto Ej;
> b6:
> $Ur = $_SESSION["logout"];
> Ej:
> $g2 = $base_url;
> $v9 = $zN["mo_idp_request_signed"];
> $Lm = $m3;
> $KN = $Ur;
> $JW = Utilities::createLogoutRequest($Jb, $g2, $Lm, $I2, $Hr);
> $Ip = drupal_get_path("module", "miniorange_saml");
> if (empty($I2) || $I2 == "HTTP-Redirect") {
> goto pe;
> }
> if ($v9) {
> goto e1;
> }
> $Ao = base64_encode($JW);
> Utilities::postSAMLRequest($m3, $Ao, $KN);
> exit;
> e1:
> $Ao = Utilities::signXML($JW, Utilities::getPublicCertificate(), Utilities::getPrivateKey(), "NameID", $hH);
> Utilities::postSAMLRequest($m3, $Ao, $KN);
> goto Kl;
> pe:
> $zE = $m3;
> if (strpos($m3, "?") !== false) {
> goto G7;
> }
> $zE .= "?";
> goto aX;
> G7:
> $zE .= "&";
> aX:
> if ($v9) {
> goto N2;
> }
> $zE .= "SAMLRequest=" . $JW . "&RelayState=" . urlencode($KN);
> header("Location: " . $zE);
> exit;
> N2:
> if ($hH == "RSA_SHA256") {
> goto xj;
> }
> if ($hH == "RSA_SHA384") {
> goto G6;
> }
> if ($hH == "RSA_SHA512") {
> goto Dh;
> }
> if ($hH == "RSA_SHA1") {
> goto c_;
> }
> goto E5;
> xj:
> $JW = "SAMLRequest=" . $JW . "&RelayState=" . urlencode($KN) . "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA256);
> goto E5;
> G6:
> $JW = "SAMLRequest=" . $JW . "&RelayState=" . urlencode($KN) . "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA384);
> goto E5;
> Dh:
> $JW = "SAMLRequest=" . $JW . "&RelayState=" . urlencode($KN) . "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA512);
> goto E5;
> c_:
> $JW = "SAMLRequest=" . $JW . "&RelayState=" . urlencode($KN) . "&SigAlg=" . urlencode(XMLSecurityKey::RSA_SHA1);
> E5:
> $ex = array("type" => "private");
> if ($hH == "RSA_SHA256") {
> goto R6;
> }
> if ($hH == "RSA_SHA384") {
> goto EQ;
> }
> if ($hH == "RSA_SHA512") {
> goto Ly;
> }
> if ($hH == "RSA_SHA1") {
> goto PX;
> }
> goto Te;
> R6:
> $ZE = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, $ex);
> goto Te;
> EQ:
> $ZE = new XMLSecurityKey(XMLSecurityKey::RSA_SHA384, $ex);
> goto Te;
> Ly:
> $ZE = new XMLSecurityKey(XMLSecurityKey::RSA_SHA512, $ex);
> goto Te;
> PX:
> $ZE = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, $ex);
> Te:
> $fT = Utilities::getPrivateKey();
> $ZE->loadKey($fT, FALSE);
> $TF = new XMLSecurityDSig();
> $ge = $ZE->signData($JW);
> $ge = base64_encode($ge);
> $zE .= $JW . "&Signature=" . urlencode($ge);
> header("Location: " . $zE);
> exit;
> Kl:
> eI:
> ib:
> }
> public static function createLogoutRequest($Jb, $jm, $Lm, $Kf = "HttpRedirect", $Hr = '')
> {
> $RW = "<?xml version="1.0" encoding="UTF-8"?>" . "<samlp:LogoutRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ForceAuthn="true" ID="" . self::generateID() . "" IssueInstant="" . self::generateTimestamp() . "" Version="2.0" Destination="" . $Lm . "">\xd
\x9\x9\x9 <saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">" . $jm . "</saml:Issuer>
\xa \x9\x9\x9\x9\x9<saml:NameID xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">" . $Jb . "</saml:NameID>";
> if (empty($Hr)) {
> goto ej;
501c488,501
< public static function upload_metadata($e3, $PB, $kO = false, $xc = false, $DC = false, $Pj = null)
---
> $RW .= "<samlp:SessionIndex>" . $Hr . "</samlp:SessionIndex>";
> ej:
> $RW .= "</samlp:LogoutRequest>";
> if (!(empty($Kf) || $Kf == "HttpRedirect")) {
> goto JT;
> }
> $QM = gzdeflate($RW);
> $eV = base64_encode($QM);
> $FR = urlencode($eV);
> $RW = $FR;
> JT:
> return $RW;
> }
> public static function upload_metadata($d6, $yZ, $PN = false, $Zj = false, $ZH = false, $GX = null)
504,506c504,506
< require_once drupal_get_path("module", "miniorange_saml") . DIRECTORY_SEPARATOR . "includes" . DIRECTORY_SEPARATOR . "MetadataReader.php";
< $Ej = new DOMDocument();
< $Ej->loadXML($e3);
---
> require_once drupal_get_path("module", "miniorange_saml") . DIRECTORY_SEPARATOR . "includes" . DIRECTORY_SEPARATOR . "MetadataReader.php";
> $nD = new DOMDocument();
> $nD->loadXML($d6);
508,516c508,516
< $FF = $Ej->firstChild;
< $RE = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress";
< if (empty($FF)) {
< goto mA;
< }
< $VY = new IDPMetadataReader($Ej);
< $LM = $VY->getIdentityProviders();
< if (!empty($LM)) {
< goto bm;
---
> $W0 = $nD->firstChild;
> $VC = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress";
> if (empty($W0)) {
> goto IQ;
> }
> $xJ = new IDPMetadataReader($nD);
> $rB = $xJ->getIdentityProviders();
> if (!empty($rB)) {
> goto Ep;
518c518
< drupal_set_message(t("Please provide a valid metadata file."), "error");
---
> drupal_set_message(t("Please provide a valid metadata file."), "error");
520,561c520,530
< bm:
< foreach ($LM as $mz => $n0) {
< $qh = $n0->getLoginURL("HTTP-Redirect");
< $fA = $n0->getLogoutURL("HTTP-Redirect");
< if (!empty($qh)) {
< goto ym;
< }
< $qh = $n0->getLoginURL("HTTP-POST");
< ym:
< if (!empty($fA)) {
< goto QA;
< }
< $fA = $n0->getLogoutURL("HTTP-POST");
< QA:
< $wt = $n0->getEntityID();
< $vs = $n0->getSigningCertificate();
< $Pz = $base_url;
< $gq = FALSE;
< $uL = "HTTP-Redirect";
< $Tv = "HTTP-POST";
< Wy:
< }
< de:
< $ZQ = db_query("SELECT * FROM {miniorange_saml_idp_list}");
< $IX = $ZQ->fetchAll();
< $Pj = -1;
< if ($kO == true || $kO == 1) {
< goto Fg;
< }
< $xc = '';
< goto vs;
< Fg:
< $xc = $xc;
< vs:
< $uy = "RSA_SHA256";
< foreach ($IX as $c3) {
< if (!($c3->mo_idp_issuer == $wt || $c3->mo_idp_sso_url == $qh)) {
< goto x7;
< }
< $Pj = $c3->id;
< x7:
< fT:
---
> Ep:
> foreach ($rB as $ZE => $Ru) {
> $pq = $Ru->getLoginURL("HTTP-Redirect");
> $m3 = $Ru->getLogoutURL("HTTP-Redirect");
> if (!empty($pq)) {
> goto j6;
> }
> $pq = $Ru->getLoginURL("HTTP-POST");
> j6:
> if (!empty($m3)) {
> goto x8;
563,564c532,556
< iP:
< if ($Pj == -1) {
---
> $m3 = $Ru->getLogoutURL("HTTP-POST");
> x8:
> $p1 = $Ru->getEntityID();
> $Yq = $Ru->getSigningCertificate();
> $rz = $base_url;
> $v9 = FALSE;
> $Ms = "HTTP-Redirect";
> $aX = "HTTP-POST";
> L8:
> }
> ly:
> $rX = db_query("SELECT * FROM {miniorange_saml_idp_list}");
> $zN = $rX->fetchAll();
> $GX = -1;
> if ($PN == true || $PN == 1) {
> goto y3;
> }
> $Zj = '';
> goto yA;
> y3:
> $Zj = $Zj;
> yA:
> $hH = "RSA_SHA256";
> foreach ($zN as $I0) {
> if (!($I0->mo_idp_issuer == $p1 || $I0->mo_idp_sso_url == $pq)) {
567,568c559
< Utilities::Database_update($PB, $wt, $qh, $vs, $RE, $gq, $uL, $Tv, $fA, $kO, $xc, $Pj, $uy);
< goto n3;
---
> $GX = $I0->id;
570,574c561
< Utilities::Database_insert($PB, $wt, $qh, $vs, $RE, $gq, $uL, $Tv, $fA, $kO, $xc, $uy);
< n3:
< mA:
< if ($DC) {
< goto DF;
---
> FV:
576c563,576
< drupal_set_message(t("Please provide a valid metadata file."), "error");
---
> zl:
> if ($GX == -1) {
> goto sq;
> }
> Utilities::Database_update($yZ, $p1, $pq, $Yq, $VC, $v9, $Ms, $aX, $m3, $PN, $Zj, $GX, $hH);
> goto RL;
> sq:
> Utilities::Database_insert($yZ, $p1, $pq, $Yq, $VC, $v9, $Ms, $aX, $m3, $PN, $Zj, $hH);
> RL:
> IQ:
> if ($ZH) {
> goto np;
> }
> drupal_set_message(t("Please provide a valid metadata file."), "error");
578,580c578,580
< goto vA;
< DF:
< drupal_set_message(t("Identity Provider Configuration successfully saved."));
---
> goto Wv;
> np:
> drupal_set_message(t("Identity Provider Configuration successfully saved."));
582c582
< vA:
---
> Wv:
584c584
< public static function Database_insert($PB, $wt, $qh, $vs, $RE, $gq, $uL, $Tv, $fA, $kO, $xc, $uy)
---
> public static function Database_insert($yZ, $p1, $pq, $Yq, $VC, $v9, $Ms, $aX, $m3, $PN, $Zj, $hH)
586c586
< db_insert("miniorange_saml_idp_list")->fields(array("mo_idp_name" => $PB, "mo_idp_issuer" => $wt, "mo_idp_sso_url" => $qh, "mo_idp_cert" => $vs, "mo_idp_nameid_format" => $RE, "mo_idp_request_signed" => $gq, "mo_idp_http_binding_sso" => $uL, "mo_idp_http_binding_slo" => $Tv, "mo_idp_slo_url" => $fA, "miniorange_saml_fetch_metadata_time_intervals" => $kO, "miniorange_saml_meta_data_url" => $xc, "security_signature_algorithm" => $uy))->execute();
---
> db_insert("miniorange_saml_idp_list")->fields(array("mo_idp_name" => $yZ, "mo_idp_issuer" => $p1, "mo_idp_sso_url" => $pq, "mo_idp_cert" => $Yq, "mo_idp_nameid_format" => $VC, "mo_idp_request_signed" => $v9, "mo_idp_http_binding_sso" => $Ms, "mo_idp_http_binding_slo" => $aX, "mo_idp_slo_url" => $m3, "miniorange_saml_fetch_metadata_time_intervals" => $PN, "miniorange_saml_meta_data_url" => $Zj, "security_signature_algorithm" => $hH))->execute();
588c588
< public static function Database_update($PB, $wt, $qh, $vs, $RE, $gq, $uL, $Tv, $fA, $kO, $xc, $Pj, $uy)
---
> public static function Database_update($yZ, $p1, $pq, $Yq, $VC, $v9, $Ms, $aX, $m3, $PN, $Zj, $GX, $hH)
590,696c590,696
< db_update("miniorange_saml_idp_list")->fields(array("mo_idp_name" => $PB, "mo_idp_issuer" => $wt, "mo_idp_sso_url" => $qh, "mo_idp_cert" => $vs, "mo_idp_nameid_format" => $RE, "mo_idp_request_signed" => $gq, "mo_idp_http_binding_sso" => $uL, "mo_idp_http_binding_slo" => $Tv, "mo_idp_slo_url" => $fA, "miniorange_saml_fetch_metadata_time_intervals" => $kO, "miniorange_saml_meta_data_url" => $xc, "security_signature_algorithm" => $uy))->condition("id", $Pj, "=")->execute();
< }
< public static function generateTimestamp($eA = NULL)
< {
< if (!($eA === NULL)) {
< goto QI;
< }
< $eA = time();
< QI:
< return gmdate("Y-m-d\TH:i:s\Z", $eA);
< }
< public static function xpQuery(DOMNode $HF, $v5)
< {
< static $Zo = NULL;
< if ($HF instanceof DOMDocument) {
< goto jh;
< }
< $OZ = $HF->ownerDocument;
< goto o9;
< jh:
< $OZ = $HF;
< o9:
< if (!($Zo === NULL || !$Zo->document->isSameNode($OZ))) {
< goto Yp;
< }
< $Zo = new DOMXPath($OZ);
< $Zo->registerNamespace("soap-env", "http://schemas.xmlsoap.org/soap/envelope/");
< $Zo->registerNamespace("saml_protocol", "urn:oasis:names:tc:SAML:2.0:protocol");
< $Zo->registerNamespace("saml_assertion", "urn:oasis:names:tc:SAML:2.0:assertion");
< $Zo->registerNamespace("saml_metadata", "urn:oasis:names:tc:SAML:2.0:metadata");
< $Zo->registerNamespace("ds", "http://www.w3.org/2000/09/xmldsig#");
< $Zo->registerNamespace("xenc", "http://www.w3.org/2001/04/xmlenc#");
< Yp:
< $hS = $Zo->query($v5, $HF);
< $hK = array();
< $Eo = 0;
< eL:
< if (!($Eo < $hS->length)) {
< goto am;
< }
< $hK[$Eo] = $hS->item($Eo);
< H2:
< $Eo++;
< goto eL;
< am:
< return $hK;
< }
< public static function parseNameId(DOMElement $gp)
< {
< $hK = array("Value" => trim($gp->textContent));
< foreach (array("NameQualifier", "SPNameQualifier", "Format") as $zQ) {
< if (!$gp->hasAttribute($zQ)) {
< goto KL;
< }
< $hK[$zQ] = $gp->getAttribute($zQ);
< KL:
< aJ:
< }
< hm:
< return $hK;
< }
< public static function xsDateTimeToTimestamp($qU)
< {
< $kr = array();
< $Wu = "/^(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(?:\.\d+)?Z$/D";
< if (!(preg_match($Wu, $qU, $kr) == 0)) {
< goto Yz;
< }
< echo sprintf("nvalid SAML2 timestamp passed to xsDateTimeToTimestamp: " . $qU);
< exit;
< Yz:
< $sI = intval($kr[1]);
< $UY = intval($kr[2]);
< $H7 = intval($kr[3]);
< $CF = intval($kr[4]);
< $uZ = intval($kr[5]);
< $h4 = intval($kr[6]);
< $c1 = gmmktime($CF, $uZ, $h4, $UY, $H7, $sI);
< return $c1;
< }
< public static function extractStrings(DOMElement $xh, $es, $Fw)
< {
< $hK = array();
< $HF = $xh->firstChild;
< Co:
< if (!($HF !== NULL)) {
< goto iY;
< }
< if (!($HF->namespaceURI !== $es || $HF->localName !== $Fw)) {
< goto xO;
< }
< goto xI;
< xO:
< $hK[] = trim($HF->textContent);
< xI:
< $HF = $HF->nextSibling;
< goto Co;
< iY:
< return $hK;
< }
< public static function validateElement(DOMElement $rZ)
< {
< $Ji = new XMLSecurityDSig();
< $Ji->idKeys[] = "ID";
< $d7 = self::xpQuery($rZ, "./ds:Signature");
< if (count($d7) === 0) {
< goto AV;
---
> db_update("miniorange_saml_idp_list")->fields(array("mo_idp_name" => $yZ, "mo_idp_issuer" => $p1, "mo_idp_sso_url" => $pq, "mo_idp_cert" => $Yq, "mo_idp_nameid_format" => $VC, "mo_idp_request_signed" => $v9, "mo_idp_http_binding_sso" => $Ms, "mo_idp_http_binding_slo" => $aX, "mo_idp_slo_url" => $m3, "miniorange_saml_fetch_metadata_time_intervals" => $PN, "miniorange_saml_meta_data_url" => $Zj, "security_signature_algorithm" => $hH))->condition("id", $GX, "=")->execute();
> }
> public static function generateTimestamp($zJ = NULL)
> {
> if (!($zJ === NULL)) {
> goto ST;
> }
> $zJ = time();
> ST:
> return gmdate("Y-m-d\TH:i:s\Z", $zJ);
> }
> public static function xpQuery(DOMNode $Dx, $Mp)
> {
> static $sq = NULL;
> if ($Dx instanceof DOMDocument) {
> goto du;
> }
> $je = $Dx->ownerDocument;
> goto we;
> du:
> $je = $Dx;
> we:
> if (!($sq === NULL || !$sq->document->isSameNode($je))) {
> goto X_;
> }
> $sq = new DOMXPath($je);
> $sq->registerNamespace("soap-env", "http://schemas.xmlsoap.org/soap/envelope/");
> $sq->registerNamespace("saml_protocol", "urn:oasis:names:tc:SAML:2.0:protocol");
> $sq->registerNamespace("saml_assertion", "urn:oasis:names:tc:SAML:2.0:assertion");
> $sq->registerNamespace("saml_metadata", "urn:oasis:names:tc:SAML:2.0:metadata");
> $sq->registerNamespace("ds", "http://www.w3.org/2000/09/xmldsig#");
> $sq->registerNamespace("xenc", "http://www.w3.org/2001/04/xmlenc#");
> X_:
> $bI = $sq->query($Mp, $Dx);
> $t1 = array();
> $Xc = 0;
> gE:
> if (!($Xc < $bI->length)) {
> goto cc;
> }
> $t1[$Xc] = $bI->item($Xc);
> bC:
> $Xc++;
> goto gE;
> cc:
> return $t1;
> }
> public static function parseNameId(DOMElement $nV)
> {
> $t1 = array("Value" => trim($nV->textContent));
> foreach (array("NameQualifier", "SPNameQualifier", "Format") as $M_) {
> if (!$nV->hasAttribute($M_)) {
> goto vW;
> }
> $t1[$M_] = $nV->getAttribute($M_);
> vW:
> um:
> }
> J5:
> return $t1;
> }
> public static function xsDateTimeToTimestamp($w7)
> {
> $Ku = array();
> $dv = "/^(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(?:\.\d+)?Z$/D";
> if (!(preg_match($dv, $w7, $Ku) == 0)) {
> goto aF;
> }
> echo sprintf("nvalid SAML2 timestamp passed to xsDateTimeToTimestamp: " . $w7);
> exit;
> aF:
> $Dd = intval($Ku[1]);
> $Mw = intval($Ku[2]);
> $cs = intval($Ku[3]);
> $Nd = intval($Ku[4]);
> $dO = intval($Ku[5]);
> $qC = intval($Ku[6]);
> $lQ = gmmktime($Nd, $dO, $qC, $Mw, $cs, $Dd);
> return $lQ;
> }
> public static function extractStrings(DOMElement $vN, $O4, $lY)
> {
> $t1 = array();
> $Dx = $vN->firstChild;
> p3:
> if (!($Dx !== NULL)) {
> goto el;
> }
> if (!($Dx->namespaceURI !== $O4 || $Dx->localName !== $lY)) {
> goto WY;
> }
> goto Dj;
> WY:
> $t1[] = trim($Dx->textContent);
> Dj:
> $Dx = $Dx->nextSibling;
> goto p3;
> el:
> return $t1;
> }
> public static function validateElement(DOMElement $bF)
> {
> $hR = new XMLSecurityDSig();
> $hR->idKeys[] = "ID";
> $ZU = self::xpQuery($bF, "./ds:Signature");
> if (count($ZU) === 0) {
> goto TA;
698,699c698,699
< if (count($d7) > 1) {
< goto Sk;
---
> if (count($ZU) > 1) {
> goto bR;
701,702c701,702
< goto jM;
< AV:
---
> goto xp;
> TA:
704,735c704,713
< goto jM;
< Sk:
< echo "XMLSec: more than one signature element in root.";
< exit;
< jM:
< $d7 = $d7[0];
< $Ji->sigNode = $d7;
< $Ji->canonicalizeSignedInfo();
< if ($Ji->validateReference()) {
< goto iZ;
< }
< echo sprintf("XMLsec: digest validation failed");
< exit;
< iZ:
< $Go = FALSE;
< foreach ($Ji->getValidatedNodes() as $f9) {
< if ($f9->isSameNode($rZ)) {
< goto Lr;
< }
< if ($rZ->parentNode instanceof DOMDocument && $f9->isSameNode($rZ->ownerDocument)) {
< goto yV;
< }
< goto lB;
< Lr:
< $Go = TRUE;
< goto sz;
< goto lB;
< yV:
< $Go = TRUE;
< goto sz;
< lB:
< m9:
---
> goto xp;
> bR:
> echo "XMLSec: more than one signature element in root.";
> exit;
> xp:
> $ZU = $ZU[0];
> $hR->sigNode = $ZU;
> $hR->canonicalizeSignedInfo();
> if ($hR->validateReference()) {
> goto wW;
737,739c715,724
< sz:
< if ($Go) {
< goto ej;
---
> echo sprintf("XMLsec: digest validation failed");
> exit;
> wW:
> $oH = FALSE;
> foreach ($hR->getValidatedNodes() as $Po) {
> if ($Po->isSameNode($bF)) {
> goto Zn;
> }
> if ($bF->parentNode instanceof DOMDocument && $Po->isSameNode($bF->ownerDocument)) {
> goto Jg;
741c726,741
< echo "XMLSec: The root element is not signed.";
---
> goto fQ;
> Zn:
> $oH = TRUE;
> goto cv;
> goto fQ;
> Jg:
> $oH = TRUE;
> goto cv;
> fQ:
> h0:
> }
> cv:
> if ($oH) {
> goto p7;
> }
> echo "XMLSec: The root element is not signed.";
743,749c743,749
< ej:
< $MI = array();
< foreach (self::xpQuery($d7, "./ds:KeyInfo/ds:X509Data/ds:X509Certificate") as $SD) {
< $S3 = trim($SD->textContent);
< $S3 = str_replace(array("
", "
", " ", " "), '', $S3);
< $MI[] = $S3;
< Xc:
---
> p7:
> $By = array();
> foreach (self::xpQuery($ZU, "./ds:KeyInfo/ds:X509Data/ds:X509Certificate") as $hI) {
> $ci = trim($hI->textContent);
> $ci = str_replace(array("\xd", "
", "\x9", " "), '', $ci);
> $By[] = $ci;
> Vl:
751,753c751,753
< Jp:
< $hK = array("Signature" => $Ji, "Certificates" => $MI);
< return $hK;
---
> kH:
> $t1 = array("Signature" => $hR, "Certificates" => $By);
> return $t1;
755c755
< public static function validateSignature(array $oA, XMLSecurityKey $mz)
---
> public static function validateSignature(array $Bj, XMLSecurityKey $ZE)
757,760c757,760
< $Ji = $oA["Signature"];
< $ye = self::xpQuery($Ji->sigNode, "./ds:SignedInfo/ds:SignatureMethod");
< if (!empty($ye)) {
< goto xP;
---
> $hR = $Bj["Signature"];
> $HD = self::xpQuery($hR->sigNode, "./ds:SignedInfo/ds:SignatureMethod");
> if (!empty($HD)) {
> goto Zh;
762c762
< echo sprintf("Missing SignatureMethod element");
---
> echo sprintf("Missing SignatureMethod element");
764,767c764,767
< xP:
< $ye = $ye[0];
< if ($ye->hasAttribute("Algorithm")) {
< goto a2;
---
> Zh:
> $HD = $HD[0];
> if ($HD->hasAttribute("Algorithm")) {
> goto MN;
769c769
< echo sprintf("Missing Algorithm-attribute on SignatureMethod element.");
---
> echo sprintf("Missing Algorithm-attribute on SignatureMethod element.");
771,774c771,774
< a2:
< $pq = $ye->getAttribute("Algorithm");
< if (!($mz->type === XMLSecurityKey::RSA_SHA1 && $pq !== $mz->type)) {
< goto Op;
---
> MN:
> $Py = $HD->getAttribute("Algorithm");
> if (!($ZE->type === XMLSecurityKey::RSA_SHA1 && $Py !== $ZE->type)) {
> goto S4;
776,779c776,779
< $mz = self::castKey($mz, $pq);
< Op:
< if ($Ji->verify($mz)) {
< goto VU;
---
> $ZE = self::castKey($ZE, $Py);
> S4:
> if ($hR->verify($ZE)) {
> goto Kc;
781c781
< echo sprintf("Unable to validate Sgnature");
---
> echo sprintf("Unable to validate Sgnature");
783c783
< VU:
---
> Kc:
785c785
< public static function castKey(XMLSecurityKey $mz, $tY, $Ak = "public")
---
> public static function castKey(XMLSecurityKey $ZE, $P_, $rV = "public")
787,788c787,788
< if (!($mz->type === $tY)) {
< goto vQ;
---
> if (!($ZE->type === $P_)) {
> goto lk;
790,794c790,794
< return $mz;
< vQ:
< $DK = openssl_pkey_get_details($mz->key);
< if (!($DK === FALSE)) {
< goto bq;
---
> return $ZE;
> lk:
> $E6 = openssl_pkey_get_details($ZE->key);
> if (!($E6 === FALSE)) {
> goto Ww;
796c796
< echo sprintf("Unable to get key details from XMLSecurityKey.");
---
> echo sprintf("Unable to get key details from XMLSecurityKey.");
798,800c798,800
< bq:
< if (isset($DK["key"])) {
< goto Bd;
---
> Ww:
> if (isset($E6["key"])) {
> goto ur;
802c802
< echo sprintf("Missing key in public key details.");
---
> echo sprintf("Missing key in public key details.");
804,807c804,807
< Bd:
< $C4 = new XMLSecurityKey($tY, array("type" => $Ak));
< $C4->loadKey($DK["key"]);
< return $C4;
---
> ur:
> $VH = new XMLSecurityKey($P_, array("type" => $rV));
> $VH->loadKey($E6["key"]);
> return $VH;
809c809
< public static function processResponse($Bf, $v4, $Rb, SAML2_Response $Dj, $vd)
---
> public static function processResponse($NH, $z0, $PT, SAML2_Response $yH, $vA)
811,813c811,813
< $vA = $Dj->getDestination();
< if (!($vA !== NULL && $vA !== $Bf)) {
< goto LS;
---
> $Ui = $yH->getDestination();
> if (!($Ui !== NULL && $Ui !== $NH)) {
> goto lh;
815c815
< echo sprintf("Destination in response doesn't match the current URL. Destination is "" . $vA . "", current URL is "" . $Bf . "".");
---
> echo sprintf("Destination in response doesn't match the current URL. Destination is "" . $Ui . "", current URL is "" . $NH . "".");
817,819c817,819
< LS:
< $it = self::checkSign($v4, $Rb, $vd);
< return $it;
---
> lh:
> $SH = self::checkSign($z0, $PT, $vA);
> return $SH;
821c821
< public static function checkSign($v4, $Rb, $vd)
---
> public static function checkSign($z0, $PT, $vA)
823,825c823,825
< $MI = $Rb["Certificates"];
< if (!(count($MI) === 0)) {
< goto dR;
---
> $By = $PT["Certificates"];
> if (!(count($By) === 0)) {
> goto bo;
828,832c828,832
< dR:
< $Zh = self::findCertificate($v4, $MI, $vd);
< $oy = NULL;
< $mz = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, array("type" => "public"));
< $mz->loadKey($Zh);
---
> bo:
> $la = self::findCertificate($z0, $By, $vA);
> $B6 = NULL;
> $ZE = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, array("type" => "public"));
> $ZE->loadKey($la);
834c834
< self::validateSignature($Rb, $mz);
---
> self::validateSignature($PT, $ZE);
836,837c836,837
< } catch (Exception $Rk) {
< $oy = $Rk;
---
> } catch (Exception $Ln) {
> $B6 = $Ln;
839,840c839,840
< if ($oy !== NULL) {
< goto cE;
---
> if ($B6 !== NULL) {
> goto XU;
843,883c843,882
< goto R0;
< cE:
< throw $oy;
< R0:
< }
< private static function findCertificate(string $GM, array $MI, $vd)
< {
< $Qv = $MI[0];
< $Qv = chunk_split($Qv, 80);
< foreach ($MI as $Fx) {
< $RP = strtolower(sha1(base64_decode($Fx)));
< if (!(strcmp($RP, $GM) == 0)) {
< goto b9;
< }
< $On = "-----BEGIN CERTIFICATE-----\xa" . chunk_split($Fx, 64) . "-----END CERTIFICATE-----
";
< return $On;
< b9:
< TQ:
< }
< UM:
< if ($vd == "testValidate") {
< goto uG;
< }
< echo " <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>We could not sign you in. Please contact your Administrator.</p></div>";
< exit;
< goto oA;
< uG:
< echo "<div style="font-family:Calibri;padding:0 3%;">";
< echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>
\xa <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>Unable to find a certificate matching the configured fingerprint.</p>\xd\xa <p><strong>Possible Cause: </strong>Content of 'X.509 Certificate' field in Service Provider Settings is incorrect</p>\xd\xa\x9 <p><b>Expected value: </b>" . $Qv . "</p>";
< echo str_repeat(" ", 15);
< echo "</div>\xd\xa <div style="margin:3%;display:block;text-align:center;">\xd
<form action="index.php">
<div style="margin:3%;display:block;text-align:center;"><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"></div>";
< exit;
< oA:
< }
< public static function validateIssuerAndAudience($ac, $Ho, $d0, $base_url, $vd)
< {
< $u1 = current($ac->getAssertions())->getIssuer();
< $Sb = current(current($ac->getAssertions())->getValidAudiences());
< $C0 = variable_get("miniorange_saml_entity_id", $base_url);
< if (strcmp($d0, $u1) === 0) {
< goto td;
---
> goto p9;
> XU:
> throw $B6;
> p9:
> }
> private static function findCertificate(string $gd, array $By, $vA)
> {
> $jk = $By[0];
> $jk = chunk_split($jk, 80);
> foreach ($By as $HL) {
> $Tb = strtolower(sha1(base64_decode($HL)));
> if (!(strcmp($Tb, $gd) == 0)) {
> goto gM;
> }
> $O5 = "-----BEGIN CERTIFICATE-----\xa" . chunk_split($HL, 64) . "-----END CERTIFICATE-----
";
> return $O5;
> gM:
> ew:
> }
> mX:
> if ($vA == "testValidate") {
> goto Gy;
> }
> echo " <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>We could not sign you in. Please contact your Administrator.</p></div>";
> exit;
> goto D1;
> Gy:
> echo "<div style="font-family:Calibri;padding:0 3%;">";
> echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>
\xa <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>Unable to find a certificate matching the configured fingerprint.</p>\xd\xa <p><strong>Possible Cause: </strong>Content of 'X.509 Certificate' field in Service Provider Settings is incorrect</p>
\xa\x9 \x9 <p><b>Expected value: </b>" . $jk . "</p>";
> echo str_repeat(" ", 15);
> echo "</div>
\xa <div style="margin:3%;display:block;text-align:center;">\xd
<form action="index.php">\xd
<div style="margin:3%;display:block;text-align:center;"><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"></div>";
> exit;
> D1:
> }
> public static function validateIssuerAndAudience($hl, $nW, $PF, $base_url, $vA)
> {
> $jm = current($hl->getAssertions())->getIssuer();
> $hw = current(current($hl->getAssertions())->getValidAudiences());
> if (strcmp($PF, $jm) === 0) {
> goto NW;
885,886c884,885
< if ($vd == "testValidate") {
< goto mV;
---
> if ($vA == "testValidate") {
> goto RC;
888c887
< echo " <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>We could not sign you in. Please contact your Administrator.</p></div>\xd\xa <div style="margin:3%;display:block;text-align:center;">";
---
> echo " <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>We could not sign you in. Please contact your Administrator.</p></div>
\xa <div style="margin:3%;display:block;text-align:center;">";
890,891c889,890
< goto dP;
< mV:
---
> goto nh;
> RC:
893,894c892,893
< echo "<div style="font-family:Calibri;padding:0 3%;">";
< echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>\xd\xa <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>Issuer cannot be verified.</p>\xd
<p>Please contact your administrator and report the following error:</p>
<p><strong>Possible Cause: </strong>The value in 'IdP Entity ID or Issuer' field in Service Provider Settings is incorrect</p>
\xa <p><strong>Expected Entity ID: </strong>" . $u1 . "<p>\xd
<p><strong>Entity ID Found: </strong>" . $d0 . "</p>\xd
</div>\xd\xa <div style="margin:3%;display:block;text-align:center;">
<div style="margin:3%;display:block;text-align:center;"><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"></div>";
---
> echo "<div style="font-family:Calibri;padding:0 3%;">";
> echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>
\xa <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>Issuer cannot be verified.</p>
\xa <p>Please contact your administrator and report the following error:</p>\xd\xa <p><strong>Possible Cause: </strong>The value in 'IdP Entity ID or Issuer' field in Service Provider Settings is incorrect</p>
\xa <p><strong>Expected Entity ID: </strong>" . $jm . "<p>
\xa <p><strong>Entity ID Found: </strong>" . $PF . "</p>
</div>\xd
<div style="margin:3%;display:block;text-align:center;">
\xa <div style="margin:3%;display:block;text-align:center;"><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"></div>";
896,900c895,899
< dP:
< goto G7;
< td:
< if (strcmp($Sb, $C0) === 0) {
< goto Ah;
---
> nh:
> goto eF;
> NW:
> if (strcmp($hw, $nW) === 0) {
> goto J7;
902c901
< echo sprintf("Invalid audience");
---
> echo sprintf("Invalid audience");
904,905c903,904
< goto t1;
< Ah:
---
> goto Ce;
> J7:
907,908c906,907
< t1:
< G7:
---
> Ce:
> eF:
910c909
< private static function doDecryptElement(DOMElement $dy, XMLSecurityKey $hO, array &$uB)
---
> private static function doDecryptElement(DOMElement $RQ, XMLSecurityKey $c3, array &$zI)
912,965c911,955
< $kF = new XMLSecEnc();
< $kF->setNode($dy);
< $kF->type = $dy->getAttribute("Type");
< $Gg = $kF->locateKey($dy);
< if ($Gg) {
< goto hn;
< }
< echo sprintf("Could not locate key algorithm in encrypted data.");
< exit;
< hn:
< $lT = $kF->locateKeyInfo($Gg);
< if ($lT) {
< goto pn;
< }
< echo sprintf("Could not locate <dsig:KeyInfo> for the encrypted key.");
< exit;
< pn:
< $t_ = $hO->getAlgorithm();
< if ($lT->isEncrypted) {
< goto vK;
< }
< $ma = $Gg->getAlgorithm();
< if (!($t_ !== $ma)) {
< goto U_;
< }
< echo "Algorithm mismatch between input key and key in message. " . "Key was: " . filter_xss(var_export($t_, TRUE)) . "; message was: " . filter_xss(var_export($ma, TRUE));
< exit;
< U_:
< $Gg = $hO;
< goto jR;
< vK:
< $Lu = $lT->getAlgorithm();
< if (!in_array($Lu, $uB, TRUE)) {
< goto HS;
< }
< echo sprintf("Algorithm disabled: " . var_export($Lu, TRUE));
< exit;
< HS:
< if (!($Lu === XMLSecurityKey::RSA_OAEP_MGF1P && $t_ === XMLSecurityKey::RSA_1_5)) {
< goto Qb;
< }
< $t_ = XMLSecurityKey::RSA_OAEP_MGF1P;
< Qb:
< if (!($t_ !== $Lu)) {
< goto Ql;
< }
< echo "Algorithm mismatch between input key and key used to encrypt " . " the symmetric key for the message. Key was: " . filter_xss(var_export($t_, TRUE)) . "; message was: " . filter_xss(var_export($Lu, TRUE));
< exit;
< Ql:
< $yY = $lT->encryptedCtx;
< $lT->key = $hO->key;
< $rV = $Gg->getSymmetricKeySize();
< if (!($rV === NULL)) {
< goto la;
---
> $Ma = new XMLSecEnc();
> $Ma->setNode($RQ);
> $Ma->type = $RQ->getAttribute("Type");
> $s1 = $Ma->locateKey($RQ);
> if ($s1) {
> goto V9;
> }
> echo sprintf("Could not locate key algorithm in encrypted data.");
> exit;
> V9:
> $wB = $Ma->locateKeyInfo($s1);
> if ($wB) {
> goto IT;
> }
> echo sprintf("Could not locate <dsig:KeyInfo> for the encrypted key.");
> exit;
> IT:
> $qV = $c3->getAlgorithm();
> if ($wB->isEncrypted) {
> goto ra;
> }
> $f4 = $s1->getAlgorithm();
> if (!($qV !== $f4)) {
> goto id;
> }
> echo "Algorithm mismatch between input key and key in message. " . "Key was: " . filter_xss(var_export($qV, TRUE)) . "; message was: " . filter_xss(var_export($f4, TRUE));
> exit;
> id:
> $s1 = $c3;
> goto uR;
> ra:
> $Zf = $wB->getAlgorithm();
> if (!in_array($Zf, $zI, TRUE)) {
> goto Gd;
> }
> echo sprintf("Algorithm disabled: " . var_export($Zf, TRUE));
> exit;
> Gd:
> if (!($Zf === XMLSecurityKey::RSA_OAEP_MGF1P && $qV === XMLSecurityKey::RSA_1_5)) {
> goto dH;
> }
> $qV = XMLSecurityKey::RSA_OAEP_MGF1P;
> dH:
> if (!($qV !== $Zf)) {
> goto V3;
967c957
< echo "Unknown key size for encryption algorithm: " . var_export($Gg->type, TRUE);
---
> echo "Algorithm mismatch between input key and key used to encrypt " . " the symmetric key for the message. Key was: " . filter_xss(var_export($qV, TRUE)) . "; message was: " . filter_xss(var_export($Zf, TRUE));
969c959,968
< la:
---
> V3:
> $fG = $wB->encryptedCtx;
> $wB->key = $c3->key;
> $qH = $s1->getSymmetricKeySize();
> if (!($qH === NULL)) {
> goto U1;
> }
> echo "Unknown key size for encryption algorithm: " . var_export($s1->type, TRUE);
> exit;
> U1:
971,1026c970,1025
< $mz = $yY->decryptKey($lT);
< if (!(strlen($mz) != $rV)) {
< goto Al;
< }
< echo "Unexpected key size (" . strlen($mz) * 8 . "bits) for encryption algorithm: " . var_export($Gg->type, TRUE);
< exit;
< Al:
< } catch (Exception $Rk) {
< $T7 = $yY->getCipherValue();
< $yB = openssl_pkey_get_details($lT->key);
< $yB = sha1(serialize($yB), TRUE);
< $mz = sha1($T7 . $yB, TRUE);
< if (strlen($mz) > $rV) {
< goto PN;
< }
< if (strlen($mz) < $rV) {
< goto UU;
< }
< goto xe;
< PN:
< $mz = substr($mz, 0, $rV);
< goto xe;
< UU:
< $mz = str_pad($mz, $rV);
< xe:
< }
< $Gg->loadkey($mz);
< jR:
< $tY = $Gg->getAlgorithm();
< if (!in_array($tY, $uB, TRUE)) {
< goto m5;
< }
< echo "Algorithm disabled: " . filter_xss(var_export($tY, TRUE));
< exit;
< m5:
< $aM = $kF->decryptNode($Gg, FALSE);
< $gp = "<root xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" " . "xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">" . $aM . "</root>";
< $zU = new DOMDocument();
< if (@$zU->loadXML($gp)) {
< goto LY;
< }
< throw new Exception("Failed to parse decrypted XML. Maybe the wrong sharedkey was used?");
< LY:
< $XH = $zU->firstChild->firstChild;
< if (!($XH === NULL)) {
< goto aE;
< }
< echo sprintf("Missing encrypted element.");
< throw new Exception("Missing encrypted element.");
< aE:
< if ($XH instanceof DOMElement) {
< goto a6;
< }
< echo sprintf("Decrypted element was not actually a DOMElement.");
< a6:
< return $XH;
---
> $ZE = $fG->decryptKey($wB);
> if (!(strlen($ZE) != $qH)) {
> goto vX;
> }
> echo "Unexpected key size (" . strlen($ZE) * 8 . "bits) for encryption algorithm: " . var_export($s1->type, TRUE);
> exit;
> vX:
> } catch (Exception $Ln) {
> $MB = $fG->getCipherValue();
> $wq = openssl_pkey_get_details($wB->key);
> $wq = sha1(serialize($wq), TRUE);
> $ZE = sha1($MB . $wq, TRUE);
> if (strlen($ZE) > $qH) {
> goto vG;
> }
> if (strlen($ZE) < $qH) {
> goto Qy;
> }
> goto uX;
> vG:
> $ZE = substr($ZE, 0, $qH);
> goto uX;
> Qy:
> $ZE = str_pad($ZE, $qH);
> uX:
> }
> $s1->loadkey($ZE);
> uR:
> $P_ = $s1->getAlgorithm();
> if (!in_array($P_, $zI, TRUE)) {
> goto eY;
> }
> echo "Algorithm disabled: " . filter_xss(var_export($P_, TRUE));
> exit;
> eY:
> $FE = $Ma->decryptNode($s1, FALSE);
> $nV = "<root xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" " . "xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">" . $FE . "</root>";
> $j9 = new DOMDocument();
> if (@$j9->loadXML($nV)) {
> goto Mj;
> }
> throw new Exception("Failed to parse decrypted XML. Maybe the wrong sharedkey was used?");
> Mj:
> $j8 = $j9->firstChild->firstChild;
> if (!($j8 === NULL)) {
> goto jG;
> }
> echo sprintf("Missing encrypted element.");
> throw new Exception("Missing encrypted element.");
> jG:
> if ($j8 instanceof DOMElement) {
> goto e4;
> }
> echo sprintf("Decrypted element was not actually a DOMElement.");
> e4:
> return $j8;
1028c1027
< public static function decryptElement(DOMElement $dy, XMLSecurityKey $hO, array $uB = array(), XMLSecurityKey $WS = NULL)
---
> public static function decryptElement(DOMElement $RQ, XMLSecurityKey $c3, array $zI = array(), XMLSecurityKey $Fs = NULL)
1031,1032c1030,1031
< return self::doDecryptElement($dy, $hO, $uB);
< } catch (Exception $Rk) {
---
> return self::doDecryptElement($RQ, $c3, $zI);
> } catch (Exception $Ln) {
1034,1050c1033,1049
< return self::doDecryptElement($dy, $WS, $uB);
< } catch (Exception $P9) {
< $NJ = variable_get("miniorange_saml_publ_certificate", '');
< if (!empty($NJ)) {
< goto b1;
< }
< $Qv = MiniorangeSAMLConstants::MINIORANGE_PUBLIC_CERTIFICATE;
< $df = "<strong>Possible Cause: </strong>If you have removed custom certificate then please update this default public certificate in your IDP side.";
< goto aG;
< b1:
< $Qv = variable_get("miniorange_saml_publ_certificate", '');
< $df = "<strong>Possible Cause: </strong>If you have uploaded custom certificate then please update this new custom public certificate in your IDP side.";
< aG:
< echo "<div style="font-family:Calibri;padding:0 3%;">";
< echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>\xd\xa <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>Unable to find a certificate matching the configured fingerprint.</p>
\xa <p>" . $df . "</p>
\xa\x9 <p><b>Expected value: </b>" . $Qv . "</p>";
< echo str_repeat(" ", 15);
< echo "</div>\xd\xa <div style="margin:3%;display:block;text-align:center;">
\xa <form action="index.php">\xd
<div style="margin:3%;display:block;text-align:center;"><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"></div>";
---
> return self::doDecryptElement($RQ, $Fs, $zI);
> } catch (Exception $Vd) {
> $LI = variable_get("miniorange_saml_publ_certificate", '');
> if (!empty($LI)) {
> goto xu;
> }
> $jk = MiniorangeSAMLConstants::MINIORANGE_PUBLIC_CERTIFICATE;
> $oc = "<strong>Possible Cause: </strong>If you have removed custom certificate then please update this default public certificate in your IDP side.";
> goto pA;
> xu:
> $jk = variable_get("miniorange_saml_publ_certificate", '');
> $oc = "<strong>Possible Cause: </strong>If you have uploaded custom certificate then please update this new custom public certificate in your IDP side.";
> pA:
> echo "<div style="font-family:Calibri;padding:0 3%;">";
> echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>\xd\xa <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>Unable to find a certificate matching the configured fingerprint.</p>
\xa <p>" . $oc . "</p>
\xa \x9\x9 <p><b>Expected value: </b>" . $jk . "</p>";
> echo str_repeat(" ", 15);
> echo "</div>
<div style="margin:3%;display:block;text-align:center;">
<form action="index.php">\xd
<div style="margin:3%;display:block;text-align:center;"><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"></div>";
1056,1094c1055,1093
< public static function get_mapped_groups($kW, $Q4)
< {
< $hN = array();
< if (empty($Q4)) {
< goto iK;
< }
< $jg = array();
< $Eo = 1;
< KP:
< if (!($Eo < 10)) {
< goto qG;
< }
< $ss = $kW->get("group" . $Eo . "_map");
< $jg[$Eo] = explode(";", $ss);
< $Eo++;
< goto KP;
< qG:
< iK:
< foreach ($Q4 as $DJ) {
< if (empty($DJ)) {
< goto xK;
< }
< $Eo = 0;
< $pv = false;
< HR:
< if (!($Eo < 9 && !$pv)) {
< goto p4;
< }
< if (!(!empty($jg[$Eo]) && in_array($DJ, $jg[$Eo]))) {
< goto Ea;
< }
< $hN[] = $kW->get("group" . $Eo);
< $pv = true;
< Ea:
< $Eo++;
< goto HR;
< p4:
< xK:
< Ka:
---
> public static function get_mapped_groups($SQ, $Hz)
> {
> $SC = array();
> if (empty($Hz)) {
> goto CH;
> }
> $ce = array();
> $Xc = 1;
> kl:
> if (!($Xc < 10)) {
> goto Wa;
> }
> $pT = $SQ->get("group" . $Xc . "_map");
> $ce[$Xc] = explode(";", $pT);
> $Xc++;
> goto kl;
> Wa:
> CH:
> foreach ($Hz as $f5) {
> if (empty($f5)) {
> goto rb;
> }
> $Xc = 0;
> $up = false;
> Ha:
> if (!($Xc < 9 && !$up)) {
> goto OA;
> }
> if (!(!empty($ce[$Xc]) && in_array($f5, $ce[$Xc]))) {
> goto ML;
> }
> $SC[] = $SQ->get("group" . $Xc);
> $up = true;
> ML:
> $Xc++;
> goto Ha;
> OA:
> rb:
> Ko:
1096,1097c1095,1096
< LM:
< return array_unique($hN);
---
> sA:
> return array_unique($SC);
1099c1098
< public static function getEncryptionAlgorithm($GA)
---
> public static function getEncryptionAlgorithm($LM)
1101,1102c1100,1101
< switch ($GA) {
< case "http://www.w3.org/2001/04/xmlenc#tripledes-cbc":
---
> switch ($LM) {
> case "http://www.w3.org/2001/04/xmlenc#tripledes-cbc":
1104,1105c1103,1104
< goto pj;
< case "http://www.w3.org/2001/04/xmlenc#aes128-cbc":
---
> goto QC;
> case "http://www.w3.org/2001/04/xmlenc#aes128-cbc":
1107c1106
< case "http://www.w3.org/2001/04/xmlenc#aes192-cbc":
---
> case "http://www.w3.org/2001/04/xmlenc#aes192-cbc":
1109,1110c1108,1109
< goto pj;
< case "http://www.w3.org/2001/04/xmlenc#aes256-cbc":
---
> goto QC;
> case "http://www.w3.org/2001/04/xmlenc#aes256-cbc":
1112,1113c1111,1112
< goto pj;
< case "http://www.w3.org/2001/04/xmlenc#rsa-1_5":
---
> goto QC;
> case "http://www.w3.org/2001/04/xmlenc#rsa-1_5":
1115,1116c1114,1115
< goto pj;
< case "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p":
---
> goto QC;
> case "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p":
1118,1119c1117,1118
< goto pj;
< case "http://www.w3.org/2000/09/xmldsig#dsa-sha1":
---
> goto QC;
> case "http://www.w3.org/2000/09/xmldsig#dsa-sha1":
1121,1122c1120,1121
< goto pj;
< case "http://www.w3.org/2000/09/xmldsig#rsa-sha1":
---
> goto QC;
> case "http://www.w3.org/2000/09/xmldsig#rsa-sha1":
1124,1125c1123,1124
< goto pj;
< case "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256":
---
> goto QC;
> case "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256":
1127,1128c1126,1127
< goto pj;
< case "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384":
---
> goto QC;
> case "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384":
1130,1131c1129,1130
< goto pj;
< case "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512":
---
> goto QC;
> case "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512":
1133c1132
< goto pj;
---
> goto QC;
1135c1134
< echo sprintf("Invalid Encryption Method: " . $GA);
---
> echo sprintf("Invalid Encryption Method: " . $LM);
1137c1136
< goto pj;
---
> goto QC;
1139,1140c1138,1139
< eI:
< pj:
---
> Gb:
> QC:
1142c1141
< public static function sanitize_certificate($q5)
---
> public static function sanitize_certificate($Dq)
1144,1170c1143,1169
< $q5 = preg_replace("/[
]+/", '', $q5);
< $q5 = str_replace("-", '', $q5);
< $q5 = str_replace("BEGIN CERTIFICATE", '', $q5);
< $q5 = str_replace("END CERTIFICATE", '', $q5);
< $q5 = str_replace(" ", '', $q5);
< $q5 = chunk_split($q5, 64, "
");
< $q5 = "-----BEGIN CERTIFICATE-----\xd
" . $q5 . "-----END CERTIFICATE-----";
< return $q5;
< }
< public static function sanitize_private_key($QH)
< {
< $QH = preg_replace("/[\xd\xa]+/", '', $QH);
< $QH = str_replace("-", '', $QH);
< $QH = str_replace("BEGIN PRIVATE KEY", '', $QH);
< $QH = str_replace("END PRIVATE KEY", '', $QH);
< $QH = str_replace(" ", '', $QH);
< $QH = chunk_split($QH, 64, "
\xa");
< $QH = "-----BEGIN PRIVATE KEY-----
" . $QH . "-----END PRIVATE KEY-----";
< return $QH;
< }
< public static function desanitize_certificate($q5)
< {
< $q5 = preg_replace("/[
\xa]+/", '', $q5);
< $q5 = str_replace("-----BEGIN CERTIFICATE-----", '', $q5);
< $q5 = str_replace("-----END CERTIFICATE-----", '', $q5);
< $q5 = str_replace(" ", '', $q5);
< return $q5;
---
> $Dq = preg_replace("/[
\xa]+/", '', $Dq);
> $Dq = str_replace("-", '', $Dq);
> $Dq = str_replace("BEGIN CERTIFICATE", '', $Dq);
> $Dq = str_replace("END CERTIFICATE", '', $Dq);
> $Dq = str_replace(" ", '', $Dq);
> $Dq = chunk_split($Dq, 64, "
");
> $Dq = "-----BEGIN CERTIFICATE-----\xd\xa" . $Dq . "-----END CERTIFICATE-----";
> return $Dq;
> }
> public static function sanitize_private_key($HN)
> {
> $HN = preg_replace("/[\xd\xa]+/", '', $HN);
> $HN = str_replace("-", '', $HN);
> $HN = str_replace("BEGIN PRIVATE KEY", '', $HN);
> $HN = str_replace("END PRIVATE KEY", '', $HN);
> $HN = str_replace(" ", '', $HN);
> $HN = chunk_split($HN, 64, "
");
> $HN = "-----BEGIN PRIVATE KEY-----
\xa" . $HN . "-----END PRIVATE KEY-----";
> return $HN;
> }
> public static function desanitize_certificate($Dq)
> {
> $Dq = preg_replace("/[
\xa]+/", '', $Dq);
> $Dq = str_replace("-----BEGIN CERTIFICATE-----", '', $Dq);
> $Dq = str_replace("-----END CERTIFICATE-----", '', $Dq);
> $Dq = str_replace(" ", '', $Dq);
> return $Dq;
1174,1176c1173,1175
< $kb = variable_get("miniorange_saml_private_certificate", '');
< $q5 = !empty($kb) ? $kb : MiniorangeSAMLConstants::MINIORANGE_PRIVATE_KEY;
< return $q5;
---
> $fT = variable_get("miniorange_saml_private_certificate", '');
> $Dq = !empty($fT) ? $fT : MiniorangeSAMLConstants::MINIORANGE_PRIVATE_KEY;
> return $Dq;
1180,1204c1179,1203
< $qO = variable_get("miniorange_saml_publ_certificate", '');
< $q5 = !empty($qO) ? $qO : MiniorangeSAMLConstants::MINIORANGE_PUBLIC_CERTIFICATE;
< return $q5;
< }
< public static function Print_SAML_Request($Ix, $Ak)
< {
< header("Content-Type: text/html");
< $OZ = new DOMDocument();
< $OZ->preserveWhiteSpace = false;
< $OZ->formatOutput = true;
< $OZ->loadXML($Ix);
< if ($Ak == "displaySAMLRequest") {
< goto TI;
< }
< $KB = "SAML Response";
< goto Wj;
< TI:
< $KB = "SAML Request";
< Wj:
< $rT = $OZ->saveXML();
< $Vd = htmlentities($rT);
< $Vd = rtrim($Vd);
< $gp = simplexml_load_string($rT);
< $xc = drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css";
< echo "<link rel='stylesheet' id='mo_saml_admin_settings_style-css' href='" . $xc . "' type='text/css' media='all' />\xd
<div class="mo-display-logs" ><p type="text" id="SAML_type">" . $KB . "</p></div> \x9\xd
<div type="text" id="SAML_display" class="mo-display-block"><pre class='brush: xml;'>" . $Vd . "</pre></div><br>
\xa <div style="margin:3%;display:block;text-align:center;">
\xa <div style="margin:3%;display:block;text-align:center;" ></div>
<button id="copy" onclick="copyDivToClipboard()" style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;" >Copy</button> \xd\xa <input id="dwn-btn" style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Download"\xd
">
</div>\xd
\x9 </div>";
---
> $Pz = variable_get("miniorange_saml_publ_certificate", '');
> $Dq = !empty($Pz) ? $Pz : MiniorangeSAMLConstants::MINIORANGE_PUBLIC_CERTIFICATE;
> return $Dq;
> }
> public static function Print_SAML_Request($Wd, $rV)
> {
> header("Content-Type: text/html");
> $je = new DOMDocument();
> $je->preserveWhiteSpace = false;
> $je->formatOutput = true;
> $je->loadXML($Wd);
> if ($rV == "displaySAMLRequest") {
> goto vy;
> }
> $hB = "SAML Response";
> goto kR;
> vy:
> $hB = "SAML Request";
> kR:
> $UD = $je->saveXML();
> $bR = htmlentities($UD);
> $bR = rtrim($bR);
> $nV = simplexml_load_string($UD);
> $Zj = drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css";
> echo "<link rel='stylesheet' id='mo_saml_admin_settings_style-css' href='" . $Zj . "' type='text/css' media='all' />
<div class="mo-display-logs" ><p type="text" id="SAML_type">" . $hB . "</p></div>
\xa <div type="text" id="SAML_display" class="mo-display-block"><pre class='brush: xml;'>" . $bR . "</pre></div><br>
\xa <div style="margin:3%;display:block;text-align:center;">
<div style="margin:3%;display:block;text-align:center;" ></div>
\xa <button id="copy" onclick="copyDivToClipboard()" style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;" >Copy</button>
\xa <input id="dwn-btn" style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Download"
">\xd\xa </div>\xd
\x9\x9 </div>";
1206c1205
< echo " <script>
\xa function copyDivToClipboard() {
\xa var aux = document.createElement("input");
\xa aux.setAttribute("value", document.getElementById("SAML_display").textContent);
\xa document.body.appendChild(aux);\xd\xa aux.select();
\xa document.execCommand("copy");
\xa document.body.removeChild(aux);
\xa document.getElementById('copy').textContent = "Copied";
\xa document.getElementById('copy').style.background = "grey";
\xa window.getSelection().selectAllChildren( document.getElementById( "SAML_display" ) );\xd
}
\xa\xd\xa function download(filename, text) {\xd\xa var element = document.createElement('a');\xd
element.setAttribute('href', 'data:Application/octet-stream;charset=utf-8,' + encodeURIComponent(text));\xd\xa element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}
\xa\xd\xa document.getElementById("dwn-btn").addEventListener("click", function () {
\xa var filename = document.getElementById("SAML_type").textContent+".xml";\xd\xa var node = document.getElementById("SAML_display");
htmlContent = node.innerHTML;
text = node.textContent;\xd
console.log(text);
\xa download(filename, text);
\xa }, false);\xd\xa </script>\xd\xa ";
---
> echo " <script>\xd
function copyDivToClipboard() {
var aux = document.createElement("input");
aux.setAttribute("value", document.getElementById("SAML_display").textContent);
document.body.appendChild(aux);\xd\xa aux.select();\xd\xa document.execCommand("copy");
document.body.removeChild(aux);\xd\xa document.getElementById('copy').textContent = "Copied";
\xa document.getElementById('copy').style.background = "grey";\xd
window.getSelection().selectAllChildren( document.getElementById( "SAML_display" ) );\xd
}\xd
\xd
function download(filename, text) {\xd\xa var element = document.createElement('a');\xd\xa element.setAttribute('href', 'data:Application/octet-stream;charset=utf-8,' + encodeURIComponent(text));\xd\xa element.setAttribute('download', filename);
\xa element.style.display = 'none';\xd\xa document.body.appendChild(element);\xd\xa element.click();
\xa document.body.removeChild(element);\xd
}
\xd
document.getElementById("dwn-btn").addEventListener("click", function () {\xd
var filename = document.getElementById("SAML_type").textContent+".xml";
\xa var node = document.getElementById("SAML_display");\xd\xa htmlContent = node.innerHTML;\xd
text = node.textContent;
\xa console.log(text);\xd\xa download(filename, text);\xd
}, false);\xd\xa </script>\xd
";
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/includes/XMLSecurityDSig.php" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/includes/XMLSecurityDSig.php"
6,17c6,17
< const XMLDSIGNS = "http://www.w3.org/2000/09/xmldsig#";
< const SHA1 = "http://www.w3.org/2000/09/xmldsig#sha1";
< const SHA256 = "http://www.w3.org/2001/04/xmlenc#sha256";
< const SHA384 = "http://www.w3.org/2001/04/xmldsig-more#sha384";
< const SHA512 = "http://www.w3.org/2001/04/xmlenc#sha512";
< const RIPEMD160 = "http://www.w3.org/2001/04/xmlenc#ripemd160";
< const C14N = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
< const C14N_COMMENTS = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments";
< const EXC_C14N = "http://www.w3.org/2001/10/xml-exc-c14n#";
< const EXC_C14N_COMMENTS = "http://www.w3.org/2001/10/xml-exc-c14n#WithComments";
< const template = "<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
\xa <ds:SignatureMethod />
\xa </ds:SignedInfo>\xd\xa</ds:Signature>";
< const BASE_TEMPLATE = "<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">\xd
<SignedInfo>\xd\xa <SignatureMethod />
\xa </SignedInfo>\xd
</Signature>";
---
> const XMLDSIGNS = "http://www.w3.org/2000/09/xmldsig#";
> const SHA1 = "http://www.w3.org/2000/09/xmldsig#sha1";
> const SHA256 = "http://www.w3.org/2001/04/xmlenc#sha256";
> const SHA384 = "http://www.w3.org/2001/04/xmldsig-more#sha384";
> const SHA512 = "http://www.w3.org/2001/04/xmlenc#sha512";
> const RIPEMD160 = "http://www.w3.org/2001/04/xmlenc#ripemd160";
> const C14N = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
> const C14N_COMMENTS = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments";
> const EXC_C14N = "http://www.w3.org/2001/10/xml-exc-c14n#";
> const EXC_C14N_COMMENTS = "http://www.w3.org/2001/10/xml-exc-c14n#WithComments";
> const template = "<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">\xd\xa <ds:SignedInfo>\xd
<ds:SignatureMethod />
</ds:SignedInfo>\xd\xa</ds:Signature>";
> const BASE_TEMPLATE = "<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>\xd
<SignatureMethod />
\xa </SignedInfo>\xd\xa</Signature>";
25c25
< private $searchpfx = "secdsig";
---
> private $searchpfx = "secdsig";
27c27
< public function __construct($R7 = "ds")
---
> public function __construct($jX = "ds")
29,40c29,40
< $lS = self::BASE_TEMPLATE;
< if (empty($R7)) {
< goto Ep;
< }
< $this->prefix = $R7 . ":";
< $N2 = array("<S", "</S", "xmlns=");
< $Ig = array("<{$R7}:S", "</{$R7}:S", "xmlns:{$R7}=");
< $lS = str_replace($N2, $Ig, $lS);
< Ep:
< $HX = new DOMDocument();
< $HX->loadXML($lS);
< $this->sigNode = $HX->documentElement;
---
> $lM = self::BASE_TEMPLATE;
> if (empty($jX)) {
> goto mj;
> }
> $this->prefix = $jX . ":";
> $Qk = array("<S", "</S", "xmlns=");
> $nw = array("<{$jX}:S", "</{$jX}:S", "xmlns:{$jX}=");
> $lM = str_replace($Qk, $nw, $lM);
> mj:
> $fu = new DOMDocument();
> $fu->loadXML($lM);
> $this->sigNode = $fu->documentElement;
49c49
< goto MK;
---
> goto dx;
51,54c51,54
< $Ec = new DOMXPath($this->sigNode->ownerDocument);
< $Ec->registerNamespace("secdsig", self::XMLDSIGNS);
< $this->xPathCtx = $Ec;
< MK:
---
> $BF = new DOMXPath($this->sigNode->ownerDocument);
> $BF->registerNamespace("secdsig", self::XMLDSIGNS);
> $this->xPathCtx = $BF;
> dx:
57c57
< public static function generateGUID($R7 = "pfx")
---
> public static function generateGUID($jX = "pfx")
59,84c59,84
< $va = md5(uniqid(mt_rand(), true));
< $Ud = $R7 . substr($va, 0, 8) . "-" . substr($va, 8, 4) . "-" . substr($va, 12, 4) . "-" . substr($va, 16, 4) . "-" . substr($va, 20, 12);
< return $Ud;
< }
< public static function generate_GUID($R7 = "pfx")
< {
< return self::generateGUID($R7);
< }
< public function locateSignature($hA, $Er = 0)
< {
< if ($hA instanceof DOMDocument) {
< goto Ie;
< }
< $OZ = $hA->ownerDocument;
< goto Ia;
< Ie:
< $OZ = $hA;
< Ia:
< if (!$OZ) {
< goto VG;
< }
< $Ec = new DOMXPath($OZ);
< $Ec->registerNamespace("secdsig", self::XMLDSIGNS);
< $v5 = ".//secdsig:Signature";
< $vu = $Ec->query($v5, $hA);
< $this->sigNode = $vu->item($Er);
---
> $lH = md5(uniqid(mt_rand(), true));
> $hO = $jX . substr($lH, 0, 8) . "-" . substr($lH, 8, 4) . "-" . substr($lH, 12, 4) . "-" . substr($lH, 16, 4) . "-" . substr($lH, 20, 12);
> return $hO;
> }
> public static function generate_GUID($jX = "pfx")
> {
> return self::generateGUID($jX);
> }
> public function locateSignature($bX, $E_ = 0)
> {
> if ($bX instanceof DOMDocument) {
> goto y8;
> }
> $je = $bX->ownerDocument;
> goto jA;
> y8:
> $je = $bX;
> jA:
> if (!$je) {
> goto wh;
> }
> $BF = new DOMXPath($je);
> $BF->registerNamespace("secdsig", self::XMLDSIGNS);
> $Mp = ".//secdsig:Signature";
> $jS = $BF->query($Mp, $bX);
> $this->sigNode = $jS->item($E_);
86c86
< VG:
---
> wh:
89c89
< public function createNewSignNode($SS, $rE = null)
---
> public function createNewSignNode($l2, $ND = null)
91,110c91,110
< $OZ = $this->sigNode->ownerDocument;
< if (!is_null($rE)) {
< goto KF;
< }
< $HF = $OZ->createElementNS(self::XMLDSIGNS, $this->prefix . $SS);
< goto rd;
< KF:
< $HF = $OZ->createElementNS(self::XMLDSIGNS, $this->prefix . $SS, $rE);
< rd:
< return $HF;
< }
< public function setCanonicalMethod($GA)
< {
< switch ($GA) {
< case "http://www.w3.org/TR/2001/REC-xml-c14n-20010315":
< case "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments":
< case "http://www.w3.org/2001/10/xml-exc-c14n#":
< case "http://www.w3.org/2001/10/xml-exc-c14n#WithComments":
< $this->canonicalMethod = $GA;
< goto Lx;
---
> $je = $this->sigNode->ownerDocument;
> if (!is_null($ND)) {
> goto L5;
> }
> $Dx = $je->createElementNS(self::XMLDSIGNS, $this->prefix . $l2);
> goto KC;
> L5:
> $Dx = $je->createElementNS(self::XMLDSIGNS, $this->prefix . $l2, $ND);
> KC:
> return $Dx;
> }
> public function setCanonicalMethod($LM)
> {
> switch ($LM) {
> case "http://www.w3.org/TR/2001/REC-xml-c14n-20010315":
> case "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments":
> case "http://www.w3.org/2001/10/xml-exc-c14n#":
> case "http://www.w3.org/2001/10/xml-exc-c14n#WithComments":
> $this->canonicalMethod = $LM;
> goto T1;
112c112
< throw new Exception("Invalid Canonical Method");
---
> throw new Exception("Invalid Canonical Method");
114,180c114,180
< wm:
< Lx:
< if (!($Ec = $this->getXPathObj())) {
< goto zz;
< }
< $v5 = "./" . $this->searchpfx . ":SignedInfo";
< $vu = $Ec->query($v5, $this->sigNode);
< if (!($bd = $vu->item(0))) {
< goto Cd;
< }
< $v5 = "./" . $this->searchpfx . "CanonicalizationMethod";
< $vu = $Ec->query($v5, $bd);
< if ($bC = $vu->item(0)) {
< goto qT;
< }
< $bC = $this->createNewSignNode("CanonicalizationMethod");
< $bd->insertBefore($bC, $bd->firstChild);
< qT:
< $bC->setAttribute("Algorithm", $this->canonicalMethod);
< Cd:
< zz:
< }
< private function canonicalizeData($HF, $or, $CQ = null, $Wt = null)
< {
< $jf = false;
< $ee = false;
< switch ($or) {
< case "http://www.w3.org/TR/2001/REC-xml-c14n-20010315":
< $jf = false;
< $ee = false;
< goto CW;
< case "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments":
< $ee = true;
< goto CW;
< case "http://www.w3.org/2001/10/xml-exc-c14n#":
< $jf = true;
< goto CW;
< case "http://www.w3.org/2001/10/xml-exc-c14n#WithComments":
< $jf = true;
< $ee = true;
< goto CW;
< }
< Ec:
< CW:
< if (!(is_null($CQ) && $HF instanceof DOMNode && $HF->ownerDocument !== null && $HF->isSameNode($HF->ownerDocument->documentElement))) {
< goto yP;
< }
< $gT = $HF;
< x5:
< if (!($h9 = $gT->previousSibling)) {
< goto Mq;
< }
< if (!($h9->nodeType == XML_PI_NODE || $h9->nodeType == XML_COMMENT_NODE && $ee)) {
< goto D2;
< }
< goto Mq;
< D2:
< $gT = $h9;
< goto x5;
< Mq:
< if (!($h9 == null)) {
< goto yd;
< }
< $HF = $HF->ownerDocument;
< yd:
< yP:
< return $HF->C14N($jf, $ee, $CQ, $Wt);
---
> Nt:
> T1:
> if (!($BF = $this->getXPathObj())) {
> goto K4;
> }
> $Mp = "./" . $this->searchpfx . ":SignedInfo";
> $jS = $BF->query($Mp, $this->sigNode);
> if (!($fV = $jS->item(0))) {
> goto Db;
> }
> $Mp = "./" . $this->searchpfx . "CanonicalizationMethod";
> $jS = $BF->query($Mp, $fV);
> if ($S7 = $jS->item(0)) {
> goto RV;
> }
> $S7 = $this->createNewSignNode("CanonicalizationMethod");
> $fV->insertBefore($S7, $fV->firstChild);
> RV:
> $S7->setAttribute("Algorithm", $this->canonicalMethod);
> Db:
> K4:
> }
> private function canonicalizeData($Dx, $xk, $Cq = null, $u0 = null)
> {
> $a8 = false;
> $Aa = false;
> switch ($xk) {
> case "http://www.w3.org/TR/2001/REC-xml-c14n-20010315":
> $a8 = false;
> $Aa = false;
> goto Di;
> case "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments":
> $Aa = true;
> goto Di;
> case "http://www.w3.org/2001/10/xml-exc-c14n#":
> $a8 = true;
> goto Di;
> case "http://www.w3.org/2001/10/xml-exc-c14n#WithComments":
> $a8 = true;
> $Aa = true;
> goto Di;
> }
> aG:
> Di:
> if (!(is_null($Cq) && $Dx instanceof DOMNode && $Dx->ownerDocument !== null && $Dx->isSameNode($Dx->ownerDocument->documentElement))) {
> goto Dy;
> }
> $ub = $Dx;
> zN:
> if (!($q_ = $ub->previousSibling)) {
> goto b2;
> }
> if (!($q_->nodeType == XML_PI_NODE || $q_->nodeType == XML_COMMENT_NODE && $Aa)) {
> goto Ri;
> }
> goto b2;
> Ri:
> $ub = $q_;
> goto zN;
> b2:
> if (!($q_ == null)) {
> goto yN;
> }
> $Dx = $Dx->ownerDocument;
> yN:
> Dy:
> return $Dx->C14N($a8, $Aa, $Cq, $u0);
184,202c184,202
< $OZ = $this->sigNode->ownerDocument;
< $or = null;
< if (!$OZ) {
< goto St;
< }
< $Ec = $this->getXPathObj();
< $v5 = "./secdsig:SignedInfo";
< $vu = $Ec->query($v5, $this->sigNode);
< if (!($Vu = $vu->item(0))) {
< goto Br;
< }
< $v5 = "./secdsig:CanonicalizationMethod";
< $vu = $Ec->query($v5, $Vu);
< if (!($bC = $vu->item(0))) {
< goto pL;
< }
< $or = $bC->getAttribute("Algorithm");
< pL:
< $this->signedInfo = $this->canonicalizeData($Vu, $or);
---
> $je = $this->sigNode->ownerDocument;
> $xk = null;
> if (!$je) {
> goto Xr;
> }
> $BF = $this->getXPathObj();
> $Mp = "./secdsig:SignedInfo";
> $jS = $BF->query($Mp, $this->sigNode);
> if (!($PL = $jS->item(0))) {
> goto K_;
> }
> $Mp = "./secdsig:CanonicalizationMethod";
> $jS = $BF->query($Mp, $PL);
> if (!($S7 = $jS->item(0))) {
> goto oD;
> }
> $xk = $S7->getAttribute("Algorithm");
> oD:
> $this->signedInfo = $this->canonicalizeData($PL, $xk);
204,205c204,205
< Br:
< St:
---
> K_:
> Xr:
208c208
< public function calculateDigest($mm, $IX, $I3 = true)
---
> public function calculateDigest($Be, $zN, $cW = true)
210c210
< switch ($mm) {
---
> switch ($Be) {
212,213c212,213
< $hn = "sha1";
< goto aA;
---
> $K0 = "sha1";
> goto cu;
215,216c215,216
< $hn = "sha256";
< goto aA;
---
> $K0 = "sha256";
> goto cu;
218,219c218,219
< $hn = "sha384";
< goto aA;
---
> $K0 = "sha384";
> goto cu;
221,222c221,222
< $hn = "sha512";
< goto aA;
---
> $K0 = "sha512";
> goto cu;
224,225c224,225
< $hn = "ripemd160";
< goto aA;
---
> $K0 = "ripemd160";
> goto cu;
227c227
< throw new Exception("Cannot validate digest: Unsupported Algorithm <{$mm}>");
---
> throw new Exception("Cannot validate digest: Unsupported Algorithm <{$Be}>");
229,346c229,297
< hM:
< aA:
< $Vb = hash($hn, $IX, true);
< if (!$I3) {
< goto nz;
< }
< $Vb = base64_encode($Vb);
< nz:
< return $Vb;
< }
< public function validateDigest($uA, $IX)
< {
< $Ec = new DOMXPath($uA->ownerDocument);
< $Ec->registerNamespace("secdsig", self::XMLDSIGNS);
< $v5 = "string(./secdsig:DigestMethod/@Algorithm)";
< $mm = $Ec->evaluate($v5, $uA);
< $ZD = $this->calculateDigest($mm, $IX, false);
< $v5 = "string(./secdsig:DigestValue)";
< $uD = $Ec->evaluate($v5, $uA);
< return $ZD == base64_decode($uD);
< }
< public function processTransforms($uA, $uw, $E9 = true)
< {
< $IX = $uw;
< $Ec = new DOMXPath($uA->ownerDocument);
< $Ec->registerNamespace("secdsig", self::XMLDSIGNS);
< $v5 = "./secdsig:Transforms/secdsig:Transform";
< $gM = $Ec->query($v5, $uA);
< $dI = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
< $CQ = null;
< $Wt = null;
< foreach ($gM as $zn) {
< $tY = $zn->getAttribute("Algorithm");
< switch ($tY) {
< case "http://www.w3.org/2001/10/xml-exc-c14n#":
< case "http://www.w3.org/2001/10/xml-exc-c14n#WithComments":
< if (!$E9) {
< goto ZK;
< }
< $dI = $tY;
< goto Tw;
< ZK:
< $dI = "http://www.w3.org/2001/10/xml-exc-c14n#";
< Tw:
< $HF = $zn->firstChild;
< pQ:
< if (!$HF) {
< goto WU;
< }
< if (!($HF->localName == "InclusiveNamespaces")) {
< goto ZQ;
< }
< if (!($Nv = $HF->getAttribute("PrefixList"))) {
< goto bt;
< }
< $PA = array();
< $FB = explode(" ", $Nv);
< foreach ($FB as $Nv) {
< $pW = trim($Nv);
< if (empty($pW)) {
< goto SJ;
< }
< $PA[] = $pW;
< SJ:
< L3:
< }
< HQ:
< if (!(count($PA) > 0)) {
< goto Ze;
< }
< $Wt = $PA;
< Ze:
< bt:
< goto WU;
< ZQ:
< $HF = $HF->nextSibling;
< goto pQ;
< WU:
< goto ra;
< case "http://www.w3.org/TR/2001/REC-xml-c14n-20010315":
< case "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments":
< if (!$E9) {
< goto Mx;
< }
< $dI = $tY;
< goto Fy;
< Mx:
< $dI = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
< Fy:
< goto ra;
< case "http://www.w3.org/TR/1999/REC-xpath-19991116":
< $HF = $zn->firstChild;
< kG:
< if (!$HF) {
< goto p0;
< }
< if (!($HF->localName == "XPath")) {
< goto pJ;
< }
< $CQ = array();
< $CQ["query"] = "(.//. | .//@* | .//namespace::*)[" . $HF->nodeValue . "]";
< $ed["namespaces"] = array();
< $z7 = $Ec->query("./namespace::*", $HF);
< foreach ($z7 as $lB) {
< if (!($lB->localName != "xml")) {
< goto M_;
< }
< $CQ["namespaces"][$lB->localName] = $lB->nodeValue;
< M_:
< qK:
< }
< gH:
< goto p0;
< pJ:
< $HF = $HF->nextSibling;
< goto kG;
< p0:
< goto ra;
---
> gA:
> cu:
> $fi = hash($K0, $zN, true);
> if (!$cW) {
> goto Vj;
> }
> $fi = base64_encode($fi);
> Vj:
> return $fi;
> }
> public function validateDigest($Ji, $zN)
> {
> $BF = new DOMXPath($Ji->ownerDocument);
> $BF->registerNamespace("secdsig", self::XMLDSIGNS);
> $Mp = "string(./secdsig:DigestMethod/@Algorithm)";
> $Be = $BF->evaluate($Mp, $Ji);
> $wj = $this->calculateDigest($Be, $zN, false);
> $Mp = "string(./secdsig:DigestValue)";
> $uX = $BF->evaluate($Mp, $Ji);
> return $wj == base64_decode($uX);
> }
> public function processTransforms($Ji, $BT, $yo = true)
> {
> $zN = $BT;
> $BF = new DOMXPath($Ji->ownerDocument);
> $BF->registerNamespace("secdsig", self::XMLDSIGNS);
> $Mp = "./secdsig:Transforms/secdsig:Transform";
> $SI = $BF->query($Mp, $Ji);
> $XV = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
> $Cq = null;
> $u0 = null;
> foreach ($SI as $J7) {
> $P_ = $J7->getAttribute("Algorithm");
> switch ($P_) {
> case "http://www.w3.org/2001/10/xml-exc-c14n#":
> case "http://www.w3.org/2001/10/xml-exc-c14n#WithComments":
> if (!$yo) {
> goto y6;
> }
> $XV = $P_;
> goto qv;
> y6:
> $XV = "http://www.w3.org/2001/10/xml-exc-c14n#";
> qv:
> $Dx = $J7->firstChild;
> Eu:
> if (!$Dx) {
> goto nw;
> }
> if (!($Dx->localName == "InclusiveNamespaces")) {
> goto gf;
> }
> if (!($De = $Dx->getAttribute("PrefixList"))) {
> goto e3;
> }
> $Nl = array();
> $Iv = explode(" ", $De);
> foreach ($Iv as $De) {
> $QP = trim($De);
> if (empty($QP)) {
> goto Ht;
> }
> $Nl[] = $QP;
> Ht:
> W1:
> }
> g4:
> if (!(count($Nl) > 0)) {
> goto wM;
348,349c299,344
< E6:
< ra:
---
> $u0 = $Nl;
> wM:
> e3:
> goto nw;
> gf:
> $Dx = $Dx->nextSibling;
> goto Eu;
> nw:
> goto qi;
> case "http://www.w3.org/TR/2001/REC-xml-c14n-20010315":
> case "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments":
> if (!$yo) {
> goto oN;
> }
> $XV = $P_;
> goto A6;
> oN:
> $XV = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
> A6:
> goto qi;
> case "http://www.w3.org/TR/1999/REC-xpath-19991116":
> $Dx = $J7->firstChild;
> Qk:
> if (!$Dx) {
> goto cV;
> }
> if (!($Dx->localName == "XPath")) {
> goto Np;
> }
> $Cq = array();
> $Cq["query"] = "(.//. | .//@* | .//namespace::*)[" . $Dx->nodeValue . "]";
> $aG["namespaces"] = array();
> $xw = $BF->query("./namespace::*", $Dx);
> foreach ($xw as $yP) {
> if (!($yP->localName != "xml")) {
> goto YE;
> }
> $Cq["namespaces"][$yP->localName] = $yP->nodeValue;
> YE:
> rP:
> }
> sw:
> goto cV;
> Np:
> $Dx = $Dx->nextSibling;
> goto Qk;
350a346
> goto qi;
352,385c348,385
< rw:
< if (!$IX instanceof DOMElement) {
< goto cC;
< }
< $IX = $this->canonicalizeData($uw, $dI, $CQ, $Wt);
< cC:
< return $IX;
< }
< public function processRefNode($uA)
< {
< $Pk = null;
< $E9 = true;
< if ($nj = $uA->getAttribute("URI")) {
< goto eb;
< }
< $E9 = false;
< $Pk = $uA->ownerDocument;
< goto Mg;
< eb:
< $V1 = parse_url($nj);
< if (empty($V1["path"])) {
< goto oF;
< }
< $Pk = file_get_contents($V1);
< goto TN;
< oF:
< if ($J1 = $V1["fragment"]) {
< goto YY;
< }
< $Pk = $uA->ownerDocument;
< goto K1;
< YY:
< $E9 = false;
< $ZP = new DOMXPath($uA->ownerDocument);
---
> CL:
> qi:
> lD:
> }
> cI:
> if (!$zN instanceof DOMElement) {
> goto S1;
> }
> $zN = $this->canonicalizeData($BT, $XV, $Cq, $u0);
> S1:
> return $zN;
> }
> public function processRefNode($Ji)
> {
> $GL = null;
> $yo = true;
> if ($uk = $Ji->getAttribute("URI")) {
> goto eP;
> }
> $yo = false;
> $GL = $Ji->ownerDocument;
> goto ne;
> eP:
> $VS = parse_url($uk);
> if (empty($VS["path"])) {
> goto O0;
> }
> $GL = file_get_contents($VS);
> goto bB;
> O0:
> if ($pb = $VS["fragment"]) {
> goto zY;
> }
> $GL = $Ji->ownerDocument;
> goto Su;
> zY:
> $yo = false;
> $Dj = new DOMXPath($Ji->ownerDocument);
387c387
< goto py;
---
> goto sb;
389,395c389,395
< foreach ($this->idNS as $jV => $Vg) {
< $ZP->registerNamespace($jV, $Vg);
< Dq:
< }
< Hg:
< py:
< $Ic = "@Id="" . $J1 . """;
---
> foreach ($this->idNS as $HI => $C6) {
> $Dj->registerNamespace($HI, $C6);
> FZ:
> }
> lZ:
> sb:
> $DY = "@Id="" . $pb . """;
397c397
< goto xA;
---
> goto fW;
399,412c399,412
< foreach ($this->idKeys as $hc) {
< $Ic .= " or @{$hc}='{$J1}'";
< Te:
< }
< dj:
< xA:
< $v5 = "//*[" . $Ic . "]";
< $Pk = $ZP->query($v5)->item(0);
< K1:
< TN:
< Mg:
< $IX = $this->processTransforms($uA, $Pk, $E9);
< if ($this->validateDigest($uA, $IX)) {
< goto kW;
---
> foreach ($this->idKeys as $Cj) {
> $DY .= " or @{$Cj}='{$pb}'";
> ey:
> }
> d9:
> fW:
> $Mp = "//*[" . $DY . "]";
> $GL = $Dj->query($Mp)->item(0);
> Su:
> bB:
> ne:
> $zN = $this->processTransforms($Ji, $GL, $yo);
> if ($this->validateDigest($Ji, $zN)) {
> goto CA;
415,427c415,427
< kW:
< if (!$Pk instanceof DOMElement) {
< goto rk;
< }
< if (!empty($J1)) {
< goto sH;
< }
< $this->validatedNodes[] = $Pk;
< goto O8;
< sH:
< $this->validatedNodes[$J1] = $Pk;
< O8:
< rk:
---
> CA:
> if (!$GL instanceof DOMElement) {
> goto yL;
> }
> if (!empty($pb)) {
> goto x_;
> }
> $this->validatedNodes[] = $GL;
> goto li;
> x_:
> $this->validatedNodes[$pb] = $GL;
> li:
> yL:
430c430
< public function getRefNodeID($uA)
---
> public function getRefNodeID($Ji)
432,433c432,433
< if (!($nj = $uA->getAttribute("URI"))) {
< goto Hp;
---
> if (!($uk = $Ji->getAttribute("URI"))) {
> goto bD;
435,445c435,445
< $V1 = parse_url($nj);
< if (!empty($V1["path"])) {
< goto y9;
< }
< if (!($J1 = $V1["fragment"])) {
< goto RG;
< }
< return $J1;
< RG:
< y9:
< Hp:
---
> $VS = parse_url($uk);
> if (!empty($VS["path"])) {
> goto iN;
> }
> if (!($pb = $VS["fragment"])) {
> goto tt;
> }
> return $pb;
> tt:
> iN:
> bD:
450,461c450,461
< $wx = array();
< $Ec = $this->getXPathObj();
< $v5 = "./secdsig:SignedInfo/secdsig:Reference";
< $vu = $Ec->query($v5, $this->sigNode);
< if (!($vu->length == 0)) {
< goto O4;
< }
< throw new Exception("Reference nodes not found");
< O4:
< foreach ($vu as $uA) {
< $wx[] = $this->getRefNodeID($uA);
< fb:
---
> $Hs = array();
> $BF = $this->getXPathObj();
> $Mp = "./secdsig:SignedInfo/secdsig:Reference";
> $jS = $BF->query($Mp, $this->sigNode);
> if (!($jS->length == 0)) {
> goto Fg;
> }
> throw new Exception("Reference nodes not found");
> Fg:
> foreach ($jS as $Ji) {
> $Hs[] = $this->getRefNodeID($Ji);
> t5:
463,464c463,464
< Da:
< return $wx;
---
> SF:
> return $Hs;
468,470c468,470
< $f1 = $this->sigNode->ownerDocument->documentElement;
< if ($f1->isSameNode($this->sigNode)) {
< goto A2;
---
> $TA = $this->sigNode->ownerDocument->documentElement;
> if ($TA->isSameNode($this->sigNode)) {
> goto dC;
473c473
< goto Qr;
---
> goto Kb;
476,482c476,482
< Qr:
< A2:
< $Ec = $this->getXPathObj();
< $v5 = "./secdsig:SignedInfo/secdsig:Reference";
< $vu = $Ec->query($v5, $this->sigNode);
< if (!($vu->length == 0)) {
< goto h5;
---
> Kb:
> dC:
> $BF = $this->getXPathObj();
> $Mp = "./secdsig:SignedInfo/secdsig:Reference";
> $jS = $BF->query($Mp, $this->sigNode);
> if (!($jS->length == 0)) {
> goto de;
484,485c484,485
< throw new Exception("Reference nodes not found");
< h5:
---
> throw new Exception("Reference nodes not found");
> de:
487,489c487,489
< foreach ($vu as $uA) {
< if ($this->processRefNode($uA)) {
< goto LK;
---
> foreach ($jS as $Ji) {
> if ($this->processRefNode($Ji)) {
> goto Cf;
492,494c492,494
< throw new Exception("Reference validation failed");
< LK:
< FX:
---
> throw new Exception("Reference validation failed");
> Cf:
> Zp:
496c496
< tl:
---
> lF:
499c499
< private function addRefInternal($ah, $HF, $tY, $te = null, $s9 = null)
---
> private function addRefInternal($KO, $Dx, $P_, $IR = null, $cj = null)
501,551c501,551
< $R7 = null;
< $G2 = null;
< $m7 = "Id";
< $Ij = true;
< $gi = false;
< if (!is_array($s9)) {
< goto Vr;
< }
< $R7 = empty($s9["prefix"]) ? null : $s9["prefix"];
< $G2 = empty($s9["prefix_ns"]) ? null : $s9["prefix_ns"];
< $m7 = empty($s9["id_name"]) ? "Id" : $s9["id_name"];
< $Ij = !isset($s9["overwrite"]) ? true : (bool) $s9["overwrite"];
< $gi = !isset($s9["force_uri"]) ? false : (bool) $s9["force_uri"];
< Vr:
< $lW = $m7;
< if (empty($R7)) {
< goto CB;
< }
< $lW = $R7 . ":" . $lW;
< CB:
< $uA = $this->createNewSignNode("Reference");
< $ah->appendChild($uA);
< if (!$HF instanceof DOMDocument) {
< goto qf;
< }
< if ($gi) {
< goto Sq;
< }
< goto K4;
< qf:
< $nj = null;
< if ($Ij) {
< goto Z4;
< }
< $nj = $G2 ? $HF->getAttributeNS($G2, $m7) : $HF->getAttribute($m7);
< Z4:
< if (!empty($nj)) {
< goto AH;
< }
< $nj = self::generateGUID();
< $HF->setAttributeNS($G2, $lW, $nj);
< AH:
< $uA->setAttribute("URI", "#" . $nj);
< goto K4;
< Sq:
< $uA->setAttribute("URI", '');
< K4:
< $ox = $this->createNewSignNode("Transforms");
< $uA->appendChild($ox);
< if (is_array($te)) {
< goto NK;
---
> $jX = null;
> $vw = null;
> $mM = "Id";
> $JN = true;
> $nM = false;
> if (!is_array($cj)) {
> goto Q7;
> }
> $jX = empty($cj["prefix"]) ? null : $cj["prefix"];
> $vw = empty($cj["prefix_ns"]) ? null : $cj["prefix_ns"];
> $mM = empty($cj["id_name"]) ? "Id" : $cj["id_name"];
> $JN = !isset($cj["overwrite"]) ? true : (bool) $cj["overwrite"];
> $nM = !isset($cj["force_uri"]) ? false : (bool) $cj["force_uri"];
> Q7:
> $uE = $mM;
> if (empty($jX)) {
> goto rx;
> }
> $uE = $jX . ":" . $uE;
> rx:
> $Ji = $this->createNewSignNode("Reference");
> $KO->appendChild($Ji);
> if (!$Dx instanceof DOMDocument) {
> goto qS;
> }
> if ($nM) {
> goto qB;
> }
> goto jM;
> qS:
> $uk = null;
> if ($JN) {
> goto ny;
> }
> $uk = $vw ? $Dx->getAttributeNS($vw, $mM) : $Dx->getAttribute($mM);
> ny:
> if (!empty($uk)) {
> goto aC;
> }
> $uk = self::generateGUID();
> $Dx->setAttributeNS($vw, $uE, $uk);
> aC:
> $Ji->setAttribute("URI", "#" . $uk);
> goto jM;
> qB:
> $Ji->setAttribute("URI", '');
> jM:
> $ji = $this->createNewSignNode("Transforms");
> $Ji->appendChild($ji);
> if (is_array($IR)) {
> goto sk;
554c554
< goto oZ;
---
> goto RT;
556,662c556,662
< goto CH;
< NK:
< foreach ($te as $zn) {
< $aJ = $this->createNewSignNode("Transform");
< $ox->appendChild($aJ);
< if (is_array($zn) && !empty($zn["http://www.w3.org/TR/1999/REC-xpath-19991116"]) && !empty($zn["http://www.w3.org/TR/1999/REC-xpath-19991116"]["query"])) {
< goto kJ;
< }
< $aJ->setAttribute("Algorithm", $zn);
< goto id;
< kJ:
< $aJ->setAttribute("Algorithm", "http://www.w3.org/TR/1999/REC-xpath-19991116");
< $un = $this->createNewSignNode("XPath", $zn["http://www.w3.org/TR/1999/REC-xpath-19991116"]["query"]);
< $aJ->appendChild($un);
< if (empty($zn["http://www.w3.org/TR/1999/REC-xpath-19991116"]["namespaces"])) {
< goto K2;
< }
< foreach ($zn["http://www.w3.org/TR/1999/REC-xpath-19991116"]["namespaces"] as $R7 => $Wp) {
< $un->setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:{$R7}", $Wp);
< IJ:
< }
< HW:
< K2:
< id:
< Fe:
< }
< oH:
< goto CH;
< oZ:
< $aJ = $this->createNewSignNode("Transform");
< $ox->appendChild($aJ);
< $aJ->setAttribute("Algorithm", $this->canonicalMethod);
< CH:
< $jA = $this->processTransforms($uA, $HF);
< $ZD = $this->calculateDigest($tY, $jA);
< $HG = $this->createNewSignNode("DigestMethod");
< $uA->appendChild($HG);
< $HG->setAttribute("Algorithm", $tY);
< $uD = $this->createNewSignNode("DigestValue", $ZD);
< $uA->appendChild($uD);
< }
< public function addReference($HF, $tY, $te = null, $s9 = null)
< {
< if (!($Ec = $this->getXPathObj())) {
< goto ka;
< }
< $v5 = "./secdsig:SignedInfo";
< $vu = $Ec->query($v5, $this->sigNode);
< if (!($BM = $vu->item(0))) {
< goto Fu;
< }
< $this->addRefInternal($BM, $HF, $tY, $te, $s9);
< Fu:
< ka:
< }
< public function addReferenceList($nC, $tY, $te = null, $s9 = null)
< {
< if (!($Ec = $this->getXPathObj())) {
< goto K0;
< }
< $v5 = "./secdsig:SignedInfo";
< $vu = $Ec->query($v5, $this->sigNode);
< if (!($BM = $vu->item(0))) {
< goto V8;
< }
< foreach ($nC as $HF) {
< $this->addRefInternal($BM, $HF, $tY, $te, $s9);
< oS:
< }
< sj:
< V8:
< K0:
< }
< public function addObject($IX, $vt = null, $F3 = null)
< {
< $YF = $this->createNewSignNode("Object");
< $this->sigNode->appendChild($YF);
< if (empty($vt)) {
< goto HZ;
< }
< $YF->setAttribute("MimeType", $vt);
< HZ:
< if (empty($F3)) {
< goto E2;
< }
< $YF->setAttribute("Encoding", $F3);
< E2:
< if ($IX instanceof DOMElement) {
< goto o0;
< }
< $Tl = $this->sigNode->ownerDocument->createTextNode($IX);
< goto lm;
< o0:
< $Tl = $this->sigNode->ownerDocument->importNode($IX, true);
< lm:
< $YF->appendChild($Tl);
< return $YF;
< }
< public function locateKey($HF = null)
< {
< if (!empty($HF)) {
< goto Vx;
< }
< $HF = $this->sigNode;
< Vx:
< if ($HF instanceof DOMNode) {
< goto oe;
---
> goto tZ;
> sk:
> foreach ($IR as $J7) {
> $S2 = $this->createNewSignNode("Transform");
> $ji->appendChild($S2);
> if (is_array($J7) && !empty($J7["http://www.w3.org/TR/1999/REC-xpath-19991116"]) && !empty($J7["http://www.w3.org/TR/1999/REC-xpath-19991116"]["query"])) {
> goto sG;
> }
> $S2->setAttribute("Algorithm", $J7);
> goto r0;
> sG:
> $S2->setAttribute("Algorithm", "http://www.w3.org/TR/1999/REC-xpath-19991116");
> $i8 = $this->createNewSignNode("XPath", $J7["http://www.w3.org/TR/1999/REC-xpath-19991116"]["query"]);
> $S2->appendChild($i8);
> if (empty($J7["http://www.w3.org/TR/1999/REC-xpath-19991116"]["namespaces"])) {
> goto Yd;
> }
> foreach ($J7["http://www.w3.org/TR/1999/REC-xpath-19991116"]["namespaces"] as $jX => $TH) {
> $i8->setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:{$jX}", $TH);
> my:
> }
> gh:
> Yd:
> r0:
> vx:
> }
> TG:
> goto tZ;
> RT:
> $S2 = $this->createNewSignNode("Transform");
> $ji->appendChild($S2);
> $S2->setAttribute("Algorithm", $this->canonicalMethod);
> tZ:
> $LP = $this->processTransforms($Ji, $Dx);
> $wj = $this->calculateDigest($P_, $LP);
> $hb = $this->createNewSignNode("DigestMethod");
> $Ji->appendChild($hb);
> $hb->setAttribute("Algorithm", $P_);
> $uX = $this->createNewSignNode("DigestValue", $wj);
> $Ji->appendChild($uX);
> }
> public function addReference($Dx, $P_, $IR = null, $cj = null)
> {
> if (!($BF = $this->getXPathObj())) {
> goto YG;
> }
> $Mp = "./secdsig:SignedInfo";
> $jS = $BF->query($Mp, $this->sigNode);
> if (!($pA = $jS->item(0))) {
> goto QV;
> }
> $this->addRefInternal($pA, $Dx, $P_, $IR, $cj);
> QV:
> YG:
> }
> public function addReferenceList($oN, $P_, $IR = null, $cj = null)
> {
> if (!($BF = $this->getXPathObj())) {
> goto N5;
> }
> $Mp = "./secdsig:SignedInfo";
> $jS = $BF->query($Mp, $this->sigNode);
> if (!($pA = $jS->item(0))) {
> goto TM;
> }
> foreach ($oN as $Dx) {
> $this->addRefInternal($pA, $Dx, $P_, $IR, $cj);
> VA:
> }
> vF:
> TM:
> N5:
> }
> public function addObject($zN, $Wa = null, $FD = null)
> {
> $y3 = $this->createNewSignNode("Object");
> $this->sigNode->appendChild($y3);
> if (empty($Wa)) {
> goto jf;
> }
> $y3->setAttribute("MimeType", $Wa);
> jf:
> if (empty($FD)) {
> goto I6;
> }
> $y3->setAttribute("Encoding", $FD);
> I6:
> if ($zN instanceof DOMElement) {
> goto p6;
> }
> $AV = $this->sigNode->ownerDocument->createTextNode($zN);
> goto wI;
> p6:
> $AV = $this->sigNode->ownerDocument->importNode($zN, true);
> wI:
> $y3->appendChild($AV);
> return $y3;
> }
> public function locateKey($Dx = null)
> {
> if (!empty($Dx)) {
> goto Gm;
> }
> $Dx = $this->sigNode;
> Gm:
> if ($Dx instanceof DOMNode) {
> goto r2;
665,674c665,674
< oe:
< if (!($OZ = $HF->ownerDocument)) {
< goto qF;
< }
< $Ec = new DOMXPath($OZ);
< $Ec->registerNamespace("secdsig", self::XMLDSIGNS);
< $v5 = "string(./secdsig:SignedInfo/secdsig:SignatureMethod/@Algorithm)";
< $tY = $Ec->evaluate($v5, $HF);
< if (!$tY) {
< goto q_;
---
> r2:
> if (!($je = $Dx->ownerDocument)) {
> goto o3;
> }
> $BF = new DOMXPath($je);
> $BF->registerNamespace("secdsig", self::XMLDSIGNS);
> $Mp = "string(./secdsig:SignedInfo/secdsig:SignatureMethod/@Algorithm)";
> $P_ = $BF->evaluate($Mp, $Dx);
> if (!$P_) {
> goto dY;
677,678c677,678
< $oB = new XMLSecurityKey($tY, array("type" => "public"));
< } catch (Exception $Rk) {
---
> $Vi = new XMLSecurityKey($P_, array("type" => "public"));
> } catch (Exception $Ln) {
681,683c681,683
< return $oB;
< q_:
< qF:
---
> return $Vi;
> dY:
> o3:
686c686
< public function verify($oB)
---
> public function verify($Vi)
688,694c688,694
< $OZ = $this->sigNode->ownerDocument;
< $Ec = new DOMXPath($OZ);
< $Ec->registerNamespace("secdsig", self::XMLDSIGNS);
< $v5 = "string(./secdsig:SignatureValue)";
< $kQ = $Ec->evaluate($v5, $this->sigNode);
< if (!empty($kQ)) {
< goto L8;
---
> $je = $this->sigNode->ownerDocument;
> $BF = new DOMXPath($je);
> $BF->registerNamespace("secdsig", self::XMLDSIGNS);
> $Mp = "string(./secdsig:SignatureValue)";
> $I1 = $BF->evaluate($Mp, $this->sigNode);
> if (!empty($I1)) {
> goto TP;
696,698c696,698
< throw new Exception("Unable to locate SignatureValue");
< L8:
< return $oB->verifySignature($this->signedInfo, base64_decode($kQ));
---
> throw new Exception("Unable to locate SignatureValue");
> TP:
> return $Vi->verifySignature($this->signedInfo, base64_decode($I1));
700c700
< public function signData($oB, $IX)
---
> public function signData($Vi, $zN)
702c702
< return $oB->signData($IX);
---
> return $Vi->signData($zN);
704c704
< public function sign($oB, $VZ = null)
---
> public function sign($Vi, $m9 = null)
706,707c706,707
< if (!($VZ != null)) {
< goto MZ;
---
> if (!($m9 != null)) {
> goto Is;
710,737c710,737
< $this->appendSignature($VZ);
< $this->sigNode = $VZ->lastChild;
< MZ:
< if (!($Ec = $this->getXPathObj())) {
< goto qm;
< }
< $v5 = "./secdsig:SignedInfo";
< $vu = $Ec->query($v5, $this->sigNode);
< if (!($BM = $vu->item(0))) {
< goto Fp;
< }
< $v5 = "./secdsig:SignatureMethod";
< $vu = $Ec->query($v5, $BM);
< $C5 = $vu->item(0);
< $C5->setAttribute("Algorithm", $oB->type);
< $IX = $this->canonicalizeData($BM, $this->canonicalMethod);
< $kQ = base64_encode($this->signData($oB, $IX));
< $qe = $this->createNewSignNode("SignatureValue", $kQ);
< if ($Wi = $BM->nextSibling) {
< goto P1;
< }
< $this->sigNode->appendChild($qe);
< goto C1;
< P1:
< $Wi->parentNode->insertBefore($qe, $Wi);
< C1:
< Fp:
< qm:
---
> $this->appendSignature($m9);
> $this->sigNode = $m9->lastChild;
> Is:
> if (!($BF = $this->getXPathObj())) {
> goto Y2;
> }
> $Mp = "./secdsig:SignedInfo";
> $jS = $BF->query($Mp, $this->sigNode);
> if (!($pA = $jS->item(0))) {
> goto Mg;
> }
> $Mp = "./secdsig:SignatureMethod";
> $jS = $BF->query($Mp, $pA);
> $Se = $jS->item(0);
> $Se->setAttribute("Algorithm", $Vi->type);
> $zN = $this->canonicalizeData($pA, $this->canonicalMethod);
> $I1 = base64_encode($this->signData($Vi, $zN));
> $oQ = $this->createNewSignNode("SignatureValue", $I1);
> if ($F3 = $pA->nextSibling) {
> goto fE;
> }
> $this->sigNode->appendChild($oQ);
> goto TK;
> fE:
> $F3->parentNode->insertBefore($oQ, $F3);
> TK:
> Mg:
> Y2:
742c742
< public function appendKey($oB, $xh = null)
---
> public function appendKey($Vi, $vN = null)
744c744
< $oB->serializeKey($xh);
---
> $Vi->serializeKey($vN);
746c746
< public function insertSignature($HF, $nY = null)
---
> public function insertSignature($Dx, $gS = null)
748,751c748,751
< $Ej = $HF->ownerDocument;
< $d7 = $Ej->importNode($this->sigNode, true);
< if ($nY == null) {
< goto L1;
---
> $nD = $Dx->ownerDocument;
> $ZU = $nD->importNode($this->sigNode, true);
> if ($gS == null) {
> goto M8;
753,757c753,757
< return $HF->insertBefore($d7, $nY);
< goto K9;
< L1:
< return $HF->insertBefore($d7);
< K9:
---
> return $Dx->insertBefore($ZU, $gS);
> goto zd;
> M8:
> return $Dx->insertBefore($ZU);
> zd:
759c759
< public function appendSignature($Fh, $Kt = false)
---
> public function appendSignature($e4, $HH = false)
761,762c761,762
< $nY = $Kt ? $Fh->firstChild : null;
< return $this->insertSignature($Fh, $nY);
---
> $gS = $HH ? $e4->firstChild : null;
> return $this->insertSignature($e4, $gS);
764c764
< public static function get509XCert($Fx, $Ru = true)
---
> public static function get509XCert($HL, $FI = true)
766,768c766,768
< $N_ = self::staticGet509XCerts($Fx, $Ru);
< if (empty($N_)) {
< goto BO;
---
> $jc = self::staticGet509XCerts($HL, $FI);
> if (empty($jc)) {
> goto HF;
770,771c770,771
< return $N_[0];
< BO:
---
> return $jc[0];
> HF:
774c774
< public static function staticGet509XCerts($N_, $Ru = true)
---
> public static function staticGet509XCerts($jc, $FI = true)
776,777c776,777
< if ($Ru) {
< goto Tm;
---
> if ($FI) {
> goto ul;
779,857c779,848
< return array($N_);
< goto GS;
< Tm:
< $IX = '';
< $mt = array();
< $Ay = explode("
", $N_);
< $U6 = false;
< foreach ($Ay as $GZ) {
< if (!$U6) {
< goto og;
< }
< if (!(strncmp($GZ, "-----END CERTIFICATE", 20) == 0)) {
< goto P_;
< }
< $U6 = false;
< $mt[] = $IX;
< $IX = '';
< goto V2;
< P_:
< $IX .= trim($GZ);
< goto zJ;
< og:
< if (!(strncmp($GZ, "-----BEGIN CERTIFICATE", 22) == 0)) {
< goto Bf;
< }
< $U6 = true;
< Bf:
< zJ:
< V2:
< }
< kj:
< return $mt;
< GS:
< }
< public static function staticAdd509Cert($JL, $Fx, $Ru = true, $d9 = false, $Ec = null, $s9 = null)
< {
< if (!$d9) {
< goto f1;
< }
< $Fx = file_get_contents($Fx);
< f1:
< if ($JL instanceof DOMElement) {
< goto XK;
< }
< throw new Exception("Invalid parent Node parameter");
< XK:
< $y0 = $JL->ownerDocument;
< if (!empty($Ec)) {
< goto vW;
< }
< $Ec = new DOMXPath($JL->ownerDocument);
< $Ec->registerNamespace("secdsig", self::XMLDSIGNS);
< vW:
< $v5 = "./secdsig:KeyInfo";
< $vu = $Ec->query($v5, $JL);
< $DK = $vu->item(0);
< $mE = '';
< if (!$DK) {
< goto ih;
< }
< $Nv = $DK->lookupPrefix(self::XMLDSIGNS);
< if (empty($Nv)) {
< goto Z1;
< }
< $mE = $Nv . ":";
< Z1:
< goto mQ;
< ih:
< $Nv = $JL->lookupPrefix(self::XMLDSIGNS);
< if (empty($Nv)) {
< goto Rz;
< }
< $mE = $Nv . ":";
< Rz:
< $S_ = false;
< $DK = $y0->createElementNS(self::XMLDSIGNS, $mE . "KeyInfo");
< $v5 = "./secdsig:Object";
< $vu = $Ec->query($v5, $JL);
< if (!($Jt = $vu->item(0))) {
---
> return array($jc);
> goto j1;
> ul:
> $zN = '';
> $JY = array();
> $Z7 = explode("\xa", $jc);
> $v7 = false;
> foreach ($Z7 as $SW) {
> if (!$v7) {
> goto GG;
> }
> if (!(strncmp($SW, "-----END CERTIFICATE", 20) == 0)) {
> goto vr;
> }
> $v7 = false;
> $JY[] = $zN;
> $zN = '';
> goto C6;
> vr:
> $zN .= trim($SW);
> goto r9;
> GG:
> if (!(strncmp($SW, "-----BEGIN CERTIFICATE", 22) == 0)) {
> goto EI;
> }
> $v7 = true;
> EI:
> r9:
> C6:
> }
> bE:
> return $JY;
> j1:
> }
> public static function staticAdd509Cert($Q1, $HL, $FI = true, $nn = false, $BF = null, $cj = null)
> {
> if (!$nn) {
> goto cB;
> }
> $HL = file_get_contents($HL);
> cB:
> if ($Q1 instanceof DOMElement) {
> goto pT;
> }
> throw new Exception("Invalid parent Node parameter");
> pT:
> $El = $Q1->ownerDocument;
> if (!empty($BF)) {
> goto rQ;
> }
> $BF = new DOMXPath($Q1->ownerDocument);
> $BF->registerNamespace("secdsig", self::XMLDSIGNS);
> rQ:
> $Mp = "./secdsig:KeyInfo";
> $jS = $BF->query($Mp, $Q1);
> $E6 = $jS->item(0);
> $Ub = '';
> if (!$E6) {
> goto LS;
> }
> $De = $E6->lookupPrefix(self::XMLDSIGNS);
> if (empty($De)) {
> goto DX;
> }
> $Ub = $De . ":";
> DX:
> goto xY;
> LS:
> $De = $Q1->lookupPrefix(self::XMLDSIGNS);
> if (empty($De)) {
860,861c851
< $Jt->parentNode->insertBefore($DK, $Jt);
< $S_ = true;
---
> $Ub = $De . ":";
863,1007c853,1007
< if ($S_) {
< goto RH;
< }
< $JL->appendChild($DK);
< RH:
< mQ:
< $N_ = self::staticGet509XCerts($Fx, $Ru);
< $bz = $y0->createElementNS(self::XMLDSIGNS, $mE . "X509Data");
< $DK->appendChild($bz);
< $AK = false;
< $HY = false;
< if (!is_array($s9)) {
< goto bg;
< }
< if (empty($s9["issuerSerial"])) {
< goto cf;
< }
< $AK = true;
< cf:
< if (empty($s9["subjectName"])) {
< goto J_;
< }
< $HY = true;
< J_:
< bg:
< foreach ($N_ as $zp) {
< if (!($AK || $HY)) {
< goto oE;
< }
< if (!($S3 = openssl_x509_parse("-----BEGIN CERTIFICATE-----\xa" . chunk_split($zp, 64, "\xa") . "-----END CERTIFICATE-----
"))) {
< goto js;
< }
< if (!($HY && !empty($S3["subject"]))) {
< goto z_;
< }
< if (is_array($S3["subject"])) {
< goto WY;
< }
< $LD = $S3["issuer"];
< goto w_;
< WY:
< $Oo = array();
< foreach ($S3["subject"] as $mz => $rE) {
< if (is_array($rE)) {
< goto qg;
< }
< array_unshift($Oo, "{$mz}={$rE}");
< goto Jk;
< qg:
< foreach ($rE as $ql) {
< array_unshift($Oo, "{$mz}={$ql}");
< Ar:
< }
< Th:
< Jk:
< wM:
< }
< Zo:
< $LD = implode(",", $Oo);
< w_:
< $iQ = $y0->createElementNS(self::XMLDSIGNS, $mE . "X509SubjectName", $LD);
< $bz->appendChild($iQ);
< z_:
< if (!($AK && !empty($S3["issuer"]) && !empty($S3["serialNumber"]))) {
< goto fw;
< }
< if (is_array($S3["issuer"])) {
< goto mm;
< }
< $ag = $S3["issuer"];
< goto i0;
< mm:
< $Oo = array();
< foreach ($S3["issuer"] as $mz => $rE) {
< array_unshift($Oo, "{$mz}={$rE}");
< Ud:
< }
< ft:
< $ag = implode(",", $Oo);
< i0:
< $j2 = $y0->createElementNS(self::XMLDSIGNS, $mE . "X509IssuerSerial");
< $bz->appendChild($j2);
< $UC = $y0->createElementNS(self::XMLDSIGNS, $mE . "X509IssuerName", $ag);
< $j2->appendChild($UC);
< $UC = $y0->createElementNS(self::XMLDSIGNS, $mE . "X509SerialNumber", $S3["serialNumber"]);
< $j2->appendChild($UC);
< fw:
< js:
< oE:
< $xg = $y0->createElementNS(self::XMLDSIGNS, $mE . "X509Certificate", $zp);
< $bz->appendChild($xg);
< ZT:
< }
< JC:
< }
< public function add509Cert($Fx, $Ru = true, $d9 = false, $s9 = null)
< {
< if (!($Ec = $this->getXPathObj())) {
< goto Zm;
< }
< self::staticAdd509Cert($this->sigNode, $Fx, $Ru, $d9, $Ec, $s9);
< Zm:
< }
< public function appendToKeyInfo($HF)
< {
< $JL = $this->sigNode;
< $y0 = $JL->ownerDocument;
< $Ec = $this->getXPathObj();
< if (!empty($Ec)) {
< goto GO;
< }
< $Ec = new DOMXPath($JL->ownerDocument);
< $Ec->registerNamespace("secdsig", self::XMLDSIGNS);
< GO:
< $v5 = "./secdsig:KeyInfo";
< $vu = $Ec->query($v5, $JL);
< $DK = $vu->item(0);
< if ($DK) {
< goto pY;
< }
< $mE = '';
< $Nv = $JL->lookupPrefix(self::XMLDSIGNS);
< if (empty($Nv)) {
< goto Z_;
< }
< $mE = $Nv . ":";
< Z_:
< $S_ = false;
< $DK = $y0->createElementNS(self::XMLDSIGNS, $mE . "KeyInfo");
< $v5 = "./secdsig:Object";
< $vu = $Ec->query($v5, $JL);
< if (!($Jt = $vu->item(0))) {
< goto Y1;
< }
< $Jt->parentNode->insertBefore($DK, $Jt);
< $S_ = true;
< Y1:
< if ($S_) {
< goto Ns;
< }
< $JL->appendChild($DK);
< Ns:
< pY:
< $DK->appendChild($HF);
< return $DK;
---
> $r_ = false;
> $E6 = $El->createElementNS(self::XMLDSIGNS, $Ub . "KeyInfo");
> $Mp = "./secdsig:Object";
> $jS = $BF->query($Mp, $Q1);
> if (!($yx = $jS->item(0))) {
> goto xF;
> }
> $yx->parentNode->insertBefore($E6, $yx);
> $r_ = true;
> xF:
> if ($r_) {
> goto yE;
> }
> $Q1->appendChild($E6);
> yE:
> xY:
> $jc = self::staticGet509XCerts($HL, $FI);
> $s4 = $El->createElementNS(self::XMLDSIGNS, $Ub . "X509Data");
> $E6->appendChild($s4);
> $va = false;
> $Qh = false;
> if (!is_array($cj)) {
> goto tz;
> }
> if (empty($cj["issuerSerial"])) {
> goto GR;
> }
> $va = true;
> GR:
> if (empty($cj["subjectName"])) {
> goto mt;
> }
> $Qh = true;
> mt:
> tz:
> foreach ($jc as $aY) {
> if (!($va || $Qh)) {
> goto BI;
> }
> if (!($ci = openssl_x509_parse("-----BEGIN CERTIFICATE-----\xa" . chunk_split($aY, 64, "\xa") . "-----END CERTIFICATE-----
"))) {
> goto rA;
> }
> if (!($Qh && !empty($ci["subject"]))) {
> goto ue;
> }
> if (is_array($ci["subject"])) {
> goto dQ;
> }
> $Ph = $ci["issuer"];
> goto uJ;
> dQ:
> $SB = array();
> foreach ($ci["subject"] as $ZE => $ND) {
> if (is_array($ND)) {
> goto pm;
> }
> array_unshift($SB, "{$ZE}={$ND}");
> goto W7;
> pm:
> foreach ($ND as $oI) {
> array_unshift($SB, "{$ZE}={$oI}");
> VH:
> }
> ZI:
> W7:
> jE:
> }
> AJ:
> $Ph = implode(",", $SB);
> uJ:
> $sP = $El->createElementNS(self::XMLDSIGNS, $Ub . "X509SubjectName", $Ph);
> $s4->appendChild($sP);
> ue:
> if (!($va && !empty($ci["issuer"]) && !empty($ci["serialNumber"]))) {
> goto rZ;
> }
> if (is_array($ci["issuer"])) {
> goto oY;
> }
> $B4 = $ci["issuer"];
> goto RD;
> oY:
> $SB = array();
> foreach ($ci["issuer"] as $ZE => $ND) {
> array_unshift($SB, "{$ZE}={$ND}");
> QM:
> }
> Lu:
> $B4 = implode(",", $SB);
> RD:
> $H4 = $El->createElementNS(self::XMLDSIGNS, $Ub . "X509IssuerSerial");
> $s4->appendChild($H4);
> $cZ = $El->createElementNS(self::XMLDSIGNS, $Ub . "X509IssuerName", $B4);
> $H4->appendChild($cZ);
> $cZ = $El->createElementNS(self::XMLDSIGNS, $Ub . "X509SerialNumber", $ci["serialNumber"]);
> $H4->appendChild($cZ);
> rZ:
> rA:
> BI:
> $yY = $El->createElementNS(self::XMLDSIGNS, $Ub . "X509Certificate", $aY);
> $s4->appendChild($yY);
> TI:
> }
> s8:
> }
> public function add509Cert($HL, $FI = true, $nn = false, $cj = null)
> {
> if (!($BF = $this->getXPathObj())) {
> goto UK;
> }
> self::staticAdd509Cert($this->sigNode, $HL, $FI, $nn, $BF, $cj);
> UK:
> }
> public function appendToKeyInfo($Dx)
> {
> $Q1 = $this->sigNode;
> $El = $Q1->ownerDocument;
> $BF = $this->getXPathObj();
> if (!empty($BF)) {
> goto Vq;
> }
> $BF = new DOMXPath($Q1->ownerDocument);
> $BF->registerNamespace("secdsig", self::XMLDSIGNS);
> Vq:
> $Mp = "./secdsig:KeyInfo";
> $jS = $BF->query($Mp, $Q1);
> $E6 = $jS->item(0);
> if ($E6) {
> goto kc;
> }
> $Ub = '';
> $De = $Q1->lookupPrefix(self::XMLDSIGNS);
> if (empty($De)) {
> goto Yo;
> }
> $Ub = $De . ":";
> Yo:
> $r_ = false;
> $E6 = $El->createElementNS(self::XMLDSIGNS, $Ub . "KeyInfo");
> $Mp = "./secdsig:Object";
> $jS = $BF->query($Mp, $Q1);
> if (!($yx = $jS->item(0))) {
> goto B9;
> }
> $yx->parentNode->insertBefore($E6, $yx);
> $r_ = true;
> B9:
> if ($r_) {
> goto yD;
> }
> $Q1->appendChild($E6);
> yD:
> kc:
> $E6->appendChild($Dx);
> return $E6;
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/includes/XMLSecurityKey.php" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/includes/XMLSecurityKey.php"
6,21c6,21
< const TRIPLEDES_CBC = "http://www.w3.org/2001/04/xmlenc#tripledes-cbc";
< const AES128_CBC = "http://www.w3.org/2001/04/xmlenc#aes128-cbc";
< const AES192_CBC = "http://www.w3.org/2001/04/xmlenc#aes192-cbc";
< const AES256_CBC = "http://www.w3.org/2001/04/xmlenc#aes256-cbc";
< const AES128_GCM = "http://www.w3.org/2009/xmlenc11#aes128-gcm";
< const AES192_GCM = "http://www.w3.org/2009/xmlenc11#aes192-gcm";
< const AES256_GCM = "http://www.w3.org/2009/xmlenc11#aes256-gcm";
< const RSA_1_5 = "http://www.w3.org/2001/04/xmlenc#rsa-1_5";
< const RSA_OAEP_MGF1P = "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p";
< const RSA_OAEP = "http://www.w3.org/2009/xmlenc11#rsa-oaep";
< const DSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#dsa-sha1";
< const RSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
< const RSA_SHA256 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256";
< const RSA_SHA384 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384";
< const RSA_SHA512 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512";
< const HMAC_SHA1 = "http://www.w3.org/2000/09/xmldsig#hmac-sha1";
---
> const TRIPLEDES_CBC = "http://www.w3.org/2001/04/xmlenc#tripledes-cbc";
> const AES128_CBC = "http://www.w3.org/2001/04/xmlenc#aes128-cbc";
> const AES192_CBC = "http://www.w3.org/2001/04/xmlenc#aes192-cbc";
> const AES256_CBC = "http://www.w3.org/2001/04/xmlenc#aes256-cbc";
> const AES128_GCM = "http://www.w3.org/2009/xmlenc11#aes128-gcm";
> const AES192_GCM = "http://www.w3.org/2009/xmlenc11#aes192-gcm";
> const AES256_GCM = "http://www.w3.org/2009/xmlenc11#aes256-gcm";
> const RSA_1_5 = "http://www.w3.org/2001/04/xmlenc#rsa-1_5";
> const RSA_OAEP_MGF1P = "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p";
> const RSA_OAEP = "http://www.w3.org/2009/xmlenc11#rsa-oaep";
> const DSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#dsa-sha1";
> const RSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
> const RSA_SHA256 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256";
> const RSA_SHA384 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384";
> const RSA_SHA512 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512";
> const HMAC_SHA1 = "http://www.w3.org/2000/09/xmldsig#hmac-sha1";
35c35
< public function __construct($Ak, $He = null)
---
> public function __construct($rV, $qt = null)
37c37
< switch ($Ak) {
---
> switch ($rV) {
39,45c39,45
< $this->cryptParams["library"] = "openssl";
< $this->cryptParams["cipher"] = "des-ede3-cbc";
< $this->cryptParams["type"] = "symmetric";
< $this->cryptParams["method"] = "http://www.w3.org/2001/04/xmlenc#tripledes-cbc";
< $this->cryptParams["keysize"] = 24;
< $this->cryptParams["blocksize"] = 8;
< goto Pr;
---
> $this->cryptParams["library"] = "openssl";
> $this->cryptParams["cipher"] = "des-ede3-cbc";
> $this->cryptParams["type"] = "symmetric";
> $this->cryptParams["method"] = "http://www.w3.org/2001/04/xmlenc#tripledes-cbc";
> $this->cryptParams["keysize"] = 24;
> $this->cryptParams["blocksize"] = 8;
> goto vN;
47,53c47,53
< $this->cryptParams["library"] = "openssl";
< $this->cryptParams["cipher"] = "aes-128-cbc";
< $this->cryptParams["type"] = "symmetric";
< $this->cryptParams["method"] = "http://www.w3.org/2001/04/xmlenc#aes128-cbc";
< $this->cryptParams["keysize"] = 16;
< $this->cryptParams["blocksize"] = 16;
< goto Pr;
---
> $this->cryptParams["library"] = "openssl";
> $this->cryptParams["cipher"] = "aes-128-cbc";
> $this->cryptParams["type"] = "symmetric";
> $this->cryptParams["method"] = "http://www.w3.org/2001/04/xmlenc#aes128-cbc";
> $this->cryptParams["keysize"] = 16;
> $this->cryptParams["blocksize"] = 16;
> goto vN;
55,61c55,61
< $this->cryptParams["library"] = "openssl";
< $this->cryptParams["cipher"] = "aes-192-cbc";
< $this->cryptParams["type"] = "symmetric";
< $this->cryptParams["method"] = "http://www.w3.org/2001/04/xmlenc#aes192-cbc";
< $this->cryptParams["keysize"] = 24;
< $this->cryptParams["blocksize"] = 16;
< goto Pr;
---
> $this->cryptParams["library"] = "openssl";
> $this->cryptParams["cipher"] = "aes-192-cbc";
> $this->cryptParams["type"] = "symmetric";
> $this->cryptParams["method"] = "http://www.w3.org/2001/04/xmlenc#aes192-cbc";
> $this->cryptParams["keysize"] = 24;
> $this->cryptParams["blocksize"] = 16;
> goto vN;
63,69c63,69
< $this->cryptParams["library"] = "openssl";
< $this->cryptParams["cipher"] = "aes-256-cbc";
< $this->cryptParams["type"] = "symmetric";
< $this->cryptParams["method"] = "http://www.w3.org/2001/04/xmlenc#aes256-cbc";
< $this->cryptParams["keysize"] = 32;
< $this->cryptParams["blocksize"] = 16;
< goto Pr;
---
> $this->cryptParams["library"] = "openssl";
> $this->cryptParams["cipher"] = "aes-256-cbc";
> $this->cryptParams["type"] = "symmetric";
> $this->cryptParams["method"] = "http://www.w3.org/2001/04/xmlenc#aes256-cbc";
> $this->cryptParams["keysize"] = 32;
> $this->cryptParams["blocksize"] = 16;
> goto vN;
71,77c71,77
< $this->cryptParams["library"] = "openssl";
< $this->cryptParams["cipher"] = "aes-128-gcm";
< $this->cryptParams["type"] = "symmetric";
< $this->cryptParams["method"] = "http://www.w3.org/2009/xmlenc11#aes128-gcm";
< $this->cryptParams["keysize"] = 16;
< $this->cryptParams["blocksize"] = 16;
< goto Pr;
---
> $this->cryptParams["library"] = "openssl";
> $this->cryptParams["cipher"] = "aes-128-gcm";
> $this->cryptParams["type"] = "symmetric";
> $this->cryptParams["method"] = "http://www.w3.org/2009/xmlenc11#aes128-gcm";
> $this->cryptParams["keysize"] = 16;
> $this->cryptParams["blocksize"] = 16;
> goto vN;
79,85c79,85
< $this->cryptParams["library"] = "openssl";
< $this->cryptParams["cipher"] = "aes-192-gcm";
< $this->cryptParams["type"] = "symmetric";
< $this->cryptParams["method"] = "http://www.w3.org/2009/xmlenc11#aes192-gcm";
< $this->cryptParams["keysize"] = 24;
< $this->cryptParams["blocksize"] = 16;
< goto Pr;
---
> $this->cryptParams["library"] = "openssl";
> $this->cryptParams["cipher"] = "aes-192-gcm";
> $this->cryptParams["type"] = "symmetric";
> $this->cryptParams["method"] = "http://www.w3.org/2009/xmlenc11#aes192-gcm";
> $this->cryptParams["keysize"] = 24;
> $this->cryptParams["blocksize"] = 16;
> goto vN;
87,93c87,93
< $this->cryptParams["library"] = "openssl";
< $this->cryptParams["cipher"] = "aes-256-gcm";
< $this->cryptParams["type"] = "symmetric";
< $this->cryptParams["method"] = "http://www.w3.org/2009/xmlenc11#aes256-gcm";
< $this->cryptParams["keysize"] = 32;
< $this->cryptParams["blocksize"] = 16;
< goto Pr;
---
> $this->cryptParams["library"] = "openssl";
> $this->cryptParams["cipher"] = "aes-256-gcm";
> $this->cryptParams["type"] = "symmetric";
> $this->cryptParams["method"] = "http://www.w3.org/2009/xmlenc11#aes256-gcm";
> $this->cryptParams["keysize"] = 32;
> $this->cryptParams["blocksize"] = 16;
> goto vN;
95,108c95,108
< $this->cryptParams["library"] = "openssl";
< $this->cryptParams["padding"] = OPENSSL_PKCS1_PADDING;
< $this->cryptParams["method"] = "http://www.w3.org/2001/04/xmlenc#rsa-1_5";
< if (!(is_array($He) && !empty($He["type"]))) {
< goto kD;
< }
< if (!($He["type"] == "public" || $He["type"] == "private")) {
< goto SI;
< }
< $this->cryptParams["type"] = $He["type"];
< goto Pr;
< SI:
< kD:
< throw new Exception("Certificate "type" (private/public) must be passed via parameters");
---
> $this->cryptParams["library"] = "openssl";
> $this->cryptParams["padding"] = OPENSSL_PKCS1_PADDING;
> $this->cryptParams["method"] = "http://www.w3.org/2001/04/xmlenc#rsa-1_5";
> if (!(is_array($qt) && !empty($qt["type"]))) {
> goto q7;
> }
> if (!($qt["type"] == "public" || $qt["type"] == "private")) {
> goto YX;
> }
> $this->cryptParams["type"] = $qt["type"];
> goto vN;
> YX:
> q7:
> throw new Exception("Certificate "type" (private/public) must be passed via parameters");
110,124c110,124
< $this->cryptParams["library"] = "openssl";
< $this->cryptParams["padding"] = OPENSSL_PKCS1_OAEP_PADDING;
< $this->cryptParams["method"] = "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p";
< $this->cryptParams["hash"] = null;
< if (!(is_array($He) && !empty($He["type"]))) {
< goto B3;
< }
< if (!($He["type"] == "public" || $He["type"] == "private")) {
< goto si;
< }
< $this->cryptParams["type"] = $He["type"];
< goto Pr;
< si:
< B3:
< throw new Exception("Certificate "type" (private/public) must be passed via parameters");
---
> $this->cryptParams["library"] = "openssl";
> $this->cryptParams["padding"] = OPENSSL_PKCS1_OAEP_PADDING;
> $this->cryptParams["method"] = "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p";
> $this->cryptParams["hash"] = null;
> if (!(is_array($qt) && !empty($qt["type"]))) {
> goto rp;
> }
> if (!($qt["type"] == "public" || $qt["type"] == "private")) {
> goto ex;
> }
> $this->cryptParams["type"] = $qt["type"];
> goto vN;
> ex:
> rp:
> throw new Exception("Certificate "type" (private/public) must be passed via parameters");
126,140c126,140
< $this->cryptParams["library"] = "openssl";
< $this->cryptParams["padding"] = OPENSSL_PKCS1_OAEP_PADDING;
< $this->cryptParams["method"] = "http://www.w3.org/2009/xmlenc11#rsa-oaep";
< $this->cryptParams["hash"] = "http://www.w3.org/2009/xmlenc11#mgf1sha1";
< if (!(is_array($He) && !empty($He["type"]))) {
< goto s3;
< }
< if (!($He["type"] == "public" || $He["type"] == "private")) {
< goto JU;
< }
< $this->cryptParams["type"] = $He["type"];
< goto Pr;
< JU:
< s3:
< throw new Exception("Certificate "type" (private/public) must be passed via parameters");
---
> $this->cryptParams["library"] = "openssl";
> $this->cryptParams["padding"] = OPENSSL_PKCS1_OAEP_PADDING;
> $this->cryptParams["method"] = "http://www.w3.org/2009/xmlenc11#rsa-oaep";
> $this->cryptParams["hash"] = "http://www.w3.org/2009/xmlenc11#mgf1sha1";
> if (!(is_array($qt) && !empty($qt["type"]))) {
> goto qw;
> }
> if (!($qt["type"] == "public" || $qt["type"] == "private")) {
> goto u0;
> }
> $this->cryptParams["type"] = $qt["type"];
> goto vN;
> u0:
> qw:
> throw new Exception("Certificate "type" (private/public) must be passed via parameters");
142,155c142,155
< $this->cryptParams["library"] = "openssl";
< $this->cryptParams["method"] = "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
< $this->cryptParams["padding"] = OPENSSL_PKCS1_PADDING;
< if (!(is_array($He) && !empty($He["type"]))) {
< goto dz;
< }
< if (!($He["type"] == "public" || $He["type"] == "private")) {
< goto Pe;
< }
< $this->cryptParams["type"] = $He["type"];
< goto Pr;
< Pe:
< dz:
< throw new Exception("Certificate "type" (private/public) must be passed via parameters");
---
> $this->cryptParams["library"] = "openssl";
> $this->cryptParams["method"] = "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
> $this->cryptParams["padding"] = OPENSSL_PKCS1_PADDING;
> if (!(is_array($qt) && !empty($qt["type"]))) {
> goto mM;
> }
> if (!($qt["type"] == "public" || $qt["type"] == "private")) {
> goto oe;
> }
> $this->cryptParams["type"] = $qt["type"];
> goto vN;
> oe:
> mM:
> throw new Exception("Certificate "type" (private/public) must be passed via parameters");
157,171c157,171
< $this->cryptParams["library"] = "openssl";
< $this->cryptParams["method"] = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256";
< $this->cryptParams["padding"] = OPENSSL_PKCS1_PADDING;
< $this->cryptParams["digest"] = "SHA256";
< if (!(is_array($He) && !empty($He["type"]))) {
< goto j9;
< }
< if (!($He["type"] == "public" || $He["type"] == "private")) {
< goto lQ;
< }
< $this->cryptParams["type"] = $He["type"];
< goto Pr;
< lQ:
< j9:
< throw new Exception("Certificate "type" (private/public) must be passed via parameters");
---
> $this->cryptParams["library"] = "openssl";
> $this->cryptParams["method"] = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256";
> $this->cryptParams["padding"] = OPENSSL_PKCS1_PADDING;
> $this->cryptParams["digest"] = "SHA256";
> if (!(is_array($qt) && !empty($qt["type"]))) {
> goto b3;
> }
> if (!($qt["type"] == "public" || $qt["type"] == "private")) {
> goto y4;
> }
> $this->cryptParams["type"] = $qt["type"];
> goto vN;
> y4:
> b3:
> throw new Exception("Certificate "type" (private/public) must be passed via parameters");
173,187c173,187
< $this->cryptParams["library"] = "openssl";
< $this->cryptParams["method"] = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384";
< $this->cryptParams["padding"] = OPENSSL_PKCS1_PADDING;
< $this->cryptParams["digest"] = "SHA384";
< if (!(is_array($He) && !empty($He["type"]))) {
< goto qA;
< }
< if (!($He["type"] == "public" || $He["type"] == "private")) {
< goto EI;
< }
< $this->cryptParams["type"] = $He["type"];
< goto Pr;
< EI:
< qA:
< throw new Exception("Certificate "type" (private/public) must be passed via parameters");
---
> $this->cryptParams["library"] = "openssl";
> $this->cryptParams["method"] = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384";
> $this->cryptParams["padding"] = OPENSSL_PKCS1_PADDING;
> $this->cryptParams["digest"] = "SHA384";
> if (!(is_array($qt) && !empty($qt["type"]))) {
> goto cT;
> }
> if (!($qt["type"] == "public" || $qt["type"] == "private")) {
> goto Bk;
> }
> $this->cryptParams["type"] = $qt["type"];
> goto vN;
> Bk:
> cT:
> throw new Exception("Certificate "type" (private/public) must be passed via parameters");
189,203c189,203
< $this->cryptParams["library"] = "openssl";
< $this->cryptParams["method"] = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512";
< $this->cryptParams["padding"] = OPENSSL_PKCS1_PADDING;
< $this->cryptParams["digest"] = "SHA512";
< if (!(is_array($He) && !empty($He["type"]))) {
< goto U5;
< }
< if (!($He["type"] == "public" || $He["type"] == "private")) {
< goto fh;
< }
< $this->cryptParams["type"] = $He["type"];
< goto Pr;
< fh:
< U5:
< throw new Exception("Certificate "type" (private/public) must be passed via parameters");
---
> $this->cryptParams["library"] = "openssl";
> $this->cryptParams["method"] = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512";
> $this->cryptParams["padding"] = OPENSSL_PKCS1_PADDING;
> $this->cryptParams["digest"] = "SHA512";
> if (!(is_array($qt) && !empty($qt["type"]))) {
> goto xH;
> }
> if (!($qt["type"] == "public" || $qt["type"] == "private")) {
> goto NC;
> }
> $this->cryptParams["type"] = $qt["type"];
> goto vN;
> NC:
> xH:
> throw new Exception("Certificate "type" (private/public) must be passed via parameters");
205,207c205,207
< $this->cryptParams["library"] = $Ak;
< $this->cryptParams["method"] = "http://www.w3.org/2000/09/xmldsig#hmac-sha1";
< goto Pr;
---
> $this->cryptParams["library"] = $rV;
> $this->cryptParams["method"] = "http://www.w3.org/2000/09/xmldsig#hmac-sha1";
> goto vN;
209c209
< throw new Exception("Invalid Key Type");
---
> throw new Exception("Invalid Key Type");
211,213c211,213
< Xm:
< Pr:
< $this->type = $Ak;
---
> kB:
> vN:
> $this->type = $rV;
217,218c217,218
< if (isset($this->cryptParams["keysize"])) {
< goto d9;
---
> if (isset($this->cryptParams["keysize"])) {
> goto fJ;
221,222c221,222
< d9:
< return $this->cryptParams["keysize"];
---
> fJ:
> return $this->cryptParams["keysize"];
226,227c226,227
< if (isset($this->cryptParams["keysize"])) {
< goto QL;
---
> if (isset($this->cryptParams["keysize"])) {
> goto Up;
229,232c229,232
< throw new Exception("Unknown key size for type "" . $this->type . "".");
< QL:
< $T9 = $this->cryptParams["keysize"];
< $mz = openssl_random_pseudo_bytes($T9);
---
> throw new Exception("Unknown key size for type "" . $this->type . "".");
> Up:
> $H9 = $this->cryptParams["keysize"];
> $ZE = openssl_random_pseudo_bytes($H9);
234c234
< goto Ev;
---
> goto OZ;
236,239c236,270
< $Eo = 0;
< iG:
< if (!($Eo < strlen($mz))) {
< goto xN;
---
> $Xc = 0;
> hc:
> if (!($Xc < strlen($ZE))) {
> goto VK;
> }
> $Q6 = ord($ZE[$Xc]) & 0xfe;
> $X1 = 1;
> $LW = 1;
> BD:
> if (!($LW < 8)) {
> goto Oz;
> }
> $X1 ^= $Q6 >> $LW & 1;
> UJ:
> $LW++;
> goto BD;
> Oz:
> $Q6 |= $X1;
> $ZE[$Xc] = chr($Q6);
> U0:
> $Xc++;
> goto hc;
> VK:
> OZ:
> $this->key = $ZE;
> return $ZE;
> }
> public static function getRawThumbprint($HL)
> {
> $Z7 = explode("\xa", $HL);
> $zN = '';
> $v7 = false;
> foreach ($Z7 as $SW) {
> if (!$v7) {
> goto I3;
241,246c272,273
< $b1 = ord($mz[$Eo]) & 0xfe;
< $io = 1;
< $CO = 1;
< iz:
< if (!($CO < 8)) {
< goto I0;
---
> if (!(strncmp($SW, "-----END CERTIFICATE", 20) == 0)) {
> goto Ff;
248,290c275,290
< $io ^= $b1 >> $CO & 1;
< ne:
< $CO++;
< goto iz;
< I0:
< $b1 |= $io;
< $mz[$Eo] = chr($b1);
< C9:
< $Eo++;
< goto iG;
< xN:
< Ev:
< $this->key = $mz;
< return $mz;
< }
< public static function getRawThumbprint($Fx)
< {
< $Ay = explode("\xa", $Fx);
< $IX = '';
< $U6 = false;
< foreach ($Ay as $GZ) {
< if (!$U6) {
< goto Iv;
< }
< if (!(strncmp($GZ, "-----END CERTIFICATE", 20) == 0)) {
< goto gW;
< }
< goto Jr;
< gW:
< $IX .= trim($GZ);
< goto ef;
< Iv:
< if (!(strncmp($GZ, "-----BEGIN CERTIFICATE", 22) == 0)) {
< goto GB;
< }
< $U6 = true;
< GB:
< ef:
< pH:
< }
< Jr:
< if (empty($IX)) {
< goto Fj;
---
> goto wB;
> Ff:
> $zN .= trim($SW);
> goto IJ;
> I3:
> if (!(strncmp($SW, "-----BEGIN CERTIFICATE", 22) == 0)) {
> goto IK;
> }
> $v7 = true;
> IK:
> IJ:
> Y1:
> }
> wB:
> if (empty($zN)) {
> goto Rp;
292,293c292,293
< return strtolower(sha1(base64_decode($IX)));
< Fj:
---
> return strtolower(sha1(base64_decode($zN)));
> Rp:
296c296
< public function loadKey($mz, $HU = false, $zf = false)
---
> public function loadKey($ZE, $fx = false, $sG = false)
298,299c298,299
< if ($HU) {
< goto y1;
---
> if ($fx) {
> goto Ra;
301,307c301,307
< $this->key = $mz;
< goto L0;
< y1:
< $this->key = file_get_contents($mz);
< L0:
< if ($zf) {
< goto zb;
---
> $this->key = $ZE;
> goto Dm;
> Ra:
> $this->key = file_get_contents($ZE);
> Dm:
> if ($sG) {
> goto hD;
310,311c310,311
< goto Bo;
< zb:
---
> goto H5;
> hD:
313,318c313,318
< openssl_x509_export($this->key, $xR);
< $this->x509Certificate = $xR;
< $this->key = $xR;
< Bo:
< if (!($this->cryptParams["library"] == "openssl")) {
< goto fL;
---
> openssl_x509_export($this->key, $SS);
> $this->x509Certificate = $SS;
> $this->key = $SS;
> H5:
> if (!($this->cryptParams["library"] == "openssl")) {
> goto Pc;
321,323c321,323
< case "public":
< if (!$zf) {
< goto Ii;
---
> case "public":
> if (!$sG) {
> goto rH;
326c326
< Ii:
---
> rH:
329c329
< goto z0;
---
> goto gq;
331,334c331,334
< throw new Exception("Unable to extract public key");
< z0:
< goto xC;
< case "private":
---
> throw new Exception("Unable to extract public key");
> gq:
> goto Gq;
> case "private":
336,343c336,343
< goto xC;
< case "symmetric":
< if (!(strlen($this->key) < $this->cryptParams["keysize"])) {
< goto Q3;
< }
< throw new Exception("Key must contain at least " . $this->cryptParams["keysize"] . " characters for this cipher, contains " . strlen($this->key));
< Q3:
< goto xC;
---
> goto Gq;
> case "symmetric":
> if (!(strlen($this->key) < $this->cryptParams["keysize"])) {
> goto Gu;
> }
> throw new Exception("Key must contain at least " . $this->cryptParams["keysize"] . " characters for this cipher, contains " . strlen($this->key));
> Gu:
> goto Gq;
345c345,417
< throw new Exception("Unknown type");
---
> throw new Exception("Unknown type");
> }
> fX:
> Gq:
> Pc:
> }
> private function padISO10126($zN, $pm)
> {
> if (!($pm > 256)) {
> goto Hx;
> }
> throw new Exception("Block size higher than 256 not allowed");
> Hx:
> $JF = $pm - strlen($zN) % $pm;
> $FC = chr($JF);
> return $zN . str_repeat($FC, $JF);
> }
> private function unpadISO10126($zN)
> {
> $JF = substr($zN, -1);
> $S9 = ord($JF);
> return substr($zN, 0, -$S9);
> }
> private function encryptSymmetric($zN)
> {
> $this->iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($this->cryptParams["cipher"]));
> $OU = null;
> if (in_array($this->cryptParams["cipher"], ["aes-128-gcm", "aes-192-gcm", "aes-256-gcm"])) {
> goto Rn;
> }
> $zN = $this->padISO10126($zN, $this->cryptParams["blocksize"]);
> $Du = openssl_encrypt($zN, $this->cryptParams["cipher"], $this->key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $this->iv);
> goto WV;
> Rn:
> if (!(version_compare(PHP_VERSION, "7.1.0") < 0)) {
> goto pI;
> }
> throw new Exception("PHP 7.1.0 is required to use AES GCM algorithms");
> pI:
> $OU = openssl_random_pseudo_bytes(self::AUTHTAG_LENGTH);
> $Du = openssl_encrypt($zN, $this->cryptParams["cipher"], $this->key, OPENSSL_RAW_DATA, $this->iv, $OU);
> WV:
> if (!(false === $Du)) {
> goto n7;
> }
> throw new Exception("Failure encrypting Data (openssl symmetric) - " . openssl_error_string());
> n7:
> return $this->iv . $Du . $OU;
> }
> private function decryptSymmetric($zN)
> {
> $dH = openssl_cipher_iv_length($this->cryptParams["cipher"]);
> $this->iv = substr($zN, 0, $dH);
> $zN = substr($zN, $dH);
> $OU = null;
> if (in_array($this->cryptParams["cipher"], ["aes-128-gcm", "aes-192-gcm", "aes-256-gcm"])) {
> goto K1;
> }
> $FE = openssl_decrypt($zN, $this->cryptParams["cipher"], $this->key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $this->iv);
> goto CT;
> K1:
> if (!(version_compare(PHP_VERSION, "7.1.0") < 0)) {
> goto eu;
> }
> throw new Exception("PHP 7.1.0 is required to use AES GCM algorithms");
> eu:
> $uS = 0 - self::AUTHTAG_LENGTH;
> $OU = substr($zN, $uS);
> $zN = substr($zN, 0, $uS);
> $FE = openssl_decrypt($zN, $this->cryptParams["cipher"], $this->key, OPENSSL_RAW_DATA, $this->iv, $OU);
> CT:
> if (!(false === $FE)) {
> goto uc;
347,439c419,421
< mf:
< xC:
< fL:
< }
< private function padISO10126($IX, $oJ)
< {
< if (!($oJ > 256)) {
< goto cz;
< }
< throw new Exception("Block size higher than 256 not allowed");
< cz:
< $NP = $oJ - strlen($IX) % $oJ;
< $iv = chr($NP);
< return $IX . str_repeat($iv, $NP);
< }
< private function unpadISO10126($IX)
< {
< $NP = substr($IX, -1);
< $GX = ord($NP);
< return substr($IX, 0, -$GX);
< }
< private function encryptSymmetric($IX)
< {
< $this->iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($this->cryptParams["cipher"]));
< $qP = null;
< if (in_array($this->cryptParams["cipher"], ["aes-128-gcm", "aes-192-gcm", "aes-256-gcm"])) {
< goto gn;
< }
< $IX = $this->padISO10126($IX, $this->cryptParams["blocksize"]);
< $mn = openssl_encrypt($IX, $this->cryptParams["cipher"], $this->key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $this->iv);
< goto BS;
< gn:
< if (!(version_compare(PHP_VERSION, "7.1.0") < 0)) {
< goto Ee;
< }
< throw new Exception("PHP 7.1.0 is required to use AES GCM algorithms");
< Ee:
< $qP = openssl_random_pseudo_bytes(self::AUTHTAG_LENGTH);
< $mn = openssl_encrypt($IX, $this->cryptParams["cipher"], $this->key, OPENSSL_RAW_DATA, $this->iv, $qP);
< BS:
< if (!(false === $mn)) {
< goto WR;
< }
< throw new Exception("Failure encrypting Data (openssl symmetric) - " . openssl_error_string());
< WR:
< return $this->iv . $mn . $qP;
< }
< private function decryptSymmetric($IX)
< {
< $NI = openssl_cipher_iv_length($this->cryptParams["cipher"]);
< $this->iv = substr($IX, 0, $NI);
< $IX = substr($IX, $NI);
< $qP = null;
< if (in_array($this->cryptParams["cipher"], ["aes-128-gcm", "aes-192-gcm", "aes-256-gcm"])) {
< goto nI;
< }
< $aM = openssl_decrypt($IX, $this->cryptParams["cipher"], $this->key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $this->iv);
< goto dl;
< nI:
< if (!(version_compare(PHP_VERSION, "7.1.0") < 0)) {
< goto AC;
< }
< throw new Exception("PHP 7.1.0 is required to use AES GCM algorithms");
< AC:
< $Co = 0 - self::AUTHTAG_LENGTH;
< $qP = substr($IX, $Co);
< $IX = substr($IX, 0, $Co);
< $aM = openssl_decrypt($IX, $this->cryptParams["cipher"], $this->key, OPENSSL_RAW_DATA, $this->iv, $qP);
< dl:
< if (!(false === $aM)) {
< goto Oh;
< }
< throw new Exception("Failure decrypting Data (openssl symmetric) - " . openssl_error_string());
< Oh:
< return null !== $qP ? $aM : $this->unpadISO10126($aM);
< }
< private function encryptPublic($IX)
< {
< if (openssl_public_encrypt($IX, $mn, $this->key, $this->cryptParams["padding"])) {
< goto AT;
< }
< throw new Exception("Failure encrypting Data (openssl public) - " . openssl_error_string());
< AT:
< return $mn;
< }
< private function decryptPublic($IX)
< {
< if (openssl_public_decrypt($IX, $aM, $this->key, $this->cryptParams["padding"])) {
< goto op;
< }
< throw new Exception("Failure decrypting Data (openssl public) - " . openssl_error_string());
< op:
< return $aM;
---
> throw new Exception("Failure decrypting Data (openssl symmetric) - " . openssl_error_string());
> uc:
> return null !== $OU ? $FE : $this->unpadISO10126($FE);
441c423
< private function encryptPrivate($IX)
---
> private function encryptPublic($zN)
443,444c425,426
< if (openssl_private_encrypt($IX, $mn, $this->key, $this->cryptParams["padding"])) {
< goto xH;
---
> if (openssl_public_encrypt($zN, $Du, $this->key, $this->cryptParams["padding"])) {
> goto Zw;
446,448c428,444
< throw new Exception("Failure encrypting Data (openssl private) - " . openssl_error_string());
< xH:
< return $mn;
---
> throw new Exception("Failure encrypting Data (openssl public) - " . openssl_error_string());
> Zw:
> return $Du;
> }
> private function decryptPublic($zN)
> {
> if (openssl_public_decrypt($zN, $FE, $this->key, $this->cryptParams["padding"])) {
> goto hR;
> }
> throw new Exception("Failure decrypting Data (openssl public) - " . openssl_error_string());
> hR:
> return $FE;
> }
> private function encryptPrivate($zN)
> {
> if (openssl_private_encrypt($zN, $Du, $this->key, $this->cryptParams["padding"])) {
> goto mZ;
450c446,450
< private function decryptPrivate($IX)
---
> throw new Exception("Failure encrypting Data (openssl private) - " . openssl_error_string());
> mZ:
> return $Du;
> }
> private function decryptPrivate($zN)
452,453c452,453
< if (openssl_private_decrypt($IX, $aM, $this->key, $this->cryptParams["padding"])) {
< goto pF;
---
> if (openssl_private_decrypt($zN, $FE, $this->key, $this->cryptParams["padding"])) {
> goto cM;
455,457c455,457
< throw new Exception("Failure decrypting Data (openssl private) - " . openssl_error_string());
< pF:
< return $aM;
---
> throw new Exception("Failure decrypting Data (openssl private) - " . openssl_error_string());
> cM:
> return $FE;
459c459
< private function signOpenSSL($IX)
---
> private function signOpenSSL($zN)
461,463c461,463
< $pq = OPENSSL_ALGO_SHA1;
< if (empty($this->cryptParams["digest"])) {
< goto xJ;
---
> $Py = OPENSSL_ALGO_SHA1;
> if (empty($this->cryptParams["digest"])) {
> goto u3;
465,468c465,468
< $pq = $this->cryptParams["digest"];
< xJ:
< if (openssl_sign($IX, $DX, $this->key, $pq)) {
< goto Mw;
---
> $Py = $this->cryptParams["digest"];
> u3:
> if (openssl_sign($zN, $ge, $this->key, $Py)) {
> goto Ia;
470,472c470,472
< throw new Exception("Failure Signing Data: " . openssl_error_string() . " - " . $pq);
< Mw:
< return $DX;
---
> throw new Exception("Failure Signing Data: " . openssl_error_string() . " - " . $Py);
> Ia:
> return $ge;
474c474
< private function verifyOpenSSL($IX, $DX)
---
> private function verifyOpenSSL($zN, $ge)
476,478c476,478
< $pq = OPENSSL_ALGO_SHA1;
< if (empty($this->cryptParams["digest"])) {
< goto zN;
---
> $Py = OPENSSL_ALGO_SHA1;
> if (empty($this->cryptParams["digest"])) {
> goto A3;
480,482c480,482
< $pq = $this->cryptParams["digest"];
< zN:
< return openssl_verify($IX, $DX, $this->key, $pq);
---
> $Py = $this->cryptParams["digest"];
> A3:
> return openssl_verify($zN, $ge, $this->key, $Py);
484c484
< public function encryptData($IX)
---
> public function encryptData($zN)
486,487c486,487
< if (!($this->cryptParams["library"] === "openssl")) {
< goto lr;
---
> if (!($this->cryptParams["library"] === "openssl")) {
> goto C8;
489,495c489,495
< switch ($this->cryptParams["type"]) {
< case "symmetric":
< return $this->encryptSymmetric($IX);
< case "public":
< return $this->encryptPublic($IX);
< case "private":
< return $this->encryptPrivate($IX);
---
> switch ($this->cryptParams["type"]) {
> case "symmetric":
> return $this->encryptSymmetric($zN);
> case "public":
> return $this->encryptPublic($zN);
> case "private":
> return $this->encryptPrivate($zN);
497,499c497,499
< OS:
< ba:
< lr:
---
> r6:
> WL:
> C8:
501c501
< public function decryptData($IX)
---
> public function decryptData($zN)
503,504c503,504
< if (!($this->cryptParams["library"] === "openssl")) {
< goto fJ;
---
> if (!($this->cryptParams["library"] === "openssl")) {
> goto wK;
506,512c506,512
< switch ($this->cryptParams["type"]) {
< case "symmetric":
< return $this->decryptSymmetric($IX);
< case "public":
< return $this->decryptPublic($IX);
< case "private":
< return $this->decryptPrivate($IX);
---
> switch ($this->cryptParams["type"]) {
> case "symmetric":
> return $this->decryptSymmetric($zN);
> case "public":
> return $this->decryptPublic($zN);
> case "private":
> return $this->decryptPrivate($zN);
514,516c514,516
< jy:
< yK:
< fJ:
---
> Cr:
> l6:
> wK:
518c518
< public function signData($IX)
---
> public function signData($zN)
520,522c520,522
< switch ($this->cryptParams["library"]) {
< case "openssl":
< return $this->signOpenSSL($IX);
---
> switch ($this->cryptParams["library"]) {
> case "openssl":
> return $this->signOpenSSL($zN);
524c524
< return hash_hmac("sha1", $IX, $this->key, true);
---
> return hash_hmac("sha1", $zN, $this->key, true);
526,527c526,527
< xz:
< Ma:
---
> uy:
> U4:
529c529
< public function verifySignature($IX, $DX)
---
> public function verifySignature($zN, $ge)
531,533c531,533
< switch ($this->cryptParams["library"]) {
< case "openssl":
< return $this->verifyOpenSSL($IX, $DX);
---
> switch ($this->cryptParams["library"]) {
> case "openssl":
> return $this->verifyOpenSSL($zN, $ge);
535,536c535,536
< $iK = hash_hmac("sha1", $IX, $this->key, true);
< return strcmp($DX, $iK) == 0;
---
> $Is = hash_hmac("sha1", $zN, $this->key, true);
> return strcmp($ge, $Is) == 0;
538,539c538,539
< CK:
< q8:
---
> C2:
> s0:
547c547
< return $this->cryptParams["method"];
---
> return $this->cryptParams["method"];
549c549
< public static function makeAsnSegment($Ak, $sq)
---
> public static function makeAsnSegment($rV, $yV)
551c551
< switch ($Ak) {
---
> switch ($rV) {
553,554c553,554
< if (!(ord($sq) > 0x7f)) {
< goto lG;
---
> if (!(ord($yV) > 0x7f)) {
> goto xE;
556,558c556,558
< $sq = chr(0) . $sq;
< lG:
< goto Qk;
---
> $yV = chr(0) . $yV;
> xE:
> goto Cc;
560,561c560,561
< $sq = chr(0) . $sq;
< goto Qk;
---
> $yV = chr(0) . $yV;
> goto Cc;
563,609c563,609
< CU:
< Qk:
< $Y4 = strlen($sq);
< if ($Y4 < 128) {
< goto p7;
< }
< if ($Y4 < 0x100) {
< goto EK;
< }
< if ($Y4 < 0x10000) {
< goto wk;
< }
< $rl = null;
< goto Nt;
< wk:
< $rl = sprintf("%c%c%c%c%s", $Ak, 0x82, $Y4 / 0x100, $Y4 % 0x100, $sq);
< Nt:
< goto cn;
< EK:
< $rl = sprintf("%c%c%c%s", $Ak, 0x81, $Y4, $sq);
< cn:
< goto PH;
< p7:
< $rl = sprintf("%c%c%s", $Ak, $Y4, $sq);
< PH:
< return $rl;
< }
< public static function convertRSA($RT, $ve)
< {
< $NU = self::makeAsnSegment(0x2, $ve);
< $Fa = self::makeAsnSegment(0x2, $RT);
< $pc = self::makeAsnSegment(0x30, $Fa . $NU);
< $fP = self::makeAsnSegment(0x3, $pc);
< $g0 = pack("H*", "300D06092A864886F70D0101010500");
< $Tm = self::makeAsnSegment(0x30, $g0 . $fP);
< $XA = base64_encode($Tm);
< $F3 = "-----BEGIN PUBLIC KEY-----
";
< $Co = 0;
< Pt:
< if (!($cT = substr($XA, $Co, 64))) {
< goto NZ;
< }
< $F3 = $F3 . $cT . "\xa";
< $Co += 64;
< goto Pt;
< NZ:
< return $F3 . "-----END PUBLIC KEY-----
";
---
> EZ:
> Cc:
> $J2 = strlen($yV);
> if ($J2 < 128) {
> goto EC;
> }
> if ($J2 < 0x100) {
> goto iP;
> }
> if ($J2 < 0x10000) {
> goto cH;
> }
> $im = null;
> goto Jk;
> cH:
> $im = sprintf("%c%c%c%c%s", $rV, 0x82, $J2 / 0x100, $J2 % 0x100, $yV);
> Jk:
> goto rd;
> iP:
> $im = sprintf("%c%c%c%s", $rV, 0x81, $J2, $yV);
> rd:
> goto Je;
> EC:
> $im = sprintf("%c%c%s", $rV, $J2, $yV);
> Je:
> return $im;
> }
> public static function convertRSA($RH, $hy)
> {
> $m6 = self::makeAsnSegment(0x2, $hy);
> $Pl = self::makeAsnSegment(0x2, $RH);
> $rO = self::makeAsnSegment(0x30, $Pl . $m6);
> $bw = self::makeAsnSegment(0x3, $rO);
> $PG = pack("H*", "300D06092A864886F70D0101010500");
> $US = self::makeAsnSegment(0x30, $PG . $bw);
> $tR = base64_encode($US);
> $FD = "-----BEGIN PUBLIC KEY-----\xa";
> $uS = 0;
> kV:
> if (!($NL = substr($tR, $uS, 64))) {
> goto T6;
> }
> $FD = $FD . $NL . "
";
> $uS += 64;
> goto kV;
> T6:
> return $FD . "-----END PUBLIC KEY-----\xa";
611c611
< public function serializeKey($xh)
---
> public function serializeKey($vN)
622c622
< public static function fromEncryptedKeyElement(DOMElement $gT)
---
> public static function fromEncryptedKeyElement(DOMElement $ub)
624,634c624,634
< $Rv = new XMLSecEnc();
< $Rv->setNode($gT);
< if ($oB = $Rv->locateKey()) {
< goto mp;
< }
< throw new Exception("Unable to locate algorithm for this Encrypted Key");
< mp:
< $oB->isEncrypted = true;
< $oB->encryptedCtx = $Rv;
< XMLSecEnc::staticLocateKeyInfo($oB, $gT);
< return $oB;
---
> $rr = new XMLSecEnc();
> $rr->setNode($ub);
> if ($Vi = $rr->locateKey()) {
> goto c2;
> }
> throw new Exception("Unable to locate algorithm for this Encrypted Key");
> c2:
> $Vi->isEncrypted = true;
> $Vi->encryptedCtx = $rr;
> XMLSecEnc::staticLocateKeyInfo($Vi, $ub);
> return $Vi;
639,641c639,641
< const template = "<xenc:EncryptedData xmlns:xenc='http://www.w3.org/2001/04/xmlenc#'>
<xenc:CipherData>\xd\xa <xenc:CipherValue></xenc:CipherValue>
</xenc:CipherData>\xd\xa</xenc:EncryptedData>";
< const Element = "http://www.w3.org/2001/04/xmlenc#Element";
< const Content = "http://www.w3.org/2001/04/xmlenc#Content";
---
> const template = "<xenc:EncryptedData xmlns:xenc='http://www.w3.org/2001/04/xmlenc#'>\xd\xa <xenc:CipherData>
<xenc:CipherValue></xenc:CipherValue>\xd
</xenc:CipherData>\xd
</xenc:EncryptedData>";
> const Element = "http://www.w3.org/2001/04/xmlenc#Element";
> const Content = "http://www.w3.org/2001/04/xmlenc#Content";
643c643
< const XMLENCNS = "http://www.w3.org/2001/04/xmlenc#";
---
> const XMLENCNS = "http://www.w3.org/2001/04/xmlenc#";
658c658
< public function addReference($SS, $HF, $Ak)
---
> public function addReference($l2, $Dx, $rV)
660,661c660,661
< if ($HF instanceof DOMNode) {
< goto Xv;
---
> if ($Dx instanceof DOMNode) {
> goto hS;
663,665c663,665
< throw new Exception("$node is not of type DOMNode");
< Xv:
< $PV = $this->encdoc;
---
> throw new Exception("$node is not of type DOMNode");
> hS:
> $C4 = $this->encdoc;
667,672c667,672
< $Id = $this->encdoc;
< $this->encdoc = $PV;
< $lQ = XMLSecurityDSig::generateGUID();
< $gT = $Id->documentElement;
< $gT->setAttribute("Id", $lQ);
< $this->references[$SS] = array("node" => $HF, "type" => $Ak, "encnode" => $Id, "refuri" => $lQ);
---
> $uU = $this->encdoc;
> $this->encdoc = $C4;
> $mf = XMLSecurityDSig::generateGUID();
> $ub = $uU->documentElement;
> $ub->setAttribute("Id", $mf);
> $this->references[$l2] = array("node" => $Dx, "type" => $rV, "encnode" => $uU, "refuri" => $mf);
674c674
< public function setNode($HF)
---
> public function setNode($Dx)
676c676
< $this->rawNode = $HF;
---
> $this->rawNode = $Dx;
678c678
< public function encryptNode($oB, $Ig = true)
---
> public function encryptNode($Vi, $nw = true)
680c680
< $IX = '';
---
> $zN = '';
682c682
< goto zR;
---
> goto bs;
684,696c684,696
< throw new Exception("Node to encrypt has not been set");
< zR:
< if ($oB instanceof XMLSecurityKey) {
< goto Xp;
< }
< throw new Exception("Invalid Key");
< Xp:
< $OZ = $this->rawNode->ownerDocument;
< $ZP = new DOMXPath($this->encdoc);
< $Am = $ZP->query("/xenc:EncryptedData/xenc:CipherData/xenc:CipherValue");
< $Tu = $Am->item(0);
< if (!($Tu == null)) {
< goto GN;
---
> throw new Exception("Node to encrypt has not been set");
> bs:
> if ($Vi instanceof XMLSecurityKey) {
> goto CI;
> }
> throw new Exception("Invalid Key");
> CI:
> $je = $this->rawNode->ownerDocument;
> $Dj = new DOMXPath($this->encdoc);
> $sx = $Dj->query("/xenc:EncryptedData/xenc:CipherData/xenc:CipherValue");
> $a0 = $sx->item(0);
> if (!($a0 == null)) {
> goto a2;
698,699c698,699
< throw new Exception("Error locating CipherValue element within template");
< GN:
---
> throw new Exception("Error locating CipherValue element within template");
> a2:
702,704c702,704
< $IX = $OZ->saveXML($this->rawNode);
< $this->encdoc->documentElement->setAttribute("Type", self::Element);
< goto j2;
---
> $zN = $je->saveXML($this->rawNode);
> $this->encdoc->documentElement->setAttribute("Type", self::Element);
> goto zg;
706,713c706,713
< $B1 = $this->rawNode->childNodes;
< foreach ($B1 as $qJ) {
< $IX .= $OZ->saveXML($qJ);
< Jb:
< }
< Ms:
< $this->encdoc->documentElement->setAttribute("Type", self::Content);
< goto j2;
---
> $qa = $this->rawNode->childNodes;
> foreach ($qa as $L2) {
> $zN .= $je->saveXML($L2);
> hY:
> }
> on:
> $this->encdoc->documentElement->setAttribute("Type", self::Content);
> goto zg;
715c715
< throw new Exception("Type is currently not supported");
---
> throw new Exception("Type is currently not supported");
717,726c717,726
< y6:
< j2:
< $iH = $this->encdoc->documentElement->appendChild($this->encdoc->createElementNS(self::XMLENCNS, "xenc:EncryptionMethod"));
< $iH->setAttribute("Algorithm", $oB->getAlgorithm());
< $Tu->parentNode->parentNode->insertBefore($iH, $Tu->parentNode->parentNode->firstChild);
< $G_ = base64_encode($oB->encryptData($IX));
< $rE = $this->encdoc->createTextNode($G_);
< $Tu->appendChild($rE);
< if ($Ig) {
< goto F4;
---
> eq:
> zg:
> $QS = $this->encdoc->documentElement->appendChild($this->encdoc->createElementNS(self::XMLENCNS, "xenc:EncryptionMethod"));
> $QS->setAttribute("Algorithm", $Vi->getAlgorithm());
> $a0->parentNode->parentNode->insertBefore($QS, $a0->parentNode->parentNode->firstChild);
> $CS = base64_encode($Vi->encryptData($zN));
> $ND = $this->encdoc->createTextNode($CS);
> $a0->appendChild($ND);
> if ($nw) {
> goto o7;
729,730c729,730
< goto UX;
< F4:
---
> goto Mu;
> o7:
734c734
< goto dm;
---
> goto NN;
737,740c737,740
< dm:
< $RV = $this->rawNode->ownerDocument->importNode($this->encdoc->documentElement, true);
< $this->rawNode->parentNode->replaceChild($RV, $this->rawNode);
< return $RV;
---
> NN:
> $zm = $this->rawNode->ownerDocument->importNode($this->encdoc->documentElement, true);
> $this->rawNode->parentNode->replaceChild($zm, $this->rawNode);
> return $zm;
742,743c742,743
< $RV = $this->rawNode->ownerDocument->importNode($this->encdoc->documentElement, true);
< Ur:
---
> $zm = $this->rawNode->ownerDocument->importNode($this->encdoc->documentElement, true);
> KZ:
745c745
< goto d0;
---
> goto h3;
748,764c748,764
< goto Ur;
< d0:
< $this->rawNode->appendChild($RV);
< return $RV;
< }
< Ff:
< wD:
< UX:
< }
< public function encryptReferences($oB)
< {
< $Z7 = $this->rawNode;
< $Zi = $this->type;
< foreach ($this->references as $SS => $i4) {
< $this->encdoc = $i4["encnode"];
< $this->rawNode = $i4["node"];
< $this->type = $i4["type"];
---
> goto KZ;
> h3:
> $this->rawNode->appendChild($zm);
> return $zm;
> }
> aE:
> M_:
> Mu:
> }
> public function encryptReferences($Vi)
> {
> $Xf = $this->rawNode;
> $vo = $this->type;
> foreach ($this->references as $l2 => $hh) {
> $this->encdoc = $hh["encnode"];
> $this->rawNode = $hh["node"];
> $this->type = $hh["type"];
766,777c766,777
< $rf = $this->encryptNode($oB);
< $this->references[$SS]["encnode"] = $rf;
< } catch (Exception $Rk) {
< $this->rawNode = $Z7;
< $this->type = $Zi;
< throw $Rk;
< }
< Sx:
< }
< cD:
< $this->rawNode = $Z7;
< $this->type = $Zi;
---
> $iP = $this->encryptNode($Vi);
> $this->references[$l2]["encnode"] = $iP;
> } catch (Exception $Ln) {
> $this->rawNode = $Xf;
> $this->type = $vo;
> throw $Ln;
> }
> EE:
> }
> Hu:
> $this->rawNode = $Xf;
> $this->type = $vo;
782c782
< goto da;
---
> goto JD;
784,793c784,793
< throw new Exception("Node to decrypt has not been set");
< da:
< $OZ = $this->rawNode->ownerDocument;
< $ZP = new DOMXPath($OZ);
< $ZP->registerNamespace("xmlencr", self::XMLENCNS);
< $v5 = "./xmlencr:CipherData/xmlencr:CipherValue";
< $vu = $ZP->query($v5, $this->rawNode);
< $HF = $vu->item(0);
< if ($HF) {
< goto IA;
---
> throw new Exception("Node to decrypt has not been set");
> JD:
> $je = $this->rawNode->ownerDocument;
> $Dj = new DOMXPath($je);
> $Dj->registerNamespace("xmlencr", self::XMLENCNS);
> $Mp = "./xmlencr:CipherData/xmlencr:CipherValue";
> $jS = $Dj->query($Mp, $this->rawNode);
> $Dx = $jS->item(0);
> if ($Dx) {
> goto Z_;
796,797c796,797
< IA:
< return base64_decode($HF->nodeValue);
---
> Z_:
> return base64_decode($Dx->nodeValue);
799c799
< public function decryptNode($oB, $Ig = true)
---
> public function decryptNode($Vi, $nw = true)
801,802c801,802
< if ($oB instanceof XMLSecurityKey) {
< goto HN;
---
> if ($Vi instanceof XMLSecurityKey) {
> goto J9;
804,819c804,819
< throw new Exception("Invalid Key");
< HN:
< $dy = $this->getCipherValue();
< if ($dy) {
< goto pb;
< }
< throw new Exception("Cannot locate encrypted data");
< goto B5;
< pb:
< $aM = $oB->decryptData($dy);
< if ($Ig) {
< goto eC;
< }
< return $aM;
< goto R4;
< eC:
---
> throw new Exception("Invalid Key");
> J9:
> $RQ = $this->getCipherValue();
> if ($RQ) {
> goto iw;
> }
> throw new Exception("Cannot locate encrypted data");
> goto W9;
> iw:
> $FE = $Vi->decryptData($RQ);
> if ($nw) {
> goto is;
> }
> return $FE;
> goto rR;
> is:
822,823c822,823
< $NL = new DOMDocument();
< $NL->loadXML($aM);
---
> $Kn = new DOMDocument();
> $Kn->loadXML($FE);
825c825
< goto cg;
---
> goto lW;
827,831c827,831
< return $NL;
< cg:
< $RV = $this->rawNode->ownerDocument->importNode($NL->documentElement, true);
< $this->rawNode->parentNode->replaceChild($RV, $this->rawNode);
< return $RV;
---
> return $Kn;
> lW:
> $zm = $this->rawNode->ownerDocument->importNode($Kn->documentElement, true);
> $this->rawNode->parentNode->replaceChild($zm, $this->rawNode);
> return $zm;
834c834
< goto SV;
---
> goto V0;
836,845c836,845
< $OZ = $this->rawNode->ownerDocument;
< goto Wu;
< SV:
< $OZ = $this->rawNode;
< Wu:
< $AE = $OZ->createDocumentFragment();
< $AE->appendXML($aM);
< $xh = $this->rawNode->parentNode;
< $xh->replaceChild($AE, $this->rawNode);
< return $xh;
---
> $je = $this->rawNode->ownerDocument;
> goto UT;
> V0:
> $je = $this->rawNode;
> UT:
> $M2 = $je->createDocumentFragment();
> $M2->appendXML($FE);
> $vN = $this->rawNode->parentNode;
> $vN->replaceChild($M2, $this->rawNode);
> return $vN;
847c847,865
< return $aM;
---
> return $FE;
> }
> Y6:
> wa:
> rR:
> W9:
> }
> public function encryptKey($N_, $sd, $hc = true)
> {
> if (!(!$N_ instanceof XMLSecurityKey || !$sd instanceof XMLSecurityKey)) {
> goto hn;
> }
> throw new Exception("Invalid Key");
> hn:
> $v8 = base64_encode($N_->encryptData($sd->key));
> $bF = $this->encdoc->documentElement;
> $fG = $this->encdoc->createElementNS(self::XMLENCNS, "xenc:EncryptedKey");
> if ($hc) {
> goto ho;
849,882c867,882
< cr:
< JQ:
< R4:
< B5:
< }
< public function encryptKey($Sr, $hm, $mS = true)
< {
< if (!(!$Sr instanceof XMLSecurityKey || !$hm instanceof XMLSecurityKey)) {
< goto gl;
< }
< throw new Exception("Invalid Key");
< gl:
< $iX = base64_encode($Sr->encryptData($hm->key));
< $rZ = $this->encdoc->documentElement;
< $yY = $this->encdoc->createElementNS(self::XMLENCNS, "xenc:EncryptedKey");
< if ($mS) {
< goto d3;
< }
< $this->encKey = $yY;
< goto Gp;
< d3:
< $DK = $rZ->insertBefore($this->encdoc->createElementNS("http://www.w3.org/2000/09/xmldsig#", "dsig:KeyInfo"), $rZ->firstChild);
< $DK->appendChild($yY);
< Gp:
< $iH = $yY->appendChild($this->encdoc->createElementNS(self::XMLENCNS, "xenc:EncryptionMethod"));
< $iH->setAttribute("Algorithm", $Sr->getAlgorithm());
< if (empty($Sr->name)) {
< goto rU;
< }
< $DK = $yY->appendChild($this->encdoc->createElementNS("http://www.w3.org/2000/09/xmldsig#", "dsig:KeyInfo"));
< $DK->appendChild($this->encdoc->createElementNS("http://www.w3.org/2000/09/xmldsig#", "dsig:KeyName", $Sr->name));
< rU:
< $Wb = $yY->appendChild($this->encdoc->createElementNS(self::XMLENCNS, "xenc:CipherData"));
< $Wb->appendChild($this->encdoc->createElementNS(self::XMLENCNS, "xenc:CipherValue", $iX));
---
> $this->encKey = $fG;
> goto F0;
> ho:
> $E6 = $bF->insertBefore($this->encdoc->createElementNS("http://www.w3.org/2000/09/xmldsig#", "dsig:KeyInfo"), $bF->firstChild);
> $E6->appendChild($fG);
> F0:
> $QS = $fG->appendChild($this->encdoc->createElementNS(self::XMLENCNS, "xenc:EncryptionMethod"));
> $QS->setAttribute("Algorithm", $N_->getAlgorithm());
> if (empty($N_->name)) {
> goto MI;
> }
> $E6 = $fG->appendChild($this->encdoc->createElementNS("http://www.w3.org/2000/09/xmldsig#", "dsig:KeyInfo"));
> $E6->appendChild($this->encdoc->createElementNS("http://www.w3.org/2000/09/xmldsig#", "dsig:KeyName", $N_->name));
> MI:
> $rT = $fG->appendChild($this->encdoc->createElementNS(self::XMLENCNS, "xenc:CipherData"));
> $rT->appendChild($this->encdoc->createElementNS(self::XMLENCNS, "xenc:CipherValue", $v8));
884c884
< goto nJ;
---
> goto x2;
886,891c886,891
< $x3 = $yY->appendChild($this->encdoc->createElementNS(self::XMLENCNS, "xenc:ReferenceList"));
< foreach ($this->references as $SS => $i4) {
< $lQ = $i4["refuri"];
< $c7 = $x3->appendChild($this->encdoc->createElementNS(self::XMLENCNS, "xenc:DataReference"));
< $c7->setAttribute("URI", "#" . $lQ);
< eU:
---
> $Bd = $fG->appendChild($this->encdoc->createElementNS(self::XMLENCNS, "xenc:ReferenceList"));
> foreach ($this->references as $l2 => $hh) {
> $mf = $hh["refuri"];
> $UL = $Bd->appendChild($this->encdoc->createElementNS(self::XMLENCNS, "xenc:DataReference"));
> $UL->setAttribute("URI", "#" . $mf);
> JC:
893,894c893,894
< La:
< nJ:
---
> sX:
> x2:
897c897
< public function decryptKey($yY)
---
> public function decryptKey($fG)
899,900c899,900
< if ($yY->isEncrypted) {
< goto bD;
---
> if ($fG->isEncrypted) {
> goto sd;
902,928c902,928
< throw new Exception("Key is not Encrypted");
< bD:
< if (!empty($yY->key)) {
< goto O3;
< }
< throw new Exception("Key is missing data to perform the decryption");
< O3:
< return $this->decryptNode($yY, false);
< }
< public function locateEncryptedData($gT)
< {
< if ($gT instanceof DOMDocument) {
< goto zt;
< }
< $OZ = $gT->ownerDocument;
< goto CS;
< zt:
< $OZ = $gT;
< CS:
< if (!$OZ) {
< goto T3;
< }
< $Ec = new DOMXPath($OZ);
< $v5 = "//*[local-name()='EncryptedData' and namespace-uri()='" . self::XMLENCNS . "']";
< $vu = $Ec->query($v5);
< return $vu->item(0);
< T3:
---
> throw new Exception("Key is not Encrypted");
> sd:
> if (!empty($fG->key)) {
> goto yM;
> }
> throw new Exception("Key is missing data to perform the decryption");
> yM:
> return $this->decryptNode($fG, false);
> }
> public function locateEncryptedData($ub)
> {
> if ($ub instanceof DOMDocument) {
> goto H1;
> }
> $je = $ub->ownerDocument;
> goto aJ;
> H1:
> $je = $ub;
> aJ:
> if (!$je) {
> goto eV;
> }
> $BF = new DOMXPath($je);
> $Mp = "//*[local-name()='EncryptedData' and namespace-uri()='" . self::XMLENCNS . "']";
> $jS = $BF->query($Mp);
> return $jS->item(0);
> eV:
931c931
< public function locateKey($HF = null)
---
> public function locateKey($Dx = null)
933,934c933,934
< if (!empty($HF)) {
< goto g5;
---
> if (!empty($Dx)) {
> goto I5;
936,939c936,939
< $HF = $this->rawNode;
< g5:
< if ($HF instanceof DOMElement) {
< goto t6;
---
> $Dx = $this->rawNode;
> I5:
> if ($Dx instanceof DOMElement) {
> goto tg;
942,951c942,951
< t6:
< if (!($OZ = $HF->ownerDocument)) {
< goto hh;
< }
< $Ec = new DOMXPath($OZ);
< $Ec->registerNamespace("xmlsecenc", self::XMLENCNS);
< $v5 = ".//xmlsecenc:EncryptionMethod";
< $vu = $Ec->query($v5, $HF);
< if (!($I5 = $vu->item(0))) {
< goto e5;
---
> tg:
> if (!($je = $Dx->ownerDocument)) {
> goto wo;
> }
> $BF = new DOMXPath($je);
> $BF->registerNamespace("xmlsecenc", self::XMLENCNS);
> $Mp = ".//xmlsecenc:EncryptionMethod";
> $jS = $BF->query($Mp, $Dx);
> if (!($TE = $jS->item(0))) {
> goto aL;
953c953
< $Qt = $I5->getAttribute("Algorithm");
---
> $VW = $TE->getAttribute("Algorithm");
955,956c955,956
< $oB = new XMLSecurityKey($Qt, array("type" => "private"));
< } catch (Exception $Rk) {
---
> $Vi = new XMLSecurityKey($VW, array("type" => "private"));
> } catch (Exception $Ln) {
959,961c959,961
< return $oB;
< e5:
< hh:
---
> return $Vi;
> aL:
> wo:
964c964
< public static function staticLocateKeyInfo($OG = null, $HF = null)
---
> public static function staticLocateKeyInfo($Lz = null, $Dx = null)
966,967c966,967
< if (!(empty($HF) || !$HF instanceof DOMElement)) {
< goto F0;
---
> if (!(empty($Dx) || !$Dx instanceof DOMElement)) {
> goto TZ;
970,973c970,973
< F0:
< $OZ = $HF->ownerDocument;
< if ($OZ) {
< goto QQ;
---
> TZ:
> $je = $Dx->ownerDocument;
> if ($je) {
> goto I0;
976,984c976,1022
< QQ:
< $Ec = new DOMXPath($OZ);
< $Ec->registerNamespace("xmlsecenc", self::XMLENCNS);
< $Ec->registerNamespace("xmlsecdsig", XMLSecurityDSig::XMLDSIGNS);
< $v5 = "./xmlsecdsig:KeyInfo";
< $vu = $Ec->query($v5, $HF);
< $I5 = $vu->item(0);
< if ($I5) {
< goto uc;
---
> I0:
> $BF = new DOMXPath($je);
> $BF->registerNamespace("xmlsecenc", self::XMLENCNS);
> $BF->registerNamespace("xmlsecdsig", XMLSecurityDSig::XMLDSIGNS);
> $Mp = "./xmlsecdsig:KeyInfo";
> $jS = $BF->query($Mp, $Dx);
> $TE = $jS->item(0);
> if ($TE) {
> goto UQ;
> }
> return $Lz;
> UQ:
> foreach ($TE->childNodes as $L2) {
> switch ($L2->localName) {
> case "KeyName":
> if (empty($Lz)) {
> goto CG;
> }
> $Lz->name = $L2->nodeValue;
> CG:
> goto cd;
> case "KeyValue":
> foreach ($L2->childNodes as $Jg) {
> switch ($Jg->localName) {
> case "DSAKeyValue":
> throw new Exception("DSAKeyValue currently not supported");
> case "RSAKeyValue":
> $RH = null;
> $hy = null;
> if (!($nA = $Jg->getElementsByTagName("Modulus")->item(0))) {
> goto Gc;
> }
> $RH = base64_decode($nA->nodeValue);
> Gc:
> if (!($Id = $Jg->getElementsByTagName("Exponent")->item(0))) {
> goto ux;
> }
> $hy = base64_decode($Id->nodeValue);
> ux:
> if (!(empty($RH) || empty($hy))) {
> goto GA;
> }
> throw new Exception("Missing Modulus or Exponent");
> GA:
> $b8 = XMLSecurityKey::convertRSA($RH, $hy);
> $Lz->loadKey($b8);
> goto Bc;
986,1083c1024,1083
< return $OG;
< uc:
< foreach ($I5->childNodes as $qJ) {
< switch ($qJ->localName) {
< case "KeyName":
< if (empty($OG)) {
< goto fK;
< }
< $OG->name = $qJ->nodeValue;
< fK:
< goto Ef;
< case "KeyValue":
< foreach ($qJ->childNodes as $Xd) {
< switch ($Xd->localName) {
< case "DSAKeyValue":
< throw new Exception("DSAKeyValue currently not supported");
< case "RSAKeyValue":
< $RT = null;
< $ve = null;
< if (!($ZT = $Xd->getElementsByTagName("Modulus")->item(0))) {
< goto Ji;
< }
< $RT = base64_decode($ZT->nodeValue);
< Ji:
< if (!($nD = $Xd->getElementsByTagName("Exponent")->item(0))) {
< goto Zt;
< }
< $ve = base64_decode($nD->nodeValue);
< Zt:
< if (!(empty($RT) || empty($ve))) {
< goto p1;
< }
< throw new Exception("Missing Modulus or Exponent");
< p1:
< $d6 = XMLSecurityKey::convertRSA($RT, $ve);
< $OG->loadKey($d6);
< goto xl;
< }
< ZM:
< xl:
< y3:
< }
< CY:
< goto Ef;
< case "RetrievalMethod":
< $Ak = $qJ->getAttribute("Type");
< if (!($Ak !== "http://www.w3.org/2001/04/xmlenc#EncryptedKey")) {
< goto Lp;
< }
< goto Ef;
< Lp:
< $nj = $qJ->getAttribute("URI");
< if (!($nj[0] !== "#")) {
< goto yU;
< }
< goto Ef;
< yU:
< $BA = substr($nj, 1);
< $v5 = "//xmlsecenc:EncryptedKey[@Id='{$BA}']";
< $A2 = $Ec->query($v5)->item(0);
< if ($A2) {
< goto Qc;
< }
< throw new Exception("Unable to locate EncryptedKey with @Id='{$BA}'.");
< Qc:
< return XMLSecurityKey::fromEncryptedKeyElement($A2);
< case "EncryptedKey":
< return XMLSecurityKey::fromEncryptedKeyElement($qJ);
< case "X509Data":
< if (!($q8 = $qJ->getElementsByTagName("X509Certificate"))) {
< goto mk;
< }
< if (!($q8->length > 0)) {
< goto IQ;
< }
< $dP = $q8->item(0)->textContent;
< $dP = str_replace(array("
", "\xa", " "), '', $dP);
< $dP = "-----BEGIN CERTIFICATE-----
" . chunk_split($dP, 64, "\xa") . "-----END CERTIFICATE-----\xa";
< $OG->loadKey($dP, false, true);
< IQ:
< mk:
< goto Ef;
< }
< He:
< Ef:
< Bi:
< }
< LJ:
< return $OG;
< }
< public function locateKeyInfo($OG = null, $HF = null)
< {
< if (!empty($HF)) {
< goto VS;
< }
< $HF = $this->rawNode;
< VS:
< return self::staticLocateKeyInfo($OG, $HF);
---
> C9:
> Bc:
> RQ:
> }
> X3:
> goto cd;
> case "RetrievalMethod":
> $rV = $L2->getAttribute("Type");
> if (!($rV !== "http://www.w3.org/2001/04/xmlenc#EncryptedKey")) {
> goto TO;
> }
> goto cd;
> TO:
> $uk = $L2->getAttribute("URI");
> if (!($uk[0] !== "#")) {
> goto iG;
> }
> goto cd;
> iG:
> $jj = substr($uk, 1);
> $Mp = "//xmlsecenc:EncryptedKey[@Id='{$jj}']";
> $uB = $BF->query($Mp)->item(0);
> if ($uB) {
> goto km;
> }
> throw new Exception("Unable to locate EncryptedKey with @Id='{$jj}'.");
> km:
> return XMLSecurityKey::fromEncryptedKeyElement($uB);
> case "EncryptedKey":
> return XMLSecurityKey::fromEncryptedKeyElement($L2);
> case "X509Data":
> if (!($Fl = $L2->getElementsByTagName("X509Certificate"))) {
> goto OX;
> }
> if (!($Fl->length > 0)) {
> goto yV;
> }
> $sn = $Fl->item(0)->textContent;
> $sn = str_replace(array("
", "\xa", " "), '', $sn);
> $sn = "-----BEGIN CERTIFICATE-----\xa" . chunk_split($sn, 64, "
") . "-----END CERTIFICATE-----
";
> $Lz->loadKey($sn, false, true);
> yV:
> OX:
> goto cd;
> }
> Ay:
> cd:
> uv:
> }
> P4:
> return $Lz;
> }
> public function locateKeyInfo($Lz = null, $Dx = null)
> {
> if (!empty($Dx)) {
> goto zI;
> }
> $Dx = $this->rawNode;
> zI:
> return self::staticLocateKeyInfo($Lz, $Dx);
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/includes/basicEnum.php" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/includes/basicEnum.php"
10c10
< goto Wp;
---
> goto BY;
13,21c13,21
< Wp:
< $EZ = get_called_class();
< if (array_key_exists($EZ, self::$constCacheArray)) {
< goto ix;
< }
< $lM = new ReflectionClass($EZ);
< self::$constCacheArray[$EZ] = $lM->getConstants();
< ix:
< return self::$constCacheArray[$EZ];
---
> BY:
> $XY = get_called_class();
> if (array_key_exists($XY, self::$constCacheArray)) {
> goto Yf;
> }
> $Ef = new ReflectionClass($XY);
> self::$constCacheArray[$XY] = $Ef->getConstants();
> Yf:
> return self::$constCacheArray[$XY];
23c23
< public static function isValidName($SS, $ta = false)
---
> public static function isValidName($l2, $IU = false)
25,32c25,32
< $gW = self::getConstants();
< if (!$ta) {
< goto Kj;
< }
< return array_key_exists($SS, $gW);
< Kj:
< $z3 = array_map("strtolower", array_keys($gW));
< return in_array(strtolower($SS), $z3);
---
> $Eu = self::getConstants();
> if (!$IU) {
> goto PL;
> }
> return array_key_exists($l2, $Eu);
> PL:
> $Rt = array_map("strtolower", array_keys($Eu));
> return in_array(strtolower($l2), $Rt);
34c34
< public static function isValidValue($rE, $ta = true)
---
> public static function isValidValue($ND, $IU = true)
36,37c36,37
< $Wj = array_values(self::getConstants());
< return in_array($rE, $Wj, $ta);
---
> $tm = array_values(self::getConstants());
> return in_array($ND, $tm, $IU);
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/includes/constants.php" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/includes/constants.php"
6,10c6,10
< const BASE_URL = "https://login.xecurify.com";
< const LICENSE_TYPE = "DRUPAL_SAML_SP_ENTERPRISE_MODULE";
< const PLAN_NAME = "drupal_miniorange_saml_enterprise_plan";
< const MINIORANGE_PRIVATE_KEY = "-----BEGIN PRIVATE KEY-----\xd
MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAN6Wb3vWL0VEwAOt
waY1SPqDyupjbxgs4dMWBvWZDMB/5y2XhqZ3utyaJcCt/sgTsHjk9AUC8/9UxlYO\xd\xaljo9V0TT1gu3gVkHCzq1/2Y0tLyM5gszZZ4nmWfa4iD26RdCguZLGkda5BvGspsg
LFoJJIGUAgvQHbz/C8VX/Dd875RVAgMBAAECgYEAvUonkqOJ3ZlixX4dgbAs2MX9\xd
aSiYUHHStcU0s+WtH4Nl4LLMkoKdiX8Zfes6EYIVACqMjjp9r3SzmnmbLfn+XHbc
EZT+N40Cci+nedlDqhLgkfr2lg26DtZ3Sjk7kJnLHxhFVqWO4eaullcqn0wgqUyW
\xasJ8vX0tEeCK7L8DCtJ0CQQDu1cFN8aiQdZLf5oeZ5GHnZbEiKJ3oOw4GJLu3Odq2
\xadftZsdWHSSJ9pVD07+JuLUtV+vqdy1MKzDsJzbb2bETrAkEA7pXAP9PE5dzS4UPc\xd
XUisvsMAbkAm48ga6MCbj/7I2BScsZ9+/dWBI8B4hXQ1sAfm7sdpb1utKlOY8927\xd
EVI7vwJAP0aMfyz+Hr+3mPBHjsMOGTM8+bLPGx7COWhz/zgptNuPKxVNYBlFNQqe\xd\xaZzZCxDPl2LK0wSeEKcEwBwnkZmcK3wJBAOcgKx2qCRSk16ViGBhGTxJ91ez4OLRx
\xaJaBU9l6IdAjf7uwjluJP8sqvqhGegmQFQ7INfBZkuVxHn+Se6JnfEAECQDJq0Fvi\xd
Ezbp2ziTla1MCJ2DAVAka2ZpRtgAX5tT1ES8lrtgBfsXggj0mz2xnE78WfY4CLYs\xd
CeDDPLctn+tuIns=\xd\xa-----END PRIVATE KEY-----";
< const MINIORANGE_PUBLIC_CERTIFICATE = "-----BEGIN CERTIFICATE-----\xd
MIIC3DCCAkWgAwIBAgIBADANBgkqhkiG9w0BAQ0FADCBijELMAkGA1UEBhMCaW4x
\xaCzAJBgNVBAgMAk1IMRMwEQYDVQQKDApNSU5JT1JBTkdFMRMwEQYDVQQDDApNSU5J\xd
T1JBTkdFMQ0wCwYDVQQHDARQVU5FMRMwEQYDVQQLDApNSU5JT1JBTkdFMSAwHgYJ\xd
KoZIhvcNAQkBFhFpbmZvQHhlY3VyaWZ5LmNvbTAeFw0yMjAzMjgxMTU4MTJaFw0y\xd\xaNDAzMjcxMTU4MTJaMIGKMQswCQYDVQQGEwJpbjELMAkGA1UECAwCTUgxEzARBgNV\xd\xaBAoMCk1JTklPUkFOR0UxEzARBgNVBAMMCk1JTklPUkFOR0UxDTALBgNVBAcMBFBV
\xaTkUxEzARBgNVBAsMCk1JTklPUkFOR0UxIDAeBgkqhkiG9w0BCQEWEWluZm9AeGVj
\xadXJpZnkuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDelm971i9FRMAD
rcGmNUj6g8rqY28YLOHTFgb1mQzAf+ctl4amd7rcmiXArf7IE7B45PQFAvP/VMZW\xd\xaDpY6PVdE09YLt4FZBws6tf9mNLS8jOYLM2WeJ5ln2uIg9ukXQoLmSxpHWuQbxrKb\xd
ICxaCSSBlAIL0B28/wvFV/w3fO+UVQIDAQABo1AwTjAdBgNVHQ4EFgQUtjBIuRTG
qE6xe30u+QUvE6NJkjIwHwYDVR0jBBgwFoAUtjBIuRTGqE6xe30u+QUvE6NJkjIw\xd\xaDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQ0FAAOBgQCOKuCsrt2r/ts75Uy7QRD+\xd\xaY1D9Yu3rX/UEAu5BcBtpjc+ReSToI+bnxUmSIWP7jpp91EP6ZakHd0Kogct72r3d
WCy9200HkKydA167ZTofBHW17xMmgrAtyparL+gYuwvdj66hRSmxMCGB/5k2313m
\xabJKfnmwGxOW8wZaMJoBupg==\xd
-----END CERTIFICATE-----";
---
> const BASE_URL = "https://login.xecurify.com";
> const LICENSE_TYPE = "DRUPAL_SAML_SP_ENTERPRISE_MODULE";
> const PLAN_NAME = "drupal_miniorange_saml_enterprise_plan";
> const MINIORANGE_PRIVATE_KEY = "-----BEGIN PRIVATE KEY-----
MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAN6Wb3vWL0VEwAOt
waY1SPqDyupjbxgs4dMWBvWZDMB/5y2XhqZ3utyaJcCt/sgTsHjk9AUC8/9UxlYO\xd\xaljo9V0TT1gu3gVkHCzq1/2Y0tLyM5gszZZ4nmWfa4iD26RdCguZLGkda5BvGspsg
\xaLFoJJIGUAgvQHbz/C8VX/Dd875RVAgMBAAECgYEAvUonkqOJ3ZlixX4dgbAs2MX9
aSiYUHHStcU0s+WtH4Nl4LLMkoKdiX8Zfes6EYIVACqMjjp9r3SzmnmbLfn+XHbc\xd
EZT+N40Cci+nedlDqhLgkfr2lg26DtZ3Sjk7kJnLHxhFVqWO4eaullcqn0wgqUyW\xd\xasJ8vX0tEeCK7L8DCtJ0CQQDu1cFN8aiQdZLf5oeZ5GHnZbEiKJ3oOw4GJLu3Odq2
\xadftZsdWHSSJ9pVD07+JuLUtV+vqdy1MKzDsJzbb2bETrAkEA7pXAP9PE5dzS4UPc\xd\xaXUisvsMAbkAm48ga6MCbj/7I2BScsZ9+/dWBI8B4hXQ1sAfm7sdpb1utKlOY8927\xd\xaEVI7vwJAP0aMfyz+Hr+3mPBHjsMOGTM8+bLPGx7COWhz/zgptNuPKxVNYBlFNQqe\xd
ZzZCxDPl2LK0wSeEKcEwBwnkZmcK3wJBAOcgKx2qCRSk16ViGBhGTxJ91ez4OLRx
JaBU9l6IdAjf7uwjluJP8sqvqhGegmQFQ7INfBZkuVxHn+Se6JnfEAECQDJq0Fvi\xd
Ezbp2ziTla1MCJ2DAVAka2ZpRtgAX5tT1ES8lrtgBfsXggj0mz2xnE78WfY4CLYs
\xaCeDDPLctn+tuIns=
-----END PRIVATE KEY-----";
> const MINIORANGE_PUBLIC_CERTIFICATE = "-----BEGIN CERTIFICATE-----
\xaMIIC3DCCAkWgAwIBAgIBADANBgkqhkiG9w0BAQ0FADCBijELMAkGA1UEBhMCaW4x\xd\xaCzAJBgNVBAgMAk1IMRMwEQYDVQQKDApNSU5JT1JBTkdFMRMwEQYDVQQDDApNSU5J\xd\xaT1JBTkdFMQ0wCwYDVQQHDARQVU5FMRMwEQYDVQQLDApNSU5JT1JBTkdFMSAwHgYJ
KoZIhvcNAQkBFhFpbmZvQHhlY3VyaWZ5LmNvbTAeFw0yMjAzMjgxMTU4MTJaFw0y
\xaNDAzMjcxMTU4MTJaMIGKMQswCQYDVQQGEwJpbjELMAkGA1UECAwCTUgxEzARBgNV\xd\xaBAoMCk1JTklPUkFOR0UxEzARBgNVBAMMCk1JTklPUkFOR0UxDTALBgNVBAcMBFBV
\xaTkUxEzARBgNVBAsMCk1JTklPUkFOR0UxIDAeBgkqhkiG9w0BCQEWEWluZm9AeGVj\xd
dXJpZnkuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDelm971i9FRMAD\xd\xarcGmNUj6g8rqY28YLOHTFgb1mQzAf+ctl4amd7rcmiXArf7IE7B45PQFAvP/VMZW
\xaDpY6PVdE09YLt4FZBws6tf9mNLS8jOYLM2WeJ5ln2uIg9ukXQoLmSxpHWuQbxrKb\xd
ICxaCSSBlAIL0B28/wvFV/w3fO+UVQIDAQABo1AwTjAdBgNVHQ4EFgQUtjBIuRTG
qE6xe30u+QUvE6NJkjIwHwYDVR0jBBgwFoAUtjBIuRTGqE6xe30u+QUvE6NJkjIw
\xaDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQ0FAAOBgQCOKuCsrt2r/ts75Uy7QRD+
Y1D9Yu3rX/UEAu5BcBtpjc+ReSToI+bnxUmSIWP7jpp91EP6ZakHd0Kogct72r3d
WCy9200HkKydA167ZTofBHW17xMmgrAtyparL+gYuwvdj66hRSmxMCGB/5k2313m
\xabJKfnmwGxOW8wZaMJoBupg==
\xa-----END CERTIFICATE-----";
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/includes/customer_setup.php" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/includes/customer_setup.php"
14c14
< public function __construct($hE, $cA, $wl, $y4)
---
> public function __construct($fa, $PA, $b3, $xg)
16,21c16,21
< $this->email = $hE;
< $this->phone = $cA;
< $this->password = $wl;
< $this->otpToken = $y4;
< $this->defaultCustomerId = "16555";
< $this->defaultCustomerApiKey = "fFd2XcvTGDemZvbw1bcUesNJWEqKbbUq";
---
> $this->email = $fa;
> $this->phone = $PA;
> $this->password = $b3;
> $this->otpToken = $xg;
> $this->defaultCustomerId = "16555";
> $this->defaultCustomerApiKey = "fFd2XcvTGDemZvbw1bcUesNJWEqKbbUq";
26c26
< goto vX;
---
> goto zC;
28,52c28,52
< return json_encode(array("status" => "CURL_ERROR", "statusMessage" => "<a href="http://php.net/manual/en/curl.installation.php">PHP cURL extension</a> is not installed or disabled."));
< vX:
< $xc = MiniorangeSAMLConstants::BASE_URL . "/moas/rest/customer/check-if-exists";
< $gI = curl_init($xc);
< $hE = $this->email;
< $EW = array("email" => $hE);
< $tF = json_encode($EW);
< curl_setopt($gI, CURLOPT_FOLLOWLOCATION, TRUE);
< curl_setopt($gI, CURLOPT_ENCODING, '');
< curl_setopt($gI, CURLOPT_RETURNTRANSFER, TRUE);
< curl_setopt($gI, CURLOPT_AUTOREFERER, TRUE);
< curl_setopt($gI, CURLOPT_SSL_VERIFYPEER, FALSE);
< curl_setopt($gI, CURLOPT_MAXREDIRS, 10);
< curl_setopt($gI, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "charset: UTF - 8", "Authorization: Basic"));
< curl_setopt($gI, CURLOPT_POST, TRUE);
< curl_setopt($gI, CURLOPT_POSTFIELDS, $tF);
< $u4 = curl_exec($gI);
< if (!curl_errno($gI)) {
< goto Mn;
< }
< $w0 = array("%method" => "checkCustomer", "%file" => "customer_setup.php", "%error" => curl_error($gI));
< watchdog("miniorange_saml", "Error at %method of %file: %error", $w0);
< Mn:
< curl_close($gI);
< return $u4;
---
> return json_encode(array("status" => "CURL_ERROR", "statusMessage" => "<a href="http://php.net/manual/en/curl.installation.php">PHP cURL extension</a> is not installed or disabled."));
> zC:
> $Zj = MiniorangeSAMLConstants::BASE_URL . "/moas/rest/customer/check-if-exists";
> $s8 = curl_init($Zj);
> $fa = $this->email;
> $gH = array("email" => $fa);
> $th = json_encode($gH);
> curl_setopt($s8, CURLOPT_FOLLOWLOCATION, TRUE);
> curl_setopt($s8, CURLOPT_ENCODING, '');
> curl_setopt($s8, CURLOPT_RETURNTRANSFER, TRUE);
> curl_setopt($s8, CURLOPT_AUTOREFERER, TRUE);
> curl_setopt($s8, CURLOPT_SSL_VERIFYPEER, FALSE);
> curl_setopt($s8, CURLOPT_MAXREDIRS, 10);
> curl_setopt($s8, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "charset: UTF - 8", "Authorization: Basic"));
> curl_setopt($s8, CURLOPT_POST, TRUE);
> curl_setopt($s8, CURLOPT_POSTFIELDS, $th);
> $e_ = curl_exec($s8);
> if (!curl_errno($s8)) {
> goto g8;
> }
> $dR = array("%method" => "checkCustomer", "%file" => "customer_setup.php", "%error" => curl_error($s8));
> watchdog("miniorange_saml", "Error at %method of %file: %error", $dR);
> g8:
> curl_close($s8);
> return $e_;
57c57
< goto A0;
---
> goto Nb;
59,82c59,82
< return json_encode(array("statusCode" => "ERROR", "statusMessage" => ". Please check your configuration."));
< A0:
< $xc = MiniorangeSAMLConstants::BASE_URL . "/moas/rest/customer/add";
< $gI = curl_init($xc);
< $EW = array("companyName" => $_SERVER["SERVER_NAME"], "areaOfInterest" => "Drupal SAML Module - Premium", "email" => $this->email, "phone" => $this->phone, "password" => $this->password);
< $tF = json_encode($EW);
< curl_setopt($gI, CURLOPT_FOLLOWLOCATION, TRUE);
< curl_setopt($gI, CURLOPT_ENCODING, '');
< curl_setopt($gI, CURLOPT_RETURNTRANSFER, TRUE);
< curl_setopt($gI, CURLOPT_AUTOREFERER, TRUE);
< curl_setopt($gI, CURLOPT_SSL_VERIFYPEER, FALSE);
< curl_setopt($gI, CURLOPT_MAXREDIRS, 10);
< curl_setopt($gI, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "charset: UTF - 8", "Authorization: Basic"));
< curl_setopt($gI, CURLOPT_POST, TRUE);
< curl_setopt($gI, CURLOPT_POSTFIELDS, $tF);
< $u4 = curl_exec($gI);
< if (!curl_errno($gI)) {
< goto hZ;
< }
< $w0 = array("%method" => "createCustomer", "%file" => "customer_setup.php", "%error" => curl_error($gI));
< watchdog("miniorange_saml", "Error at %method of %file: %error", $w0);
< hZ:
< curl_close($gI);
< return $u4;
---
> return json_encode(array("statusCode" => "ERROR", "statusMessage" => ". Please check your configuration."));
> Nb:
> $Zj = MiniorangeSAMLConstants::BASE_URL . "/moas/rest/customer/add";
> $s8 = curl_init($Zj);
> $gH = array("companyName" => $_SERVER["SERVER_NAME"], "areaOfInterest" => "Drupal SAML Module - Premium", "email" => $this->email, "phone" => $this->phone, "password" => $this->password);
> $th = json_encode($gH);
> curl_setopt($s8, CURLOPT_FOLLOWLOCATION, TRUE);
> curl_setopt($s8, CURLOPT_ENCODING, '');
> curl_setopt($s8, CURLOPT_RETURNTRANSFER, TRUE);
> curl_setopt($s8, CURLOPT_AUTOREFERER, TRUE);
> curl_setopt($s8, CURLOPT_SSL_VERIFYPEER, FALSE);
> curl_setopt($s8, CURLOPT_MAXREDIRS, 10);
> curl_setopt($s8, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "charset: UTF - 8", "Authorization: Basic"));
> curl_setopt($s8, CURLOPT_POST, TRUE);
> curl_setopt($s8, CURLOPT_POSTFIELDS, $th);
> $e_ = curl_exec($s8);
> if (!curl_errno($s8)) {
> goto F4;
> }
> $dR = array("%method" => "createCustomer", "%file" => "customer_setup.php", "%error" => curl_error($s8));
> watchdog("miniorange_saml", "Error at %method of %file: %error", $dR);
> F4:
> curl_close($s8);
> return $e_;
87,113c87,113
< $xc = MiniorangeSAMLConstants::BASE_URL . "/moas/rest/customer/license";
< $gI = curl_init($xc);
< $E4 = variable_get("miniorange_saml_customer_id", '');
< $i8 = variable_get("miniorange_saml_customer_api_key", '');
< $RC = round(microtime(true) * 1000);
< $zW = $E4 . number_format($RC, 0, '', '') . $i8;
< $hv = hash("sha512", $zW);
< $nt = "Customer-Key: " . $E4;
< $Sm = "Timestamp: " . number_format($RC, 0, '', '');
< $Nk = "Authorization: " . $hv;
< $EW = '';
< $EW = array("customerId" => $E4, "applicationName" => "drupal_miniorange_saml_enterprise_plan");
< $tF = json_encode($EW);
< curl_setopt($gI, CURLOPT_FOLLOWLOCATION, true);
< curl_setopt($gI, CURLOPT_ENCODING, '');
< curl_setopt($gI, CURLOPT_RETURNTRANSFER, true);
< curl_setopt($gI, CURLOPT_AUTOREFERER, true);
< curl_setopt($gI, CURLOPT_SSL_VERIFYPEER, false);
< curl_setopt($gI, CURLOPT_MAXREDIRS, 10);
< curl_setopt($gI, CURLOPT_HTTPHEADER, array("Content-Type: application/json", $nt, $Sm, $Nk));
< curl_setopt($gI, CURLOPT_POST, true);
< curl_setopt($gI, CURLOPT_POSTFIELDS, $tF);
< curl_setopt($gI, CURLOPT_CONNECTTIMEOUT, 5);
< curl_setopt($gI, CURLOPT_TIMEOUT, 20);
< $u4 = curl_exec($gI);
< if (!curl_errno($gI)) {
< goto gz;
---
> $Zj = MiniorangeSAMLConstants::BASE_URL . "/moas/rest/customer/license";
> $s8 = curl_init($Zj);
> $mC = variable_get("miniorange_saml_customer_id", '');
> $Og = variable_get("miniorange_saml_customer_api_key", '');
> $hY = round(microtime(true) * 1000);
> $a_ = $mC . number_format($hY, 0, '', '') . $Og;
> $MO = hash("sha512", $a_);
> $kc = "Customer-Key: " . $mC;
> $kt = "Timestamp: " . number_format($hY, 0, '', '');
> $ry = "Authorization: " . $MO;
> $gH = '';
> $gH = array("customerId" => $mC, "applicationName" => "drupal_miniorange_saml_enterprise_plan");
> $th = json_encode($gH);
> curl_setopt($s8, CURLOPT_FOLLOWLOCATION, true);
> curl_setopt($s8, CURLOPT_ENCODING, '');
> curl_setopt($s8, CURLOPT_RETURNTRANSFER, true);
> curl_setopt($s8, CURLOPT_AUTOREFERER, true);
> curl_setopt($s8, CURLOPT_SSL_VERIFYPEER, false);
> curl_setopt($s8, CURLOPT_MAXREDIRS, 10);
> curl_setopt($s8, CURLOPT_HTTPHEADER, array("Content-Type: application/json", $kc, $kt, $ry));
> curl_setopt($s8, CURLOPT_POST, true);
> curl_setopt($s8, CURLOPT_POSTFIELDS, $th);
> curl_setopt($s8, CURLOPT_CONNECTTIMEOUT, 5);
> curl_setopt($s8, CURLOPT_TIMEOUT, 20);
> $e_ = curl_exec($s8);
> if (!curl_errno($s8)) {
> goto ph;
116,118c116,118
< gz:
< curl_close($gI);
< return $u4;
---
> ph:
> curl_close($s8);
> return $e_;
123c123
< goto BE;
---
> goto pH;
125,150c125,150
< return json_encode(array("apiKey" => "CURL_ERROR", "token" => "<a href="http://php.net/manual/en/curl.installation.php">PHP cURL extension</a> is not installed or disabled."));
< BE:
< $xc = MiniorangeSAMLConstants::BASE_URL . "/moas/rest/customer/key";
< $gI = curl_init($xc);
< $hE = $this->email;
< $wl = $this->password;
< $EW = array("email" => $hE, "password" => $wl);
< $tF = json_encode($EW);
< curl_setopt($gI, CURLOPT_FOLLOWLOCATION, TRUE);
< curl_setopt($gI, CURLOPT_ENCODING, '');
< curl_setopt($gI, CURLOPT_RETURNTRANSFER, TRUE);
< curl_setopt($gI, CURLOPT_AUTOREFERER, TRUE);
< curl_setopt($gI, CURLOPT_SSL_VERIFYPEER, FALSE);
< curl_setopt($gI, CURLOPT_MAXREDIRS, 10);
< curl_setopt($gI, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "charset: UTF - 8", "Authorization: Basic"));
< curl_setopt($gI, CURLOPT_POST, TRUE);
< curl_setopt($gI, CURLOPT_POSTFIELDS, $tF);
< $u4 = curl_exec($gI);
< if (!curl_errno($gI)) {
< goto Sz;
< }
< $w0 = array("%method" => "getCustomerKeys", "%file" => "customer_setup.php", "%error" => curl_error($gI));
< watchdog("miniorange_saml", "Error at %method of %file: %error", $w0);
< Sz:
< curl_close($gI);
< return $u4;
---
> return json_encode(array("apiKey" => "CURL_ERROR", "token" => "<a href="http://php.net/manual/en/curl.installation.php">PHP cURL extension</a> is not installed or disabled."));
> pH:
> $Zj = MiniorangeSAMLConstants::BASE_URL . "/moas/rest/customer/key";
> $s8 = curl_init($Zj);
> $fa = $this->email;
> $b3 = $this->password;
> $gH = array("email" => $fa, "password" => $b3);
> $th = json_encode($gH);
> curl_setopt($s8, CURLOPT_FOLLOWLOCATION, TRUE);
> curl_setopt($s8, CURLOPT_ENCODING, '');
> curl_setopt($s8, CURLOPT_RETURNTRANSFER, TRUE);
> curl_setopt($s8, CURLOPT_AUTOREFERER, TRUE);
> curl_setopt($s8, CURLOPT_SSL_VERIFYPEER, FALSE);
> curl_setopt($s8, CURLOPT_MAXREDIRS, 10);
> curl_setopt($s8, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "charset: UTF - 8", "Authorization: Basic"));
> curl_setopt($s8, CURLOPT_POST, TRUE);
> curl_setopt($s8, CURLOPT_POSTFIELDS, $th);
> $e_ = curl_exec($s8);
> if (!curl_errno($s8)) {
> goto Fi;
> }
> $dR = array("%method" => "getCustomerKeys", "%file" => "customer_setup.php", "%error" => curl_error($s8));
> watchdog("miniorange_saml", "Error at %method of %file: %error", $dR);
> Fi:
> curl_close($s8);
> return $e_;
155c155
< goto kH;
---
> goto lH;
157,189c157,189
< return json_encode(array("status" => "CURL_ERROR", "statusMessage" => "<a href="http://php.net/manual/en/curl.installation.php">PHP cURL extension</a> is not installed or disabled."));
< kH:
< $xc = MiniorangeSAMLConstants::BASE_URL . "/moas/api/auth/challenge";
< $gI = curl_init($xc);
< $zB = $this->defaultCustomerId;
< $SB = $this->defaultCustomerApiKey;
< $Ea = variable_get("miniorange_saml_customer_admin_email", NULL);
< $f8 = round(microtime(TRUE) * 1000);
< $Wc = $zB . number_format($RC, 0, '', '') . $SB;
< $e2 = hash("sha512", $Wc);
< $p0 = "Customer-Key: " . $zB;
< $hB = "Timestamp: " . number_format($RC, 0, '', '');
< $M1 = "Authorization: " . $e2;
< $EW = array("customerKey" => $zB, "email" => $Ea, "authType" => "EMAIL");
< $tF = json_encode($EW);
< curl_setopt($gI, CURLOPT_FOLLOWLOCATION, TRUE);
< curl_setopt($gI, CURLOPT_ENCODING, '');
< curl_setopt($gI, CURLOPT_RETURNTRANSFER, TRUE);
< curl_setopt($gI, CURLOPT_AUTOREFERER, TRUE);
< curl_setopt($gI, CURLOPT_SSL_VERIFYPEER, FALSE);
< curl_setopt($gI, CURLOPT_MAXREDIRS, 10);
< curl_setopt($gI, CURLOPT_HTTPHEADER, array("Content-Type: application/json", $p0, $hB, $M1));
< curl_setopt($gI, CURLOPT_POST, TRUE);
< curl_setopt($gI, CURLOPT_POSTFIELDS, $tF);
< $u4 = curl_exec($gI);
< if (!curl_errno($gI)) {
< goto yD;
< }
< $w0 = array("%method" => "sendOtp", "%file" => "customer_setup.php", "%error" => curl_error($gI));
< watchdog("miniorange_saml", "Error at %method of %file: %error", $w0);
< yD:
< curl_close($gI);
< return $u4;
---
> return json_encode(array("status" => "CURL_ERROR", "statusMessage" => "<a href="http://php.net/manual/en/curl.installation.php">PHP cURL extension</a> is not installed or disabled."));
> lH:
> $Zj = MiniorangeSAMLConstants::BASE_URL . "/moas/api/auth/challenge";
> $s8 = curl_init($Zj);
> $pu = $this->defaultCustomerId;
> $eM = $this->defaultCustomerApiKey;
> $q1 = variable_get("miniorange_saml_customer_admin_email", NULL);
> $uZ = round(microtime(TRUE) * 1000);
> $rN = $pu . number_format($hY, 0, '', '') . $eM;
> $WC = hash("sha512", $rN);
> $l1 = "Customer-Key: " . $pu;
> $yf = "Timestamp: " . number_format($hY, 0, '', '');
> $Ky = "Authorization: " . $WC;
> $gH = array("customerKey" => $pu, "email" => $q1, "authType" => "EMAIL");
> $th = json_encode($gH);
> curl_setopt($s8, CURLOPT_FOLLOWLOCATION, TRUE);
> curl_setopt($s8, CURLOPT_ENCODING, '');
> curl_setopt($s8, CURLOPT_RETURNTRANSFER, TRUE);
> curl_setopt($s8, CURLOPT_AUTOREFERER, TRUE);
> curl_setopt($s8, CURLOPT_SSL_VERIFYPEER, FALSE);
> curl_setopt($s8, CURLOPT_MAXREDIRS, 10);
> curl_setopt($s8, CURLOPT_HTTPHEADER, array("Content-Type: application/json", $l1, $yf, $Ky));
> curl_setopt($s8, CURLOPT_POST, TRUE);
> curl_setopt($s8, CURLOPT_POSTFIELDS, $th);
> $e_ = curl_exec($s8);
> if (!curl_errno($s8)) {
> goto B5;
> }
> $dR = array("%method" => "sendOtp", "%file" => "customer_setup.php", "%error" => curl_error($s8));
> watchdog("miniorange_saml", "Error at %method of %file: %error", $dR);
> B5:
> curl_close($s8);
> return $e_;
191c191
< public function validateOtp($iP)
---
> public function validateOtp($iu)
194c194
< goto gX;
---
> goto tp;
196,227c196,227
< return json_encode(array("status" => "CURL_ERROR", "statusMessage" => "<a href="http://php.net/manual/en/curl.installation.php">PHP cURL extension</a> is not installed or disabled."));
< gX:
< $xc = MiniorangeSAMLConstants::BASE_URL . "/moas/api/auth/validate";
< $gI = curl_init($xc);
< $zB = $this->defaultCustomerId;
< $SB = $this->defaultCustomerApiKey;
< $f8 = round(microtime(TRUE) * 1000);
< $Wc = $zB . number_format($RC, 0, '', '') . $SB;
< $e2 = hash("sha512", $Wc);
< $p0 = "Customer-Key: " . $zB;
< $hB = "Timestamp: " . number_format($RC, 0, '', '');
< $M1 = "Authorization: " . $e2;
< $EW = array("txId" => $iP, "token" => $this->otpToken);
< $tF = json_encode($EW);
< curl_setopt($gI, CURLOPT_FOLLOWLOCATION, TRUE);
< curl_setopt($gI, CURLOPT_ENCODING, '');
< curl_setopt($gI, CURLOPT_RETURNTRANSFER, TRUE);
< curl_setopt($gI, CURLOPT_AUTOREFERER, TRUE);
< curl_setopt($gI, CURLOPT_SSL_VERIFYPEER, FALSE);
< curl_setopt($gI, CURLOPT_MAXREDIRS, 10);
< curl_setopt($gI, CURLOPT_HTTPHEADER, array("Content-Type: application/json", $p0, $hB, $M1));
< curl_setopt($gI, CURLOPT_POST, TRUE);
< curl_setopt($gI, CURLOPT_POSTFIELDS, $tF);
< $u4 = curl_exec($gI);
< if (!curl_errno($gI)) {
< goto cj;
< }
< $w0 = array("%method" => "validateOtp", "%file" => "customer_setup.php", "%error" => curl_error($gI));
< watchdog("miniorange_saml", "Error at %method of %file: %error", $w0);
< cj:
< curl_close($gI);
< return $u4;
---
> return json_encode(array("status" => "CURL_ERROR", "statusMessage" => "<a href="http://php.net/manual/en/curl.installation.php">PHP cURL extension</a> is not installed or disabled."));
> tp:
> $Zj = MiniorangeSAMLConstants::BASE_URL . "/moas/api/auth/validate";
> $s8 = curl_init($Zj);
> $pu = $this->defaultCustomerId;
> $eM = $this->defaultCustomerApiKey;
> $uZ = round(microtime(TRUE) * 1000);
> $rN = $pu . number_format($hY, 0, '', '') . $eM;
> $WC = hash("sha512", $rN);
> $l1 = "Customer-Key: " . $pu;
> $yf = "Timestamp: " . number_format($hY, 0, '', '');
> $Ky = "Authorization: " . $WC;
> $gH = array("txId" => $iu, "token" => $this->otpToken);
> $th = json_encode($gH);
> curl_setopt($s8, CURLOPT_FOLLOWLOCATION, TRUE);
> curl_setopt($s8, CURLOPT_ENCODING, '');
> curl_setopt($s8, CURLOPT_RETURNTRANSFER, TRUE);
> curl_setopt($s8, CURLOPT_AUTOREFERER, TRUE);
> curl_setopt($s8, CURLOPT_SSL_VERIFYPEER, FALSE);
> curl_setopt($s8, CURLOPT_MAXREDIRS, 10);
> curl_setopt($s8, CURLOPT_HTTPHEADER, array("Content-Type: application/json", $l1, $yf, $Ky));
> curl_setopt($s8, CURLOPT_POST, TRUE);
> curl_setopt($s8, CURLOPT_POSTFIELDS, $th);
> $e_ = curl_exec($s8);
> if (!curl_errno($s8)) {
> goto bG;
> }
> $dR = array("%method" => "validateOtp", "%file" => "customer_setup.php", "%error" => curl_error($s8));
> watchdog("miniorange_saml", "Error at %method of %file: %error", $dR);
> bG:
> curl_close($s8);
> return $e_;
229c229
< function verifyLicense($ZW)
---
> function verifyLicense($D3)
231,234c231,234
< $xc = MiniorangeSAMLConstants::BASE_URL . "/moas/api/backupcode/verify";
< $gI = curl_init($xc);
< $E4 = variable_get("miniorange_saml_customer_id");
< $i8 = variable_get("miniorange_saml_customer_api_key");
---
> $Zj = MiniorangeSAMLConstants::BASE_URL . "/moas/api/backupcode/verify";
> $s8 = curl_init($Zj);
> $mC = variable_get("miniorange_saml_customer_id");
> $Og = variable_get("miniorange_saml_customer_api_key");
236,258c236,258
< $RC = round(microtime(TRUE) * 1000);
< $zW = $E4 . number_format($RC, 0, '', '') . $i8;
< $hv = hash("sha512", $zW);
< $nt = "Customer-Key: " . $E4;
< $Sm = "Timestamp: " . number_format($RC, 0, '', '');
< $Nk = "Authorization: " . $hv;
< $EW = '';
< $EW = array("code" => $ZW, "customerKey" => $E4, "additionalFields" => array("field1" => $base_url));
< $tF = json_encode($EW);
< curl_setopt($gI, CURLOPT_FOLLOWLOCATION, true);
< curl_setopt($gI, CURLOPT_ENCODING, '');
< curl_setopt($gI, CURLOPT_RETURNTRANSFER, true);
< curl_setopt($gI, CURLOPT_AUTOREFERER, true);
< curl_setopt($gI, CURLOPT_SSL_VERIFYPEER, false);
< curl_setopt($gI, CURLOPT_MAXREDIRS, 10);
< curl_setopt($gI, CURLOPT_HTTPHEADER, array("Content-Type: application/json", $nt, $Sm, $Nk));
< curl_setopt($gI, CURLOPT_POST, true);
< curl_setopt($gI, CURLOPT_POSTFIELDS, $tF);
< curl_setopt($gI, CURLOPT_CONNECTTIMEOUT, 5);
< curl_setopt($gI, CURLOPT_TIMEOUT, 20);
< $u4 = curl_exec($gI);
< if (!curl_errno($gI)) {
< goto rh;
---
> $hY = round(microtime(TRUE) * 1000);
> $a_ = $mC . number_format($hY, 0, '', '') . $Og;
> $MO = hash("sha512", $a_);
> $kc = "Customer-Key: " . $mC;
> $kt = "Timestamp: " . number_format($hY, 0, '', '');
> $ry = "Authorization: " . $MO;
> $gH = '';
> $gH = array("code" => $D3, "customerKey" => $mC, "additionalFields" => array("field1" => $base_url));
> $th = json_encode($gH);
> curl_setopt($s8, CURLOPT_FOLLOWLOCATION, true);
> curl_setopt($s8, CURLOPT_ENCODING, '');
> curl_setopt($s8, CURLOPT_RETURNTRANSFER, true);
> curl_setopt($s8, CURLOPT_AUTOREFERER, true);
> curl_setopt($s8, CURLOPT_SSL_VERIFYPEER, false);
> curl_setopt($s8, CURLOPT_MAXREDIRS, 10);
> curl_setopt($s8, CURLOPT_HTTPHEADER, array("Content-Type: application/json", $kc, $kt, $ry));
> curl_setopt($s8, CURLOPT_POST, true);
> curl_setopt($s8, CURLOPT_POSTFIELDS, $th);
> curl_setopt($s8, CURLOPT_CONNECTTIMEOUT, 5);
> curl_setopt($s8, CURLOPT_TIMEOUT, 20);
> $e_ = curl_exec($s8);
> if (!curl_errno($s8)) {
> goto ss;
260c260
< echo "Request Error:" . curl_error($gI);
---
> echo "Request Error:" . curl_error($s8);
262,264c262,264
< rh:
< curl_close($gI);
< return $u4;
---
> ss:
> curl_close($s8);
> return $e_;
268,295c268,295
< $xc = MiniorangeSAMLConstants::BASE_URL . "/moas/api/backupcode/updatestatus";
< $gI = curl_init($xc);
< $E4 = variable_get("miniorange_saml_customer_id");
< $i8 = variable_get("miniorange_saml_customer_api_key");
< $RC = round(microtime(TRUE) * 1000);
< $zW = $E4 . number_format($RC, 0, '', '') . $i8;
< $hv = hash("sha512", $zW);
< $nt = "Customer-Key: " . $E4;
< $Sm = "Timestamp: " . number_format($RC, 0, '', '');
< $Nk = "Authorization: " . $hv;
< $mz = variable_get("miniorange_saml_customer_admin_token");
< $ZW = AESEncryption::decrypt_data(variable_get("miniorange_saml_license_key"), $mz);
< $EW = array("code" => $ZW, "customerKey" => $E4);
< $tF = json_encode($EW);
< curl_setopt($gI, CURLOPT_FOLLOWLOCATION, true);
< curl_setopt($gI, CURLOPT_ENCODING, '');
< curl_setopt($gI, CURLOPT_RETURNTRANSFER, true);
< curl_setopt($gI, CURLOPT_AUTOREFERER, true);
< curl_setopt($gI, CURLOPT_SSL_VERIFYPEER, false);
< curl_setopt($gI, CURLOPT_MAXREDIRS, 10);
< curl_setopt($gI, CURLOPT_HTTPHEADER, array("Content-Type: application/json", $nt, $Sm, $Nk));
< curl_setopt($gI, CURLOPT_POST, true);
< curl_setopt($gI, CURLOPT_POSTFIELDS, $tF);
< curl_setopt($gI, CURLOPT_CONNECTTIMEOUT, 5);
< curl_setopt($gI, CURLOPT_TIMEOUT, 20);
< $u4 = curl_exec($gI);
< if (!curl_errno($gI)) {
< goto VY;
---
> $Zj = MiniorangeSAMLConstants::BASE_URL . "/moas/api/backupcode/updatestatus";
> $s8 = curl_init($Zj);
> $mC = variable_get("miniorange_saml_customer_id");
> $Og = variable_get("miniorange_saml_customer_api_key");
> $hY = round(microtime(TRUE) * 1000);
> $a_ = $mC . number_format($hY, 0, '', '') . $Og;
> $MO = hash("sha512", $a_);
> $kc = "Customer-Key: " . $mC;
> $kt = "Timestamp: " . number_format($hY, 0, '', '');
> $ry = "Authorization: " . $MO;
> $ZE = variable_get("miniorange_saml_customer_admin_token");
> $D3 = AESEncryption::decrypt_data(variable_get("miniorange_saml_license_key"), $ZE);
> $gH = array("code" => $D3, "customerKey" => $mC);
> $th = json_encode($gH);
> curl_setopt($s8, CURLOPT_FOLLOWLOCATION, true);
> curl_setopt($s8, CURLOPT_ENCODING, '');
> curl_setopt($s8, CURLOPT_RETURNTRANSFER, true);
> curl_setopt($s8, CURLOPT_AUTOREFERER, true);
> curl_setopt($s8, CURLOPT_SSL_VERIFYPEER, false);
> curl_setopt($s8, CURLOPT_MAXREDIRS, 10);
> curl_setopt($s8, CURLOPT_HTTPHEADER, array("Content-Type: application/json", $kc, $kt, $ry));
> curl_setopt($s8, CURLOPT_POST, true);
> curl_setopt($s8, CURLOPT_POSTFIELDS, $th);
> curl_setopt($s8, CURLOPT_CONNECTTIMEOUT, 5);
> curl_setopt($s8, CURLOPT_TIMEOUT, 20);
> $e_ = curl_exec($s8);
> if (!curl_errno($s8)) {
> goto VC;
297c297
< echo "Request Error:" . curl_error($gI);
---
> echo "Request Error:" . curl_error($s8);
299,301c299,301
< VY:
< curl_close($gI);
< return $u4;
---
> VC:
> curl_close($s8);
> return $e_;
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/includes/encryption.php" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/includes/encryption.php"
6c6
< public static function encrypt_data($IX, $mz)
---
> public static function encrypt_data($zN, $ZE)
8,13c8,13
< $mz = openssl_digest($mz, "sha256");
< $GA = "AES-128-CBC";
< $TV = openssl_cipher_iv_length($GA);
< $mO = openssl_random_pseudo_bytes($TV);
< $lx = openssl_encrypt($IX, $GA, $mz, OPENSSL_RAW_DATA || OPENSSL_ZERO_PADDING, $mO);
< return base64_encode($mO . $lx);
---
> $ZE = openssl_digest($ZE, "sha256");
> $LM = "AES-128-CBC";
> $sR = openssl_cipher_iv_length($LM);
> $fb = openssl_random_pseudo_bytes($sR);
> $pY = openssl_encrypt($zN, $LM, $ZE, OPENSSL_RAW_DATA || OPENSSL_ZERO_PADDING, $fb);
> return base64_encode($fb . $pY);
15c15
< public static function decrypt_data($IX, $mz, $GA = "AES-128-CBC")
---
> public static function decrypt_data($zN, $ZE, $LM = "AES-128-CBC")
17,23c17,23
< $Y6 = base64_decode($IX);
< $mz = openssl_digest($mz, "sha256");
< $TV = openssl_cipher_iv_length($GA);
< $mO = substr($Y6, 0, $TV);
< $IX = substr($Y6, $TV);
< $MT = openssl_decrypt($IX, $GA, $mz, OPENSSL_RAW_DATA || OPENSSL_ZERO_PADDING, $mO);
< return $MT;
---
> $ku = base64_decode($zN);
> $ZE = openssl_digest($ZE, "sha256");
> $sR = openssl_cipher_iv_length($LM);
> $fb = substr($ku, 0, $sR);
> $zN = substr($ku, $sR);
> $x5 = openssl_decrypt($zN, $LM, $ZE, OPENSSL_RAW_DATA || OPENSSL_ZERO_PADDING, $fb);
> return $x5;
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/includes/miniorange_saml_enum.php" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/includes/miniorange_saml_enum.php"
4c4
< include "basicEnum.php";
---
> include "basicEnum.php";
7,10c7,10
< const Broker_service = "mo_saml_enable_cloud_broker";
< const SP_Base_Url = "miniorange_saml_base_url";
< const SP_Entity_ID = "miniorange_saml_base_url";
< const SP_ACS_URL = "miniorange_saml_sp_issuer";
---
> const Broker_service = "mo_saml_enable_cloud_broker";
> const SP_Base_Url = "miniorange_saml_base_url";
> const SP_Entity_ID = "miniorange_saml_base_url";
> const SP_ACS_URL = "miniorange_saml_sp_issuer";
14,25c14,25
< const Identity_name = "mo_idp_name";
< const Issuer = "mo_idp_issuer";
< const Enable_Signed_SSO_and_SLO = "mo_idp_request_signed";
< const Name_ID_format = "mo_idp_nameid_format";
< const Binding_SSO = "mo_idp_http_binding_sso";
< const Login_URL = "mo_idp_sso_url";
< const Binding_SLO = "mo_idp_http_binding_slo";
< const Fetch_Metadata_Time_Intervals = "miniorange_saml_fetch_metadata_time_intervals";
< const Logout_URL = "mo_idp_slo_url";
< const X509_certificate = "mo_idp_cert";
< const Fetch_Metadata_URL = "miniorange_saml_meta_data_url";
< const Secrity_Signature_Algo = "security_signature_algorithm";
---
> const Identity_name = "mo_idp_name";
> const Issuer = "mo_idp_issuer";
> const Enable_Signed_SSO_and_SLO = "mo_idp_request_signed";
> const Name_ID_format = "mo_idp_nameid_format";
> const Binding_SSO = "mo_idp_http_binding_sso";
> const Login_URL = "mo_idp_sso_url";
> const Binding_SLO = "mo_idp_http_binding_slo";
> const Fetch_Metadata_Time_Intervals = "miniorange_saml_fetch_metadata_time_intervals";
> const Logout_URL = "mo_idp_slo_url";
> const X509_certificate = "mo_idp_cert";
> const Fetch_Metadata_URL = "miniorange_saml_meta_data_url";
> const Secrity_Signature_Algo = "security_signature_algorithm";
29,32c29,32
< const Protect_whole_site = "miniorange_saml_force_auth";
< const Auto_redirect = "miniorange_saml_auto_redirect_to_idp";
< const Backdoor_Login = "miniorange_saml_enable_backdoor";
< const Default_redirect_url = "miniorange_saml_default_relaystate";
---
> const Protect_whole_site = "miniorange_saml_force_auth";
> const Auto_redirect = "miniorange_saml_auto_redirect_to_idp";
> const Backdoor_Login = "miniorange_saml_enable_backdoor";
> const Default_redirect_url = "miniorange_saml_default_relaystate";
36,37c36,37
< const Custom_private_cert = "miniorange_saml_private_certificate";
< const Custom_public_cert = "miniorange_saml_publ_certificate";
---
> const Custom_private_cert = "miniorange_saml_private_certificate";
> const Custom_public_cert = "miniorange_saml_publ_certificate";
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/includes/miniorange_saml_support.php" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/includes/miniorange_saml_support.php"
9c9
< public function __construct($hE, $cA, $v5)
---
> public function __construct($fa, $PA, $Mp)
11,13c11,13
< $this->email = $hE;
< $this->phone = $cA;
< $this->query = $v5;
---
> $this->email = $fa;
> $this->phone = $PA;
> $this->query = $Mp;
17,33c17,33
< $this->query = "[Drupal " . VERSION . " SAML SP Enterprise With Multiple IDP | " . system_get_info("module", "miniorange_saml")["version"] . " | PHP " . phpversion() . " ] " . $this->query;
< $EW = array("company" => $_SERVER["SERVER_NAME"], "email" => $this->email, "ccEmail" => "[email protected]", "phone" => $this->phone, "query" => $this->query);
< $tF = json_encode($EW);
< $xc = MiniorangeSAMLConstants::BASE_URL . "/moas/rest/customer/contact-us";
< $gI = curl_init($xc);
< curl_setopt($gI, CURLOPT_FOLLOWLOCATION, TRUE);
< curl_setopt($gI, CURLOPT_ENCODING, '');
< curl_setopt($gI, CURLOPT_RETURNTRANSFER, TRUE);
< curl_setopt($gI, CURLOPT_AUTOREFERER, TRUE);
< curl_setopt($gI, CURLOPT_SSL_VERIFYPEER, FALSE);
< curl_setopt($gI, CURLOPT_MAXREDIRS, 10);
< curl_setopt($gI, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "charset: UTF-8", "Authorization: Basic"));
< curl_setopt($gI, CURLOPT_POST, TRUE);
< curl_setopt($gI, CURLOPT_POSTFIELDS, $tF);
< $u4 = curl_exec($gI);
< if (!curl_errno($gI)) {
< goto PF;
---
> $this->query = "[Drupal " . VERSION . " SAML SP Enterprise With Multiple IDP | " . system_get_info("module", "miniorange_saml")["version"] . " | PHP " . phpversion() . " ] " . $this->query;
> $gH = array("company" => $_SERVER["SERVER_NAME"], "email" => $this->email, "ccEmail" => "[email protected]", "phone" => $this->phone, "query" => $this->query);
> $th = json_encode($gH);
> $Zj = MiniorangeSAMLConstants::BASE_URL . "/moas/rest/customer/contact-us";
> $s8 = curl_init($Zj);
> curl_setopt($s8, CURLOPT_FOLLOWLOCATION, TRUE);
> curl_setopt($s8, CURLOPT_ENCODING, '');
> curl_setopt($s8, CURLOPT_RETURNTRANSFER, TRUE);
> curl_setopt($s8, CURLOPT_AUTOREFERER, TRUE);
> curl_setopt($s8, CURLOPT_SSL_VERIFYPEER, FALSE);
> curl_setopt($s8, CURLOPT_MAXREDIRS, 10);
> curl_setopt($s8, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "charset: UTF-8", "Authorization: Basic"));
> curl_setopt($s8, CURLOPT_POST, TRUE);
> curl_setopt($s8, CURLOPT_POSTFIELDS, $th);
> $e_ = curl_exec($s8);
> if (!curl_errno($s8)) {
> goto ap;
35,36c35,36
< $w0 = array("%method" => "sendSupportQuery", "%file" => "miniorange_saml_support.php", "%error" => curl_error($gI));
< watchdog("miniorange_saml", "cURL Error at %method of %file: %error", $w0);
---
> $dR = array("%method" => "sendSupportQuery", "%file" => "miniorange_saml_support.php", "%error" => curl_error($s8));
> watchdog("miniorange_saml", "cURL Error at %method of %file: %error", $dR);
38,39c38,39
< PF:
< curl_close($gI);
---
> ap:
> curl_close($s8);
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/miniorange_saml.install" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/miniorange_saml.install"
6,38c6,38
< variable_del("miniorange_saml_status");
< variable_del("miniorange_config_status");
< variable_del("miniorange_saml_customer_admin_email");
< variable_del("miniorange_saml_customer_admin_phone");
< variable_del("miniorange_saml_customer_admin_token");
< variable_del("miniorange_saml_customer_id");
< variable_del("miniorange_saml_customer_api_key");
< variable_del("miniorange_saml_idp_name");
< variable_del("miniorange_saml_sp_issuer");
< variable_del("miniorange_saml_idp_issuer");
< variable_del("miniorange_saml_idp_login_url");
< variable_del("miniorange_saml_idp_logout_url");
< variable_del("miniorange_saml_idp_x509_certificate");
< variable_del("miniorange_saml_enable_login");
< variable_del("miniorange_saml_auto_redirect_to_idp");
< variable_del("miniorange_saml_force_auth");
< variable_del("miniorange_saml_enable_backdoor");
< variable_del("miniorange_saml_license_key");
< variable_del("miniorange_saml_default_relaystate");
< variable_del("miniorange_saml_request_signed");
< variable_del("miniorange_saml_http_binding");
< variable_del("miniorange_saml_attrs_list");
< variable_del("miniorange_saml_fetch_metadata_time_intervals");
< variable_del("security_signature_algorithm");
< variable_del("miniorange_saml_meta_data_url");
< variable_del("miniorange_saml_sp_role_names");
< variable_del("miniorange_saml_log_url_class");
< variable_del("miniorange_saml_licenseType");
< variable_del("miniorange_saml_licensePlan");
< variable_del("miniorange_saml_assertion_not_after");
< variable_del("miniorange_saml_assertion_not_before");
< if (!db_table_exists("miniorange_saml_idp_list")) {
< goto hF;
---
> variable_del("miniorange_saml_status");
> variable_del("miniorange_config_status");
> variable_del("miniorange_saml_customer_admin_email");
> variable_del("miniorange_saml_customer_admin_phone");
> variable_del("miniorange_saml_customer_admin_token");
> variable_del("miniorange_saml_customer_id");
> variable_del("miniorange_saml_customer_api_key");
> variable_del("miniorange_saml_idp_name");
> variable_del("miniorange_saml_sp_issuer");
> variable_del("miniorange_saml_idp_issuer");
> variable_del("miniorange_saml_idp_login_url");
> variable_del("miniorange_saml_idp_logout_url");
> variable_del("miniorange_saml_idp_x509_certificate");
> variable_del("miniorange_saml_enable_login");
> variable_del("miniorange_saml_auto_redirect_to_idp");
> variable_del("miniorange_saml_force_auth");
> variable_del("miniorange_saml_enable_backdoor");
> variable_del("miniorange_saml_license_key");
> variable_del("miniorange_saml_default_relaystate");
> variable_del("miniorange_saml_request_signed");
> variable_del("miniorange_saml_http_binding");
> variable_del("miniorange_saml_attrs_list");
> variable_del("miniorange_saml_fetch_metadata_time_intervals");
> variable_del("security_signature_algorithm");
> variable_del("miniorange_saml_meta_data_url");
> variable_del("miniorange_saml_sp_role_names");
> variable_del("miniorange_saml_log_url_class");
> variable_del("miniorange_saml_licenseType");
> variable_del("miniorange_saml_licensePlan");
> variable_del("miniorange_saml_assertion_not_after");
> variable_del("miniorange_saml_assertion_not_before");
> if (!db_table_exists("miniorange_saml_idp_list")) {
> goto Ms;
40,41c40,41
< drupal_uninstall_schema("miniorange_saml_idp_list");
< hF:
---
> drupal_uninstall_schema("miniorange_saml_idp_list");
> Ms:
45,49c45,49
< variable_set("miniorange_saml_email_attribute", "NameID");
< variable_set("miniorange_saml_username_attribute", "NameID");
< variable_set("security_signature_algorithm", "RSA_SHA256");
< if (db_table_exists("miniorange_saml_idp_list")) {
< goto pm;
---
> variable_set("miniorange_saml_email_attribute", "NameID");
> variable_set("miniorange_saml_username_attribute", "NameID");
> variable_set("security_signature_algorithm", "RSA_SHA256");
> if (db_table_exists("miniorange_saml_idp_list")) {
> goto Ci;
51,52c51,52
< drupal_install_schema("miniorange_saml");
< pm:
---
> drupal_install_schema("miniorange_saml");
> Ci:
56,57c56,57
< $LQ["miniorange_saml_idp_list"] = array("description" => t("SP Configuration Storage"), "fields" => array("id" => array("type" => "serial", "unsigned" => TRUE, "not null" => TRUE), "mo_idp_name" => array("type" => "text", "not null" => TRUE), "mo_idp_issuer" => array("type" => "varchar", "length" => 254, "not null" => TRUE), "mo_idp_sso_url" => array("type" => "varchar", "length" => 254, "not null" => TRUE), "mo_idp_cert" => array("type" => "varchar", "length" => 4096, "default" => "FALSE", "not null" => NULL), "mo_idp_nameid_format" => array("type" => "varchar", "length" => 254, "not null" => TRUE), "mo_idp_request_signed" => array("type" => "varchar", "length" => 20, "default" => "FALSE", "not null" => TRUE), "mo_idp_http_binding_sso" => array("type" => "varchar", "length" => 20, "default" => "FALSE", "not null" => TRUE), "mo_idp_http_binding_slo" => array("type" => "varchar", "length" => 20, "default" => "FALSE", "not null" => TRUE), "mo_idp_slo_url" => array("type" => "varchar", "length" => 254, "not null" => TRUE), "miniorange_saml_fetch_metadata_time_intervals" => array("type" => "varchar", "length" => 20, "default" => "FALSE", "not null" => TRUE), "miniorange_saml_meta_data_url" => array("type" => "varchar", "length" => 254, "not null" => TRUE), "security_signature_algorithm" => array("type" => "varchar", "length" => 20, "not null" => TRUE)), "primary key" => array("id"));
< return $LQ;
---
> $M9["miniorange_saml_idp_list"] = array("description" => t("SP Configuration Storage"), "fields" => array("id" => array("type" => "serial", "unsigned" => TRUE, "not null" => TRUE), "mo_idp_name" => array("type" => "text", "not null" => TRUE), "mo_idp_issuer" => array("type" => "varchar", "length" => 254, "not null" => TRUE), "mo_idp_sso_url" => array("type" => "varchar", "length" => 254, "not null" => TRUE), "mo_idp_cert" => array("type" => "varchar", "length" => 4096, "default" => "FALSE", "not null" => NULL), "mo_idp_nameid_format" => array("type" => "varchar", "length" => 254, "not null" => TRUE), "mo_idp_request_signed" => array("type" => "varchar", "length" => 20, "default" => "FALSE", "not null" => TRUE), "mo_idp_http_binding_sso" => array("type" => "varchar", "length" => 20, "default" => "FALSE", "not null" => TRUE), "mo_idp_http_binding_slo" => array("type" => "varchar", "length" => 20, "default" => "FALSE", "not null" => TRUE), "mo_idp_slo_url" => array("type" => "varchar", "length" => 254, "not null" => TRUE), "miniorange_saml_fetch_metadata_time_intervals" => array("type" => "varchar", "length" => 20, "default" => "FALSE", "not null" => TRUE), "miniorange_saml_meta_data_url" => array("type" => "varchar", "length" => 254, "not null" => TRUE), "security_signature_algorithm" => array("type" => "varchar", "length" => 20, "not null" => TRUE)), "primary key" => array("id"));
> return $M9;
61,62c61,62
< if (!(variable_get("miniorange_saml_license_key", NULL) != NULL)) {
< goto hl;
---
> if (!(variable_get("miniorange_saml_license_key", NULL) != NULL)) {
> goto Nx;
64,69c64,69
< $Ea = variable_get("miniorange_saml_customer_admin_email", NULL);
< $cA = variable_get("miniorange_saml_customer_admin_phone", NULL);
< $ow = new MiniorangeSAMLCustomer($Ea, $cA, NULL, NULL);
< $Dj = $ow->updateStatus() !== NULL ? json_decode($ow->updateStatus()) : '';
< if (!(isset($Dj->status) && $Dj->status == "SUCCESS")) {
< goto Ci;
---
> $q1 = variable_get("miniorange_saml_customer_admin_email", NULL);
> $PA = variable_get("miniorange_saml_customer_admin_phone", NULL);
> $aR = new MiniorangeSAMLCustomer($q1, $PA, NULL, NULL);
> $yH = $aR->updateStatus() !== NULL ? json_decode($aR->updateStatus()) : '';
> if (!(isset($yH->status) && $yH->status == "SUCCESS")) {
> goto U7;
71,73c71,73
< variable_del("miniorange_saml_license_key");
< Ci:
< hl:
---
> variable_del("miniorange_saml_license_key");
> U7:
> Nx:
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/miniorange_saml.module" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/miniorange_saml.module"
6,24c6,24
< $Lh["admin/config/people/miniorange_saml"] = array("title" => "miniOrange SAML Login Configuration", "description" => "miniOrange SAML Login Configuration", "page callback" => "drupal_get_form", "page arguments" => array("miniorange_saml_customer_setup"), "access arguments" => array("administer site configuration"), "file" => "miniorange_saml_customer_setup.inc");
< $Lh["admin/config/people/miniorange_saml/customer_setup"] = array("title" => "Register/Login", "weight" => -9, "type" => MENU_DEFAULT_LOCAL_TASK, "access arguments" => array("administer site configuration"), "page arguments" => array("miniorange_saml_customer_setup"), "file" => "miniorange_saml_customer_setup.inc");
< $Lh["admin/config/people/miniorange_saml/idp_setup"] = array("title" => "Service Provider Metadata", "weight" => -8, "access arguments" => array("administer site configuration"), "page arguments" => array("miniorange_sp_information"), "file" => "miniorange_sp_information.inc", "type" => MENU_LOCAL_TASK);
< $Lh["admin/config/people/miniorange_saml/sp_setup"] = array("title" => "Service Provider Setup", "weight" => -7, "type" => MENU_LOCAL_TASK, "access arguments" => array("administer site configuration"), "page arguments" => array("miniorange_saml_idp_setup"), "file" => "miniorange_saml_idp_setup.inc");
< $Lh["admin/config/people/miniorange_saml/signon_settings"] = array("title" => "Signin", "weight" => -6, "type" => MENU_LOCAL_TASK, "access arguments" => array("administer site configuration"), "page arguments" => array("miniorange_saml_login_options"), "file" => "miniorange_saml_login_options.inc");
< $Lh["admin/config/people/miniorange_saml/mapping_config"] = array("title" => "Mapping", "weight" => -5, "type" => MENU_LOCAL_TASK, "access arguments" => array("administer site configuration"), "page arguments" => array("miniorange_saml_mapping"), "file" => "miniorange_saml_mapping.inc");
< $Lh["admin/config/people/miniorange_saml/export_config"] = array("title" => "Import/Export", "weight" => -4, "type" => MENU_LOCAL_TASK, "access arguments" => array("administer site configuration"), "page arguments" => array("miniorange_saml_export_config"), "file" => "miniorange_saml_export_config.inc");
< $Lh["admin/config/people/miniorange_saml/custom_certificate"] = array("title" => "Custom Certificate", "weight" => -3, "type" => MENU_LOCAL_TASK, "access arguments" => array("administer site configuration"), "page arguments" => array("mo_saml_add_custom_certificate"), "file" => "mo_saml_add_custom_certificate.inc");
< $Lh["admin/config/people/miniorange_saml/licensing"] = array("title" => "Upgrade Plans", "weight" => -2, "type" => MENU_LOCAL_TASK, "access arguments" => array("administer site configuration"), "page arguments" => array("miniorange_saml_licensing"), "file" => "miniorange_saml_licensing.inc");
< $Lh["samllogin"] = array("access callback" => TRUE, "page callback" => "saml_login", "type" => MENU_CALLBACK);
< $Lh["samlassertion"] = array("access callback" => TRUE, "page callback" => "saml_response", "type" => MENU_CALLBACK);
< $Lh["samllogout"] = array("access callback" => TRUE, "page callback" => "saml_logout", "type" => MENU_CALLBACK);
< $Lh["testConfig"] = array("access callback" => TRUE, "page callback" => "test_configuration", "type" => MENU_CALLBACK);
< $Lh["showSAMLrequest"] = array("access callback" => TRUE, "page callback" => "SAML_Request_Generator", "type" => MENU_CALLBACK);
< $Lh["showSAMLresponse"] = array("access callback" => TRUE, "page callback" => "SAML_Response_Generator", "type" => MENU_CALLBACK);
< $Lh["mosp_metadata"] = array("access callback" => TRUE, "page callback" => "miniorange_saml_metadata", "type" => MENU_CALLBACK);
< $Lh["mosp_download_metadata"] = array("access arguments" => array("administer site configuration"), "page callback" => "miniorange_saml_download_metadata", "type" => MENU_CALLBACK);
< $Lh["moLicenseFetch"] = array("access callback" => TRUE, "page callback" => "moLicenseFetch", "type" => MENU_CALLBACK);
< return $Lh;
---
> $Dy["admin/config/people/miniorange_saml"] = array("title" => "miniOrange SAML Login Configuration", "description" => "miniOrange SAML Login Configuration", "page callback" => "drupal_get_form", "page arguments" => array("miniorange_saml_customer_setup"), "access arguments" => array("administer site configuration"), "file" => "miniorange_saml_customer_setup.inc");
> $Dy["admin/config/people/miniorange_saml/customer_setup"] = array("title" => "Register/Login", "weight" => -9, "type" => MENU_DEFAULT_LOCAL_TASK, "access arguments" => array("administer site configuration"), "page arguments" => array("miniorange_saml_customer_setup"), "file" => "miniorange_saml_customer_setup.inc");
> $Dy["admin/config/people/miniorange_saml/idp_setup"] = array("title" => "Service Provider Metadata", "weight" => -8, "access arguments" => array("administer site configuration"), "page arguments" => array("miniorange_sp_information"), "file" => "miniorange_sp_information.inc", "type" => MENU_LOCAL_TASK);
> $Dy["admin/config/people/miniorange_saml/sp_setup"] = array("title" => "Service Provider Setup", "weight" => -7, "type" => MENU_LOCAL_TASK, "access arguments" => array("administer site configuration"), "page arguments" => array("miniorange_saml_idp_setup"), "file" => "miniorange_saml_idp_setup.inc");
> $Dy["admin/config/people/miniorange_saml/signon_settings"] = array("title" => "Signin", "weight" => -6, "type" => MENU_LOCAL_TASK, "access arguments" => array("administer site configuration"), "page arguments" => array("miniorange_saml_login_options"), "file" => "miniorange_saml_login_options.inc");
> $Dy["admin/config/people/miniorange_saml/mapping_config"] = array("title" => "Mapping", "weight" => -5, "type" => MENU_LOCAL_TASK, "access arguments" => array("administer site configuration"), "page arguments" => array("miniorange_saml_mapping"), "file" => "miniorange_saml_mapping.inc");
> $Dy["admin/config/people/miniorange_saml/export_config"] = array("title" => "Import/Export", "weight" => -4, "type" => MENU_LOCAL_TASK, "access arguments" => array("administer site configuration"), "page arguments" => array("miniorange_saml_export_config"), "file" => "miniorange_saml_export_config.inc");
> $Dy["admin/config/people/miniorange_saml/custom_certificate"] = array("title" => "Custom Certificate", "weight" => -3, "type" => MENU_LOCAL_TASK, "access arguments" => array("administer site configuration"), "page arguments" => array("mo_saml_add_custom_certificate"), "file" => "mo_saml_add_custom_certificate.inc");
> $Dy["admin/config/people/miniorange_saml/licensing"] = array("title" => "Upgrade Plans", "weight" => -2, "type" => MENU_LOCAL_TASK, "access arguments" => array("administer site configuration"), "page arguments" => array("miniorange_saml_licensing"), "file" => "miniorange_saml_licensing.inc");
> $Dy["samllogin"] = array("access callback" => TRUE, "page callback" => "saml_login", "type" => MENU_CALLBACK);
> $Dy["samlassertion"] = array("access callback" => TRUE, "page callback" => "saml_response", "type" => MENU_CALLBACK);
> $Dy["samllogout"] = array("access callback" => TRUE, "page callback" => "saml_logout", "type" => MENU_CALLBACK);
> $Dy["testConfig"] = array("access callback" => TRUE, "page callback" => "test_configuration", "type" => MENU_CALLBACK);
> $Dy["showSAMLrequest"] = array("access callback" => TRUE, "page callback" => "SAML_Request_Generator", "type" => MENU_CALLBACK);
> $Dy["showSAMLresponse"] = array("access callback" => TRUE, "page callback" => "SAML_Response_Generator", "type" => MENU_CALLBACK);
> $Dy["mosp_metadata"] = array("access callback" => TRUE, "page callback" => "miniorange_saml_metadata", "type" => MENU_CALLBACK);
> $Dy["mosp_download_metadata"] = array("access arguments" => array("administer site configuration"), "page callback" => "miniorange_saml_download_metadata", "type" => MENU_CALLBACK);
> $Dy["moLicenseFetch"] = array("access callback" => TRUE, "page callback" => "moLicenseFetch", "type" => MENU_CALLBACK);
> return $Dy;
26c26
< function moLicenseFetch($Ax = TRUE)
---
> function moLicenseFetch($zE = TRUE)
29,61c29,61
< $Ea = variable_get("miniorange_saml_customer_admin_email", NULL);
< $cA = variable_get("miniorange_saml_customer_admin_phone", NULL);
< $ow = new MiniorangeSAMLCustomer($Ea, $cA, NULL, NULL);
< $uc = $ow->ccl() !== NULL ? json_decode($ow->ccl()) : '';
< if (isset($uc->status) && $uc->status == "SUCCESS") {
< goto MP;
< }
< $DC = t("Failed to fetch update");
< $Wq = "error";
< goto gb;
< MP:
< variable_set("mo_last_license_fetch_time", time());
< variable_set("miniorange_saml_licenseExpiry", $uc->licenseExpiry);
< variable_set("miniorange_saml_supportExpiry", $uc->supportExpiry);
< variable_set("miniorange_saml_licenseType", $uc->licenseType);
< variable_set("miniorange_saml_licensePlan", $uc->licensePlan);
< $DC = t("Successfully fetched the update");
< $Wq = "status";
< gb:
< if (!$Ax) {
< goto ha;
< }
< drupal_set_message($DC, $Wq);
< drupal_goto($base_url . "/admin/config/people/miniorange_saml");
< ha:
< }
< function miniorange_saml_update_status_alter(&$Tc)
< {
< $p1 = system_get_info("module", "miniorange_saml")["version"];
< $kg = isset($Tc["miniorange_saml"]["recommended"]) ? $Tc["miniorange_saml"]["recommended"] : 99.98999999999999;
< $P6 = strtotime(variable_get("miniorange_saml_licenseExpiry", ''));
< if (!(isset($Tc["miniorange_saml"]) && $P6 < time() && strcmp($p1, $kg) != 0)) {
< goto k6;
---
> $q1 = variable_get("miniorange_saml_customer_admin_email", NULL);
> $PA = variable_get("miniorange_saml_customer_admin_phone", NULL);
> $aR = new MiniorangeSAMLCustomer($q1, $PA, NULL, NULL);
> $ZQ = $aR->ccl() !== NULL ? json_decode($aR->ccl()) : '';
> if (isset($ZQ->status) && $ZQ->status == "SUCCESS") {
> goto Vm;
> }
> $ZH = t("Failed to fetch update");
> $hF = "error";
> goto Nr;
> Vm:
> variable_set("mo_last_license_fetch_time", time());
> variable_set("miniorange_saml_licenseExpiry", $ZQ->licenseExpiry);
> variable_set("miniorange_saml_supportExpiry", $ZQ->supportExpiry);
> variable_set("miniorange_saml_licenseType", $ZQ->licenseType);
> variable_set("miniorange_saml_licensePlan", $ZQ->licensePlan);
> $ZH = t("Successfully fetched the update");
> $hF = "status";
> Nr:
> if (!$zE) {
> goto mg;
> }
> drupal_set_message($ZH, $hF);
> drupal_goto($base_url . "/admin/config/people/miniorange_saml");
> mg:
> }
> function miniorange_saml_update_status_alter(&$hW)
> {
> $K3 = system_get_info("module", "miniorange_saml")["version"];
> $aW = isset($hW["miniorange_saml"]["recommended"]) ? $hW["miniorange_saml"]["recommended"] : 99.98999999999999;
> $C_ = strtotime(variable_get("miniorange_saml_licenseExpiry", ''));
> if (!(isset($hW["miniorange_saml"]) && $C_ < time() && strcmp($K3, $aW) != 0)) {
> goto kC;
63,64c63,64
< if (!(time() - variable_get("mo_last_license_fetch_time", 0) >= 3600 * 24)) {
< goto PW;
---
> if (!(time() - variable_get("mo_last_license_fetch_time", 0) >= 3600 * 24)) {
> goto Jz;
67,74c67,74
< PW:
< $P6 = strtotime(variable_get("miniorange_saml_licenseExpiry", ''));
< if (!($P6 < time())) {
< goto cM;
< }
< drupal_set_message("your license is expired. You need to renew your license.", "error");
< cM:
< k6:
---
> Jz:
> $C_ = strtotime(variable_get("miniorange_saml_licenseExpiry", ''));
> if (!($C_ < time())) {
> goto OK;
> }
> drupal_set_message("your license is expired. You need to renew your license.", "error");
> OK:
> kC:
84c84
< function _generate_metadata($aW = false)
---
> function _generate_metadata($O9 = false)
86,102c86,102
< $yu = Utilities::miniorange_get_baseURL();
< $Nt = $yu;
< $u1 = variable_get("miniorange_saml_entity_id", '');
< $vn = !empty($u1) ? $u1 : $yu;
< if (substr($Nt, -1) == "/") {
< goto yA;
< }
< $NA = $Nt . "/?q=samlassertion";
< $fA = $Nt . "/user/logout";
< goto CV;
< yA:
< $NA = $Nt . "?q=samlassertion";
< $fA = $Nt . "?user/logout";
< CV:
< $q5 = Utilities::desanitize_certificate(Utilities::getPublicCertificate());
< if (!(isset($_REQUEST["certificate"]) && $_REQUEST["certificate"] == "true")) {
< goto SN;
---
> $Gx = Utilities::miniorange_get_baseURL();
> $uD = $Gx;
> $jm = variable_get("miniorange_saml_entity_id", '');
> $iF = !empty($jm) ? $jm : $Gx;
> if (substr($uD, -1) == "/") {
> goto M7;
> }
> $XZ = $uD . "/?q=samlassertion";
> $m3 = $uD . "/user/logout";
> goto OT;
> M7:
> $XZ = $uD . "?q=samlassertion";
> $m3 = $uD . "?user/logout";
> OT:
> $Dq = Utilities::desanitize_certificate(Utilities::getPublicCertificate());
> if (!(isset($_REQUEST["certificate"]) && $_REQUEST["certificate"] == "true")) {
> goto IN;
104,105c104,105
< $sB = "Content-Disposition: attachment; filename="sp-certificate.crt"";
< header($sB);
---
> $Ch = "Content-Disposition: attachment; filename="sp-certificate.crt"";
> header($Ch);
108,117c108,117
< SN:
< if ($aW) {
< goto v0;
< }
< header("Content-Type: text/xml");
< goto cW;
< v0:
< header("Content-Disposition: attachment; filename="Metadata.xml"");
< cW:
< echo "<?xml version="1.0"?>
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" validUntil="2024-03-27T23:59:59Z" cacheDuration="PT1446808792S" entityID="" . $vn . "">
\xa <md:SPSSODescriptor AuthnRequestsSigned="true" WantAssertionsSigned="true" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">\xd
<md:KeyDescriptor use="signing">\xd
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">\xd
<ds:X509Data>
\xa <ds:X509Certificate>" . $q5 . "</ds:X509Certificate>
</ds:X509Data>
\xa </ds:KeyInfo>
\xa </md:KeyDescriptor>\xd\xa <md:KeyDescriptor use="encryption">\xd
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
\xa <ds:X509Data>
\xa <ds:X509Certificate>" . $q5 . "</ds:X509Certificate>\xd\xa </ds:X509Data>\xd
</ds:KeyInfo>
</md:KeyDescriptor>\xd
<md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="" . $fA . ""/>
<md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="" . $fA . ""/>\xd
<md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</md:NameIDFormat>
\xa <md:NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified</md:NameIDFormat>
<md:NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:transient</md:NameIDFormat>
\xa <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="" . $NA . "" index="1"/>\xd\xa </md:SPSSODescriptor>
<md:Organization>\xd
<md:OrganizationName xml:lang="en-US">miniOrange</md:OrganizationName>
<md:OrganizationDisplayName xml:lang="en-US">miniOrange</md:OrganizationDisplayName>
<md:OrganizationURL xml:lang="en-US">https://miniorange.com</md:OrganizationURL>\xd
</md:Organization>
<md:ContactPerson contactType="technical">
<md:GivenName>miniOrange</md:GivenName>
<md:EmailAddress>[email protected]</md:EmailAddress>
\xa </md:ContactPerson>
<md:ContactPerson contactType="support">\xd
<md:GivenName>miniOrange</md:GivenName>\xd\xa <md:EmailAddress>[email protected]</md:EmailAddress>
\xa </md:ContactPerson>
\xa </md:EntityDescriptor>";
---
> IN:
> if ($O9) {
> goto G1;
> }
> header("Content-Type: text/xml");
> goto FX;
> G1:
> header("Content-Disposition: attachment; filename="Metadata.xml"");
> FX:
> echo "<?xml version="1.0"?>\xd
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" validUntil="2024-03-27T23:59:59Z" cacheDuration="PT1446808792S" entityID="" . $iF . "">\xd\xa <md:SPSSODescriptor AuthnRequestsSigned="true" WantAssertionsSigned="true" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<md:KeyDescriptor use="signing">\xd\xa <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
\xa <ds:X509Data>
\xa <ds:X509Certificate>" . $Dq . "</ds:X509Certificate>\xd\xa </ds:X509Data>\xd\xa </ds:KeyInfo>\xd
</md:KeyDescriptor>\xd\xa <md:KeyDescriptor use="encryption">
\xa <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">\xd\xa <ds:X509Data>
<ds:X509Certificate>" . $Dq . "</ds:X509Certificate>
</ds:X509Data>\xd\xa </ds:KeyInfo>
\xa </md:KeyDescriptor>\xd\xa <md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="" . $m3 . ""/>
\xa <md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="" . $m3 . ""/>\xd\xa <md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</md:NameIDFormat>\xd\xa <md:NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified</md:NameIDFormat>
\xa <md:NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:transient</md:NameIDFormat>\xd\xa <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="" . $XZ . "" index="1"/>\xd\xa </md:SPSSODescriptor>\xd\xa <md:Organization>
<md:OrganizationName xml:lang="en-US">miniOrange</md:OrganizationName>
<md:OrganizationDisplayName xml:lang="en-US">miniOrange</md:OrganizationDisplayName>\xd\xa <md:OrganizationURL xml:lang="en-US">https://miniorange.com</md:OrganizationURL>\xd\xa </md:Organization>
\xa <md:ContactPerson contactType="technical">
\xa <md:GivenName>miniOrange</md:GivenName>
<md:EmailAddress>[email protected]</md:EmailAddress>\xd\xa </md:ContactPerson>
\xa <md:ContactPerson contactType="support">\xd
<md:GivenName>miniOrange</md:GivenName>
<md:EmailAddress>[email protected]</md:EmailAddress>
</md:ContactPerson>
</md:EntityDescriptor>";
122,136c122,136
< $yu = Utilities::miniorange_get_baseURL();
< $ih = "testValidate";
< $Pj = $_GET["testid"];
< $ZQ = db_query("SELECT * FROM {miniorange_saml_idp_list} WHERE id = {$Pj}");
< $IX = $ZQ->fetchAssoc();
< $zM = $IX["mo_idp_sso_url"];
< $aG = $yu . "/?q=samlassertion";
< $u1 = $yu;
< $gq = $IX["mo_idp_request_signed"];
< $uy = $IX["security_signature_algorithm"];
< $uL = $IX["mo_idp_http_binding_sso"];
< $RE = $IX["mo_idp_nameid_format"];
< $bA = Utilities::createAuthnRequest($aG, $u1, $zM, $RE, $uL, "false");
< $BS = new MiniOrangeAuthnRequest();
< $BS->sendSamlRequestByBindingType($bA, $uL, $ih, $zM, $gq, $uy);
---
> $Gx = Utilities::miniorange_get_baseURL();
> $KN = "testValidate";
> $GX = $_GET["testid"];
> $rX = db_query("SELECT * FROM {miniorange_saml_idp_list} WHERE id = {$GX}");
> $zN = $rX->fetchAssoc();
> $Gr = $zN["mo_idp_sso_url"];
> $eN = $Gx . "/?q=samlassertion";
> $jm = $Gx;
> $v9 = $zN["mo_idp_request_signed"];
> $hH = $zN["security_signature_algorithm"];
> $Ms = $zN["mo_idp_http_binding_sso"];
> $VC = $zN["mo_idp_nameid_format"];
> $JW = Utilities::createAuthnRequest($eN, $jm, $Gr, $VC, $Ms, "false");
> $lq = new MiniOrangeAuthnRequest();
> $lq->sendSamlRequestByBindingType($JW, $Ms, $KN, $Gr, $v9, $hH);
140,141c140,141
< $Kk = variable_get("miniorange_saml_idp_login_url", '');
< $RE = variable_get("miniorange_nameid_format", '');
---
> $U3 = variable_get("miniorange_saml_idp_login_url", '');
> $VC = variable_get("miniorange_nameid_format", '');
143,146c143,146
< $NA = $base_url . "/?q=samlassertion";
< $t7 = Utilities::createSAMLRequest($NA, $base_url, $Kk, $RE);
< $ih = "displaySAMLRequest";
< Utilities::Print_SAML_Request($t7, $ih);
---
> $XZ = $base_url . "/?q=samlassertion";
> $QO = Utilities::createSAMLRequest($XZ, $base_url, $U3, $VC);
> $KN = "displaySAMLRequest";
> Utilities::Print_SAML_Request($QO, $KN);
150c150
< saml_login("showSamlResponse");
---
> saml_login("showSamlResponse");
152c152
< function miniorange_saml_form_alter(&$form, &$form_state, $GL)
---
> function miniorange_saml_form_alter(&$form, &$form_state, $lZ)
154,236c154,236
< $yu = Utilities::miniorange_get_baseURL();
< $Gt = variable_get("miniorange_saml_force_auth", FALSE);
< $MU = variable_get("miniorange_saml_enable_backdoor", FALSE);
< $rS = variable_get("miniorange_saml_auto_redirect_to_idp", FALSE);
< $kC = variable_get("miniorange_saml_enable_login", FALSE);
< $qG = variable_get("miniorange_saml_default_relaystate", $yu . "/" . current_path());
< if (!$kC) {
< goto is;
< }
< if (!($Gt && !user_is_logged_in() && !isset($_POST["pass"]))) {
< goto Gv;
< }
< $I6 = drupal_get_query_parameters();
< if (!(!$MU || !isset($I6["saml_login"]) || $I6["saml_login"] != "false")) {
< goto w5;
< }
< saml_login($qG);
< w5:
< Gv:
< $Kz = '';
< if (!(($GL == "user_login_block" || $GL == "user_login") && !isset($_POST["pass"]))) {
< goto I4;
< }
< $I6 = drupal_get_query_parameters();
< if (!$MU) {
< goto DC;
< }
< if (isset($I6["saml_login"])) {
< goto zl;
< }
< if (!($rS && $GL == "user_login" && strtolower($Kz) != "false")) {
< goto s7;
< }
< saml_login($qG);
< s7:
< goto Y9;
< zl:
< $Kz = $I6["saml_login"];
< Y9:
< DC:
< if (!($rS && $GL == "user_login" && strtolower($Kz) != "false")) {
< goto dZ;
< }
< saml_login($qG);
< dZ:
< $ZQ = db_query("SELECT * FROM {miniorange_saml_idp_list}");
< $IX = $ZQ->fetchAll();
< $Fy = count($IX);
< if (!isset($IX)) {
< goto NC;
< }
< ye:
< if (!($Fy != 0)) {
< goto yS;
< }
< foreach ($IX as $c3) {
< $PB = $c3->mo_idp_name;
< $qh = $yu . "/?q=samllogin&idpname=" . $PB;
< $form["loginurl_"[$Fy]] = array(array("#markup" => "<a href="" . $qh . "">Login using " . $PB . "</a><br>"));
< $Fy--;
< Cz:
< }
< Gu:
< goto ye;
< yS:
< NC:
< I4:
< is:
< }
< function saml_login($qG = '')
< {
< $gh = drupal_get_query_parameters();
< $yu = Utilities::miniorange_get_baseURL();
< $wz = isset($_GET["idpname"]) ? $_GET["idpname"] : '';
< if (!empty($wz)) {
< goto wN;
< }
< $wz = variable_get("miniorange_saml_default_idp_name", '');
< wN:
< $ZQ = db_query("SELECT * FROM {miniorange_saml_idp_list} WHERE mo_idp_name = '{$wz}'");
< $IX = $ZQ->fetchAssoc();
< if (!empty($IX)) {
< goto uB;
---
> $Gx = Utilities::miniorange_get_baseURL();
> $xr = variable_get("miniorange_saml_force_auth", FALSE);
> $xZ = variable_get("miniorange_saml_enable_backdoor", FALSE);
> $vM = variable_get("miniorange_saml_auto_redirect_to_idp", FALSE);
> $xn = variable_get("miniorange_saml_enable_login", FALSE);
> $e1 = variable_get("miniorange_saml_default_relaystate", $Gx . "/" . current_path());
> if (!$xn) {
> goto z4;
> }
> if (!($xr && !user_is_logged_in() && !isset($_POST["pass"]))) {
> goto fa;
> }
> $aS = drupal_get_query_parameters();
> if (!(!$xZ || !isset($aS["saml_login"]) || $aS["saml_login"] != "false")) {
> goto j4;
> }
> saml_login($e1);
> j4:
> fa:
> $fB = '';
> if (!(($lZ == "user_login_block" || $lZ == "user_login") && !isset($_POST["pass"]))) {
> goto QP;
> }
> $aS = drupal_get_query_parameters();
> if (!$xZ) {
> goto Bd;
> }
> if (isset($aS["saml_login"])) {
> goto Iv;
> }
> if (!($vM && $lZ == "user_login" && strtolower($fB) != "false")) {
> goto K3;
> }
> saml_login($e1);
> K3:
> goto qc;
> Iv:
> $fB = $aS["saml_login"];
> qc:
> Bd:
> if (!($vM && $lZ == "user_login" && strtolower($fB) != "false")) {
> goto Cx;
> }
> saml_login($e1);
> Cx:
> $rX = db_query("SELECT * FROM {miniorange_saml_idp_list}");
> $zN = $rX->fetchAll();
> $Vk = count($zN);
> if (!isset($zN)) {
> goto em;
> }
> zb:
> if (!($Vk != 0)) {
> goto af;
> }
> foreach ($zN as $I0) {
> $yZ = $I0->mo_idp_name;
> $pq = $Gx . "/?q=samllogin&idpname=" . $yZ;
> $form["loginurl_"[$Vk]] = array(array("#markup" => "<a href="" . $pq . "">Login using " . $yZ . "</a><br>"));
> $Vk--;
> u7:
> }
> c0:
> goto zb;
> af:
> em:
> QP:
> z4:
> }
> function saml_login($e1 = '')
> {
> $J9 = drupal_get_query_parameters();
> $Gx = Utilities::miniorange_get_baseURL();
> $bK = isset($_GET["idpname"]) ? $_GET["idpname"] : '';
> if (!empty($bK)) {
> goto w9;
> }
> $bK = variable_get("miniorange_saml_default_idp_name", '');
> w9:
> $rX = db_query("SELECT * FROM {miniorange_saml_idp_list} WHERE mo_idp_name = '{$bK}'");
> $zN = $rX->fetchAssoc();
> if (!empty($zN)) {
> goto zq;
238,239c238,239
< echo "<div style="font-family:Calibri;padding:0 3%;">";
< echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>\xd
<div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>Identity Provider not configured.</p>
<p>Please contact your administrator and report the following error:</p>
<p><strong>Possible Cause: </strong>The value of IDP name is wrong.</p>\xd
</div>";
---
> echo "<div style="font-family:Calibri;padding:0 3%;">";
> echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>
\xa <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>Identity Provider not configured.</p>
\xa <p>Please contact your administrator and report the following error:</p>\xd
<p><strong>Possible Cause: </strong>The value of IDP name is wrong.</p>
</div>";
241,273c241,273
< uB:
< $zM = $IX["mo_idp_sso_url"];
< $NA = $yu . "/?q=samlassertion";
< $u1 = variable_get("miniorange_saml_entity_id", $yu);
< $gq = $IX["mo_idp_request_signed"];
< $uL = $IX["mo_idp_http_binding_sso"];
< $RE = $IX["mo_idp_nameid_format"];
< $uy = $IX["security_signature_algorithm"];
< $qG = isset($gh["destination"]) ? trim($gh["destination"], "'") : $qG;
< if (!empty($qG)) {
< goto tU;
< }
< $qG = variable_get("miniorange_saml_default_relaystate", '');
< tU:
< if (!empty($qG)) {
< goto wK;
< }
< $qG = $_SERVER["HTTP_REFERER"];
< wK:
< if (!empty($qG)) {
< goto hk;
< }
< $i_ = isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] === "on" ? "https" : "http";
< $xc = $i_ . "://{$_SERVER["HTTP_HOST"]}{$_SERVER["REQUEST_URI"]}";
< $qG = $xc;
< hk:
< if (!(empty($qG) || strpos($qG, "samllogin"))) {
< goto Uu;
< }
< $qG = $yu;
< Uu:
< $BS = new MiniOrangeAuthnRequest();
< $BS->initiateLogin($NA, $zM, $u1, $RE, $qG, $uL, $gq, $uy);
---
> zq:
> $Gr = $zN["mo_idp_sso_url"];
> $XZ = $Gx . "/?q=samlassertion";
> $jm = $Gx;
> $v9 = $zN["mo_idp_request_signed"];
> $Ms = $zN["mo_idp_http_binding_sso"];
> $VC = $zN["mo_idp_nameid_format"];
> $hH = $zN["security_signature_algorithm"];
> $e1 = isset($J9["destination"]) ? trim($J9["destination"], "'") : $e1;
> if (!empty($e1)) {
> goto qe;
> }
> $e1 = variable_get("miniorange_saml_default_relaystate", '');
> qe:
> if (!empty($e1)) {
> goto Xo;
> }
> $e1 = $_SERVER["HTTP_REFERER"];
> Xo:
> if (!empty($e1)) {
> goto t8;
> }
> $A0 = isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] === "on" ? "https" : "http";
> $Zj = $A0 . "://{$_SERVER["HTTP_HOST"]}{$_SERVER["REQUEST_URI"]}";
> $e1 = $Zj;
> t8:
> if (!(empty($e1) || strpos($e1, "samllogin"))) {
> goto xM;
> }
> $e1 = $Gx;
> xM:
> $lq = new MiniOrangeAuthnRequest();
> $lq->initiateLogin($XZ, $Gr, $jm, $VC, $e1, $Ms, $v9, $hH);
278,281c278,281
< $KT = variable_get("miniorange_saml_default_redirect_url_logout", '');
< $r6 = isset($_GET["q"]) ? $_GET["q"] : '';
< if (!(strpos($r6, "masquerade") === false)) {
< goto v6;
---
> $Gf = variable_get("miniorange_saml_default_redirect_url_logout", '');
> $N3 = isset($_GET["q"]) ? $_GET["q"] : '';
> if (!(strpos($N3, "masquerade") === false)) {
> goto tv;
283,284c283,284
< if (!(isset($KT) && !empty($KT))) {
< goto VL;
---
> if (!(isset($Gf) && !empty($Gf))) {
> goto Rc;
287,289c287,289
< drupal_goto($KT);
< VL:
< v6:
---
> drupal_goto($Gf);
> Rc:
> tv:
294c294
< drupal_goto($_REQUEST["RelayState"]);
---
> drupal_goto($_REQUEST["RelayState"]);
299,369c299,369
< $yu = Utilities::miniorange_get_baseURL();
< $cr = variable_get("miniorange_saml_sp_issuer", '');
< $cr = isset($cr) && !empty($cr) ? $cr : $yu;
< $H1 = variable_get("miniorange_saml_default_role", '');
< $rr = variable_get("miniorange_saml_login_by", 0);
< if ($rr == 1) {
< goto kQ;
< }
< $ym = variable_get("miniorange_saml_email_attribute", '');
< goto yQ;
< kQ:
< $ym = variable_get("miniorange_saml_username_attribute", '');
< yQ:
< if (isset($_GET["SAMLResponse"])) {
< goto y7;
< }
< $Ci = array();
< $az = variable_get("miniorange_saml_attr1_name", '');
< $Md = variable_get("miniorange_saml_idp_attr1_name", '');
< $a3 = variable_get("miniorange_saml_attr2_name", '');
< $Xo = variable_get("miniorange_saml_idp_attr2_name", '');
< $G7 = variable_get("miniorange_saml_attr3_name", '');
< $e6 = variable_get("miniorange_saml_idp_attr3_name", '');
< $NC = variable_get("miniorange_saml_attr4_name", '');
< $cg = variable_get("miniorange_saml_idp_attr4_name", '');
< $Tj = variable_get("miniorange_saml_attr5_name", '');
< $zl = variable_get("miniorange_saml_idp_attr5_name", '');
< $A4 = variable_get("miniorange_saml_sp_user_attributes", '');
< if (!(!empty($az) && !empty($Md))) {
< goto tr;
< }
< $Ci[$az] = $Md;
< tr:
< if (!(!empty($a3) && !empty($Xo))) {
< goto g3;
< }
< $Ci[$a3] = $Xo;
< g3:
< if (!(!empty($G7) && !empty($e6))) {
< goto wP;
< }
< $Ci[$G7] = $e6;
< wP:
< if (!(!empty($NC) && !empty($cg))) {
< goto oX;
< }
< $Ci[$NC] = $cg;
< oX:
< if (!(!empty($Tj) && !empty($zl))) {
< goto XN;
< }
< $Ci[$Tj] = $zl;
< XN:
< $iz = isset($A4) ? json_decode($A4, TRUE) : [];
< if (!is_array($iz)) {
< goto Pl;
< }
< foreach ($iz as $XC) {
< $H3 = $XC["attr_name"];
< $X3 = $XC["attr_value"];
< $Ci[$H3] = $X3;
< G6:
< }
< QF:
< Pl:
< $D9 = array();
< $D9 = !empty(variable_get("rolemap", '')) ? variable_get("rolemap", '') : NULL;
< $tr = new MiniOrangeAcs();
< $tP = variable_get("minorange_saml_customer_admin_fraud_check");
< $mz = variable_get("miniorange_saml_customer_admin_token");
< $Ea = variable_get("miniorange_saml_customer_admin_email");
---
> $Gx = Utilities::miniorange_get_baseURL();
> $g2 = variable_get("miniorange_saml_entity_id", '');
> $g2 = isset($g2) && !empty($g2) ? $g2 : $Gx;
> $at = variable_get("miniorange_saml_default_role", '');
> $Px = variable_get("miniorange_saml_login_by", 0);
> if ($Px == 1) {
> goto py;
> }
> $FL = variable_get("miniorange_saml_email_attribute", '');
> goto Kj;
> py:
> $FL = variable_get("miniorange_saml_username_attribute", '');
> Kj:
> if (isset($_GET["SAMLResponse"])) {
> goto D_;
> }
> $S_ = array();
> $LU = variable_get("miniorange_saml_attr1_name", '');
> $T2 = variable_get("miniorange_saml_idp_attr1_name", '');
> $jU = variable_get("miniorange_saml_attr2_name", '');
> $Rp = variable_get("miniorange_saml_idp_attr2_name", '');
> $TO = variable_get("miniorange_saml_attr3_name", '');
> $Va = variable_get("miniorange_saml_idp_attr3_name", '');
> $Yc = variable_get("miniorange_saml_attr4_name", '');
> $Kj = variable_get("miniorange_saml_idp_attr4_name", '');
> $gG = variable_get("miniorange_saml_attr5_name", '');
> $Q7 = variable_get("miniorange_saml_idp_attr5_name", '');
> $Fh = variable_get("miniorange_saml_sp_user_attributes", '');
> if (!(!empty($LU) && !empty($T2))) {
> goto Ma;
> }
> $S_[$LU] = $T2;
> Ma:
> if (!(!empty($jU) && !empty($Rp))) {
> goto Xe;
> }
> $S_[$jU] = $Rp;
> Xe:
> if (!(!empty($TO) && !empty($Va))) {
> goto I1;
> }
> $S_[$TO] = $Va;
> I1:
> if (!(!empty($Yc) && !empty($Kj))) {
> goto p1;
> }
> $S_[$Yc] = $Kj;
> p1:
> if (!(!empty($gG) && !empty($Q7))) {
> goto to;
> }
> $S_[$gG] = $Q7;
> to:
> $pZ = isset($Fh) ? json_decode($Fh, TRUE) : [];
> if (!is_array($pZ)) {
> goto kf;
> }
> foreach ($pZ as $t9) {
> $dN = $t9["attr_name"];
> $Nm = $t9["attr_value"];
> $S_[$dN] = $Nm;
> cy:
> }
> eN:
> kf:
> $su = array();
> $su = !empty(variable_get("rolemap", '')) ? variable_get("rolemap", '') : NULL;
> $HJ = new MiniOrangeAcs();
> $oM = variable_get("minorange_saml_customer_admin_fraud_check");
> $ZE = variable_get("miniorange_saml_customer_admin_token");
> $q1 = variable_get("miniorange_saml_customer_admin_email");
371,392c371,392
< global $UP;
< $ZX = $_SERVER["DOCUMENT_ROOT"] . $UP;
< $dU = trim($base_url, "/");
< if (preg_match("#^http(s)?://#", $dU)) {
< goto g9;
< }
< $dU = "http://" . $dU;
< g9:
< $FW = parse_url($dU);
< if (empty($FW)) {
< goto JD;
< }
< $Mz = isset($FW["path"]) ? $FW["path"] : '';
< $GH = preg_replace("/^www\./", '', $FW["host"] . $Mz);
< JD:
< $f5 = $ZX . $GH;
< $g6 = variable_get("miniorange_saml_license_key", NULL);
< if (($f5 == AESEncryption::decrypt_data($tP, $mz) || $f5 == AESEncryption::decrypt_data($tP, $mz, "AES-128-ECB")) && $Ea != null && $Ea != '' && $g6 != Null && $g6 != '') {
< goto Es;
< }
< if ($g6 != null && $g6 != '') {
< goto hK;
---
> global $pE;
> $DA = $_SERVER["DOCUMENT_ROOT"] . $pE;
> $EL = trim($base_url, "/");
> if (preg_match("#^http(s)?://#", $EL)) {
> goto rS;
> }
> $EL = "http://" . $EL;
> rS:
> $hN = parse_url($EL);
> if (empty($hN)) {
> goto QE;
> }
> $Sg = isset($hN["path"]) ? $hN["path"] : '';
> $as = preg_replace("/^www\./", '', $hN["host"] . $Sg);
> QE:
> $mN = $DA . $as;
> $xX = variable_get("miniorange_saml_license_key", NULL);
> if (($mN == AESEncryption::decrypt_data($oM, $ZE) || $mN == AESEncryption::decrypt_data($oM, $ZE, "AES-128-ECB")) && $q1 != null && $q1 != '' && $xX != Null && $xX != '') {
> goto ox;
> }
> if ($xX != null && $xX != '') {
> goto ke;
394,395c394,395
< if ($Ea != null && $Ea != '') {
< goto U0;
---
> if ($q1 != null && $q1 != '') {
> goto Gr;
397,398c397,398
< if (!($Ea == null || $Ea == '')) {
< goto Qi;
---
> if (!($q1 == null || $q1 == '')) {
> goto Jl;
400,401c400,401
< echo "<div style="font-family:Calibri;padding:0 3%;">";
< echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>
<div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>You are not logged in.</p>
<p>Please login first to activate single sign on.</p>
<p><strong>Possible Cause: </strong>Make sure you have logged in/ Register in to module.</p>
\xa </div>\xd\xa <div style="margin:3%;display:block;text-align:center;"></div>
\xa <div style="margin:3%;display:block;text-align:center;">\xd
<input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();">\xd
</div>";
---
> echo "<div style="font-family:Calibri;padding:0 3%;">";
> echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>
\xa <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>You are not logged in.</p>
<p>Please login first to activate single sign on.</p>\xd\xa <p><strong>Possible Cause: </strong>Make sure you have logged in/ Register in to module.</p>\xd\xa </div>
<div style="margin:3%;display:block;text-align:center;"></div>\xd
<div style="margin:3%;display:block;text-align:center;">\xd
<input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();">
\xa </div>";
403,407c403,407
< Qi:
< goto uP;
< U0:
< echo "<div style="font-family:Calibri;padding:0 3%;">";
< echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>
<div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>License key you have entered has already been used.</p>
\xa <p>Please enter a key which has not been used before on any other instance or if you have exausted all your keys then buy more license from Licensing.</p>\xd
</div>\xd\xa <div style="margin:3%;display:block;text-align:center;"></div>
\xa <div style="margin:3%;display:block;text-align:center;">
<input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();">
\xa </div>";
---
> Jl:
> goto ef;
> Gr:
> echo "<div style="font-family:Calibri;padding:0 3%;">";
> echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>\xd\xa <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>License key you have entered has already been used.</p>\xd
<p>Please enter a key which has not been used before on any other instance or if you have exausted all your keys then buy more license from Licensing.</p>
\xa </div>\xd\xa <div style="margin:3%;display:block;text-align:center;"></div>\xd
<div style="margin:3%;display:block;text-align:center;">\xd\xa <input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();">\xd\xa </div>";
409,413c409,413
< uP:
< goto gC;
< hK:
< echo "<div style="font-family:Calibri;padding:0 3%;">";
< echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>
\xa <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>License key you have not entered.</p>\xd
<p>Please enter a key which has not been used before on any other instance and activate the module.</p>
</div>\xd\xa <div style="margin:3%;display:block;text-align:center;"></div>
\xa <div style="margin:3%;display:block;text-align:center;">\xd\xa <input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();">\xd
</div>";
---
> ef:
> goto vO;
> ke:
> echo "<div style="font-family:Calibri;padding:0 3%;">";
> echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>\xd\xa <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>License key you have not entered.</p>
<p>Please enter a key which has not been used before on any other instance and activate the module.</p>\xd
</div>
\xa <div style="margin:3%;display:block;text-align:center;"></div>\xd\xa <div style="margin:3%;display:block;text-align:center;">\xd
<input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();">
\xa </div>";
415,425c415,425
< gC:
< goto R5;
< Es:
< $Dj = $tr->processSamlResponse($_POST, $yu, $cr, $ym, $Ci, $D9);
< R5:
< if (!($Dj["email"] == '' || !filter_var($Dj["email"], FILTER_VALIDATE_EMAIL))) {
< goto uJ;
< }
< echo "<div style="font-family:Calibri;padding:0 3%;">";
< echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>\xd\xa <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>User is restrictred to login.</p>\xd
<p>Please contact your administrator and report the following error:</p>
\xa <p><strong>Possible Cause: </strong> Error in reciving the email ID.</p>\xd\xa </div>
<div style="margin:3%;display:block;text-align:center;">";
< echo " <div style="margin:3%;display:block;text-align:center;"><a href=" ";
---
> vO:
> goto YB;
> ox:
> $yH = $HJ->processSamlResponse($_POST, $Gx, $g2, $FL, $S_, $su);
> YB:
> if (!($yH["email"] == '' || !filter_var($yH["email"], FILTER_VALIDATE_EMAIL))) {
> goto Lb;
> }
> echo "<div style="font-family:Calibri;padding:0 3%;">";
> echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>\xd
<div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>User is restrictred to login.</p>
<p>Please contact your administrator and report the following error:</p>
<p><strong>Possible Cause: </strong> Error in reciving the email ID.</p>\xd\xa </div>\xd
<div style="margin:3%;display:block;text-align:center;">";
> echo " <div style="margin:3%;display:block;text-align:center;"><a href=" ";
427c427
< echo " "><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"></a></div>\xd\xa ";
---
> echo " "><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"></a></div>
";
429,454c429,454
< uJ:
< if (variable_get("miniorange_saml_login_by") == 1) {
< goto So;
< }
< $z2 = user_load_by_mail($Dj["username"]);
< goto ia;
< So:
< $z2 = user_load_by_name($Dj["username"]);
< ia:
< if (!($z2 == NULL)) {
< goto J5;
< }
< $yJ = variable_get("miniorange_saml_disable_autocreate_users", FALSE);
< if ($yJ) {
< goto iw;
< }
< $Iz = user_password(8);
< $yq = array_search($H1, user_roles());
< $Xq[$yq] = $H1;
< $Kd = array("name" => $Dj["username"], "mail" => $Dj["email"], "pass" => $Iz, "status" => 1, "roles" => $Xq);
< $z2 = user_save(NULL, $Kd);
< goto oB;
< iw:
< echo "<div style="font-family:Calibri;padding:0 3%;">";
< echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>\xd
<div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>User is restrictred to login.</p>
<p>Please contact your administrator and report the following error:</p>
\xa <p><strong>Possible Cause: </strong> Non existing users are not allowed to login.</p>\xd
</div>\xd
<div style="margin:3%;display:block;text-align:center;">";
< echo " <div style="margin:3%;display:block;text-align:center;"><a href=" ";
---
> Lb:
> if (variable_get("miniorange_saml_login_by") == 1) {
> goto ti;
> }
> $Wo = user_load_by_mail($yH["username"]);
> goto Ud;
> ti:
> $Wo = user_load_by_name($yH["username"]);
> Ud:
> if (!($Wo == NULL)) {
> goto gF;
> }
> $Hv = variable_get("miniorange_saml_disable_autocreate_users", FALSE);
> if ($Hv) {
> goto PR;
> }
> $Jf = user_password(8);
> $uy = array_search($at, user_roles());
> $kI[$uy] = $at;
> $NE = array("name" => $yH["username"], "mail" => $yH["email"], "pass" => $Jf, "status" => 1, "roles" => $kI);
> $Wo = user_save(NULL, $NE);
> goto kx;
> PR:
> echo "<div style="font-family:Calibri;padding:0 3%;">";
> echo "<div style="color: #a94442;background-color: #f2dede;padding: 15px;margin-bottom: 20px;text-align:center;border:1px solid #E6B3B2;font-size:18pt;"> ERROR</div>
\xa <div style="color: #a94442;font-size:14pt; margin-bottom:20px;"><p><strong>Error: </strong>User is restrictred to login.</p>\xd
<p>Please contact your administrator and report the following error:</p>
<p><strong>Possible Cause: </strong> Non existing users are not allowed to login.</p>
</div>
\xa <div style="margin:3%;display:block;text-align:center;">";
> echo " <div style="margin:3%;display:block;text-align:center;"><a href=" ";
456c456
< echo " "><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"></a></div>\xd\xa ";
---
> echo " "><input style="padding:1%;width:100px;background: #0091CD none repeat scroll 0% 0%;cursor: pointer;font-size:15px;border-width: 1px;border-style: solid;border-radius: 3px;white-space: nowrap;box-sizing: border-box;border-color: #0073AA;box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset;color: #FFF;"type="button" value="Done" onClick="self.close();"></a></div>
";
458,462c458,462
< oB:
< J5:
< $y8 = $Dj["customFieldAttributes"];
< if (!(isset($y8) && !empty($y8))) {
< goto TR;
---
> kx:
> gF:
> $w4 = $yH["customFieldAttributes"];
> if (!(isset($w4) && !empty($w4))) {
> goto kT;
464,468c464,468
< foreach ($y8 as $mz => $rE) {
< $z2 = user_load($z2->uid);
< $z2->{$mz}["und"][0]["value"] = $rE;
< user_save($z2);
< a4:
---
> foreach ($w4 as $ZE => $ND) {
> $Wo = user_load($Wo->uid);
> $Wo->{$ZE}["und"][0]["value"] = $ND;
> user_save($Wo);
> Eh:
470,504c470,504
< JM:
< TR:
< $Nz = $Dj["customFieldRoles"];
< if (is_null($z2)) {
< goto u3;
< }
< $z2 = user_load($z2->uid);
< if (!variable_get("miniorange_saml_disable_role_update")) {
< goto MF;
< }
< $iM = $z2->{"roles"};
< foreach ($iM as $mz => $rE) {
< if (in_array($rE, $D9)) {
< goto yy;
< }
< $g7[$mz] = $rE;
< yy:
< Pz:
< }
< sV:
< MF:
< if (empty($Nz)) {
< goto aQ;
< }
< foreach ($Nz as $mz => $rE) {
< $g7[$mz] = $rE;
< $z2->{"roles"} = $g7;
< user_save($z2);
< O6:
< }
< uL:
< aQ:
< u3:
< if (flood_is_allowed($Dj["username"], 3600) && user_is_blocked($Dj["username"]) == FALSE) {
< goto kT;
---
> KM:
> kT:
> $lU = $yH["customFieldRoles"];
> if (is_null($Wo)) {
> goto iV;
> }
> $Wo = user_load($Wo->uid);
> if (!variable_get("miniorange_saml_disable_role_update")) {
> goto Yy;
> }
> $BM = $Wo->{"roles"};
> foreach ($BM as $ZE => $ND) {
> if (in_array($ND, $su)) {
> goto SA;
> }
> $G2[$ZE] = $ND;
> SA:
> jO:
> }
> n9:
> Yy:
> if (empty($lU)) {
> goto fS;
> }
> foreach ($lU as $ZE => $ND) {
> $G2[$ZE] = $ND;
> $Wo->{"roles"} = $G2;
> user_save($Wo);
> df:
> }
> aA:
> fS:
> iV:
> if (flood_is_allowed($yH["username"], 3600) && user_is_blocked($yH["username"]) == FALSE) {
> goto w7;
506,507c506,507
< flood_register_event($Dj, 3600);
< form_set_error("user_login_block", t("You are not allowed to login"));
---
> flood_register_event($yH, 3600);
> form_set_error("user_login_block", t("You are not allowed to login"));
509,572c509,572
< goto TV;
< kT:
< flood_clear_event($Dj["username"]);
< $user = user_load($z2->uid);
< $zN = array();
< $zN["name"] = $user->name;
< $yq = array_slice($z2->roles, 1);
< $mz = '';
< if (!isset($yq[0])) {
< goto Lm;
< }
< $mz = array_search($yq[0], user_roles());
< Lm:
< if (!(isset($mz) && !is_null($mz) && $mz != '')) {
< goto Q7;
< }
< $uh = variable_get(str_replace(" ", '', $z2->{"roles"}[$mz] . "_sin"), '');
< if (is_null($uh)) {
< goto FK;
< }
< $dK = variable_get(str_replace(" ", '', $z2->{"roles"}[$mz] . "_sin"), '');
< FK:
< Q7:
< $sW = variable_get("miniorange_saml_default_relaystate", '');
< if (isset($dK) && $dK != '') {
< goto Az;
< }
< if (isset($sW) && $sW != '') {
< goto pa;
< }
< if (isset($Dj["relay_state"]) && $Dj["relay_state"] != '') {
< goto Uq;
< }
< $zN["redirect"] = $yu;
< goto E0;
< Uq:
< $zN["redirect"] = $Dj["relay_state"];
< E0:
< goto UP;
< pa:
< $zN["redirect"] = $sW;
< UP:
< goto H8;
< Az:
< $zN["redirect"] = $dK;
< H8:
< $_SESSION["sessionIndex"] = $Dj["sessionIndex"];
< $_SESSION["NameID"] = $Dj["NameID"];
< $_SESSION["mo_saml"]["logged_in_with_idp"] = true;
< if (!(isset($mz) && !is_null($mz) && $mz != '')) {
< goto iD;
< }
< $Py = variable_get(str_replace(" ", '', $z2->{"roles"}[$mz] . "_sout"), '');
< if (is_null($Py)) {
< goto BH;
< }
< $_SESSION["logout"] = variable_get(str_replace(" ", '', $z2->{"roles"}[$mz] . "_sout"), '');
< BH:
< iD:
< user_login_finalize($zN);
< drupal_goto($zN["redirect"]);
< TV:
< goto ni;
< y7:
---
> goto iT;
> w7:
> flood_clear_event($yH["username"]);
> $user = user_load($Wo->uid);
> $p4 = array();
> $p4["name"] = $user->name;
> $uy = array_slice($Wo->roles, 1);
> $ZE = '';
> if (!isset($uy[0])) {
> goto c5;
> }
> $ZE = array_search($uy[0], user_roles());
> c5:
> if (!(isset($ZE) && !is_null($ZE) && $ZE != '')) {
> goto Va;
> }
> $tt = variable_get(str_replace(" ", '', $Wo->{"roles"}[$ZE] . "_sin"), '');
> if (is_null($tt)) {
> goto le;
> }
> $eq = variable_get(str_replace(" ", '', $Wo->{"roles"}[$ZE] . "_sin"), '');
> le:
> Va:
> $K_ = variable_get("miniorange_saml_default_relaystate", '');
> if (isset($eq) && $eq != '') {
> goto II;
> }
> if (isset($K_) && $K_ != '') {
> goto sQ;
> }
> if (isset($yH["relay_state"]) && $yH["relay_state"] != '') {
> goto Vi;
> }
> $p4["redirect"] = $Gx;
> goto Vp;
> Vi:
> $p4["redirect"] = $yH["relay_state"];
> Vp:
> goto bb;
> sQ:
> $p4["redirect"] = $K_;
> bb:
> goto MK;
> II:
> $p4["redirect"] = $eq;
> MK:
> $_SESSION["sessionIndex"] = $yH["sessionIndex"];
> $_SESSION["NameID"] = $yH["NameID"];
> $_SESSION["mo_saml"]["logged_in_with_idp"] = true;
> if (!(isset($ZE) && !is_null($ZE) && $ZE != '')) {
> goto E9;
> }
> $Z8 = variable_get(str_replace(" ", '', $Wo->{"roles"}[$ZE] . "_sout"), '');
> if (is_null($Z8)) {
> goto eO;
> }
> $_SESSION["logout"] = variable_get(str_replace(" ", '', $Wo->{"roles"}[$ZE] . "_sout"), '');
> eO:
> E9:
> user_login_finalize($p4);
> drupal_goto($p4["redirect"]);
> iT:
> goto cx;
> D_:
574,575c574,575
< drupal_goto($yu);
< ni:
---
> drupal_goto($Gx);
> cx:
579,608c579,608
< $qG = '';
< $Gt = variable_get("miniorange_saml_force_auth", FALSE);
< $kC = variable_get("miniorange_saml_enable_login", FALSE);
< $kp = variable_get("miniorange_saml_enable_backdoor", FALSE);
< if (!$kC) {
< goto nb;
< }
< if ($kp && isset($_GET["saml_login"]) && $_GET["saml_login"] == "false") {
< goto CE;
< }
< if (!($Gt && !user_is_logged_in() && !isset($_POST["SAMLResponse"]) && !isset($_POST["pass"]))) {
< goto yj;
< }
< if (!(strpos(request_uri(), "cron.php") == false)) {
< goto I2;
< }
< saml_login($qG);
< I2:
< yj:
< goto ys;
< CE:
< ys:
< if (!(variable_get("miniorange_saml_license_key", NULL) == NULL)) {
< goto NX;
< }
< variable_del("miniorange_saml_enable_login");
< variable_del("miniorange_saml_force_auth");
< variable_del("miniorange_saml_enable_backdoor");
< NX:
< nb:
---
> $e1 = '';
> $xr = variable_get("miniorange_saml_force_auth", FALSE);
> $xn = variable_get("miniorange_saml_enable_login", FALSE);
> $CD = variable_get("miniorange_saml_enable_backdoor", FALSE);
> if (!$xn) {
> goto cn;
> }
> if ($CD && isset($_GET["saml_login"]) && $_GET["saml_login"] == "false") {
> goto U3;
> }
> if (!($xr && !user_is_logged_in() && !isset($_POST["SAMLResponse"]) && !isset($_POST["pass"]))) {
> goto CB;
> }
> if (!(strpos(request_uri(), "cron.php") == false)) {
> goto UY;
> }
> saml_login($e1);
> UY:
> CB:
> goto qj;
> U3:
> qj:
> if (!(variable_get("miniorange_saml_license_key", NULL) == NULL)) {
> goto Ev;
> }
> variable_del("miniorange_saml_enable_login");
> variable_del("miniorange_saml_force_auth");
> variable_del("miniorange_saml_enable_backdoor");
> Ev:
> cn:
612,630c612,643
< $ZQ = db_query("SELECT * FROM {miniorange_saml_idp_list}");
< $IX = $ZQ->fetchAll();
< $Pj = -1;
< if (!isset($IX)) {
< goto df;
< }
< foreach ($IX as $c3) {
< $pO = $c3->miniorange_saml_fetch_metadata_time_intervals;
< $xc = $c3->miniorange_saml_meta_data_url;
< $PB = $c3->mo_idp_name;
< $Pj = $c3->id;
< if (!(($pO == 1 || $pO == true) && $xc != '')) {
< goto ed;
< }
< $u8 = array("ssl" => array("verify_peer" => false, "verify_peer_name" => false));
< $e3 = file_get_contents($xc, false, stream_context_create($u8));
< Utilities::upload_metadata($e3, $PB, $pO, $xc, true, $Pj);
< ed:
< MH:
---
> $rX = db_query("SELECT * FROM {miniorange_saml_idp_list}");
> $zN = $rX->fetchAll();
> $GX = -1;
> if (!isset($zN)) {
> goto xr;
> }
> foreach ($zN as $I0) {
> $tI = $I0->miniorange_saml_fetch_metadata_time_intervals;
> $Zj = $I0->miniorange_saml_meta_data_url;
> $yZ = $I0->mo_idp_name;
> $GX = $I0->id;
> if (!(($tI == 1 || $tI == true) && $Zj != '')) {
> goto xg;
> }
> $M0 = array("ssl" => array("verify_peer" => false, "verify_peer_name" => false));
> $d6 = file_get_contents($Zj, false, stream_context_create($M0));
> Utilities::upload_metadata($d6, $yZ, $tI, $Zj, true, $GX);
> xg:
> AI:
> }
> Ux:
> xr:
> }
> function miniorange_saml_seckit_options_alter(&$cj)
> {
> $Ho = variable_get("miniorange_saml_idp_login_url", '');
> $wp = parse_url($Ho, PHP_URL_HOST);
> $cj["seckit_csrf"]["origin_whitelist"][] = "https://" . $wp;
> $cj["seckit_csrf"]["origin_whitelist"][] = "https://" . $wp . "/";
> $RJ = parse_url($Ho, PHP_URL_PORT);
> if (is_null($RJ)) {
> goto TR;
632,649c645,649
< CZ:
< df:
< }
< function miniorange_saml_seckit_options_alter(&$s9)
< {
< $F0 = variable_get("miniorange_saml_idp_login_url", '');
< $bb = parse_url($F0, PHP_URL_HOST);
< $s9["seckit_csrf"]["origin_whitelist"][] = "https://" . $bb;
< $s9["seckit_csrf"]["origin_whitelist"][] = "https://" . $bb . "/";
< $Es = parse_url($F0, PHP_URL_PORT);
< if (is_null($Es)) {
< goto tD;
< }
< $bb = $bb . ":" . $Es;
< tD:
< $s9["seckit_csrf"]["origin_whitelist"][] = "https://" . $bb;
< $s9["socket_csrf"]["origin_whitelist"][] = "https://" . $bb . "/";
< $s9["seckit_csrf"]["origin_whitelist"][] = "null";
---
> $wp = $wp . ":" . $RJ;
> TR:
> $cj["seckit_csrf"]["origin_whitelist"][] = "https://" . $wp;
> $cj["socket_csrf"]["origin_whitelist"][] = "https://" . $wp . "/";
> $cj["seckit_csrf"]["origin_whitelist"][] = "null";
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/miniorange_saml_customer_setup.inc" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/miniorange_saml_customer_setup.inc"
7,27c7,27
< drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/bootstrap.min.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
< drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
< $yw = variable_get("miniorange_saml_status", '');
< if ($yw == "PLUGIN_CONFIGURATION" && variable_get("miniorange_saml_license_key", NULL) == NULL) {
< goto nF;
< }
< if ($yw == "VALIDATE_OTP") {
< goto WI;
< }
< if ($yw == "PLUGIN_CONFIGURATION") {
< goto sx;
< }
< goto kl;
< WI:
< $form["header_top_style_1"] = array("#markup" => "<div class="mo_saml_table_layout_1">");
< $form["header_top_style_2"] = array("#markup" => "<div class="mo_saml_table_layout mo_saml_container">");
< $form["miniorange_saml_customer_otp_token"] = array("#type" => "textfield", "#title" => t("OTP"), "#attributes" => array("style" => "width:55%"));
< $form["miniorange_saml_customer_validate_otp_button"] = array("#type" => "submit", "#value" => t("Validate OTP"), "#submit" => array("miniorange_saml_validate_otp_submit"));
< $form["miniorange_saml_customer_setup_resendotp"] = array("#type" => "submit", "#value" => t("Resend OTP"), "#submit" => array("miniorange_saml_resend_otp"));
< $form["miniorange_saml_customer_setup_back"] = array("#type" => "submit", "#value" => t("Back"), "#submit" => array("miniorange_saml_back"));
< $form["miniorange_saml_support_div_end"] = array("#markup" => "</div>");
---
> drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/bootstrap.min.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
> drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
> $VE = variable_get("miniorange_saml_status", '');
> if ($VE == "PLUGIN_CONFIGURATION" && variable_get("miniorange_saml_license_key", NULL) == NULL) {
> goto bv;
> }
> if ($VE == "VALIDATE_OTP") {
> goto gt;
> }
> if ($VE == "PLUGIN_CONFIGURATION") {
> goto w4;
> }
> goto Rz;
> gt:
> $form["header_top_style_1"] = array("#markup" => "<div class="mo_saml_table_layout_1">");
> $form["header_top_style_2"] = array("#markup" => "<div class="mo_saml_table_layout mo_saml_container">");
> $form["miniorange_saml_customer_otp_token"] = array("#type" => "textfield", "#title" => t("OTP"), "#attributes" => array("style" => "width:55%"));
> $form["miniorange_saml_customer_validate_otp_button"] = array("#type" => "submit", "#value" => t("Validate OTP"), "#submit" => array("miniorange_saml_validate_otp_submit"));
> $form["miniorange_saml_customer_setup_resendotp"] = array("#type" => "submit", "#value" => t("Resend OTP"), "#submit" => array("miniorange_saml_resend_otp"));
> $form["miniorange_saml_customer_setup_back"] = array("#type" => "submit", "#value" => t("Back"), "#submit" => array("miniorange_saml_back"));
> $form["miniorange_saml_support_div_end"] = array("#markup" => "</div>");
30,31c30,31
< goto kl;
< sx:
---
> goto Rz;
> w4:
33,78c33,78
< $form["header_top_style_2"] = array("#markup" => "<div class="mo_saml_table_layout_1">\xd\xa\x9 \x9 \x9\x9<div class="mo_saml_table_layout mo_saml_container">");
< $I9 = abs(floor((strtotime(variable_get("miniorange_saml_licenseExpiry", '')) - time()) / (3600 * 24)));
< if (strtotime(variable_get("miniorange_saml_licenseExpiry", '')) < time()) {
< goto ja;
< }
< if (strtotime(variable_get("miniorange_saml_licenseExpiry", '')) - 30 * 24 * 60 * 60 < time()) {
< goto mi;
< }
< $form["markup_top"] = array("#markup" => "<div class="mo_saml_welcome_message">Thank you for login with miniOrange</div><br/>" . "<h4>Your Profile: </h4>");
< goto tt;
< ja:
< $form["markup_top"] = array("#markup" => "<div class="mo_saml_license_expiry">Your maintenance support has expired " . $I9 . " days earlier, click on the Renew Maintenance link below to upgrade.</div><br/>" . "<h4>Your Profile: </h4>");
< goto tt;
< mi:
< $form["markup_top"] = array("#markup" => "<div class="mo_saml_license_expiry">Your maintenance support is going to expire in " . $I9 . " days, click on the Renew Maintenance link below to upgrade.</div><br/>" . "<h4>Your Profile: </h4>");
< tt:
< $sB = array(t("ATTRIBUTE NAME"), t("ATTRIBUTE VALUE"));
< $s9 = array();
< $ua = variable_get("miniorange_saml_customer_admin_email", '');
< $s9[0] = array("Customer Email" => "Customer Email", "email" => $ua);
< $s9[1] = array("Customer ID" => "Customer ID", "customerid" => variable_get("miniorange_saml_customer_id", ''));
< $s9[2] = array("License Type" => "License Type", "licenseType" => variable_get("miniorange_saml_licenseType", ''));
< $s9[3] = array("License Plan" => "License Plan", "licensePlan" => variable_get("miniorange_saml_licensePlan", ''));
< $s9[4] = array("PHP Version" => "PHP Version", "phpversion" => phpversion());
< $s9[5] = array("Drupal Core" => "Drupal Core", "drupalCore" => VERSION);
< $n8 = drupal_get_path("module", "miniorange_saml");
< if (strtotime(variable_get("miniorange_saml_licenseExpiry", '')) < time()) {
< goto Ck;
< }
< $s9[6] = array("Maintenance Expiry" => "Maintenance Expiry", "maintenance_expiry" => date("F j, Y, g:i a", strtotime(variable_get("miniorange_saml_licenseExpiry", ''))));
< goto LL;
< Ck:
< $s9[6] = array("Maintenance Expiry" => "Maintenance Expiry", "maintenance_expiry" => "<div style="color: red"><u style="cursor: pointer">" . date("F j, Y, g:i a", strtotime(variable_get("miniorange_saml_licenseExpiry", ''))) . "</u><sub><img style="width:15px; height:15px; padding:5px; margin-left:10px;color:red;" src="" . $base_url . "/" . $n8 . "/includes/images/warning.svg"></sub></div>");
< LL:
< $s9[7] = array("Support Expiry" => "Support Expiry", "support_expiry" => date("F j, Y, g:i a", strtotime(variable_get("miniorange_saml_supportExpiry", ''))));
< $O2 = "<a href="" . $base_url . "?q=moLicenseFetch">Fetch</a>";
< $s9[8] = array("Refetch License Details" => "Refetch License Details", "refetch_license_details" => $O2);
< if (!(strtotime(variable_get("miniorange_saml_licenseExpiry", '')) - 30 * 24 * 60 * 60 < time())) {
< goto Q1;
< }
< $s9[9] = array("Renew Maintenance" => "Renew Maintenance", "renew_maintenance" => "<a target="_blank" href="" . MiniorangeSAMLConstants::BASE_URL . "/moas/login?username=" . $ua . "&redirectUrl=" . MiniorangeSAMLConstants::BASE_URL . "/moas/admin/customer/licenserenewals?renewalrequest=" . MiniorangeSAMLConstants::LICENSE_TYPE . "">Renew Maintenance</a>");
< Q1:
< $form["fieldset"]["customerinfo"] = array("#theme" => "table", "#header" => $sB, "#rows" => $s9);
< $form["miniorange_saml_customer_Remove_Account_info"] = array("#markup" => "<br><h4>Remove Account:</h4>" . "<p>This section will help you to remove your current logged in account without losing your current configurations.</p>");
< $form["miniorange_saml_remove_account_button"] = array("#type" => "submit", "#value" => t("Remove Account"), "#submit" => array("miniorange_saml_remove_account"));
< $form["miniorange_saml_support_div_end"] = array("#markup" => "</div>");
---
> $form["header_top_style_2"] = array("#markup" => "<div class="mo_saml_table_layout_1">
\xa \x9 \x9\x9\x9 <div class="mo_saml_table_layout mo_saml_container">");
> $qG = abs(floor((strtotime(variable_get("miniorange_saml_licenseExpiry", '')) - time()) / (3600 * 24)));
> if (strtotime(variable_get("miniorange_saml_licenseExpiry", '')) < time()) {
> goto Cv;
> }
> if (strtotime(variable_get("miniorange_saml_licenseExpiry", '')) - 30 * 24 * 60 * 60 < time()) {
> goto Kw;
> }
> $form["markup_top"] = array("#markup" => "<div class="mo_saml_welcome_message">Thank you for login with miniOrange</div><br/>" . "<h4>Your Profile: </h4>");
> goto Mt;
> Cv:
> $form["markup_top"] = array("#markup" => "<div class="mo_saml_license_expiry">Your maintenance support has expired " . $qG . " days earlier, click on the Renew Maintenance link below to upgrade.</div><br/>" . "<h4>Your Profile: </h4>");
> goto Mt;
> Kw:
> $form["markup_top"] = array("#markup" => "<div class="mo_saml_license_expiry">Your maintenance support is going to expire in " . $qG . " days, click on the Renew Maintenance link below to upgrade.</div><br/>" . "<h4>Your Profile: </h4>");
> Mt:
> $Ch = array(t("ATTRIBUTE NAME"), t("ATTRIBUTE VALUE"));
> $cj = array();
> $BN = variable_get("miniorange_saml_customer_admin_email", '');
> $cj[0] = array("Customer Email" => "Customer Email", "email" => $BN);
> $cj[1] = array("Customer ID" => "Customer ID", "customerid" => variable_get("miniorange_saml_customer_id", ''));
> $cj[2] = array("License Type" => "License Type", "licenseType" => variable_get("miniorange_saml_licenseType", ''));
> $cj[3] = array("License Plan" => "License Plan", "licensePlan" => variable_get("miniorange_saml_licensePlan", ''));
> $cj[4] = array("PHP Version" => "PHP Version", "phpversion" => phpversion());
> $cj[5] = array("Drupal Core" => "Drupal Core", "drupalCore" => VERSION);
> $Ip = drupal_get_path("module", "miniorange_saml");
> if (strtotime(variable_get("miniorange_saml_licenseExpiry", '')) < time()) {
> goto Qi;
> }
> $cj[6] = array("Maintenance Expiry" => "Maintenance Expiry", "maintenance_expiry" => date("F j, Y, g:i a", strtotime(variable_get("miniorange_saml_licenseExpiry", ''))));
> goto wy;
> Qi:
> $cj[6] = array("Maintenance Expiry" => "Maintenance Expiry", "maintenance_expiry" => "<div style="color: red"><u style="cursor: pointer">" . date("F j, Y, g:i a", strtotime(variable_get("miniorange_saml_licenseExpiry", ''))) . "</u><sub><img style="width:15px; height:15px; padding:5px; margin-left:10px;color:red;" src="" . $base_url . "/" . $Ip . "/includes/images/warning.svg"></sub></div>");
> wy:
> $cj[7] = array("Support Expiry" => "Support Expiry", "support_expiry" => date("F j, Y, g:i a", strtotime(variable_get("miniorange_saml_supportExpiry", ''))));
> $Qv = "<a href="" . $base_url . "?q=moLicenseFetch">Fetch</a>";
> $cj[8] = array("Refetch License Details" => "Refetch License Details", "refetch_license_details" => $Qv);
> if (!(strtotime(variable_get("miniorange_saml_licenseExpiry", '')) - 30 * 24 * 60 * 60 < time())) {
> goto TQ;
> }
> $cj[9] = array("Renew Maintenance" => "Renew Maintenance", "renew_maintenance" => "<a target="_blank" href="" . MiniorangeSAMLConstants::BASE_URL . "/moas/login?username=" . $BN . "&redirectUrl=" . MiniorangeSAMLConstants::BASE_URL . "/moas/admin/customer/licenserenewals?renewalrequest=" . MiniorangeSAMLConstants::LICENSE_TYPE . "">Renew Maintenance</a>");
> TQ:
> $form["fieldset"]["customerinfo"] = array("#theme" => "table", "#header" => $Ch, "#rows" => $cj);
> $form["miniorange_saml_customer_Remove_Account_info"] = array("#markup" => "<br><h4>Remove Account:</h4>" . "<p>This section will help you to remove your current logged in account without losing your current configurations.</p>");
> $form["miniorange_saml_remove_account_button"] = array("#type" => "submit", "#value" => t("Remove Account"), "#submit" => array("miniorange_saml_remove_account"));
> $form["miniorange_saml_support_div_end"] = array("#markup" => "</div>");
81,88c81,88
< kl:
< goto EG;
< nF:
< $form["header_top_style_2"] = array("#markup" => "<div class="mo_saml_table_layout_1">\xd
\x9 \x9\x9 <div class="mo_saml_table_layout mo_saml_container">");
< $form["miniorange_saml_license_key"] = array("#type" => "textfield", "#title" => t("License Key"), "#attributes" => array("style" => "width:55%", "placeholder" => "Enter your license key to activate the module"));
< $form["miniorange_saml_customer_validate_license_button"] = array("#type" => "submit", "#value" => t("Activate License"), "#submit" => array("miniorange_saml_validate_license_submit"));
< $form["miniorange_saml_customer_setup_back"] = array("#type" => "submit", "#value" => t("Back"), "#submit" => array("miniorange_saml_back"));
< $form["miniorange_saml_support_div_end"] = array("#markup" => "</div>");
---
> Rz:
> goto kg;
> bv:
> $form["header_top_style_2"] = array("#markup" => "<div class="mo_saml_table_layout_1">
\x9 \x9\x9\x9\x9\x9<div class="mo_saml_table_layout mo_saml_container">");
> $form["miniorange_saml_license_key"] = array("#type" => "textfield", "#title" => t("License Key"), "#attributes" => array("style" => "width:55%", "placeholder" => "Enter your license key to activate the module"));
> $form["miniorange_saml_customer_validate_license_button"] = array("#type" => "submit", "#value" => t("Activate License"), "#submit" => array("miniorange_saml_validate_license_submit"));
> $form["miniorange_saml_customer_setup_back"] = array("#type" => "submit", "#value" => t("Back"), "#submit" => array("miniorange_saml_back"));
> $form["miniorange_saml_support_div_end"] = array("#markup" => "</div>");
91,100c91,100
< EG:
< $form["header_top_style_1"] = array("#markup" => "<div class="mo_saml_table_layout_1">");
< $form["markup_14"] = array("#markup" => "<div class="mo_saml_table_layout mo_saml_container"><h3>Register/Login with miniOrange</h3><hr><br/>");
< $form["markup_15"] = array("#markup" => "<div class="mo_saml_highlight_background_note_1">Just complete the short registration below to configure the SAML Module. Please enter a valid email id that you have access to. You will be able to move forward after verifying an OTP that we will send to this email.</div>");
< $form["miniorange_saml_customer_setup_username"] = array("#type" => "textfield", "#title" => t("Email<span class = "red_color_star">*</span>"), "#attributes" => array("style" => "width:61%"), "#required" => FALSE);
< $form["miniorange_saml_customer_setup_phone"] = array("#type" => "textfield", "#title" => t("Phone"), "#attributes" => array("style" => "width:61%"));
< $form["markup_16"] = array("#markup" => "<b>NOTE:</b> We will only call if you need support.");
< $form["miniorange_saml_customer_setup_password"] = array("#type" => "password_confirm", "#required" => FALSE);
< $form["miniorange_saml_customer_setup_button"] = array("#type" => "submit", "#value" => t("Register"), "#submit" => array("miniorange_saml_customer_setup_submit"), "#attributes" => array("style" => "background: #337ab7;color: #ffffff;text-shadow: 0 -1px 1px #337ab7, 1px 0 1px #337ab7, 0 1px 1px #337ab7, -1px 0 1px #337ab7;box-shadow: 0 1px 0 #337ab7;border-color: #337ab7 #337ab7 #337ab7;"));
< $form["miniorange_saml_support_div_end"] = array("#markup" => "</div>");
---
> kg:
> $form["header_top_style_1"] = array("#markup" => "<div class="mo_saml_table_layout_1">");
> $form["markup_14"] = array("#markup" => "<div class="mo_saml_table_layout mo_saml_container"><h3>Register/Login with miniOrange</h3><hr><br/>");
> $form["markup_15"] = array("#markup" => "<div class="mo_saml_highlight_background_note_1">Just complete the short registration below to configure the SAML Module. Please enter a valid email id that you have access to. You will be able to move forward after verifying an OTP that we will send to this email.</div>");
> $form["miniorange_saml_customer_setup_username"] = array("#type" => "textfield", "#title" => t("Email<span class = "red_color_star">*</span>"), "#attributes" => array("style" => "width:61%"), "#required" => FALSE);
> $form["miniorange_saml_customer_setup_phone"] = array("#type" => "textfield", "#title" => t("Phone"), "#attributes" => array("style" => "width:61%"));
> $form["markup_16"] = array("#markup" => "<b>NOTE:</b> We will only call if you need support.");
> $form["miniorange_saml_customer_setup_password"] = array("#type" => "password_confirm", "#required" => FALSE);
> $form["miniorange_saml_customer_setup_button"] = array("#type" => "submit", "#value" => t("Register"), "#submit" => array("miniorange_saml_customer_setup_submit"), "#attributes" => array("style" => "background: #337ab7;color: #ffffff;text-shadow: 0 -1px 1px #337ab7, 1px 0 1px #337ab7, 0 1px 1px #337ab7, -1px 0 1px #337ab7;box-shadow: 0 1px 0 #337ab7;border-color: #337ab7 #337ab7 #337ab7;"));
> $form["miniorange_saml_support_div_end"] = array("#markup" => "</div>");
106,139c106,139
< $y4 = $form["miniorange_saml_customer_otp_token"]["#value"];
< $Ea = variable_get("miniorange_saml_customer_admin_email", NULL);
< $cA = variable_get("miniorange_saml_customer_admin_phone", NULL);
< $sd = variable_get("miniorange_saml_tx_id", NULL);
< $D4 = new MiniorangeSAMLCustomer($Ea, $cA, NULL, $y4);
< $VA = $D4->validateOtp($sd) !== NULL ? json_decode($D4->validateOtp($sd)) : '';
< if (isset($VA->status) && $VA->status == "SUCCESS") {
< goto gT;
< }
< drupal_set_message(t("Error validating OTP"), "error");
< goto KA;
< gT:
< $yw = "PLUGIN_CONFIGURATION";
< variable_set("miniorange_saml_status", $yw);
< variable_del("miniorange_saml_tx_id");
< $wl = variable_get("miniorange_saml_customer_admin_password", '');
< $D4 = new MiniorangeSAMLCustomer($Ea, $cA, $wl, NULL);
< $oS = $D4->createCustomer() !== NULL ? json_decode($D4->createCustomer()) : '';
< if (isset($oS->status) && $oS->status == "SUCCESS") {
< goto j6;
< }
< drupal_set_message(t("Error creating customer"), "error");
< goto Ag;
< j6:
< $yw = "PLUGIN_CONFIGURATION";
< variable_set("miniorange_saml_status", $yw);
< variable_set("miniorange_saml_customer_admin_email", $Ea);
< variable_set("miniorange_saml_customer_admin_phone", $cA);
< variable_set("miniorange_saml_customer_admin_token", $oS->token);
< variable_set("miniorange_saml_customer_id", $oS->id);
< variable_set("miniorange_saml_customer_api_key", $oS->apiKey);
< drupal_set_message(t("Customer account created. Please verify your license key to activate module"));
< Ag:
< KA:
---
> $xg = $form["miniorange_saml_customer_otp_token"]["#value"];
> $q1 = variable_get("miniorange_saml_customer_admin_email", NULL);
> $PA = variable_get("miniorange_saml_customer_admin_phone", NULL);
> $qS = variable_get("miniorange_saml_tx_id", NULL);
> $xe = new MiniorangeSAMLCustomer($q1, $PA, NULL, $xg);
> $yw = $xe->validateOtp($qS) !== NULL ? json_decode($xe->validateOtp($qS)) : '';
> if (isset($yw->status) && $yw->status == "SUCCESS") {
> goto Kx;
> }
> drupal_set_message(t("Error validating OTP"), "error");
> goto Oe;
> Kx:
> $VE = "PLUGIN_CONFIGURATION";
> variable_set("miniorange_saml_status", $VE);
> variable_del("miniorange_saml_tx_id");
> $b3 = variable_get("miniorange_saml_customer_admin_password", '');
> $xe = new MiniorangeSAMLCustomer($q1, $PA, $b3, NULL);
> $yW = $xe->createCustomer() !== NULL ? json_decode($xe->createCustomer()) : '';
> if (isset($yW->status) && $yW->status == "SUCCESS") {
> goto uB;
> }
> drupal_set_message(t("Error creating customer"), "error");
> goto i7;
> uB:
> $VE = "PLUGIN_CONFIGURATION";
> variable_set("miniorange_saml_status", $VE);
> variable_set("miniorange_saml_customer_admin_email", $q1);
> variable_set("miniorange_saml_customer_admin_phone", $PA);
> variable_set("miniorange_saml_customer_admin_token", $yW->token);
> variable_set("miniorange_saml_customer_id", $yW->id);
> variable_set("miniorange_saml_customer_api_key", $yW->apiKey);
> drupal_set_message(t("Customer account created. Please verify your license key to activate module"));
> i7:
> Oe:
143,155c143,155
< variable_del("miniorange_saml_tx_id");
< $Ea = variable_get("miniorange_saml_customer_admin_email", NULL);
< $cA = variable_get("miniorange_saml_customer_admin_phone", NULL);
< $D4 = new MiniorangeSAMLCustomer($Ea, $cA, NULL, NULL);
< $sf = $D4->sendOtp() !== NULL ? json_decode($D4->sendOtp()) : '';
< if (!(isset($sf->status) && $sf->status == "SUCCESS")) {
< goto S9;
< }
< variable_set("miniorange_saml_tx_id", $sf->txId);
< $yw = "VALIDATE_OTP";
< variable_set("miniorange_saml_status", $yw);
< drupal_set_message(t("Verify email address by entering the passcode sent to @username", array("@username" => $Ea)));
< S9:
---
> variable_del("miniorange_saml_tx_id");
> $q1 = variable_get("miniorange_saml_customer_admin_email", NULL);
> $PA = variable_get("miniorange_saml_customer_admin_phone", NULL);
> $xe = new MiniorangeSAMLCustomer($q1, $PA, NULL, NULL);
> $Ag = $xe->sendOtp() !== NULL ? json_decode($xe->sendOtp()) : '';
> if (!(isset($Ag->status) && $Ag->status == "SUCCESS")) {
> goto JY;
> }
> variable_set("miniorange_saml_tx_id", $Ag->txId);
> $VE = "VALIDATE_OTP";
> variable_set("miniorange_saml_status", $VE);
> drupal_set_message(t("Verify email address by entering the passcode sent to @username", array("@username" => $q1)));
> JY:
159,170c159,170
< $Ea = $form["miniorange_saml_customer_setup_username"]["#value"];
< $cA = $form["miniorange_saml_customer_setup_phone"]["#value"];
< $wl = $form["miniorange_saml_customer_setup_password"]["#value"]["pass1"];
< if (empty($Ea) || empty($wl)) {
< goto q9;
< }
< if (!valid_email_address($Ea)) {
< goto EQ;
< }
< goto RU;
< q9:
< drupal_set_message(t("The <b><u>Email</u></b> and <b><u>Password</u></b> fields are required."), "error");
---
> $q1 = $form["miniorange_saml_customer_setup_username"]["#value"];
> $PA = $form["miniorange_saml_customer_setup_phone"]["#value"];
> $b3 = $form["miniorange_saml_customer_setup_password"]["#value"]["pass1"];
> if (empty($q1) || empty($b3)) {
> goto B7;
> }
> if (!valid_email_address($q1)) {
> goto Uk;
> }
> goto xq;
> B7:
> drupal_set_message(t("The <b><u>Email</u></b> and <b><u>Password</u></b> fields are required."), "error");
172,174c172,174
< goto RU;
< EQ:
< drupal_set_message(t("The email address <b><i>" . $Ea . "</i></b> is not valid."), "error");
---
> goto xq;
> Uk:
> drupal_set_message(t("The email address <b><i>" . $q1 . "</i></b> is not valid."), "error");
176,180c176,180
< RU:
< $D4 = new MiniorangeSAMLCustomer($Ea, $cA, $wl, NULL);
< $OC = $D4->checkCustomer() !== NULL ? json_decode($D4->checkCustomer()) : '';
< if (isset($OC->status) && $OC->status == "CUSTOMER_NOT_FOUND") {
< goto IH;
---
> xq:
> $xe = new MiniorangeSAMLCustomer($q1, $PA, $b3, NULL);
> $DZ = $xe->checkCustomer() !== NULL ? json_decode($xe->checkCustomer()) : '';
> if (isset($DZ->status) && $DZ->status == "CUSTOMER_NOT_FOUND") {
> goto OL;
182,183c182,183
< if ($OC->status == "CURL_ERROR") {
< goto YI;
---
> if ($DZ->status == "CURL_ERROR") {
> goto mo;
185c185
< $AH = $D4->getCustomerKeys() !== NULL ? json_decode($D4->getCustomerKeys()) : '';
---
> $mS = $xe->getCustomerKeys() !== NULL ? json_decode($xe->getCustomerKeys()) : '';
187c187
< goto sQ;
---
> goto OY;
189,218c189,218
< drupal_set_message(t("Invalid credentials"), "error");
< goto Wh;
< sQ:
< variable_set("miniorange_saml_customer_id", $AH->id);
< variable_set("miniorange_saml_customer_admin_token", $AH->token);
< variable_set("miniorange_saml_customer_admin_email", $Ea);
< variable_set("miniorange_saml_customer_admin_phone", $cA);
< variable_set("miniorange_saml_customer_api_key", $AH->apiKey);
< $yw = "PLUGIN_CONFIGURATION";
< variable_set("miniorange_saml_status", $yw);
< drupal_set_message(t("Successfully retrieved your account."));
< Wh:
< goto Jf;
< IH:
< variable_set("miniorange_saml_customer_admin_email", $Ea);
< variable_set("miniorange_saml_customer_admin_phone", $cA);
< variable_set("miniorange_saml_customer_admin_password", $wl);
< $sf = $D4->sendOtp() !== NULL ? json_decode($D4->sendOtp()) : '';
< if (!(isset($sf->status) && $sf->status == "SUCCESS")) {
< goto Me;
< }
< variable_set("miniorange_saml_tx_id", $sf->txId);
< $yw = "VALIDATE_OTP";
< variable_set("miniorange_saml_status", $yw);
< drupal_set_message(t("Verify email address by entering the passcode sent to @username", array("@username" => $Ea)));
< Me:
< goto Jf;
< YI:
< drupal_set_message(t("cURL is not enabled. Please enable cURL"), "error");
< Jf:
---
> drupal_set_message(t("Invalid credentials"), "error");
> goto R_;
> OY:
> variable_set("miniorange_saml_customer_id", $mS->id);
> variable_set("miniorange_saml_customer_admin_token", $mS->token);
> variable_set("miniorange_saml_customer_admin_email", $q1);
> variable_set("miniorange_saml_customer_admin_phone", $PA);
> variable_set("miniorange_saml_customer_api_key", $mS->apiKey);
> $VE = "PLUGIN_CONFIGURATION";
> variable_set("miniorange_saml_status", $VE);
> drupal_set_message(t("Successfully retrieved your account."));
> R_:
> goto EH;
> OL:
> variable_set("miniorange_saml_customer_admin_email", $q1);
> variable_set("miniorange_saml_customer_admin_phone", $PA);
> variable_set("miniorange_saml_customer_admin_password", $b3);
> $Ag = $xe->sendOtp() !== NULL ? json_decode($xe->sendOtp()) : '';
> if (!(isset($Ag->status) && $Ag->status == "SUCCESS")) {
> goto YZ;
> }
> variable_set("miniorange_saml_tx_id", $Ag->txId);
> $VE = "VALIDATE_OTP";
> variable_set("miniorange_saml_status", $VE);
> drupal_set_message(t("Verify email address by entering the passcode sent to @username", array("@username" => $q1)));
> YZ:
> goto EH;
> mo:
> drupal_set_message(t("cURL is not enabled. Please enable cURL"), "error");
> EH:
222,227c222,227
< $yw = "CUSTOMER_SETUP";
< variable_set("miniorange_saml_status", $yw);
< variable_del("miniorange_saml_customer_admin_email");
< variable_del("miniorange_saml_customer_admin_phone");
< variable_del("miniorange_saml_tx_id");
< drupal_set_message(t("Register/Login with your miniOrange Account"));
---
> $VE = "CUSTOMER_SETUP";
> variable_set("miniorange_saml_status", $VE);
> variable_del("miniorange_saml_customer_admin_email");
> variable_del("miniorange_saml_customer_admin_phone");
> variable_del("miniorange_saml_tx_id");
> drupal_set_message(t("Register/Login with your miniOrange Account"));
231,237c231,237
< $ZW = trim($form["miniorange_saml_license_key"]["#value"]);
< $Ea = variable_get("miniorange_saml_customer_admin_email", NULL);
< $cA = variable_get("miniorange_saml_customer_admin_phone", NULL);
< $ow = new MiniorangeSAMLCustomer($Ea, $cA, NULL, NULL);
< $fz = $ow->ccl() !== NULL ? json_decode($ow->ccl(), TRUE) : [];
< if (!(!isset($fz["status"]) || $fz["status"] != "SUCCESS" || $fz["licensePlan"] != MiniorangeSAMLConstants::PLAN_NAME)) {
< goto tW;
---
> $D3 = trim($form["miniorange_saml_license_key"]["#value"]);
> $q1 = variable_get("miniorange_saml_customer_admin_email", NULL);
> $PA = variable_get("miniorange_saml_customer_admin_phone", NULL);
> $aR = new MiniorangeSAMLCustomer($q1, $PA, NULL, NULL);
> $F4 = $aR->ccl() !== NULL ? json_decode($aR->ccl(), TRUE) : [];
> if (!(!isset($F4["status"]) || $F4["status"] != "SUCCESS" || $F4["licensePlan"] != MiniorangeSAMLConstants::PLAN_NAME)) {
> goto Sx;
239c239
< drupal_set_message(t("Invalid license! Please use a valid license to activate the module."), "error");
---
> drupal_set_message(t("Invalid license! Please use a valid license to activate the module."), "error");
241,271c241,271
< tW:
< $u4 = $ow->verifyLicense($ZW) !== NULL ? json_decode($ow->verifyLicense($ZW), TRUE) : [];
< if (strcasecmp($u4["status"], "SUCCESS") == 0) {
< goto qk;
< }
< if (strcasecmp($u4["status"], "FAILED") == 0) {
< goto dp;
< }
< drupal_set_message(t("An error occured while processing your request. Please Try again."), "error");
< goto uz;
< dp:
< if (strcasecmp($u4["message"], "Code has Expired") == 0) {
< goto K3;
< }
< drupal_set_message(t("You have entered an invalid license key. Please enter a valid license key."), "error");
< goto El;
< K3:
< drupal_set_message(t("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 exausted all your keys then buy more license from Licensing"), "error");
< El:
< uz:
< goto ga;
< qk:
< variable_set("miniorange_saml_licenseExpiry", $fz["licenseExpiry"]);
< variable_set("miniorange_saml_supportExpiry", $fz["supportExpiry"]);
< variable_set("miniorange_saml_licenseType", $fz["licenseType"]);
< variable_set("miniorange_saml_licensePlan", $fz["licensePlan"]);
< $mz = variable_get("miniorange_saml_customer_admin_token");
< variable_set("miniorange_saml_license_key", AESEncryption::encrypt_data($ZW, $mz));
< variable_set("t_site_status", AESEncryption::encrypt_data("false", $mz));
< variable_set("site_ck_l", AESEncryption::encrypt_data("true", $mz));
< drupal_set_message(t("Your license is verified. You can now setup the module."));
---
> Sx:
> $e_ = $aR->verifyLicense($D3) !== NULL ? json_decode($aR->verifyLicense($D3), TRUE) : [];
> if (strcasecmp($e_["status"], "SUCCESS") == 0) {
> goto GJ;
> }
> if (strcasecmp($e_["status"], "FAILED") == 0) {
> goto Wy;
> }
> drupal_set_message(t("An error occured while processing your request. Please Try again."), "error");
> goto Ze;
> Wy:
> if (strcasecmp($e_["message"], "Code has Expired") == 0) {
> goto IL;
> }
> drupal_set_message(t("You have entered an invalid license key. Please enter a valid license key."), "error");
> goto uM;
> IL:
> drupal_set_message(t("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 exausted all your keys then buy more license from Licensing"), "error");
> uM:
> Ze:
> goto Uc;
> GJ:
> variable_set("miniorange_saml_licenseExpiry", $F4["licenseExpiry"]);
> variable_set("miniorange_saml_supportExpiry", $F4["supportExpiry"]);
> variable_set("miniorange_saml_licenseType", $F4["licenseType"]);
> variable_set("miniorange_saml_licensePlan", $F4["licensePlan"]);
> $ZE = variable_get("miniorange_saml_customer_admin_token");
> variable_set("miniorange_saml_license_key", AESEncryption::encrypt_data($D3, $ZE));
> variable_set("t_site_status", AESEncryption::encrypt_data("false", $ZE));
> variable_set("site_ck_l", AESEncryption::encrypt_data("true", $ZE));
> drupal_set_message(t("Your license is verified. You can now setup the module."));
273,286c273,286
< global $UP;
< $AI = $_SERVER["DOCUMENT_ROOT"] . $UP;
< $dU = trim($base_url, "/");
< if (preg_match("#^http(s)?://#", $dU)) {
< goto ub;
< }
< $dU = "http://" . $dU;
< ub:
< $m2 = parse_url($dU);
< $m2["path"] = isset($m2["path"]) ? $m2["path"] : '';
< $qf = preg_replace("/^www\./", '', $m2["host"] . $m2["path"]);
< $tP = $AI . $qf;
< variable_set("minorange_saml_customer_admin_fraud_check", AESEncryption::encrypt_data($tP, $mz));
< ga:
---
> global $pE;
> $TW = $_SERVER["DOCUMENT_ROOT"] . $pE;
> $EL = trim($base_url, "/");
> if (preg_match("#^http(s)?://#", $EL)) {
> goto dJ;
> }
> $EL = "http://" . $EL;
> dJ:
> $ky = parse_url($EL);
> $ky["path"] = isset($ky["path"]) ? $ky["path"] : '';
> $xy = preg_replace("/^www\./", '', $ky["host"] . $ky["path"]);
> $oM = $TW . $xy;
> variable_set("minorange_saml_customer_admin_fraud_check", AESEncryption::encrypt_data($oM, $ZE));
> Uc:
290,293c290,293
< $hE = $form["miniorange_saml_email_address_support"]["#value"];
< $cA = $form["miniorange_saml_phone_number_support"]["#value"];
< $v5 = $form["miniorange_saml_support_query_support"]["#value"];
< Utilities::send_query($hE, $cA, $v5);
---
> $fa = $form["miniorange_saml_email_address_support"]["#value"];
> $PA = $form["miniorange_saml_phone_number_support"]["#value"];
> $Mp = $form["miniorange_saml_support_query_support"]["#value"];
> Utilities::send_query($fa, $PA, $Mp);
297,298c297,298
< if (isset($_POST["value_check"]) && $_POST["value_check"] == "True") {
< goto NH;
---
> if (isset($_POST["value_check"]) && $_POST["value_check"] == "True") {
> goto zK;
300,314c300,314
< $H0 = array();
< $H0 = $_POST;
< $GL = $_POST["form_id"];
< $rF = $_POST["form_token"];
< $b2 = $_POST["op"];
< $hs = $_POST["form_build_id"];
< echo "
<html>
\xa <head>\xd\xa <title>Confirmation</title>\xd
<link href="https://fonts.googleapis.com/css?family=PT+Serif" rel="stylesheet">\xd
</head>
\xa <body style="font-family: 'PT Serif', serif;">
\xa <div style="margin: 15% auto; height:35%; width: 40%; background-color: #eaebed; text-align: center; box-shadow: 10px 5px 5px darkgray; border-radius: 2%;">
<div style="color: #a94442; background-color:#f2dede; padding: 15px; margin-bottom: 20px; text-align:center; border:1px solid #E6B3B2; font-size:16pt; border-radius: 2%;">\xd\xa <strong>Are you sure you want to remove account..!!</strong>
</div>\xd
<p style="font-size:14px; margin-left: 8%; margin-right: 8%"><strong>Warning </strong>: If you remove your account, you will have to enter licence Key Again after login/sign in with the new account.</p>\xd\xa <br/>\xd
<form name="f" method="post" action="" id="mo_remove_account">
\xa <div>\xd
<input type="hidden" name="op" value=";
< echo $b2;
< echo ">\xd
<input type="hidden" name="form_build_id" value= ";
< echo $hs;
< echo ">
<input type="hidden" name="form_token" value=";
< echo $rF;
< echo ">
<input type="hidden" name="form_id" value= ";
< echo $GL;
< echo ">\xd\xa <input type="hidden" name="value_check" value= 'True'>
\xa </div>\xd\xa <div style="margin: auto; text-align: center;" class="mo2f_modal-footer">
\xa <input type="submit" style=" padding:1%; width:100px; background: #0091CD none repeat scroll 0% 0%; cursor: pointer; font-size:15px; border-width: 1px; border-style: solid; border-radius: 3px; white-space: nowrap; box-sizing: border-box;border-color: #0073AA; box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset; color: #FFF;" name="miniorange_confirm_submit" class="button button-danger button-large" value="Confirm"/>\xd\xa </div>
</form>
</div>\xd
</body>
\xa </html>
\xa ";
---
> $UO = array();
> $UO = $_POST;
> $lZ = $_POST["form_id"];
> $GO = $_POST["form_token"];
> $Wl = $_POST["op"];
> $JJ = $_POST["form_build_id"];
> echo "
<html>
\xa <head>\xd\xa <title>Confirmation</title>
\xa <link href="https://fonts.googleapis.com/css?family=PT+Serif" rel="stylesheet">
\xa </head>
\xa
\xa <body style="font-family: 'PT Serif', serif;">\xd
<div style="margin: 15% auto; height:35%; width: 40%; background-color: #eaebed; text-align: center; box-shadow: 10px 5px 5px darkgray; border-radius: 2%;">
\xa <div style="color: #a94442; background-color:#f2dede; padding: 15px; margin-bottom: 20px; text-align:center; border:1px solid #E6B3B2; font-size:16pt; border-radius: 2%;">
<strong>Are you sure you want to remove account..!!</strong>
</div>\xd
<p style="font-size:14px; margin-left: 8%; margin-right: 8%"><strong>Warning </strong>: If you remove your account, you will have to enter licence Key Again after login/sign in with the new account.</p>\xd
<br/>
<form name="f" method="post" action="" id="mo_remove_account">
<div>\xd\xa <input type="hidden" name="op" value=";
> echo $Wl;
> echo ">\xd\xa <input type="hidden" name="form_build_id" value= ";
> echo $JJ;
> echo ">\xd
<input type="hidden" name="form_token" value=";
> echo $GO;
> echo ">
<input type="hidden" name="form_id" value= ";
> echo $lZ;
> echo ">
<input type="hidden" name="value_check" value= 'True'>\xd
</div>
\xa <div style="margin: auto; text-align: center;" class="mo2f_modal-footer">
\xa <input type="submit" style=" padding:1%; width:100px; background: #0091CD none repeat scroll 0% 0%; cursor: pointer; font-size:15px; border-width: 1px; border-style: solid; border-radius: 3px; white-space: nowrap; box-sizing: border-box;border-color: #0073AA; box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.6) inset; color: #FFF;" name="miniorange_confirm_submit" class="button button-danger button-large" value="Confirm"/>
\xa </div>\xd
</form>
</div>\xd
</body>
</html>\xd
";
316,340c316,340
< goto dN;
< NH:
< if (!(variable_get("miniorange_saml_license_key", NULL) != NULL)) {
< goto Fh;
< }
< $Ea = variable_get("miniorange_saml_customer_admin_email", NULL);
< $cA = variable_get("miniorange_saml_customer_admin_phone", NULL);
< $ow = new MiniorangeSAMLCustomer($Ea, $cA, NULL, NULL);
< $Dj = $ow->updateStatus() !== NULL ? json_decode($ow->updateStatus()) : '';
< if (!(isset($Dj->status) && $Dj->status == "SUCCESS")) {
< goto s8;
< }
< variable_del("miniorange_saml_license_key");
< variable_del("miniorange_saml_customer_admin_email");
< variable_del("miniorange_saml_customer_admin_phone");
< variable_del("miniorange_saml_customer_api_key");
< variable_del("miniorange_saml_customer_admin_token");
< variable_del("miniorange_saml_customer_setup_password[pass1]");
< variable_del("miniorange_saml_customer_setup_password[pass2]");
< variable_set("miniorange_saml_status", "CUSTOMER_SETUP");
< drupal_set_message(t("Your Account Has Been Removed Successfully!"), "status");
< $_POST["value_check"] = "False";
< s8:
< Fh:
< dN:
---
> goto mc;
> zK:
> if (!(variable_get("miniorange_saml_license_key", NULL) != NULL)) {
> goto AG;
> }
> $q1 = variable_get("miniorange_saml_customer_admin_email", NULL);
> $PA = variable_get("miniorange_saml_customer_admin_phone", NULL);
> $aR = new MiniorangeSAMLCustomer($q1, $PA, NULL, NULL);
> $yH = $aR->updateStatus() !== NULL ? json_decode($aR->updateStatus()) : '';
> if (!(isset($yH->status) && $yH->status == "SUCCESS")) {
> goto qC;
> }
> variable_del("miniorange_saml_license_key");
> variable_del("miniorange_saml_customer_admin_email");
> variable_del("miniorange_saml_customer_admin_phone");
> variable_del("miniorange_saml_customer_api_key");
> variable_del("miniorange_saml_customer_admin_token");
> variable_del("miniorange_saml_customer_setup_password[pass1]");
> variable_del("miniorange_saml_customer_setup_password[pass2]");
> variable_set("miniorange_saml_status", "CUSTOMER_SETUP");
> drupal_set_message(t("Your Account Has Been Removed Successfully!"), "status");
> $_POST["value_check"] = "False";
> qC:
> AG:
> mc:
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/miniorange_saml_export_config.inc" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/miniorange_saml_export_config.inc"
4,6c4,6
< echo "
";
< include "includes\miniorange_saml_enum.php";
< define("Tab_Class_Names", serialize(array("Service_Providers" => "mo_options_enum_service_provider", "Mapping" => "mo_options_enum_mapping", "Sign_In_Settings" => "mo_options_enum_sign_in_settings", "Custom_Certificate" => "mo_options_enum_custom_certificate")));
---
> echo "
\xa";
> include "includes\miniorange_saml_enum.php";
> define("Tab_Class_Names", serialize(array("Service_Providers" => "mo_options_enum_service_provider", "Mapping" => "mo_options_enum_mapping", "Sign_In_Settings" => "mo_options_enum_sign_in_settings", "Custom_Certificate" => "mo_options_enum_custom_certificate")));
10,16c10,16
< drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/bootstrap.min.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
< drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
< $ww = Utilities::isCustomerRegistered($form, $form_state);
< $form["header_top_style_2"] = array("#markup" => "<div class="mo_saml_table_layout_1">
\xa <div class="mo_saml_table_layout mo_saml_container">");
< $form["markup_top"] = array("#markup" => "<h3>Export Configuration</h3>" . "<hr/>");
< $form["markup_top_head"] = array("#markup" => "<p>This tab will help you to transfer your module configurations when you change your Drupal instance.</p>" . "<p>Download module configuration file by clicking on the button given below and send us this file along with your support query. </p>");
< $q9 = Utilities::miniorange_get_baseURL();
---
> drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/bootstrap.min.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
> drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
> $Ih = Utilities::isCustomerRegistered($form, $form_state);
> $form["header_top_style_2"] = array("#markup" => "<div class="mo_saml_table_layout_1">
\xa <div class="mo_saml_table_layout mo_saml_container">");
> $form["markup_top"] = array("#markup" => "<h3>Export Configuration</h3>" . "<hr/>");
> $form["markup_top_head"] = array("#markup" => "<p>This tab will help you to transfer your module configurations when you change your Drupal instance.</p>" . "<p>Download module configuration file by clicking on the button given below and send us this file along with your support query. </p>");
> $gu = Utilities::miniorange_get_baseURL();
18c18
< goto dt;
---
> goto DS;
20,28c20,28
< $form["miniorange_saml_idp_export"] = array("#markup" => "<div style="display:block; margin-top:10px; color:red; background-color:rgba(251, 232, 0, 0.15); font-size: medium;padding:5px;border:solid 1px rgba(255, 0, 9, 0.36);">\xd\xa Please <a href="" . $q9 . "/admin/config/people/miniorange_saml/sp_setup">configure the module</a> first to export the configurations.
</div>");
< goto gA;
< dt:
< $form["miniorange_saml_idp_export"] = array("#type" => "submit", "#value" => t("Download Configuration"), "#prefix" => "<td>", "#suffix" => "</td>", "#submit" => array("miniorange_export"));
< gA:
< $form["markup_import"] = array("#markup" => "<br/><br/>" . "<h3>Import Configuration</h3>" . "<hr/>" . "<p>This tab will help you to<span style="font-weight: bold"> Import your module configurations</span> when you change your Drupal instance.</p>" . "<p>choose <b>"json"</b> Extened module configuration file and upload by clicking on the button given below. </p>");
< $form["import_Config_file"] = array("#type" => "file");
< $form["miniorange_saml_idp_import"] = array("#type" => "submit", "#value" => t("Upload"), "#submit" => array("miniorange_import_Config"), "#disabled" => $ww);
< $form["miniorange_saml_support_div_end"] = array("#markup" => "</div>");
---
> $form["miniorange_saml_idp_export"] = array("#markup" => "<div style="display:block; margin-top:10px; color:red; background-color:rgba(251, 232, 0, 0.15); font-size: medium;padding:5px;border:solid 1px rgba(255, 0, 9, 0.36);">\xd\xa Please <a href="" . $gu . "/admin/config/people/miniorange_saml/sp_setup">configure the module</a> first to export the configurations.\xd
</div>");
> goto gH;
> DS:
> $form["miniorange_saml_idp_export"] = array("#type" => "submit", "#value" => t("Download Configuration"), "#prefix" => "<td>", "#suffix" => "</td>", "#submit" => array("miniorange_export"));
> gH:
> $form["markup_import"] = array("#markup" => "<br/><br/>" . "<h3>Import Configuration</h3>" . "<hr/>" . "<p>This tab will help you to<span style="font-weight: bold"> Import your module configurations</span> when you change your Drupal instance.</p>" . "<p>choose <b>"json"</b> Extened module configuration file and upload by clicking on the button given below. </p>");
> $form["import_Config_file"] = array("#type" => "file");
> $form["miniorange_saml_idp_import"] = array("#type" => "submit", "#value" => t("Upload"), "#submit" => array("miniorange_import_Config"), "#disabled" => $Ih);
> $form["miniorange_saml_support_div_end"] = array("#markup" => "</div>");
34,42c34,42
< $ij = unserialize(Tab_Class_Names);
< $D8 = array();
< $D8["Version_dependencies"] = mo_get_version_informations();
< $D8["Service_Providers"] = getSPList();
< $D8["Mapping"] = mo_get_configuration_array("mo_options_enum_mapping");
< $D8["Sign_In_Settings"] = mo_get_configuration_array("mo_options_enum_sign_in_settings");
< $D8["Custom_Certificate"] = mo_get_configuration_array("mo_options_enum_custom_certificate");
< header("Content-Disposition: attachment; filename=miniorange-saml-config.json");
< echo json_encode($D8, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
---
> $mt = unserialize(Tab_Class_Names);
> $hX = array();
> $hX["Version_dependencies"] = mo_get_version_informations();
> $hX["Service_Providers"] = getSPList();
> $hX["Mapping"] = mo_get_configuration_array("mo_options_enum_mapping");
> $hX["Sign_In_Settings"] = mo_get_configuration_array("mo_options_enum_sign_in_settings");
> $hX["Custom_Certificate"] = mo_get_configuration_array("mo_options_enum_custom_certificate");
> header("Content-Disposition: attachment; filename=miniorange-saml-config.json");
> echo json_encode($hX, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
47,86c47,86
< $ZQ = db_query("SELECT * FROM {miniorange_saml_idp_list}");
< $IX = $ZQ->fetchAll();
< return $IX;
< }
< function mo_get_configuration_array($x7)
< {
< $JB = array();
< if ($x7 == "mo_options_enum_mapping") {
< goto EF;
< }
< $W5 = call_user_func($x7 . "::getConstants");
< foreach ($W5 as $mz => $rE) {
< $R6 = variable_get($rE);
< if (!$R6) {
< goto YS;
< }
< if (!(@unserialize($R6) !== false)) {
< goto Rg;
< }
< $R6 = unserialize($R6);
< Rg:
< $JB[$mz] = $R6;
< YS:
< md:
< }
< iN:
< goto sy;
< EF:
< $Rf = mo_get_role_mapping();
< foreach ($Rf as $mz => $rE) {
< if (empty(variable_get($rE, NULL))) {
< goto pG;
< }
< $JB[$mz] = variable_get($rE, NULL);
< pG:
< pD:
< }
< m2:
< sy:
< return $JB;
---
> $rX = db_query("SELECT * FROM {miniorange_saml_idp_list}");
> $zN = $rX->fetchAll();
> return $zN;
> }
> function mo_get_configuration_array($FF)
> {
> $Pn = array();
> if ($FF == "mo_options_enum_mapping") {
> goto Fj;
> }
> $qx = call_user_func($FF . "::getConstants");
> foreach ($qx as $ZE => $ND) {
> $Gl = variable_get($ND);
> if (!$Gl) {
> goto pt;
> }
> if (!(@unserialize($Gl) !== false)) {
> goto OH;
> }
> $Gl = unserialize($Gl);
> OH:
> $Pn[$ZE] = $Gl;
> pt:
> bl:
> }
> QL:
> goto wO;
> Fj:
> $vs = mo_get_role_mapping();
> foreach ($vs as $ZE => $ND) {
> if (empty(variable_get($ND, NULL))) {
> goto Gw;
> }
> $Pn[$ZE] = variable_get($ND, NULL);
> Gw:
> kb:
> }
> mm:
> wO:
> return $Pn;
90,91c90,91
< if (!empty($_FILES["files"]["tmp_name"]["import_Config_file"])) {
< goto Xx;
---
> if (!empty($_FILES["files"]["tmp_name"]["import_Config_file"])) {
> goto Ct;
93,270c93,270
< drupal_set_message(t("<b style="color: red">Please select file first to upload Configuration!</b>"), "error");
< goto Ln;
< Xx:
< $e3 = $_FILES["files"]["name"]["import_Config_file"];
< list($nq, $lI) = explode(".", $e3);
< if ($lI == "json") {
< goto yv;
< }
< drupal_set_message(t("<b style="color: red">File type is not compatible</b> <br> Please Select <b style="color: red">".json"</b> extended file to upload Configuration!"), "error");
< goto vb;
< yv:
< $e3 = @file_get_contents($_FILES["files"]["tmp_name"]["import_Config_file"]);
< $D8 = isset($e3) ? json_decode($e3, TRUE) : [];
< mo_update_configuration_array($D8);
< vb:
< Ln:
< }
< function mo_update_configuration_array($D8)
< {
< $ij = unserialize(Tab_Class_Names);
< foreach ($ij as $DP => $x7) {
< if ($DP == "Service_Providers") {
< goto uN;
< }
< if ($DP == "Mapping") {
< goto OC;
< }
< foreach ($D8[$DP] as $mz => $rE) {
< $qx = constant("{$x7}::{$mz}");
< if (!$qx) {
< goto Lq;
< }
< variable_set($qx, $rE);
< Lq:
< Ei:
< }
< gO:
< goto lw;
< uN:
< $Pe = count($D8[$DP]);
< $ow = new MiniorangeSAMLCustomer(NULL, NULL, NULL, NULL);
< $u4 = $ow->ccl() !== NULL ? json_decode($ow->ccl(), TRUE) : [];
< $SY = isset($u4["noOfSP"]) && $u4["noOfSP"] != "0" ? $u4["noOfSP"] : 1;
< $Pe = $SY < $Pe ? $SY : $Pe;
< $zR = 0;
< sT:
< if (!($zR < $Pe)) {
< goto ST;
< }
< $Zp = '';
< $Qf = '';
< $Y1 = '';
< $Yx = '';
< $ZM = '';
< $gf = '';
< $iD = '';
< $GE = '';
< $Dt = '';
< $Mw = '';
< $SQ = '';
< $AT = '';
< foreach ($D8[$DP][$zR] as $mz => $rE) {
< if ($mz == "mo_idp_name") {
< goto T0;
< }
< if ($mz == "mo_idp_issuer") {
< goto YL;
< }
< if ($mz == "mo_idp_request_signed") {
< goto Y8;
< }
< if ($mz == "mo_idp_nameid_format") {
< goto r2;
< }
< if ($mz == "mo_idp_http_binding_sso") {
< goto c7;
< }
< if ($mz == "mo_idp_sso_url") {
< goto up;
< }
< if ($mz == "mo_idp_http_binding_slo") {
< goto xV;
< }
< if ($mz == "miniorange_saml_fetch_metadata_time_intervals") {
< goto Tv;
< }
< if ($mz == "mo_idp_slo_url") {
< goto WN;
< }
< if ($mz == "mo_idp_cert") {
< goto Zg;
< }
< if ($mz == "miniorange_saml_meta_data_url") {
< goto rQ;
< }
< if ($mz = "security_signature_algorithm") {
< goto Dv;
< }
< goto lN;
< T0:
< $Zp = $rE;
< goto lN;
< YL:
< $Qf = $rE;
< goto lN;
< Y8:
< $Y1 = $rE;
< goto lN;
< r2:
< $Yx = $rE;
< goto lN;
< c7:
< $ZM = $rE;
< goto lN;
< up:
< $gf = $rE;
< goto lN;
< xV:
< $iD = $rE;
< goto lN;
< Tv:
< $GE = $rE;
< goto lN;
< WN:
< $Dt = $rE;
< goto lN;
< Zg:
< $Mw = $rE;
< goto lN;
< rQ:
< $SQ = $rE;
< goto lN;
< Dv:
< $AT = $rE;
< lN:
< bW:
< }
< cl:
< $ZQ = db_query("SELECT * FROM {miniorange_saml_idp_list}");
< $IX = $ZQ->fetchAll();
< $Pj = -1;
< foreach ($IX as $c3) {
< if (!($c3->mo_idp_issuer == $Qf || $c3->mo_idp_sso_url == $gf)) {
< goto yJ;
< }
< $Pj = $c3->id;
< yJ:
< bM:
< }
< HF:
< if ($Pj == -1) {
< goto F_;
< }
< Utilities::Database_update($Zp, $Qf, $gf, $Mw, $Yx, $Y1, $ZM, $iD, $Dt, $GE, $SQ, $Pj, $AT);
< goto eA;
< F_:
< Utilities::Database_insert($Zp, $Qf, $gf, $Mw, $Yx, $Y1, $ZM, $iD, $Dt, $GE, $SQ, $AT);
< eA:
< Kg:
< $zR++;
< goto sT;
< ST:
< goto lw;
< OC:
< $Rf = mo_get_role_mapping();
< foreach ($D8[$DP] as $mz => $rE) {
< variable_set($Rf[$mz], $rE);
< Nn:
< }
< IZ:
< lw:
< HY:
< }
< dV:
< $eV = "CONFIGURATION_SAVED";
< variable_set("miniorange_config_status", $eV);
< $q9 = Utilities::miniorange_get_baseURL();
< drupal_goto($q9 . "/admin/config/people/miniorange_saml/sp_setup");
---
> drupal_set_message(t("<b style="color: red">Please select file first to upload Configuration!</b>"), "error");
> goto q5;
> Ct:
> $d6 = $_FILES["files"]["name"]["import_Config_file"];
> list($Te, $iC) = explode(".", $d6);
> if ($iC == "json") {
> goto Ji;
> }
> drupal_set_message(t("<b style="color: red">File type is not compatible</b> <br> Please Select <b style="color: red">".json"</b> extended file to upload Configuration!"), "error");
> goto M1;
> Ji:
> $d6 = @file_get_contents($_FILES["files"]["tmp_name"]["import_Config_file"]);
> $hX = isset($d6) ? json_decode($d6, TRUE) : [];
> mo_update_configuration_array($hX);
> M1:
> q5:
> }
> function mo_update_configuration_array($hX)
> {
> $mt = unserialize(Tab_Class_Names);
> foreach ($mt as $Io => $FF) {
> if ($Io == "Service_Providers") {
> goto ds;
> }
> if ($Io == "Mapping") {
> goto u4;
> }
> foreach ($hX[$Io] as $ZE => $ND) {
> $j3 = constant("{$FF}::{$ZE}");
> if (!$j3) {
> goto fk;
> }
> variable_set($j3, $ND);
> fk:
> DQ:
> }
> Ek:
> goto Rh;
> ds:
> $aP = count($hX[$Io]);
> $aR = new MiniorangeSAMLCustomer(NULL, NULL, NULL, NULL);
> $e_ = $aR->ccl() !== NULL ? json_decode($aR->ccl(), TRUE) : [];
> $vF = isset($e_["noOfSP"]) && $e_["noOfSP"] != "0" ? $e_["noOfSP"] : 1;
> $aP = $vF < $aP ? $vF : $aP;
> $lc = 0;
> Xd:
> if (!($lc < $aP)) {
> goto wg;
> }
> $v4 = '';
> $Fx = '';
> $hp = '';
> $Jz = '';
> $AL = '';
> $t7 = '';
> $oz = '';
> $hf = '';
> $Xs = '';
> $lV = '';
> $G1 = '';
> $YW = '';
> foreach ($hX[$Io][$lc] as $ZE => $ND) {
> if ($ZE == "mo_idp_name") {
> goto OB;
> }
> if ($ZE == "mo_idp_issuer") {
> goto ED;
> }
> if ($ZE == "mo_idp_request_signed") {
> goto s5;
> }
> if ($ZE == "mo_idp_nameid_format") {
> goto mA;
> }
> if ($ZE == "mo_idp_http_binding_sso") {
> goto xC;
> }
> if ($ZE == "mo_idp_sso_url") {
> goto C3;
> }
> if ($ZE == "mo_idp_http_binding_slo") {
> goto iZ;
> }
> if ($ZE == "miniorange_saml_fetch_metadata_time_intervals") {
> goto Sa;
> }
> if ($ZE == "mo_idp_slo_url") {
> goto uG;
> }
> if ($ZE == "mo_idp_cert") {
> goto fp;
> }
> if ($ZE == "miniorange_saml_meta_data_url") {
> goto om;
> }
> if ($ZE = "security_signature_algorithm") {
> goto ar;
> }
> goto Hq;
> OB:
> $v4 = $ND;
> goto Hq;
> ED:
> $Fx = $ND;
> goto Hq;
> s5:
> $hp = $ND;
> goto Hq;
> mA:
> $Jz = $ND;
> goto Hq;
> xC:
> $AL = $ND;
> goto Hq;
> C3:
> $t7 = $ND;
> goto Hq;
> iZ:
> $oz = $ND;
> goto Hq;
> Sa:
> $hf = $ND;
> goto Hq;
> uG:
> $Xs = $ND;
> goto Hq;
> fp:
> $lV = $ND;
> goto Hq;
> om:
> $G1 = $ND;
> goto Hq;
> ar:
> $YW = $ND;
> Hq:
> oA:
> }
> Jc:
> $rX = db_query("SELECT * FROM {miniorange_saml_idp_list}");
> $zN = $rX->fetchAll();
> $GX = -1;
> foreach ($zN as $I0) {
> if (!($I0->mo_idp_issuer == $Fx || $I0->mo_idp_sso_url == $t7)) {
> goto nO;
> }
> $GX = $I0->id;
> nO:
> cS:
> }
> Nd:
> if ($GX == -1) {
> goto r5;
> }
> Utilities::Database_update($v4, $Fx, $t7, $lV, $Jz, $hp, $AL, $oz, $Xs, $hf, $G1, $GX, $YW);
> goto XN;
> r5:
> Utilities::Database_insert($v4, $Fx, $t7, $lV, $Jz, $hp, $AL, $oz, $Xs, $hf, $G1, $YW);
> XN:
> IG:
> $lc++;
> goto Xd;
> wg:
> goto Rh;
> u4:
> $vs = mo_get_role_mapping();
> foreach ($hX[$Io] as $ZE => $ND) {
> variable_set($vs[$ZE], $ND);
> kd:
> }
> tK:
> Rh:
> l2:
> }
> RA:
> $Zs = "CONFIGURATION_SAVED";
> variable_set("miniorange_config_status", $Zs);
> $gu = Utilities::miniorange_get_baseURL();
> drupal_goto($gu . "/admin/config/people/miniorange_saml/sp_setup");
274,281c274,281
< $j_ = array();
< $j_["PHP_version"] = phpversion();
< $j_["Drupal_version"] = VERSION;
< $j_["OPEN_SSL"] = mo_saml_is_openssl_installed();
< $j_["CURL"] = mo_saml_is_curl_installed();
< $j_["ICONV"] = mo_saml_is_iconv_installed();
< $j_["DOM"] = mo_saml_is_dom_installed();
< return $j_;
---
> $nz = array();
> $nz["PHP_version"] = phpversion();
> $nz["Drupal_version"] = VERSION;
> $nz["OPEN_SSL"] = mo_saml_is_openssl_installed();
> $nz["CURL"] = mo_saml_is_curl_installed();
> $nz["ICONV"] = mo_saml_is_iconv_installed();
> $nz["DOM"] = mo_saml_is_dom_installed();
> return $nz;
285,316c285,316
< $JB = array();
< $JB["Login_by"] = "miniorange_saml_login_by";
< $JB["Username_attr"] = "miniorange_saml_username_attribute";
< $JB["Email_attr"] = "miniorange_saml_email_attribute";
< $JB["Attribute_Name_1"] = "miniorange_saml_attr5_name";
< $JB["Idp_Attribute_Name_1"] = "miniorange_saml_idp_attr5_name";
< $JB["Attribute_Name_2"] = "miniorange_saml_attr2_name";
< $JB["Idp_Attribute_Name_2"] = "miniorange_saml_idp_attr2_name";
< $JB["Attribute_Name_3"] = "miniorange_saml_attr3_name";
< $JB["Idp_Attribute_Name_3"] = "miniorange_saml_idp_attr3_name";
< $JB["Attribute_Name_4"] = "miniorange_saml_attr4_name";
< $JB["Idp_Attribute_Name_4"] = "miniorange_saml_idp_attr4_name";
< $JB["Role"] = "miniorange_saml_idp_attr1_name";
< $JB["Role_mapping"] = "miniorange_saml_enable_rolemapping";
< $JB["Do_not_update_user_roles"] = "miniorange_saml_disable_role_update";
< $JB["Disable_auto_create_user"] = "miniorange_saml_disable_autocreate_users";
< $JB["Default_role"] = "miniorange_saml_default_role";
< $JB["SP_Roles_For_Mapping"] = "miniorange_saml_sp_role_names";
< $JB["Custom_Login_Logout_Roles"] = "miniorange_saml_log_url_class";
< $xm = user_roles($ZN = TRUE);
< foreach ($xm as $oD) {
< $y_ = str_replace(" ", '', $oD);
< $JB["Role_" . $y_] = "miniorange_saml_role_" . $y_;
< Gs:
< }
< DU:
< foreach ($xm as $Vo => $vc) {
< $Jo = str_replace(" ", '', $vc . "_sin");
< $Xk = str_replace(" ", '', $vc . "_sout");
< $JB["Login_URL_" . $vc] = $Jo;
< $JB["Logout_URL_" . $vc] = $Xk;
< zp:
---
> $Pn = array();
> $Pn["Login_by"] = "miniorange_saml_login_by";
> $Pn["Username_attr"] = "miniorange_saml_username_attribute";
> $Pn["Email_attr"] = "miniorange_saml_email_attribute";
> $Pn["Attribute_Name_1"] = "miniorange_saml_attr5_name";
> $Pn["Idp_Attribute_Name_1"] = "miniorange_saml_idp_attr5_name";
> $Pn["Attribute_Name_2"] = "miniorange_saml_attr2_name";
> $Pn["Idp_Attribute_Name_2"] = "miniorange_saml_idp_attr2_name";
> $Pn["Attribute_Name_3"] = "miniorange_saml_attr3_name";
> $Pn["Idp_Attribute_Name_3"] = "miniorange_saml_idp_attr3_name";
> $Pn["Attribute_Name_4"] = "miniorange_saml_attr4_name";
> $Pn["Idp_Attribute_Name_4"] = "miniorange_saml_idp_attr4_name";
> $Pn["Role"] = "miniorange_saml_idp_attr1_name";
> $Pn["Role_mapping"] = "miniorange_saml_enable_rolemapping";
> $Pn["Do_not_update_user_roles"] = "miniorange_saml_disable_role_update";
> $Pn["Disable_auto_create_user"] = "miniorange_saml_disable_autocreate_users";
> $Pn["Default_role"] = "miniorange_saml_default_role";
> $Pn["SP_Roles_For_Mapping"] = "miniorange_saml_sp_role_names";
> $Pn["Custom_Login_Logout_Roles"] = "miniorange_saml_log_url_class";
> $LG = user_roles($ZR = TRUE);
> foreach ($LG as $BX) {
> $rA = str_replace(" ", '', $BX);
> $Pn["Role_" . $rA] = "miniorange_saml_role_" . $rA;
> ZX:
> }
> aj:
> foreach ($LG as $DG => $R4) {
> $Av = str_replace(" ", '', $R4 . "_sin");
> $Hq = str_replace(" ", '', $R4 . "_sout");
> $Pn["Login_URL_" . $R4] = $Av;
> $Pn["Logout_URL_" . $R4] = $Hq;
> jb:
318,319c318,319
< AF:
< return $JB;
---
> Mo:
> return $Pn;
323,324c323,324
< if (in_array("openssl", get_loaded_extensions())) {
< goto s9;
---
> if (in_array("openssl", get_loaded_extensions())) {
> goto Q8;
327,328c327,328
< goto nq;
< s9:
---
> goto qt;
> Q8:
330c330
< nq:
---
> qt:
334,335c334,335
< if (in_array("curl", get_loaded_extensions())) {
< goto nY;
---
> if (in_array("curl", get_loaded_extensions())) {
> goto cg;
338,339c338,339
< goto LV;
< nY:
---
> goto YW;
> cg:
341c341
< LV:
---
> YW:
345,346c345,346
< if (in_array("iconv", get_loaded_extensions())) {
< goto Dd;
---
> if (in_array("iconv", get_loaded_extensions())) {
> goto Xa;
349,350c349,350
< goto wb;
< Dd:
---
> goto X0;
> Xa:
352c352
< wb:
---
> X0:
356,357c356,357
< if (in_array("dom", get_loaded_extensions())) {
< goto b0;
---
> if (in_array("dom", get_loaded_extensions())) {
> goto PK;
360,361c360,361
< goto Sy;
< b0:
---
> goto OG;
> PK:
363c363
< Sy:
---
> OG:
367,370c367,370
< $hE = $form["miniorange_saml_email_address"]["#value"];
< $cA = $form["miniorange_saml_phone_number"]["#value"];
< $v5 = $form["miniorange_saml_support_query"]["#value"];
< Utilities::send_query($hE, $cA, $v5);
---
> $fa = $form["miniorange_saml_email_address"]["#value"];
> $PA = $form["miniorange_saml_phone_number"]["#value"];
> $Mp = $form["miniorange_saml_support_query"]["#value"];
> Utilities::send_query($fa, $PA, $Mp);
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/miniorange_saml_idp_setup.inc" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/miniorange_saml_idp_setup.inc"
7,137c7,137
< drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/bootstrap.min.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
< drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
< $ww = Utilities::isCustomerRegistered($form, $form_state);
< if (!(isset($_GET["delete"]) && $_GET["delete"] != '')) {
< goto bb;
< }
< $l1 = $_GET["delete"];
< bb:
< if (!(isset($l1) && $l1 != '')) {
< goto o1;
< }
< Utilities::delete_sp_parameters($l1);
< drupal_set_message(t("IDP Configuration Successfully Deleted."));
< drupal_goto($base_url . "/?q=admin/config/people/miniorange_saml/sp_setup/");
< o1:
< if (!(isset($_GET["id"]) && $_GET["id"] != '')) {
< goto Ay;
< }
< $Pj = $_GET["id"];
< Ay:
< if (!(isset($Pj) && $Pj != '')) {
< goto n9;
< }
< Utilities::set_idp_parameters($Pj);
< echo " <script>\xd
window.onload = function() {
\x9 show_idp_config_form();\xd
};
\x9 </script>\xd\xa ";
< n9:
< $yq = db_select("miniorange_saml_idp_list", "id")->fields("id")->execute();
< $br = $yq->rowCount();
< $ow = new MiniorangeSAMLCustomer(NULL, NULL, NULL, NULL);
< $u4 = $ow->ccl() !== NULL ? json_decode($ow->ccl(), TRUE) : [];
< $SY = isset($u4["noOfSP"]) && $u4["noOfSP"] != "0" ? $u4["noOfSP"] : 1;
< $AR = $SY - $br;
< if (!($br != "0" && empty($Pj))) {
< goto TY;
< }
< if ($SY != $br) {
< goto FO;
< }
< $form["miniorange_saml_sp_config_tab"] = array("#markup" => "<div class="mo_saml_table_layout_1"><div class="mo_saml_table_layout mo_saml_container_center"><div id="idpconfigdata"><h5> LIST OF IDENTITY PROVIDERS</h5><hr>\xd
<p>You have reached the limit of <b>" . strval($br) . " Identity Providers (IDPs)</b>. Contact us at <a href="mailto:[email protected]">[email protected]</a> if you want to increase the limit.</p><br>");
< goto ps;
< FO:
< $form["miniorange_saml_sp_config_tab"] = array("#markup" => "<div id="idpconfigdata" class="mo_saml_table_layout_1"><div class="mo_saml_table_layout mo_saml_container_center"><h5> LIST OF IDENTITY PROVIDERS<a class="btn btn-primary btn-sm" style="padding:6px 12px; float:right" href="" . $base_url . "/admin/config/people/miniorange_saml/sp_setup?id=new">" . "Add New</a></h5><br>\xd\xa <hr><br><div>Number of IDPs remaining: " . strval($AR) . "</div><br>");
< ps:
< $sB = array("idpname" => array("data" => t("IDP Name")), "issuer" => array("data" => t("IDP Entity-ID/Issuer")), "action" => array("data" => t("Actions")));
< $s9 = array();
< $ZQ = db_query("SELECT * FROM {miniorange_saml_idp_list}");
< $IX = $ZQ->fetchAll();
< foreach ($IX as $n0) {
< $s9[$n0->id] = ["idpname" => $n0->mo_idp_name, "issuer" => $n0->mo_idp_issuer, "action" => "<a style="padding:6px 12px;cursor: pointer;" onclick="testConfig('" . getTestUrl($n0->id) . "');" target="_blank">" . "Test</a>" . " | " . "<a href="" . $base_url . "/admin/config/people/miniorange_saml/sp_setup?id=" . $n0->id . "" style="padding:6px 12px;">" . "Edit</a>" . " | " . "<a href="" . $base_url . "/admin/config/people/miniorange_saml/sp_setup?delete=" . $n0->id . "" style="padding:6px 12px;">" . "Delete</a>"];
< CX:
< }
< ll:
< $form["fieldset"]["customerinfo"] = array("#theme" => "table", "#header" => $sB, "#rows" => $s9);
< $form["markup_idpdisplay"] = array("#markup" => "</div></div></div></div><div id="idpdisplay" style="display:none;">");
< TY:
< $form["header_top_style_1"] = array("#markup" => "<div class="mo_saml_table_layout_1"><div class="mo_saml_table_layout mo_saml_container">");
< $form["markup_sp_header"] = array("#markup" => "<h3>CONFIGURE SERVICE PROVIDER</h3><hr>");
< $form["miniorange_saml_IDP_tab"] = array("#markup" => "<div id="tabhead"><h5> Enter the information gathered from your Identity Provider OR <a class="btn btn-primary btn-large" style="padding:4px 8px;" onclick="show_metadata_form()">" . "Upload IDP Metadata </a><br><br> </h5></div>");
< $form["metadata_1"] = array("#markup" => "<div border="1" id="upload_metadata_form" style="background-color:#FFFFFF; border:2px solid #CCCCCC; padding:1px 1px 1px 10px; display:none;" >" . "\x9 <table style="width:100%;">" . " <tr> <td colspan="3">" . "\x9\x9\x9 <h3>UPLOAD IDP METADATA" . " \x9\x9\x9\x9<span style="float:right;margin-right:25px;">" . " \x9<input type="button" class="btn btn-sm btn-danger" value="Cancel" onclick = "hide_metadata_form()"/></a><br>" . " \x9</span>");
< $form["metadata_idp_name"] = array("#markup" => "</td></td>" . "\x9</tr>" . " \x9 <tr><td colspan="3" ></td></tr>" . " <tr>" . " \x9\x9<td width="20%"><h4>Identity Provider name:</h4></td><td width="10%">");
< $form["miniorange_saml_idp_name_3"] = array("#type" => "textfield", "#attributes" => array("placeholder" => "Enter Identity Provider name."));
< $form["metadata_2"] = array("#markup" => "</span>" . " \x9\x9\x9\x9<br><br>" . "\x9 \x9</h1>" . " </td>" . " </tr>" . " \x9\x9 <tr><td><h4>Upload Metadata :</h4>" . "\x9\x9\x9 <td colspan="1">");
< $form["metadata_file"] = array("#type" => "file");
< $form["metadata_upload"] = array("#type" => "submit", "#value" => t("Upload"), "#submit" => array("miniorange_saml_upload_file"), "#disabled" => $ww, "#attributes" => array("style" => "border-radius:4px;background: #337ab7;color: #ffffff;text-shadow: 0 -1px 1px #337ab7, 1px 0 1px #337ab7, 0 1px 1px #337ab7, -1px 0 1px #337ab7;box-shadow: 0 1px 0 #337ab7;border-color: #337ab7 #337ab7 #337ab7;"));
< $form["metadata_3"] = array("#markup" => "</td></td>" . "</tr> " . " <tr><td colspan="3" ><p style="font-size:13pt;text-align:center;"><b>OR<hr><hr></b></p></td> </tr>" . "<tr> " . " <td width="20%"><h4>Enter metadata URL:</h4></td><td width="10%">");
< $form["metadata_URL"] = array("#type" => "textfield", "#maxlength" => 1024, "#attributes" => array("placeholder" => "Enter metadata URL of your IdP."), "#default_value" => variable_get("miniorange_saml_meta_data_url", ''));
< $form["metadata_fetch"] = array("#type" => "submit", "#value" => t("Fetch Metadata"), "#submit" => array("miniorange_saml_fetch_metadata"), "#disabled" => $ww, "#attributes" => array("style" => "border-radius:4px;background: #337ab7;color: #ffffff;text-shadow: 0 -1px 1px #337ab7, 1px 0 1px #337ab7, 0 1px 1px #337ab7, -1px 0 1px #337ab7;box-shadow: 0 1px 0 #337ab7;border-color: #337ab7 #337ab7 #337ab7;"));
< $form["metadata_4"] = array("#markup" => "</td></tr><tr><td></td><td>");
< $form["miniorange_saml_fetch_metadata_after_specific_time"] = array("#type" => "checkbox", "#title" => t("Update IdP settings by pinging metadata URL ( We will store the metadata URL )"), "#default_value" => variable_get("miniorange_saml_fetch_metadata_time_intervals", FALSE), "#disabled" => $ww);
< $yu = Utilities::miniorange_get_baseURL();
< $form["note_for metadata_fetch"] = array("#markup" => "<b>Note: </b>You can set how often you want to ping the IdP from <b><a style="font-size: small;" href="" . $yu . "/admin/config/system/cron">Here</a> OR</b> you can goto <b>Configuration=>Cron=>Run Cron Every</b> section of your drupal site");
< $form["metadata_5"] = array("#markup" => " </td></tr>" . " </table>" . "</div>" . "<div id="idpdata">");
< $form["miniorange_saml_identity_provider_guide"] = array("#type" => "select", "#title" => t("Select your Identity Provider for guideline :"), "#options" => array("select-idp" => t("Select your Identity Provider"), "adfs" => t("ADFS"), "okta" => t("Okta"), "salesforce" => t("SalesForce"), "google-apps" => t("Google Apps"), "azure-ad" => t("Azure Ad"), "onelogin" => t("OneLogin"), "centrify" => t("Centrify"), "miniorange" => t("MiniOrange"), "bitium" => t("Bitium"), "other" => t("Other")), "#disabled" => $ww, "#default_value" => variable_get("miniorange_nameid_format"), "#attributes" => array("style" => "width:82%", "onchange" => "idp_guide(value);"), "#description" => t("<b>Note : </b>Select your Identity Provider from the list above, and you can find the link to the guide for setting up SAML.<br> Please contact us if you don't find your IDP in the list."));
< echo " <script>\xd\xa function idp_guide(value) {
\xa if(value!="other" && value!="select-idp") {
window.open("https://plugins.miniorange.com/drupal-single-sign-sso-using-" + value + "-idp/", '_blank');
}
}\xd\xa </script>
\xa ";
< $form["miniorange_saml_idp_name"] = array("#type" => "textfield", "#maxlength" => 255, "#title" => t("Identity Provider Name"), "#default_value" => variable_get("miniorange_saml_idp_name", ''), "#attributes" => array("style" => "width:82%", "placeholder" => "Identity Provider Name"), "#disabled" => $ww);
< $form["miniorange_saml_idp_issuer"] = array("#type" => "textfield", "#maxlength" => 255, "#title" => t("IdP Entity ID or Issuer"), "#description" => t("<b>Note :</b> You can find the EntityID in Your IdP-Metadata XML file enclosed in <code>EntityDescriptor</code> tag having attribute as <code>entityID</code>"), "#default_value" => variable_get("miniorange_saml_idp_issuer", ''), "#attributes" => array("style" => "width:82%", "placeholder" => "IdP Entity ID or Issuer"), "#disabled" => $ww);
< $form["miniorange_nameid_format"] = array("#type" => "select", "#title" => t("NameID Format"), "#options" => array("urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" => t("urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"), "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" => t("urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"), "urn:oasis:names:tc:SAML:1.1:nameid-format:transient" => t("urn:oasis:names:tc:SAML:1.1:nameid-format:transient"), "urn:oasis:names:tc:SAML:1.1:nameid-format:persistent" => t("urn:oasis:names:tc:SAML:1.1:nameid-format:persistent")), "#default_value" => variable_get("miniorange_nameid_format"), "#attributes" => array("style" => "width:82%"), "#disabled" => $ww);
< $form["miniorange_saml_idp_binding"] = array("#type" => "radios", "#title" => t("HTTP Binding for SSO"), "#default_value" => variable_get("miniorange_saml_http_binding") == "HTTP-POST" ? 1 : 0, "#options" => array(t("HTTP-Redirect"), t("HTTP-POST")), "#disabled" => $ww);
< $form["miniorange_saml_idp_login_url"] = array("#type" => "textfield", "#title" => t("SAML Login URL"), "#maxlength" => 255, "#description" => t("<b>Note :</b> You can find the SAML Login URL in Your IdP-Metadata XML file enclosed in <code>SingleSignOnService</code> tag"), "#default_value" => variable_get("miniorange_saml_idp_login_url", ''), "#attributes" => array("style" => "width:82%", "placeholder" => "SAML Login URL"), "#disabled" => $ww);
< $form["miniorange_saml_idp_binding_slo"] = array("#type" => "radios", "#title" => t("HTTP Binding for SLO"), "#default_value" => variable_get("miniorange_saml_http_binding_slo") == "HTTP-POST" ? 1 : 0, "#options" => array(t("HTTP-Redirect"), t("HTTP-POST")), "#disabled" => $ww);
< $form["miniorange_saml_idp_logout_url"] = array("#type" => "textfield", "#maxlength" => 255, "#title" => t("SAML Logout URL"), "#description" => t("<b>Note :</b> You can find the SAML Login URL in Your IdP-Metadata XML file enclosed in <code>SingleLogoutService</code> tag"), "#default_value" => variable_get("miniorange_saml_idp_logout_url", ''), "#attributes" => array("style" => "width:82%", "placeholder" => "SAML Logout URL"), "#disabled" => $ww);
< $q5 = variable_get("miniorange_saml_idp_x509_certificate", '');
< $Ko = 1;
< if (!is_array($q5)) {
< goto O2;
< }
< $Ko = sizeof($q5);
< O2:
< if (!empty($q5)) {
< goto zU;
< }
< $q5 = array();
< $q5[0] = '';
< zU:
< if (!($Ko == '' || $Ko == NULL)) {
< goto Q6;
< }
< $Ko = 1;
< Q6:
< $Ml = array("miniorange_saml_idp_x509_certificate_1", "miniorange_saml_idp_x509_certificate_2", "miniorange_saml_idp_x509_certificate_3", "miniorange_saml_idp_x509_certificate_4");
< $Eo = 0;
< Nc:
< if (!($Eo < $Ko)) {
< goto Xj;
< }
< $form[$Ml[$Eo]] = array("#type" => "textarea", "#title" => t("x.509 Certificate Value"), "#rows" => 5, "#default_value" => $q5, "#attributes" => array("style" => "width:82%", "placeholder" => "Enter x509 Certificate Value"), "#resizable" => False, "#disabled" => $ww);
< if (!($Eo == 0)) {
< goto g_;
< }
< $form["markup_1"] = array("#markup" => "<b>NOTE:</b> Format of the certificate:<br><b>-----BEGIN CERTIFICATE-----<br>" . "XXXXXXXXXXXXXXXXXXXXXXXXXXX<br>-----END CERTIFICATE-----</b><br><br>");
< g_:
< AB:
< $Eo++;
< goto Nc;
< Xj:
< $form["security_signature_algorithm"] = array("#type" => "select", "#title" => t("Signature algorithm"), "#options" => ["RSA_SHA256" => "sha256", "RSA_SHA384" => "sha384", "RSA_SHA512" => "sha512", "RSA_SHA1" => "sha1"], "#description" => t("Algorithm used in the signing process."), "#default_valu
e" => variable_get("security_signature_algorithm"), "#attributes" => array("style" => "width:44%"));
< $form["miniorange_saml_sign_request"] = array("#type" => "checkbox", "#title" => t("Check this option to send Signed SSO and SLO requests."), "#default_value" => variable_get("miniorange_saml_request_signed", FALSE), "#disabled" => $ww);
< $mM = '';
< if (!($ww == TRUE)) {
< goto cY;
< }
< $mM = "disabled="True"";
< cY:
< $form["miniorange_saml_enable_login"] = array("#type" => "checkbox", "#title" => t("Enable login with SAML"), "#default_value" => variable_get("miniorange_saml_enable_login", FALSE), "#disabled" => $ww);
< $form["miniorange_saml_new_line"] = array("#markup" => "<br/><br/>");
< $form["miniorange_saml_idp_config_submit"] = array("#type" => "submit", "#value" => t("Save Configuration"), "#submit" => array("miniorange_saml_save_idp_config"), "#disabled" => $ww, "#attributes" => array("style" => "padding:6px 12px; border-radius:4px;"));
< $Pj = variable_get("miniorange_saml_idp_id");
< $wz = variable_get("miniorange_saml_idp_name");
< $form["miniorange_saml_test_config_button1"] = array("#markup" => "<a " . $mM . " class="btn btn-success btn-large" style="padding:6px 12px;"
onclick="testConfig('" . getTestUrl($Pj) . "');">" . "Test Configuration</a> ");
< $form["miniorange_saml_test_config_button2"] = array("#markup" => "<a " . $mM . " class="btn btn-primary btn-large" style="padding:6px 12px;"
\xa onclick="testConfig('" . getSAMLrequest($Pj) . "');">" . "SAML Request</a> ");
< $form["miniorange_saml_test_config_button3"] = array("#markup" => "<a " . $mM . " class="btn btn-primary btn-large" style="padding:6px 12px;"\xd\xa onclick="testConfig('" . getSAMLresponse($wz) . "');">" . "SAML Response</a><br><br></div></div>");
---
> drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/bootstrap.min.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
> drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
> $Ih = Utilities::isCustomerRegistered($form, $form_state);
> if (!(isset($_GET["delete"]) && $_GET["delete"] != '')) {
> goto J1;
> }
> $n5 = $_GET["delete"];
> J1:
> if (!(isset($n5) && $n5 != '')) {
> goto Ru;
> }
> Utilities::delete_sp_parameters($n5);
> drupal_set_message(t("IDP Configuration Successfully Deleted."));
> drupal_goto($base_url . "/?q=admin/config/people/miniorange_saml/sp_setup/");
> Ru:
> if (!(isset($_GET["id"]) && $_GET["id"] != '')) {
> goto P0;
> }
> $GX = $_GET["id"];
> P0:
> if (!(isset($GX) && $GX != '')) {
> goto lg;
> }
> Utilities::set_idp_parameters($GX);
> echo "\x9 <script>
\xa\x9 window.onload = function() {
\xa show_idp_config_form();
\x9 };\xd\xa </script>
";
> lg:
> $uy = db_select("miniorange_saml_idp_list", "id")->fields("id")->execute();
> $f3 = $uy->rowCount();
> $aR = new MiniorangeSAMLCustomer(NULL, NULL, NULL, NULL);
> $e_ = $aR->ccl() !== NULL ? json_decode($aR->ccl(), TRUE) : [];
> $vF = isset($e_["noOfSP"]) && $e_["noOfSP"] != "0" ? $e_["noOfSP"] : 1;
> $fc = $vF - $f3;
> if (!($f3 != "0" && empty($GX))) {
> goto qy;
> }
> if ($vF != $f3) {
> goto d1;
> }
> $form["miniorange_saml_sp_config_tab"] = array("#markup" => "<div class="mo_saml_table_layout_1"><div class="mo_saml_table_layout mo_saml_container_center"><div id="idpconfigdata"><h5> LIST OF IDENTITY PROVIDERS</h5><hr>\xd\xa <p>You have reached the limit of <b>" . strval($f3) . " Identity Providers (IDPs)</b>. Contact us at <a href="mailto:[email protected]">[email protected]</a> if you want to increase the limit.</p><br>");
> goto hh;
> d1:
> $form["miniorange_saml_sp_config_tab"] = array("#markup" => "<div id="idpconfigdata" class="mo_saml_table_layout_1"><div class="mo_saml_table_layout mo_saml_container_center"><h5> LIST OF IDENTITY PROVIDERS<a class="btn btn-primary btn-sm" style="padding:6px 12px; float:right" href="" . $base_url . "/admin/config/people/miniorange_saml/sp_setup?id=new">" . "Add New</a></h5><br>
<hr><br><div>Number of IDPs remaining: " . strval($fc) . "</div><br>");
> hh:
> $Ch = array("idpname" => array("data" => t("IDP Name")), "issuer" => array("data" => t("IDP Entity-ID/Issuer")), "action" => array("data" => t("Actions")));
> $cj = array();
> $rX = db_query("SELECT * FROM {miniorange_saml_idp_list}");
> $zN = $rX->fetchAll();
> foreach ($zN as $Ru) {
> $cj[$Ru->id] = ["idpname" => $Ru->mo_idp_name, "issuer" => $Ru->mo_idp_issuer, "action" => "<a style="padding:6px 12px;cursor: pointer;" onclick="testConfig('" . getTestUrl($Ru->id) . "');" target="_blank">" . "Test</a>" . " | " . "<a href="" . $base_url . "/admin/config/people/miniorange_saml/sp_setup?id=" . $Ru->id . "" style="padding:6px 12px;">" . "Edit</a>" . " | " . "<a href="" . $base_url . "/admin/config/people/miniorange_saml/sp_setup?delete=" . $Ru->id . "" style="padding:6px 12px;">" . "Delete</a>"];
> kj:
> }
> Nn:
> $form["fieldset"]["customerinfo"] = array("#theme" => "table", "#header" => $Ch, "#rows" => $cj);
> $form["markup_idpdisplay"] = array("#markup" => "</div></div></div></div><div id="idpdisplay" style="display:none;">");
> qy:
> $form["header_top_style_1"] = array("#markup" => "<div class="mo_saml_table_layout_1"><div class="mo_saml_table_layout mo_saml_container">");
> $form["markup_sp_header"] = array("#markup" => "<h3>CONFIGURE SERVICE PROVIDER</h3><hr>");
> $form["miniorange_saml_IDP_tab"] = array("#markup" => "<div id="tabhead"><h5> Enter the information gathered from your Identity Provider OR <a class="btn btn-primary btn-large" style="padding:4px 8px;" onclick="show_metadata_form()">" . "Upload IDP Metadata </a><br><br> </h5></div>");
> $form["metadata_1"] = array("#markup" => "<div border="1" id="upload_metadata_form" style="background-color:#FFFFFF; border:2px solid #CCCCCC; padding:1px 1px 1px 10px; display:none;" >" . "\x9 <table style="width:100%;">" . "\x9 <tr> <td colspan="3">" . " \x9 <h3>UPLOAD IDP METADATA" . " \x9\x9 <span style="float:right;margin-right:25px;">" . " \x9 <input type="button" class="btn btn-sm btn-danger" value="Cancel" onclick = "hide_metadata_form()"/></a><br>" . "\x9\x9 \x9</span>");
> $form["metadata_idp_name"] = array("#markup" => "</td></td>" . "\x9</tr>" . " \x9 \x9<tr><td colspan="3" ></td></tr>" . " <tr>" . " \x9 <td width="20%"><h4>Identity Provider name:</h4></td><td width="10%">");
> $form["miniorange_saml_idp_name_3"] = array("#type" => "textfield", "#attributes" => array("placeholder" => "Enter Identity Provider name."));
> $form["metadata_2"] = array("#markup" => "</span>" . "\x9 <br><br>" . "\x9 \x9</h1>" . "\x9\x9 </td>" . "\x9 </tr>" . "\x9\x9 <tr><td><h4>Upload Metadata :</h4>" . " <td colspan="1">");
> $form["metadata_file"] = array("#type" => "file");
> $form["metadata_upload"] = array("#type" => "submit", "#value" => t("Upload"), "#submit" => array("miniorange_saml_upload_file"), "#disabled" => $Ih, "#attributes" => array("style" => "border-radius:4px;background: #337ab7;color: #ffffff;text-shadow: 0 -1px 1px #337ab7, 1px 0 1px #337ab7, 0 1px 1px #337ab7, -1px 0 1px #337ab7;box-shadow: 0 1px 0 #337ab7;border-color: #337ab7 #337ab7 #337ab7;"));
> $form["metadata_3"] = array("#markup" => "</td></td>" . "</tr> " . " <tr><td colspan="3" ><p style="font-size:13pt;text-align:center;"><b>OR<hr><hr></b></p></td> </tr>" . "<tr> " . " <td width="20%"><h4>Enter metadata URL:</h4></td><td width="10%">");
> $form["metadata_URL"] = array("#type" => "textfield", "#maxlength" => 1024, "#attributes" => array("placeholder" => "Enter metadata URL of your IdP."), "#default_value" => variable_get("miniorange_saml_meta_data_url", ''));
> $form["metadata_fetch"] = array("#type" => "submit", "#value" => t("Fetch Metadata"), "#submit" => array("miniorange_saml_fetch_metadata"), "#disabled" => $Ih, "#attributes" => array("style" => "border-radius:4px;background: #337ab7;color: #ffffff;text-shadow: 0 -1px 1px #337ab7, 1px 0 1px #337ab7, 0 1px 1px #337ab7, -1px 0 1px #337ab7;box-shadow: 0 1px 0 #337ab7;border-color: #337ab7 #337ab7 #337ab7;"));
> $form["metadata_4"] = array("#markup" => "</td></tr><tr><td></td><td>");
> $form["miniorange_saml_fetch_metadata_after_specific_time"] = array("#type" => "checkbox", "#title" => t("Update IdP settings by pinging metadata URL ( We will store the metadata URL )"), "#default_value" => variable_get("miniorange_saml_fetch_metadata_time_intervals", FALSE), "#disabled" => $Ih);
> $Gx = Utilities::miniorange_get_baseURL();
> $form["note_for metadata_fetch"] = array("#markup" => "<b>Note: </b>You can set how often you want to ping the IdP from <b><a style="font-size: small;" href="" . $Gx . "/admin/config/system/cron">Here</a> OR</b> you can goto <b>Configuration=>Cron=>Run Cron Every</b> section of your drupal site");
> $form["metadata_5"] = array("#markup" => " </td></tr>" . "\x9</table>" . "</div>" . "<div id="idpdata">");
> $form["miniorange_saml_identity_provider_guide"] = array("#type" => "select", "#title" => t("Select your Identity Provider for guideline :"), "#options" => array("select-idp" => t("Select your Identity Provider"), "adfs" => t("ADFS"), "okta" => t("Okta"), "salesforce" => t("SalesForce"), "google-apps" => t("Google Apps"), "azure-ad" => t("Azure Ad"), "onelogin" => t("OneLogin"), "centrify" => t("Centrify"), "miniorange" => t("MiniOrange"), "bitium" => t("Bitium"), "other" => t("Other")), "#disabled" => $Ih, "#default_value" => variable_get("miniorange_nameid_format"), "#attributes" => array("style" => "width:82%", "onchange" => "idp_guide(value);"), "#description" => t("<b>Note : </b>Select your Identity Provider from the list above, and you can find the link to the guide for setting up SAML.<br> Please contact us if you don't find your IDP in the list."));
> echo " <script>
function idp_guide(value) {\xd\xa if(value!="other" && value!="select-idp") {\xd\xa window.open("https://plugins.miniorange.com/drupal-single-sign-sso-using-" + value + "-idp/", '_blank');\xd\xa }
}
\xa </script>
";
> $form["miniorange_saml_idp_name"] = array("#type" => "textfield", "#maxlength" => 255, "#title" => t("Identity Provider Name"), "#default_value" => variable_get("miniorange_saml_idp_name", ''), "#attributes" => array("style" => "width:82%", "placeholder" => "Identity Provider Name"), "#disabled" => $Ih);
> $form["miniorange_saml_idp_issuer"] = array("#type" => "textfield", "#maxlength" => 255, "#title" => t("IdP Entity ID or Issuer"), "#description" => t("<b>Note :</b> You can find the EntityID in Your IdP-Metadata XML file enclosed in <code>EntityDescriptor</code> tag having attribute as <code>entityID</code>"), "#default_value" => variable_get("miniorange_saml_idp_issuer", ''), "#attributes" => array("style" => "width:82%", "placeholder" => "IdP Entity ID or Issuer"), "#disabled" => $Ih);
> $form["miniorange_nameid_format"] = array("#type" => "select", "#title" => t("NameID Format"), "#options" => array("urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" => t("urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"), "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" => t("urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"), "urn:oasis:names:tc:SAML:1.1:nameid-format:transient" => t("urn:oasis:names:tc:SAML:1.1:nameid-format:transient"), "urn:oasis:names:tc:SAML:1.1:nameid-format:persistent" => t("urn:oasis:names:tc:SAML:1.1:nameid-format:persistent")), "#default_value" => variable_get("miniorange_nameid_format"), "#attributes" => array("style" => "width:82%"), "#disabled" => $Ih);
> $form["miniorange_saml_idp_binding"] = array("#type" => "radios", "#title" => t("HTTP Binding for SSO"), "#default_value" => variable_get("miniorange_saml_http_binding") == "HTTP-POST" ? 1 : 0, "#options" => array(t("HTTP-Redirect"), t("HTTP-POST")), "#disabled" => $Ih);
> $form["miniorange_saml_idp_login_url"] = array("#type" => "textfield", "#title" => t("SAML Login URL"), "#maxlength" => 255, "#description" => t("<b>Note :</b> You can find the SAML Login URL in Your IdP-Metadata XML file enclosed in <code>SingleSignOnService</code> tag"), "#default_value" => variable_get("miniorange_saml_idp_login_url", ''), "#attributes" => array("style" => "width:82%", "placeholder" => "SAML Login URL"), "#disabled" => $Ih);
> $form["miniorange_saml_idp_binding_slo"] = array("#type" => "radios", "#title" => t("HTTP Binding for SLO"), "#default_value" => variable_get("miniorange_saml_http_binding_slo") == "HTTP-POST" ? 1 : 0, "#options" => array(t("HTTP-Redirect"), t("HTTP-POST")), "#disabled" => $Ih);
> $form["miniorange_saml_idp_logout_url"] = array("#type" => "textfield", "#maxlength" => 255, "#title" => t("SAML Logout URL"), "#description" => t("<b>Note :</b> You can find the SAML Login URL in Your IdP-Metadata XML file enclosed in <code>SingleLogoutService</code> tag"), "#default_value" => variable_get("miniorange_saml_idp_logout_url", ''), "#attributes" => array("style" => "width:82%", "placeholder" => "SAML Logout URL"), "#disabled" => $Ih);
> $Dq = variable_get("miniorange_saml_idp_x509_certificate", '');
> $Ds = 1;
> if (!is_array($Dq)) {
> goto sx;
> }
> $Ds = sizeof($Dq);
> sx:
> if (!empty($Dq)) {
> goto eD;
> }
> $Dq = array();
> $Dq[0] = '';
> eD:
> if (!($Ds == '' || $Ds == NULL)) {
> goto Gh;
> }
> $Ds = 1;
> Gh:
> $fS = array("miniorange_saml_idp_x509_certificate_1", "miniorange_saml_idp_x509_certificate_2", "miniorange_saml_idp_x509_certificate_3", "miniorange_saml_idp_x509_certificate_4");
> $Xc = 0;
> Lc:
> if (!($Xc < $Ds)) {
> goto B1;
> }
> $form[$fS[$Xc]] = array("#type" => "textarea", "#title" => t("x.509 Certificate Value"), "#rows" => 5, "#default_value" => $Dq, "#attributes" => array("style" => "width:82%", "placeholder" => "Enter x509 Certificate Value"), "#resizable" => False, "#disabled" => $Ih);
> if (!($Xc == 0)) {
> goto kJ;
> }
> $form["markup_1"] = array("#markup" => "<b>NOTE:</b> Format of the certificate:<br><b>-----BEGIN CERTIFICATE-----<br>" . "XXXXXXXXXXXXXXXXXXXXXXXXXXX<br>-----END CERTIFICATE-----</b><br><br>");
> kJ:
> MA:
> $Xc++;
> goto Lc;
> B1:
> $form["security_signature_algorithm"] = array("#type" => "select", "#title" => t("Signature algorithm"), "#options" => ["RSA_SHA256" => "sha256", "RSA_SHA384" => "sha384", "RSA_SHA512" => "sha512", "RSA_SHA1" => "sha1"], "#description" => t("Algorithm used in the signing process."), "#default_valu
e" => variable_get("security_signature_algorithm"), "#attributes" => array("style" => "width:44%"));
> $form["miniorange_saml_sign_request"] = array("#type" => "checkbox", "#title" => t("Check this option to send Signed SSO and SLO requests."), "#default_value" => variable_get("miniorange_saml_request_signed", FALSE), "#disabled" => $Ih);
> $Vx = '';
> if (!($Ih == TRUE)) {
> goto Ym;
> }
> $Vx = "disabled="True"";
> Ym:
> $form["miniorange_saml_enable_login"] = array("#type" => "checkbox", "#title" => t("Enable login with SAML"), "#default_value" => variable_get("miniorange_saml_enable_login", FALSE), "#disabled" => $Ih);
> $form["miniorange_saml_new_line"] = array("#markup" => "<br/><br/>");
> $form["miniorange_saml_idp_config_submit"] = array("#type" => "submit", "#value" => t("Save Configuration"), "#submit" => array("miniorange_saml_save_idp_config"), "#disabled" => $Ih, "#attributes" => array("style" => "padding:6px 12px; border-radius:4px;"));
> $GX = variable_get("miniorange_saml_idp_id");
> $bK = variable_get("miniorange_saml_idp_name");
> $form["miniorange_saml_test_config_button1"] = array("#markup" => "<a " . $Vx . " class="btn btn-success btn-large" style="padding:6px 12px;"
onclick="testConfig('" . getTestUrl($GX) . "');">" . "Test Configuration</a> ");
> $form["miniorange_saml_test_config_button2"] = array("#markup" => "<a " . $Vx . " class="btn btn-primary btn-large" style="padding:6px 12px;"\xd
onclick="testConfig('" . getSAMLrequest($GX) . "');">" . "SAML Request</a> ");
> $form["miniorange_saml_test_config_button3"] = array("#markup" => "<a " . $Vx . " class="btn btn-primary btn-large" style="padding:6px 12px;"\xd
onclick="testConfig('" . getSAMLresponse($bK) . "');">" . "SAML Response</a><br><br></div></div>");
140c140
< $form["metadata_12"] = array("#markup" => " </div>");
---
> $form["metadata_12"] = array("#markup" => " </div>");
143c143
< function getTestUrl($Pj)
---
> function getTestUrl($GX)
145,147c145,147
< $yu = Utilities::miniorange_get_baseURL();
< $M7 = $yu . "/?q=testConfig&testid=" . $Pj;
< return $M7;
---
> $Gx = Utilities::miniorange_get_baseURL();
> $ia = $Gx . "/?q=testConfig&testid=" . $GX;
> return $ia;
149c149
< function getSAMLrequest($Pj)
---
> function getSAMLrequest($GX)
152,153c152,153
< $dR = $base_url . "/?q=showSAMLrequest&testid=" . $Pj;
< return $dR;
---
> $bC = $base_url . "/?q=showSAMLrequest&testid=" . $GX;
> return $bC;
155c155
< function getSAMLresponse($wz)
---
> function getSAMLresponse($bK)
158,159c158,159
< $BV = $base_url . "/?q=showSAMLresponse&idpname=" . $wz;
< return $BV;
---
> $Jw = $base_url . "/?q=showSAMLresponse&idpname=" . $bK;
> return $Jw;
164,173c164,173
< $sM = $form["miniorange_saml_enable_login"]["#value"];
< $u1 = $form["miniorange_saml_idp_issuer"]["#value"];
< $PB = $form["miniorange_saml_idp_name"]["#value"];
< $c5 = $form["miniorange_saml_sign_request"]["#value"];
< $da = $form["miniorange_saml_idp_binding"]["#value"];
< $F0 = $form["miniorange_saml_idp_login_url"]["#value"];
< $fA = $form["miniorange_saml_idp_logout_url"]["#value"];
< $uy = $form["security_signature_algorithm"]["#value"];
< if (!(empty($u1) || empty($F0) || empty($PB))) {
< goto Wb;
---
> $v5 = $form["miniorange_saml_enable_login"]["#value"];
> $jm = $form["miniorange_saml_idp_issuer"]["#value"];
> $yZ = $form["miniorange_saml_idp_name"]["#value"];
> $gv = $form["miniorange_saml_sign_request"]["#value"];
> $dc = $form["miniorange_saml_idp_binding"]["#value"];
> $Ho = $form["miniorange_saml_idp_login_url"]["#value"];
> $m3 = $form["miniorange_saml_idp_logout_url"]["#value"];
> $hH = $form["security_signature_algorithm"]["#value"];
> if (!(empty($jm) || empty($Ho) || empty($yZ))) {
> goto N3;
175c175
< drupal_set_message(t("The <b><u>Identity Provider Name, </u><u>IdP Entity ID or Issuer</u></b> and <b><u>SAML Login URL</u></b> fields are mandatory."), "error");
---
> drupal_set_message(t("The <b><u>Identity Provider Name, </u><u>IdP Entity ID or Issuer</u></b> and <b><u>SAML Login URL</u></b> fields are mandatory."), "error");
177,257c177,257
< Wb:
< $vw = isset($form["miniorange_saml_idp_x509_certificate_1"]["#value"]) ? $form["miniorange_saml_idp_x509_certificate_1"]["#value"] : '';
< $er = isset($form["miniorange_saml_idp_x509_certificate_2"]["#value"]) ? $form["miniorange_saml_idp_x509_certificate_2"]["#value"] : '';
< $Cd = isset($form["miniorange_saml_idp_x509_certificate_3"]["#value"]) ? $form["miniorange_saml_idp_x509_certificate_3"]["#value"] : '';
< $R_ = isset($form["miniorange_saml_idp_x509_certificate_4"]["#value"]) ? $form["miniorange_saml_idp_x509_certificate_4"]["#value"] : '';
< $Jh = [$vw, $er, $Cd, $R_];
< $bT = array_filter($Jh);
< $Uo = array_values($bT);
< foreach ($Uo as $mz => $rE) {
< $Uo[$mz] = Utilities::sanitize_certificate($rE);
< At:
< }
< Vq:
< if (!(empty($Uo) || is_null($Uo))) {
< goto so;
< }
< $Uo = NULL;
< so:
< $NE = $form["miniorange_saml_idp_binding_slo"]["#value"];
< $RE = $form["miniorange_nameid_format"]["#value"];
< if ($da == 1) {
< goto Wn;
< }
< $uL = "HTTP-Redirect";
< goto nK;
< Wn:
< $uL = "HTTP-POST";
< nK:
< if ($NE == 1) {
< goto ru;
< }
< $Tv = "HTTP-Redirect";
< goto dS;
< ru:
< $Tv = "HTTP-POST";
< dS:
< if ($c5 == 1) {
< goto Yt;
< }
< $gq = FALSE;
< goto v_;
< Yt:
< $gq = TRUE;
< v_:
< if ($sM == 1) {
< goto uA;
< }
< $sM = FALSE;
< goto XA;
< uA:
< $sM = TRUE;
< XA:
< variable_set("miniorange_saml_enable_login", $sM);
< $Pz = $base_url . "/?q=samlassertion";
< variable_set("miniorange_saml_sp_issuer", $Pz);
< $ZQ = db_query("SELECT * FROM {miniorange_saml_idp_list}");
< $IX = $ZQ->fetchAll();
< $Pj = -1;
< $kO = '';
< $xc = '';
< foreach ($IX as $c3) {
< if (!($c3->mo_idp_issuer == $u1 || $c3->mo_idp_sso_url == $F0)) {
< goto Xq;
< }
< $Pj = $c3->id;
< $kO = $c3->miniorange_saml_fetch_metadata_time_intervals;
< $xc = $c3->miniorange_saml_meta_data_url;
< Xq:
< XP:
< }
< Oy:
< if ($Pj == -1) {
< goto FG;
< }
< Utilities::Database_update($PB, $u1, $F0, $Uo, $RE, $gq, $uL, $Tv, $fA, $kO, $xc, $Pj, $uy);
< goto wQ;
< FG:
< Utilities::Database_insert($PB, $u1, $F0, $Uo, $RE, $gq, $uL, $Tv, $fA, $kO, $xc, $uy);
< wQ:
< drupal_set_message(t("Identity Provider Configuration successfully saved"));
< header("Location:" . $base_url . "/admin/config/people/miniorange_saml/sp_setup");
---
> N3:
> $E3 = isset($form["miniorange_saml_idp_x509_certificate_1"]["#value"]) ? $form["miniorange_saml_idp_x509_certificate_1"]["#value"] : '';
> $zl = isset($form["miniorange_saml_idp_x509_certificate_2"]["#value"]) ? $form["miniorange_saml_idp_x509_certificate_2"]["#value"] : '';
> $ZI = isset($form["miniorange_saml_idp_x509_certificate_3"]["#value"]) ? $form["miniorange_saml_idp_x509_certificate_3"]["#value"] : '';
> $SY = isset($form["miniorange_saml_idp_x509_certificate_4"]["#value"]) ? $form["miniorange_saml_idp_x509_certificate_4"]["#value"] : '';
> $sV = [$E3, $zl, $ZI, $SY];
> $qu = array_filter($sV);
> $Ny = array_values($qu);
> foreach ($Ny as $ZE => $ND) {
> $Ny[$ZE] = Utilities::sanitize_certificate($ND);
> BE:
> }
> VN:
> if (!(empty($Ny) || is_null($Ny))) {
> goto Rw;
> }
> $Ny = NULL;
> Rw:
> $Al = $form["miniorange_saml_idp_binding_slo"]["#value"];
> $VC = $form["miniorange_nameid_format"]["#value"];
> if ($dc == 1) {
> goto Q1;
> }
> $Ms = "HTTP-Redirect";
> goto hO;
> Q1:
> $Ms = "HTTP-POST";
> hO:
> if ($Al == 1) {
> goto Yq;
> }
> $aX = "HTTP-Redirect";
> goto l0;
> Yq:
> $aX = "HTTP-POST";
> l0:
> if ($gv == 1) {
> goto Ic;
> }
> $v9 = FALSE;
> goto uq;
> Ic:
> $v9 = TRUE;
> uq:
> if ($v5 == 1) {
> goto GQ;
> }
> $v5 = FALSE;
> goto Mq;
> GQ:
> $v5 = TRUE;
> Mq:
> variable_set("miniorange_saml_enable_login", $v5);
> $rz = $base_url . "/?q=samlassertion";
> variable_set("miniorange_saml_sp_issuer", $rz);
> $rX = db_query("SELECT * FROM {miniorange_saml_idp_list}");
> $zN = $rX->fetchAll();
> $GX = -1;
> $PN = '';
> $Zj = '';
> foreach ($zN as $I0) {
> if (!($I0->mo_idp_issuer == $jm || $I0->mo_idp_sso_url == $Ho)) {
> goto n8;
> }
> $GX = $I0->id;
> $PN = $I0->miniorange_saml_fetch_metadata_time_intervals;
> $Zj = $I0->miniorange_saml_meta_data_url;
> n8:
> ee:
> }
> M9:
> if ($GX == -1) {
> goto gS;
> }
> Utilities::Database_update($yZ, $jm, $Ho, $Ny, $VC, $v9, $Ms, $aX, $m3, $PN, $Zj, $GX, $hH);
> goto ng;
> gS:
> Utilities::Database_insert($yZ, $jm, $Ho, $Ny, $VC, $v9, $Ms, $aX, $m3, $PN, $Zj, $hH);
> ng:
> drupal_set_message(t("Identity Provider Configuration successfully saved"));
> header("Location:" . $base_url . "/admin/config/people/miniorange_saml/sp_setup");
263,265c263,265
< $PB = $form["miniorange_saml_idp_name_3"]["#value"];
< if (!empty($PB)) {
< goto st;
---
> $yZ = $form["miniorange_saml_idp_name_3"]["#value"];
> if (!empty($yZ)) {
> goto Le;
267c267
< drupal_set_message(t("The <b>Identity Provider Name</b> field is required."), "error");
---
> drupal_set_message(t("The <b>Identity Provider Name</b> field is required."), "error");
269,279c269,279
< st:
< $Wf = $_FILES["files"]["tmp_name"]["metadata_file"];
< if (empty($Wf)) {
< goto sB;
< }
< $e3 = file_get_contents($Wf);
< $Pj = -1;
< Utilities::upload_metadata($e3, true, $PB, false, false, $Pj);
< goto jA;
< sB:
< drupal_set_message(t("The <b>Metadata file</b> field is required."), "error");
---
> Le:
> $tl = $_FILES["files"]["tmp_name"]["metadata_file"];
> if (empty($tl)) {
> goto sK;
> }
> $d6 = file_get_contents($tl);
> $GX = -1;
> Utilities::upload_metadata($d6, true, $yZ, false, false, $GX);
> goto jp;
> sK:
> drupal_set_message(t("The <b>Metadata file</b> field is required."), "error");
281,282c281,282
< jA:
< header("Location:" . $base_url . "/admin/config/people/miniorange_saml/sp_setup");
---
> jp:
> header("Location:" . $base_url . "/admin/config/people/miniorange_saml/sp_setup");
288,290c288,290
< $PB = $form["miniorange_saml_idp_name_3"]["#value"];
< if (!empty($PB)) {
< goto Mo;
---
> $yZ = $form["miniorange_saml_idp_name_3"]["#value"];
> if (!empty($yZ)) {
> goto fz;
292c292
< drupal_set_message(t("The <b>Identity Provider Name</b> field is required."), "error");
---
> drupal_set_message(t("The <b>Identity Provider Name</b> field is required."), "error");
294,306c294,306
< Mo:
< $kO = $form["miniorange_saml_fetch_metadata_after_specific_time"]["#value"];
< $xc = filter_var($form["metadata_URL"]["#value"], FILTER_SANITIZE_URL);
< $u8 = array("ssl" => array("verify_peer" => false, "verify_peer_name" => false));
< $Pj = -1;
< if (empty($xc)) {
< goto Is;
< }
< @($e3 = file_get_contents($xc, false, stream_context_create($u8)));
< Utilities::upload_metadata($e3, $PB, $kO, $xc, true, $Pj);
< goto vg;
< Is:
< drupal_set_message(t("The <b>Metadata URL</b> field is required."), "error");
---
> fz:
> $PN = $form["miniorange_saml_fetch_metadata_after_specific_time"]["#value"];
> $Zj = filter_var($form["metadata_URL"]["#value"], FILTER_SANITIZE_URL);
> $M0 = array("ssl" => array("verify_peer" => false, "verify_peer_name" => false));
> $GX = -1;
> if (empty($Zj)) {
> goto rT;
> }
> @($d6 = file_get_contents($Zj, false, stream_context_create($M0)));
> Utilities::upload_metadata($d6, $yZ, $PN, $Zj, true, $GX);
> goto vH;
> rT:
> drupal_set_message(t("The <b>Metadata URL</b> field is required."), "error");
308,309c308,309
< vg:
< header("Location:" . $base_url . "/admin/config/people/miniorange_saml/sp_setup");
---
> vH:
> header("Location:" . $base_url . "/admin/config/people/miniorange_saml/sp_setup");
314,317c314,317
< $hE = $form["miniorange_saml_email_address"]["#value"];
< $cA = $form["miniorange_saml_phone_number"]["#value"];
< $v5 = $form["miniorange_saml_support_query"]["#value"];
< Utilities::send_query($hE, $cA, $v5);
---
> $fa = $form["miniorange_saml_email_address"]["#value"];
> $PA = $form["miniorange_saml_phone_number"]["#value"];
> $Mp = $form["miniorange_saml_support_query"]["#value"];
> Utilities::send_query($fa, $PA, $Mp);
319c319
< echo "
<script>
function redirect_to_attribute_mapping(){
\xa var baseurl = window.location.href.replace("sp_setup","mapping_config");
\xa window.location.href= baseurl;\xd\xa }
</script>";
---
> echo "\xd\xa <script>\xd
function redirect_to_attribute_mapping(){\xd\xa var baseurl = window.location.href.replace("sp_setup","mapping_config");\xd\xa window.location.href= baseurl;\xd\xa }\xd
</script>";
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/miniorange_saml_licensing.inc" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/miniorange_saml_licensing.inc"
6,17c6,17
< drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/bootstrap.min.css", array("group" => CSS_DEFAULT, "every_page" => FALSE));
< drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css", array("group" => CSS_DEFAULT, "every_page" => FALSE));
< $form["header_top_style_2"] = array("#markup" => "<div class="mo_saml_table_layout_1"><div class="mo_saml_table_layout">");
< $form["markup_1"] = array("#markup" => "<br><h2>Upgrade Plans</h2><hr>");
< $form["markup_free"] = array("#markup" => "<html lang="en">\xd\xa <head>\xd\xa <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
\xa <!-- Main Style -->\xd\xa </head>\xd
<body>\xd\xa <!-- Pricing Table Section -->
\xa <section id="pricing-table">\xd\xa <div class="container_1">
\xa <div class="row">\xd\xa <div class="pricing">\xd\xa <div>
\xa <div class="pricing-table class_inline_1">
<div class="pricing-header">
\xa <h2 class="pricing-title">Features / Plans</h2>\xd
</div>
<div class="pricing-list">
<ul>
\xa <li>Unlimited Authentications via IdP</li>
<li>Configure SP Using Metadata XML File</li>\xd\xa <li>Configure SP Using Metadata URL</li>\xd\xa <li>Basic Attribute Mapping</li>\xd
<li>Basic Role Mapping</li>\xd
<li>Step-By-Step Guide to Setup IdP</li>
<li>Export Configuration</li>
<li>Options to select SAML Request Binding Type</li>\xd
<li>Signed SSO and SLO requests</li>\xd\xa <li>Import Configuration</li>\xd\xa <li>Protect your whole site</li>
<li>Force authentication on each login attempt</li>\xd
<li>Default Redirect Url after Login</li>
\xa <li>Integrated Windows Authentication(With ADFS)***</li>\xd
<li>SAML Single Logout</li>\xd\xa <li>Custom Attribute Mapping</li>\xd
<li>Custom Role Mapping</li>
\xa <li>End to End Identity Provider Configuration **</li>\xd
<li>Auto-sync IdP Configuration from metadata</li>\xd
<li>Generate Custom SP Certificate</li>
<li>Signed requests using different algorithm</li>
\xa <li>Support multiple certificates of IDP</li>
<li>Multiple IDP's Supported ****</li>
</ul>
</div>\xd
</div>
<div class="pricing-table class_inline">
\xa <div class="pricing-header">
\xa <p class="pricing-title">Free</p>
\xa <p class="pricing-rate"><sup>$</sup> 0</p>\xd
<div class="filler-class"></div>\xd\xa <a class="btn btn-danger btn-sm mo_btn_note" style="background-color: #337ab7 !important; border-color: #337ab7 !important;display: block;">Free Plan</a>
</div>
<div class="pricing-list">\xd
<ul>
<li>✔</li>\xd\xa <li>✔</li>
\xa <li>✔</li>\xd
<li>✔</li>
\xa <li>✔</li>\xd\xa <li>✔</li>
\xa <li>✔</li>
<li></li>
<li></li>\xd
<li></li>\xd\xa <li></li>
<li></li>\xd\xa <li></li>\xd\xa <li></li>\xd\xa <li></li>\xd
<li></li>\xd\xa <li></li>\xd
<li></li>\xd
<li></li>
\xa <li></li>
\xa <li></li>
<li></li>\xd\xa <li></li>\xd\xa </ul>\xd
</div>\xd\xa </div>
\xa
<div class="pricing-table class_inline">\xd
<div class="pricing-header">\xd
<p class="pricing-title">Standard<br> <span>(Auto-Redirect to IdP)</span></p>
\xa <p class="pricing-rate"><sup>$</sup> 249<sup>*</sup></p>\xd\xa <div class="filler-class"></div>\xd\xa <a href="https://login.xecurify.com/moas/login?redirectUrl=https://login.xecurify.com/moas/initializepayment&requestOrigin=drupal_miniorange_saml_standard_plan"\xd\xa target="_blank" class="btn btn-custom btn-danger btn-sm" style="background-color: #337ab7 !important; border-color: #337ab7 !important;display: block;">Standard</a>
\xa </div>
<div class="pricing-list">
<ul>
<li>✔</li>
<li>✔</li>\xd
<li>✔</li>
<li>✔</li>
\xa <li>✔</li>\xd\xa <li>✔</li>
\xa <li>✔</li>
\xa <li>✔</li>
<li>✔</li>\xd\xa <li>✔</li>
<li>✔</li>\xd\xa <li>✔</li>
\xa <li>✔</li>\xd\xa <li>✔</li>
<li></li>\xd
<li></li>
<li></li>\xd
<li></li>
\xa <li></li>\xd
<li></li>
<li></li>\xd\xa <li></li>\xd
<li></li>\xd
</ul>\xd\xa </div>
</div>\xd
\xa \xd
<div class="pricing-table class_inline">\xd\xa <div class="pricing-header">
\xa <p class="pricing-title">Premium<br><span>(Attribute & Role Mapping)</span></p>
\xa <p class="pricing-rate"><sup>$</sup> 399<sup>*</sup></p>\xd\xa <a href="https://login.xecurify.com/moas/login?redirectUrl=https://login.xecurify.com/moas/initializepayment&requestOrigin=drupal_miniorange_saml_premium_plan"
\xa target="_blank" class="btn btn-custom btn-danger btn-sm" style="background-color: #337ab7 !important; border-color: #337ab7 !important;display: block;">Premium</a>\xd\xa </div>\xd\xa <div class="pricing-list">\xd
<ul>\xd\xa <li>✔</li>
<li>✔</li>
<li>✔</li>\xd
<li>✔</li>\xd
<li>✔</li>
<li>✔</li>\xd
<li>✔</li>\xd\xa <li>✔</li>
<li>✔</li>
\xa <li>✔</li>
\xa <li>✔</li>
<li>✔</li>
<li>✔</li>\xd\xa <li>✔</li>
\xa <li>✔</li>
<li>✔</li>\xd\xa <li>✔</li>
\xa <li>✔</li>\xd\xa <li></li>
\xa <li></li>
\xa <li></li>\xd\xa <li></li>
\xa <li></li>
</ul>\xd\xa </div>\xd
</div>
\xa <div class="pricing-table class_inline">\xd\xa <div class="pricing-header">\xd
<p class="pricing-title">Enterprise <br><span>(Multiple IdP)</span></p>
\xa <p class="pricing-rate"><sup>$</sup> 449<sup>*</sup></p>\xd
<a href="https://login.xecurify.com/moas/login?redirectUrl=https://login.xecurify.com/moas/initializepayment&requestOrigin=drupal_miniorange_saml_enterprise_plan"
target="_blank" class="btn btn-custom btn-danger btn-sm" style="background-color: #337ab7 !important; border-color: #337ab7 !important;display: block;">Enterprise</a>\xd\xa </div>
\xa <div class="pricing-list">
\xa <ul>\xd
<li>✔</li>
\xa <li>✔</li>
<li>✔</li>
\xa <li>✔</li>
\xa <li>✔</li>\xd
<li>✔</li>\xd\xa <li>✔</li>
<li>✔</li>\xd
<li>✔</li>
\xa <li>✔</li>
<li>✔</li>
\xa <li>✔</li>\xd
<li>✔</li>
\xa <li>✔</li>\xd\xa <li>✔</li>
<li>✔</li>\xd\xa <li>✔</li>\xd\xa <li>✔</li>
<li>✔</li>\xd
<li>✔</li>\xd\xa <li>✔</li>\xd
<li>✔</li>\xd\xa <li>✔</li>\xd\xa </ul>\xd\xa </div>\xd\xa </div>
</div>\xd\xa </div>
</div>
</div>
</section>\xd\xa <!-- Pricing Table Section End -->
\xa </body>
\xa </html>");
< $form["markup_4"] = array("#markup" => "<h3>Identity Providers Supported</h3>" . "We support all SAML compliant Identity Providers like Google Apps, ADFS, Okta, Salesforce, Shibboleth, SimpleSAMLphp, OpenAM, Centrify, Ping, RSA, IBM, Oracle, OneLogin, Bitium, WSO2, NetIQ, Portal Guard, Oracle Access Manager and miniOrange Identity Provider.");
< $form["markup_5"] = array("#markup" => "<h3>Steps to Upgrade to Premium Module</h3>" . "<ol><li>You will be redirected to miniOrange Login Console. Enter your password with which you created an" . " account with us. After that you will be redirected to payment page.</li>" . "<li>Enter your card details and complete the payment. On successful payment completion, you will see the link to download the premium module.</li>" . "<li>Once you download the premium module, just unzip it and replace the folder with existing module. Run the Drupal update script. URL to run update script: <b><i>Base URL of Drupal site/update.php</i></b></li></ol>");
< $form["markup_6"] = array("#markup" => "<h6>* One Time Payment</h6>");
< $form["markup_7"] = array("#markup" => "<h3>** End to End Identity Provider Integration (Additional charges may apply)</h3>" . "We will setup a Conference Call / Gotomeeting and do end to end configuration for you for IDP " . "as well as module. We provide services to do the configuration on your behalf. (Extra charges applicable at $60/hr)<br>\xd
If you have any doubts regarding the licensing plans, you can mail us at <a href="mailto:[email protected]"><i>[email protected]</i>
\xa </a> or submit a query using the support form <b>(support form available on each tab).</b>");
< $form["markup_s"] = array("#markup" => "<h3>***Integrated Windows Authentication</h3>" . "With Integrated windows authentication, if the user comes to your Drupal Site from a domain joined machine" . " then he will not even have to re-enter his credentials because <br>he already did that when he unlocked his computer.");
< $form["markup_9"] = array("#markup" => "<h3>****Multiple IDP Support</h3>" . "If you want users from different Identity Providers to SSO into your site then you can configure the module with multiple IDPs." . " <b>Additional charges will be applicable based on the number of Identity Providers you wish to configure.</b>");
< $form["markup_8"] = array("#markup" => "<br><br></div></div>");
---
> drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/bootstrap.min.css", array("group" => CSS_DEFAULT, "every_page" => FALSE));
> drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css", array("group" => CSS_DEFAULT, "every_page" => FALSE));
> $form["header_top_style_2"] = array("#markup" => "<div class="mo_saml_table_layout_1"><div class="mo_saml_table_layout">");
> $form["markup_1"] = array("#markup" => "<br><h2>Upgrade Plans</h2><hr>");
> $form["markup_free"] = array("#markup" => "<html lang="en">\xd\xa <head>
<meta charset="utf-8">
\xa <meta name="viewport" content="width=device-width, initial-scale=1">\xd
<!-- Main Style -->
</head>
\xa <body>\xd\xa <!-- Pricing Table Section -->\xd
<section id="pricing-table">\xd\xa <div class="container_1">\xd
<div class="row">\xd
<div class="pricing">\xd\xa <div>\xd
<div class="pricing-table class_inline_1">
\xa <div class="pricing-header">
\xa <h2 class="pricing-title">Features / Plans</h2>
</div>
\xa <div class="pricing-list">
<ul>\xd
<li>Unlimited Authentications via IdP</li>
<li>Configure SP Using Metadata XML File</li>
<li>Configure SP Using Metadata URL</li>\xd\xa <li>Basic Attribute Mapping</li>
<li>Basic Role Mapping</li>\xd
<li>Step-By-Step Guide to Setup IdP</li> \xd
<li>Export Configuration</li>
\xa <li>Options to select SAML Request Binding Type</li>\xd\xa <li>Signed SSO and SLO requests</li>
<li>Import Configuration</li>\xd\xa <li>Protect your whole site</li>
\xa <li>Force authentication on each login attempt</li>
<li>Default Redirect Url after Login</li>
<li>Integrated Windows Authentication(With ADFS)***</li>
<li>SAML Single Logout</li>\xd\xa <li>Custom Attribute Mapping</li>
\xa <li>Custom Role Mapping</li>
<li>End to End Identity Provider Configuration **</li>\xd\xa <li>Auto-sync IdP Configuration from metadata</li>
<li>Generate Custom SP Certificate</li>\xd\xa <li>Signed requests using different algorithm</li>
\xa <li>Support multiple certificates of IDP</li>
\xa <li>Multiple IDP's Supported ****</li>
\xa </ul>\xd
</div>\xd\xa </div>
<div class="pricing-table class_inline">\xd
<div class="pricing-header">
<p class="pricing-title">Free</p> \xd
<p class="pricing-rate"><sup>$</sup> 0</p>
<div class="filler-class"></div>\xd
<a class="btn btn-danger btn-sm mo_btn_note" style="background-color: #337ab7 !important; border-color: #337ab7 !important;display: block;">Free Plan</a>\xd\xa </div>
<div class="pricing-list">
\xa <ul>
\xa <li>✔</li>
\xa <li>✔</li>\xd\xa <li>✔</li>
\xa <li>✔</li>
\xa <li>✔</li>\xd
<li>✔</li>\xd\xa <li>✔</li>\xd\xa <li></li>
<li></li>\xd
<li></li>\xd
<li></li>\xd\xa <li></li>\xd\xa <li></li>
<li></li>\xd
<li></li>\xd
<li></li>\xd
<li></li>\xd\xa <li></li>
<li></li>\xd\xa <li></li>
<li></li>\xd\xa <li></li>\xd
<li></li>
</ul>
\xa </div>\xd
</div>\xd\xa
<div class="pricing-table class_inline">\xd
<div class="pricing-header">\xd\xa <p class="pricing-title">Standard<br> <span>(Auto-Redirect to IdP)</span></p>\xd\xa <p class="pricing-rate"><sup>$</sup> 249<sup>*</sup></p>\xd\xa <div class="filler-class"></div>\xd
<a href="https://login.xecurify.com/moas/login?redirectUrl=https://login.xecurify.com/moas/initializepayment&requestOrigin=drupal_miniorange_saml_standard_plan"\xd\xa target="_blank" class="btn btn-custom btn-danger btn-sm" style="background-color: #337ab7 !important; border-color: #337ab7 !important;display: block;">Standard</a>
</div>\xd
<div class="pricing-list">
<ul>
\xa <li>✔</li>
\xa <li>✔</li>
\xa <li>✔</li>
\xa <li>✔</li>\xd\xa <li>✔</li>\xd
<li>✔</li>
<li>✔</li>
<li>✔</li>\xd
<li>✔</li>
\xa <li>✔</li>
\xa <li>✔</li>
<li>✔</li>\xd
<li>✔</li>\xd\xa <li>✔</li>\xd
<li></li>
<li></li>\xd\xa <li></li>
<li></li>
<li></li>\xd\xa <li></li>\xd\xa <li></li>
<li></li>
\xa <li></li>
</ul>\xd
</div>
\xa </div>\xd
\xa
\xa <div class="pricing-table class_inline">\xd
<div class="pricing-header">
\xa <p class="pricing-title">Premium<br><span>(Attribute & Role Mapping)</span></p>\xd
<p class="pricing-rate"><sup>$</sup> 399<sup>*</sup></p>
\xa <a href="https://login.xecurify.com/moas/login?redirectUrl=https://login.xecurify.com/moas/initializepayment&requestOrigin=drupal_miniorange_saml_premium_plan"
\xa target="_blank" class="btn btn-custom btn-danger btn-sm" style="background-color: #337ab7 !important; border-color: #337ab7 !important;display: block;">Premium</a>\xd\xa </div>\xd
<div class="pricing-list">\xd
<ul>
<li>✔</li>\xd
<li>✔</li>\xd
<li>✔</li>
\xa <li>✔</li>\xd
<li>✔</li>
\xa <li>✔</li>
<li>✔</li>
<li>✔</li>
<li>✔</li>\xd\xa <li>✔</li>\xd\xa <li>✔</li>\xd
<li>✔</li>
\xa <li>✔</li>
<li>✔</li>\xd
<li>✔</li>
\xa <li>✔</li>
\xa <li>✔</li>
\xa <li>✔</li>\xd
<li></li>\xd\xa <li></li>\xd
<li></li>\xd\xa <li></li>
<li></li>
\xa </ul>\xd
</div>\xd\xa </div>\xd
<div class="pricing-table class_inline">\xd\xa <div class="pricing-header">\xd\xa <p class="pricing-title">Enterprise <br><span>(Multiple IdP)</span></p>
<p class="pricing-rate"><sup>$</sup> 449<sup>*</sup></p>
<a href="https://login.xecurify.com/moas/login?redirectUrl=https://login.xecurify.com/moas/initializepayment&requestOrigin=drupal_miniorange_saml_enterprise_plan"
target="_blank" class="btn btn-custom btn-danger btn-sm" style="background-color: #337ab7 !important; border-color: #337ab7 !important;display: block;">Enterprise</a>\xd\xa </div>\xd
<div class="pricing-list">\xd
<ul>
\xa <li>✔</li>\xd\xa <li>✔</li>
\xa <li>✔</li>
<li>✔</li>\xd\xa <li>✔</li>\xd\xa <li>✔</li>
\xa <li>✔</li>\xd
<li>✔</li>\xd
<li>✔</li>\xd\xa <li>✔</li>
<li>✔</li>\xd
<li>✔</li>\xd
<li>✔</li>\xd
<li>✔</li>
\xa <li>✔</li>
<li>✔</li>
\xa <li>✔</li>\xd
<li>✔</li>\xd
<li>✔</li>
\xa <li>✔</li>\xd\xa <li>✔</li>\xd\xa <li>✔</li>
<li>✔</li>\xd
</ul>
\xa </div>\xd
</div>\xd\xa </div>
\xa </div>\xd
</div>\xd\xa </div>\xd\xa </section>\xd\xa <!-- Pricing Table Section End -->
\xa </body>\xd\xa </html>");
> $form["markup_4"] = array("#markup" => "<h3>Identity Providers Supported</h3>" . "We support all SAML compliant Identity Providers like Google Apps, ADFS, Okta, Salesforce, Shibboleth, SimpleSAMLphp, OpenAM, Centrify, Ping, RSA, IBM, Oracle, OneLogin, Bitium, WSO2, NetIQ, Portal Guard, Oracle Access Manager and miniOrange Identity Provider.");
> $form["markup_5"] = array("#markup" => "<h3>Steps to Upgrade to Premium Module</h3>" . "<ol><li>You will be redirected to miniOrange Login Console. Enter your password with which you created an" . " account with us. After that you will be redirected to payment page.</li>" . "<li>Enter your card details and complete the payment. On successful payment completion, you will see the link to download the premium module.</li>" . "<li>Once you download the premium module, just unzip it and replace the folder with existing module. Run the Drupal update script. URL to run update script: <b><i>Base URL of Drupal site/update.php</i></b></li></ol>");
> $form["markup_6"] = array("#markup" => "<h6>* One Time Payment</h6>");
> $form["markup_7"] = array("#markup" => "<h3>** End to End Identity Provider Integration (Additional charges may apply)</h3>" . "We will setup a Conference Call / Gotomeeting and do end to end configuration for you for IDP " . "as well as module. We provide services to do the configuration on your behalf. (Extra charges applicable at $60/hr)<br>
\xa If you have any doubts regarding the licensing plans, you can mail us at <a href="mailto:[email protected]"><i>[email protected]</i>
\xa </a> or submit a query using the support form <b>(support form available on each tab).</b>");
> $form["markup_s"] = array("#markup" => "<h3>***Integrated Windows Authentication</h3>" . "With Integrated windows authentication, if the user comes to your Drupal Site from a domain joined machine" . " then he will not even have to re-enter his credentials because <br>he already did that when he unlocked his computer.");
> $form["markup_9"] = array("#markup" => "<h3>****Multiple IDP Support</h3>" . "If you want users from different Identity Providers to SSO into your site then you can configure the module with multiple IDPs." . " <b>Additional charges will be applicable based on the number of Identity Providers you wish to configure.</b>");
> $form["markup_8"] = array("#markup" => "<br><br></div></div>");
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/miniorange_saml_login_options.inc" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/miniorange_saml_login_options.inc"
7,20c7,20
< drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/bootstrap.min.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
< drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
< $yu = Utilities::miniorange_get_baseURL();
< $ww = Utilities::isCustomerRegistered($form, $form_state);
< $form["header_top_style_1"] = array("#markup" => "<div class="mo_saml_table_layout_1">");
< $form["markup_1"] = array("#markup" => "<div class="mo_saml_table_layout mo_saml_container"><h3>SINGLE SIGN-ON LINK</h3><hr><br>");
< $sB = array("idpname" => array("data" => t("Identity Provider Name")), "link" => array("data" => t("SP Initiated SSO Link")));
< $s9 = array();
< $ZQ = db_query("SELECT * FROM {miniorange_saml_idp_list}");
< $IX = $ZQ->fetchAll();
< foreach ($IX as $n0) {
< $s9[$n0->id] = array("idpname" => $n0->mo_idp_name, "link" => $base_url . "/?q=samllogin&idpname=" . $n0->mo_idp_name);
< $form["fieldset"]["customerinfo"] = array("#theme" => "table", "#header" => $sB, "#rows" => $s9);
< Lw:
---
> drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/bootstrap.min.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
> drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
> $Gx = Utilities::miniorange_get_baseURL();
> $Ih = Utilities::isCustomerRegistered($form, $form_state);
> $form["header_top_style_1"] = array("#markup" => "<div class="mo_saml_table_layout_1">");
> $form["markup_1"] = array("#markup" => "<div class="mo_saml_table_layout mo_saml_container"><h3>SINGLE SIGN-ON LINK</h3><hr><br>");
> $Ch = array("idpname" => array("data" => t("Identity Provider Name")), "link" => array("data" => t("SP Initiated SSO Link")));
> $cj = array();
> $rX = db_query("SELECT * FROM {miniorange_saml_idp_list}");
> $zN = $rX->fetchAll();
> foreach ($zN as $Ru) {
> $cj[$Ru->id] = array("idpname" => $Ru->mo_idp_name, "link" => $base_url . "/?q=samllogin&idpname=" . $Ru->mo_idp_name);
> $form["fieldset"]["customerinfo"] = array("#theme" => "table", "#header" => $Ch, "#rows" => $cj);
> y1:
22,34c22,34
< u_:
< $form["miniorange-saml-signin-settings-tab"] = array("#markup" => "<br><h3>AUTO-REDIRECTION from SITE</h3><hr><br>");
< $pZ = Utilities::show_idp_list();
< $hX = array_search(variable_get("miniorange_saml_default_idp_name", ''), $pZ);
< $form["miniorange_saml_select_idp_name"] = array("#type" => "select", "#title" => t("Select IDP as the Default Identity Provider"), "#options" => $pZ, "#default_value" => $hX, "#attributes" => array("style" => "width:65%"), "#disabled" => $ww, "#description" => t("<b>NOTE: </b>Selecting this IDP as default will enable all the users to redirect to this IDP's login page if the Auto-redirect feature is on."));
< $form["miniorange_saml_auto_redirect"] = array("#type" => "checkbox", "#title" => t("Check this option if you want to <b>auto redirect the user to IdP</b>"), "#default_value" => variable_get("miniorange_saml_auto_redirect_to_idp"), "#disabled" => $ww, "#description" => t("<b>Note: </b>Users will be redirected to your IdP for login when the login page is accessed.<br><br>"));
< $form["miniorange_saml_force_auth"] = array("#type" => "checkbox", "#title" => t("Protect website against anonymous access"), "#default_value" => variable_get("miniorange_saml_force_auth", ''), "#disabled" => $ww, "#description" => t("<b>Note: </b>Users will be redirected to your IdP for login in case user is not logged in and tries to access website.<br><br>"));
< $form["miniorange_saml_enable_backdoor"] = array("#type" => "checkbox", "#title" => t("Check this option if you want to enable <b>backdoor login</b>"), "#default_value" => variable_get("miniorange_saml_enable_backdoor", ''), "#disabled" => $ww, "#description" => t("<b>Note: </b>Checking this option <b>creates a backdoor to login to your Website using Drupal credentials</b><br>" . " incase you get locked out of your IdP. Note down this URL: <b><a>" . $yu . "/?saml_login=false</b></a><br><br>"));
< $form["miniorange_saml_default_relaystate"] = array("#type" => "textfield", "#title" => t("Default Redirect URL after login"), "#default_value" => variable_get("miniorange_saml_default_relaystate", ''), "#attributes" => array("style" => "width:65%", "placeholder" => "Enter Default Redirect URL After Login"), "#disabled" => $ww);
< $form["miniorange_saml_default_redirect_url_logout"] = array("#type" => "textfield", "#title" => t("Default Redirect URL after logout"), "#default_value" => variable_get("miniorange_saml_default_redirect_url_logout", ''), "#attributes" => array("style" => "width:65%", "placeholder" => "Enter Default Redirect URL After Logout"), "#disabled" => $ww);
< $form["miniorange_saml_br"] = array("#markup" => "<br>");
< $form["miniorange_saml_gateway_config_submit"] = array("#type" => "submit", "#value" => t("Save Configuration"), "#submit" => array("miniorange_saml_save_signin_settings"), "#disabled" => $ww);
< $form["miniorange_saml_support_div_end"] = array("#markup" => "</div>");
---
> tR:
> $form["miniorange-saml-signin-settings-tab"] = array("#markup" => "<br><h3>AUTO-REDIRECTION from SITE</h3><hr><br>");
> $lu = Utilities::show_idp_list();
> $KM = array_search(variable_get("miniorange_saml_default_idp_name", ''), $lu);
> $form["miniorange_saml_select_idp_name"] = array("#type" => "select", "#title" => t("Select IDP as the Default Identity Provider"), "#options" => $lu, "#default_value" => $KM, "#attributes" => array("style" => "width:65%"), "#disabled" => $Ih, "#description" => t("<b>NOTE: </b>Selecting this IDP as default will enable all the users to redirect to this IDP's login page if the Auto-redirect feature is on."));
> $form["miniorange_saml_auto_redirect"] = array("#type" => "checkbox", "#title" => t("Check this option if you want to <b>auto redirect the user to IdP</b>"), "#default_value" => variable_get("miniorange_saml_auto_redirect_to_idp"), "#disabled" => $Ih, "#description" => t("<b>Note: </b>Users will be redirected to your IdP for login when the login page is accessed.<br><br>"));
> $form["miniorange_saml_force_auth"] = array("#type" => "checkbox", "#title" => t("Protect website against anonymous access"), "#default_value" => variable_get("miniorange_saml_force_auth", ''), "#disabled" => $Ih, "#description" => t("<b>Note: </b>Users will be redirected to your IdP for login in case user is not logged in and tries to access website.<br><br>"));
> $form["miniorange_saml_enable_backdoor"] = array("#type" => "checkbox", "#title" => t("Check this option if you want to enable <b>backdoor login</b>"), "#default_value" => variable_get("miniorange_saml_enable_backdoor", ''), "#disabled" => $Ih, "#description" => t("<b>Note: </b>Checking this option <b>creates a backdoor to login to your Website using Drupal credentials</b><br>" . " incase you get locked out of your IdP. Note down this URL: <b><a>" . $Gx . "/?saml_login=false</b></a><br><br>"));
> $form["miniorange_saml_default_relaystate"] = array("#type" => "textfield", "#title" => t("Default Redirect URL after login"), "#default_value" => variable_get("miniorange_saml_default_relaystate", ''), "#attributes" => array("style" => "width:65%", "placeholder" => "Enter Default Redirect URL After Login"), "#disabled" => $Ih);
> $form["miniorange_saml_default_redirect_url_logout"] = array("#type" => "textfield", "#title" => t("Default Redirect URL after logout"), "#default_value" => variable_get("miniorange_saml_default_redirect_url_logout", ''), "#attributes" => array("style" => "width:65%", "placeholder" => "Enter Default Redirect URL After Logout"), "#disabled" => $Ih);
> $form["miniorange_saml_br"] = array("#markup" => "<br>");
> $form["miniorange_saml_gateway_config_submit"] = array("#type" => "submit", "#value" => t("Save Configuration"), "#submit" => array("miniorange_saml_save_signin_settings"), "#disabled" => $Ih);
> $form["miniorange_saml_support_div_end"] = array("#markup" => "</div>");
40,48c40,48
< $yn = $form["miniorange_saml_default_relaystate"]["#value"];
< $uW = $form["miniorange_saml_default_redirect_url_logout"]["#value"];
< $rS = $form["miniorange_saml_auto_redirect"]["#value"];
< $V3 = $form["miniorange_saml_select_idp_name"]["#value"];
< $DR = $form["miniorange_saml_force_auth"]["#value"];
< $kp = $form["miniorange_saml_enable_backdoor"]["#value"];
< $pZ = Utilities::show_idp_list();
< if ($rS == 1) {
< goto VP;
---
> $Rc = $form["miniorange_saml_default_relaystate"]["#value"];
> $pt = $form["miniorange_saml_default_redirect_url_logout"]["#value"];
> $vM = $form["miniorange_saml_auto_redirect"]["#value"];
> $hE = $form["miniorange_saml_select_idp_name"]["#value"];
> $HB = $form["miniorange_saml_force_auth"]["#value"];
> $CD = $form["miniorange_saml_enable_backdoor"]["#value"];
> $lu = Utilities::show_idp_list();
> if ($vM == 1) {
> goto W3;
50,56c50,56
< $rS = FALSE;
< goto Gt;
< VP:
< $rS = TRUE;
< Gt:
< if ($DR == 1) {
< goto np;
---
> $vM = FALSE;
> goto mT;
> W3:
> $vM = TRUE;
> mT:
> if ($HB == 1) {
> goto uk;
58,64c58,64
< $DR = FALSE;
< goto cI;
< np:
< $DR = TRUE;
< cI:
< if ($kp == 1) {
< goto Du;
---
> $HB = FALSE;
> goto AY;
> uk:
> $HB = TRUE;
> AY:
> if ($CD == 1) {
> goto TN;
66,77c66,77
< $kp = FALSE;
< goto Gd;
< Du:
< $kp = TRUE;
< Gd:
< variable_set("miniorange_saml_default_relaystate", $yn);
< variable_set("miniorange_saml_default_redirect_url_logout", $uW);
< variable_set("miniorange_saml_force_auth", $DR);
< variable_set("miniorange_saml_auto_redirect_to_idp", $rS);
< variable_set("miniorange_saml_default_idp_name", $pZ[$V3]);
< variable_set("miniorange_saml_enable_backdoor", $kp);
< drupal_set_message(t("Signin Settings successfully saved"));
---
> $CD = FALSE;
> goto yI;
> TN:
> $CD = TRUE;
> yI:
> variable_set("miniorange_saml_default_relaystate", $Rc);
> variable_set("miniorange_saml_default_redirect_url_logout", $pt);
> variable_set("miniorange_saml_force_auth", $HB);
> variable_set("miniorange_saml_auto_redirect_to_idp", $vM);
> variable_set("miniorange_saml_default_idp_name", $lu[$hE]);
> variable_set("miniorange_saml_enable_backdoor", $CD);
> drupal_set_message(t("Signin Settings successfully saved"));
81,84c81,84
< $hE = $form["miniorange_saml_email_address"]["#value"];
< $cA = $form["miniorange_saml_phone_number"]["#value"];
< $v5 = $form["miniorange_saml_support_query"]["#value"];
< Utilities::send_query($hE, $cA, $v5);
---
> $fa = $form["miniorange_saml_email_address"]["#value"];
> $PA = $form["miniorange_saml_phone_number"]["#value"];
> $Mp = $form["miniorange_saml_support_query"]["#value"];
> Utilities::send_query($fa, $PA, $Mp);
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/miniorange_saml_mapping.inc" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/miniorange_saml_mapping.inc"
4c4
< echo " ";
---
> echo " ";
8,122c8,122
< drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/bootstrap.min.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
< drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
< drupal_add_js(drupal_get_path("module", "miniorange_saml") . "/js/addAttribute.js", "file");
< $ww = Utilities::isCustomerRegistered($form, $form_state);
< $form["header_top_style_1"] = array("#markup" => "<div class="mo_saml_table_layout_1">");
< $form["markup_1"] = array("#markup" => "<div class="mo_saml_table_layout mo_saml_container"><h3>ATTRIBUTE MAPPING</h3><hr><br/>");
< $form["miniorange_saml_account_username_by"] = array("#type" => "select", "#title" => t("Login/Create Drupal account by"), "#options" => array(1 => t("Username"), 2 => t("Email")), "#default_value" => variable_get("miniorange_saml_login_by"), "#attributes" => array("style" => "width:73%"), "#disabled" => $ww);
< $form["miniorange_saml_username_attribute"] = array("#type" => "textfield", "#title" => t("Username Attribute"), "#default_value" => variable_get("miniorange_saml_username_attribute", "NameID"), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter Username attribute"), "#required" => TRUE, "#disabled" => $ww);
< $form["miniorange_saml_email_attribute"] = array("#type" => "textfield", "#title" => t("Email Attribute"), "#default_value" => variable_get("miniorange_saml_email_attribute", "NameID"), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter Email attribute"), "#required" => TRUE);
< $form["miniorange_saml_idp_attr1_name"] = array("#type" => "textfield", "#title" => t("Role"), "#default_value" => variable_get("miniorange_saml_idp_attr1_name", ''), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter Role Attribute"), "#required" => FALSE, "#disabled" => $ww);
< $form["markup_cam_top_head"] = array("#markup" => "<br><h3>CUSTOM ATTRIBUTE MAPPING</h3><hr><br>");
< $form["markup_cam"] = array("#markup" => "<div class="mo_saml_highlight_background_note_1"><p>Add the Drupal field attributes in the Attribute Name textfield \xd
and add the IdP attibutes that you need to map with the drupal attributes in the
\xa IdP Attribute Name textfield. Drupal Field Attributes will be of type text. \xd
Add the machine name of the attribute in the Drupal Attribute textfield.</p>\xd
<p>For example: If the attribute name in the drupal is name then its machine name will be field_name.</p></div><br>");
< $form["miniorange_saml_attr5_name"] = array("#type" => "textfield", "#title" => t("Attribute Name 1"), "#default_value" => variable_get("miniorange_saml_attr5_name", ''), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter Attribute Name"), "#required" => FALSE, "#disabled" => $ww);
< $form["miniorange_saml_idp_attr5_name"] = array("#type" => "textfield", "#title" => t("IdP Attribute Name 1"), "#default_value" => variable_get("miniorange_saml_idp_attr5_name", ''), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter IdP Attribute Name"), "#required" => FALSE, "#disabled" => $ww);
< $form["miniorange_saml_attr2_name"] = array("#type" => "textfield", "#title" => t("Attribute Name 2"), "#default_value" => variable_get("miniorange_saml_attr2_name", ''), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter Attribute Name"), "#required" => FALSE, "#disabled" => $ww);
< $form["miniorange_saml_idp_attr2_name"] = array("#type" => "textfield", "#title" => t("IdP Attribute Name 2"), "#default_value" => variable_get("miniorange_saml_idp_attr2_name", ''), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter IdP Attribute Name"), "#required" => FALSE, "#disabled" => $ww);
< $form["miniorange_saml_attr3_name"] = array("#type" => "textfield", "#title" => t("Attribute Name 3"), "#default_value" => variable_get("miniorange_saml_attr3_name", ''), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter Attribute Name"), "#required" => FALSE, "#disabled" => $ww);
< $form["miniorange_saml_idp_attr3_name"] = array("#type" => "textfield", "#title" => t("IdP Attribute Name 3"), "#default_value" => variable_get("miniorange_saml_idp_attr3_name", ''), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter IdP Attribute Name"), "#required" => FALSE, "#disabled" => $ww);
< $form["miniorange_saml_attr4_name"] = array("#type" => "textfield", "#title" => t("Attribute Name 4"), "#default_value" => variable_get("miniorange_saml_attr4_name", ''), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter Attribute Name"), "#required" => FALSE, "#disabled" => $ww);
< $form["miniorange_saml_idp_attr4_name"] = array("#type" => "textfield", "#title" => t("IdP Attribute Name 4"), "#default_value" => variable_get("miniorange_saml_idp_attr4_name", ''), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter IdP Attribute Name"), "#required" => FALSE, "#disabled" => $ww);
< $form["markup_idp_user_attr_header"] = array("#markup" => "<br /><h3> Additional User Attributes(Optional)<input type="button" id="add_user" class="btn btn-primary" style="width:3%;margin-left:2%;margin-right:2%;" value="+" onclick="add_user_attribute();"/> <input type="button" class="btn btn-danger" style="width:3%;" onclick="remove_user_attribute();" value="-" /></h3>");
< $form["markup_idp_user_attr_note"] = array("#markup" => "<div class="messages status">Attribute Name: It is the user attribute (machine name) whose value you want to set in site.<br />
\xa IdP Attribute Name: It is the name which you want to get from your IDP. It should be unique.</div>");
< $form["markup_idp_user_attr_header1"] = array("#markup" => "<div id="userProfileAttrDiv"><div class="row" id="before_attr_list_upa">" . " <div style="width:20%;display:inline-block;"><b>Attribute Name</b></div><div style="width:30%;display:inline-block;">" . " <b>IdP Attribute Name</b></div></div>");
< $mR = 0;
< $A4 = variable_get("miniorange_saml_sp_user_attributes", '');
< if (empty($A4)) {
< goto RI;
< }
< $iz = json_decode($A4, TRUE);
< foreach ($iz as $gQ => $zc) {
< $form["markup_idp_user_attr_list_" . $mR] = array("#markup" => "<div class="row userAttr" style="padding-bottom:1%;" id="uparow_" . $mR . "" >\xd\xa <div style="width:20%;display:inline-block;">\xd
<input type="text" name="user_profile_attr_name[" . $mR . "]" value="" . $gQ . "" class="form-text" />\xd
</div>\xd
<div style="width:30%;display:inline-block;">
\xa <input type="text" name="user_profile_attr_value[" . $mR . "]" value="" . $zc . "" class="form-text" />\xd\xa </div>\xd\xa </div>");
< $mR += 1;
< nh:
< }
< Yu:
< RI:
< $form["markup_idp_user_attr_header2"] = array("#markup" => "<br />");
< $form["markup_role_1"] = array("#markup" => "<h3>Custom Role Mapping</h3>");
< $form["miniorange_saml_enable_rolemapping"] = array("#type" => "checkbox", "#title" => t("Check this option if you want to <b>enable Role Mapping</b>"), "#default_value" => variable_get("miniorange_saml_enable_rolemapping"), "#disabled" => $ww);
< $form["miniorange_saml_disable_role_update"] = array("#type" => "checkbox", "#title" => t("Check this option if you do not want to update user role if roles not mapped"), "#default_value" => variable_get("miniorange_saml_disable_role_update"), "#disabled" => $ww);
< $form["miniorange_saml_disable_autocreate_users"] = array("#type" => "checkbox", "#title" => t("Check this option if you want to disable <b>auto creation</b> of users if user does not exist."), "#default_value" => variable_get("miniorange_saml_disable_autocreate_users", ''), "#disabled" => $ww);
< $xm = user_roles($ZN = TRUE);
< $my = array_search(variable_get("miniorange_saml_default_role", ''), $xm);
< $og = '';
< foreach ($xm as $rE) {
< $og .= "<option value=" . $rE . ">" . $rE . "</option>";
< XI:
< }
< KS:
< $form["miniorange_saml_default_mapping"] = array("#type" => "select", "#title" => t("Select default group for the new users"), "#options" => $xm, "#default_value" => $my, "#attributes" => array("style" => "width:73%"), "#disabled" => $ww);
< $form["role_option_string"] = array("#markup" => "<p id="role_string" hidden>" . $og . "</p>");
< $form["markup_idp_user_role_header"] = array("#markup" => "</br><h3> Role Attributes<input type="button" class="btn btn-primary" style="width:3%;margin-left:2%;margin-right:2%;" value="+" onclick="add_role();" /> </h3>");
< $form["markup_idp_user_role_header1"] = array("#markup" => "<div id="userSpRoleDiv"><div class="row" id="before_role_list_upa">" . " <div style="width:25%;display:inline-block;"><b>SP Role</b></div><div style="width:30%;display:inline-block;">" . " <b> IdP Role</b></div></div>");
< $ok = 0;
< $KD = variable_get("miniorange_saml_sp_role_names", '');
< if (empty($KD)) {
< goto V_;
< }
< $dl = json_decode($KD, TRUE);
< foreach ($dl as $uM) {
< $Pr = '';
< foreach ($xm as $rE) {
< if ($uM == $rE) {
< goto qR;
< }
< $Pr .= "<option value=" . $rE . ">" . $rE . "</option>";
< goto v4;
< qR:
< $Pr .= "<option value=" . $rE . " selected>" . $rE . "</option>";
< v4:
< JL:
< }
< Pp:
< $y_ = str_replace(" ", '', $uM);
< $ev = variable_get("miniorange_saml_role_" . $y_, '');
< $form["markup_idp_user_role_list_" . $ok] = array("#markup" => "<div class="row userRole" style="padding-bottom:1%;" id="role_" . $ok . "" >
<div style="width:25%;display:inline-block;">
\xa <select name="user_sp_role_name[" . $ok . "]" class="form-control sp_role_class">" . $Pr . "</select>
</div>
\xa <div style="width:45%;display:inline-block;">\xd\xa <input type="text" name="user_idp_role_name[" . $ok . "]" value="" . $ev . "" class="form-text" placeholder="semi-colon(;) separated"/>
</div>\xd\xa <div style="width:25%;display:inline-block;">
\xa <input type="button" id="" . $ok . "" class="btn btn-danger" style="width:10%;" value="-" onclick="remove_role(this.id);" />\xd\xa </div>\xd\xa </div>");
< $ok += 1;
< AY:
< }
< A5:
< V_:
< $form["markup_idp_user_role_header2"] = array("#markup" => "<br />");
< $form["markup_idp_user_attr_header2"] = array("#markup" => "<br />");
< $form["markup_idp_log_url_header"] = array("#markup" => "<div id="logUrlDiv"><div class="row" id="before_log_url_upa"><h3>Custom Login/Logout (Optional)<input type="button" class="btn btn-primary" style="width:3%;margin-left:2%;margin-right:2%;" value="+" onclick="add_url();" /> </h3></div>");
< $Rd = 0;
< $q6 = variable_get("miniorange_saml_log_url_class", '');
< if (empty($q6)) {
< goto my;
< }
< $q6 = json_decode($q6, true);
< foreach ($q6 as $uM) {
< $Pr = '';
< foreach ($xm as $rE) {
< if ($rE == $uM) {
< goto yC;
< }
< $Pr .= "<option value=" . $rE . ">" . $rE . "</option>";
< goto Nw;
< yC:
< $Pr .= "<option value=" . $rE . " selected>" . $rE . "</option>";
< Nw:
< eg:
< }
< gu:
< $F0 = variable_get(str_replace(" ", '', $uM . "_sin"), '');
< $fA = variable_get(str_replace(" ", '', $uM . "_sout"), '');
< $form["markup_idp_log_url_list_" . $Rd] = array("#markup" => "<div class="row logUrl" style="padding-bottom:1%;" id="url_" . $Rd . "" >\xd\xa <div style="width:68%;display:inline-block;">
\xa <select name="role_class[" . $Rd . "]" class="form-control sp_role_class">" . $Pr . "</select>\xd
</div>
\xa <div style="width:25%;display:inline-block;margin-left:22px;">
<input type="button" id="" . $Rd . "" class="btn btn-danger" style="width:10%;" value="-" onclick="remove_url(this.id);" />
</div></br></br>
<div style="width:76%;display:inline-block;">\xd
<input type="text" name="login_url[" . $Rd . "]" value="" . $F0 . "" class="form-text" placeholder="Enter Custom Login Url"/>
\xa </div></br></br>
<div style="width:76%;display:inline-block;">
\xa <input type="text" name="logout_url[" . $Rd . "]" value="" . $fA . "" class="form-text" placeholder="Enter Custom Logout Url"/>
\xa </div>
\xa </div>");
< $Rd += 1;
< wT:
< }
< ek:
< my:
< $form["miniorange_saml_div_end"] = array("#markup" => "<br>");
< $form["miniorange_saml_gateway_config_submit"] = array("#type" => "submit", "#value" => t("Save Configuration"), "#submit" => array("miniorange_saml_save_mapping_settings"), "#disabled" => $ww);
< $form["miniorange_saml_support_srart"] = array("#markup" => "</div></div></div></div>");
---
> drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/bootstrap.min.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
> drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
> drupal_add_js(drupal_get_path("module", "miniorange_saml") . "/js/addAttribute.js", "file");
> $Ih = Utilities::isCustomerRegistered($form, $form_state);
> $form["header_top_style_1"] = array("#markup" => "<div class="mo_saml_table_layout_1">");
> $form["markup_1"] = array("#markup" => "<div class="mo_saml_table_layout mo_saml_container"><h3>ATTRIBUTE MAPPING</h3><hr><br/>");
> $form["miniorange_saml_account_username_by"] = array("#type" => "select", "#title" => t("Login/Create Drupal account by"), "#options" => array(1 => t("Username"), 2 => t("Email")), "#default_value" => variable_get("miniorange_saml_login_by"), "#attributes" => array("style" => "width:73%"), "#disabled" => $Ih);
> $form["miniorange_saml_username_attribute"] = array("#type" => "textfield", "#title" => t("Username Attribute"), "#default_value" => variable_get("miniorange_saml_username_attribute", "NameID"), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter Username attribute"), "#required" => TRUE, "#disabled" => $Ih);
> $form["miniorange_saml_email_attribute"] = array("#type" => "textfield", "#title" => t("Email Attribute"), "#default_value" => variable_get("miniorange_saml_email_attribute", "NameID"), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter Email attribute"), "#required" => TRUE);
> $form["miniorange_saml_idp_attr1_name"] = array("#type" => "textfield", "#title" => t("Role"), "#default_value" => variable_get("miniorange_saml_idp_attr1_name", ''), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter Role Attribute"), "#required" => FALSE, "#disabled" => $Ih);
> $form["markup_cam_top_head"] = array("#markup" => "<br><h3>CUSTOM ATTRIBUTE MAPPING</h3><hr><br>");
> $form["markup_cam"] = array("#markup" => "<div class="mo_saml_highlight_background_note_1"><p>Add the Drupal field attributes in the Attribute Name textfield \xd\xa and add the IdP attibutes that you need to map with the drupal attributes in the \xd
IdP Attribute Name textfield. Drupal Field Attributes will be of type text.
Add the machine name of the attribute in the Drupal Attribute textfield.</p>\xd\xa <p>For example: If the attribute name in the drupal is name then its machine name will be field_name.</p></div><br>");
> $form["miniorange_saml_attr5_name"] = array("#type" => "textfield", "#title" => t("Attribute Name 1"), "#default_value" => variable_get("miniorange_saml_attr5_name", ''), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter Attribute Name"), "#required" => FALSE, "#disabled" => $Ih);
> $form["miniorange_saml_idp_attr5_name"] = array("#type" => "textfield", "#title" => t("IdP Attribute Name 1"), "#default_value" => variable_get("miniorange_saml_idp_attr5_name", ''), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter IdP Attribute Name"), "#required" => FALSE, "#disabled" => $Ih);
> $form["miniorange_saml_attr2_name"] = array("#type" => "textfield", "#title" => t("Attribute Name 2"), "#default_value" => variable_get("miniorange_saml_attr2_name", ''), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter Attribute Name"), "#required" => FALSE, "#disabled" => $Ih);
> $form["miniorange_saml_idp_attr2_name"] = array("#type" => "textfield", "#title" => t("IdP Attribute Name 2"), "#default_value" => variable_get("miniorange_saml_idp_attr2_name", ''), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter IdP Attribute Name"), "#required" => FALSE, "#disabled" => $Ih);
> $form["miniorange_saml_attr3_name"] = array("#type" => "textfield", "#title" => t("Attribute Name 3"), "#default_value" => variable_get("miniorange_saml_attr3_name", ''), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter Attribute Name"), "#required" => FALSE, "#disabled" => $Ih);
> $form["miniorange_saml_idp_attr3_name"] = array("#type" => "textfield", "#title" => t("IdP Attribute Name 3"), "#default_value" => variable_get("miniorange_saml_idp_attr3_name", ''), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter IdP Attribute Name"), "#required" => FALSE, "#disabled" => $Ih);
> $form["miniorange_saml_attr4_name"] = array("#type" => "textfield", "#title" => t("Attribute Name 4"), "#default_value" => variable_get("miniorange_saml_attr4_name", ''), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter Attribute Name"), "#required" => FALSE, "#disabled" => $Ih);
> $form["miniorange_saml_idp_attr4_name"] = array("#type" => "textfield", "#title" => t("IdP Attribute Name 4"), "#default_value" => variable_get("miniorange_saml_idp_attr4_name", ''), "#attributes" => array("style" => "width:73%", "placeholder" => "Enter IdP Attribute Name"), "#required" => FALSE, "#disabled" => $Ih);
> $form["markup_idp_user_attr_header"] = array("#markup" => "<br /><h3> Additional User Attributes(Optional)<input type="button" id="add_user" class="btn btn-primary" style="width:3%;margin-left:2%;margin-right:2%;" value="+" onclick="add_user_attribute();"/> <input type="button" class="btn btn-danger" style="width:3%;" onclick="remove_user_attribute();" value="-" /></h3>");
> $form["markup_idp_user_attr_note"] = array("#markup" => "<div class="messages status">Attribute Name: It is the user attribute (machine name) whose value you want to set in site.<br />\xd\xa IdP Attribute Name: It is the name which you want to get from your IDP. It should be unique.</div>");
> $form["markup_idp_user_attr_header1"] = array("#markup" => "<div id="userProfileAttrDiv"><div class="row" id="before_attr_list_upa">" . " <div style="width:20%;display:inline-block;"><b>Attribute Name</b></div><div style="width:30%;display:inline-block;">" . " <b>IdP Attribute Name</b></div></div>");
> $GB = 0;
> $Fh = variable_get("miniorange_saml_sp_user_attributes", '');
> if (empty($Fh)) {
> goto VI;
> }
> $pZ = json_decode($Fh, TRUE);
> foreach ($pZ as $O0 => $oP) {
> $form["markup_idp_user_attr_list_" . $GB] = array("#markup" => "<div class="row userAttr" style="padding-bottom:1%;" id="uparow_" . $GB . "" >\xd\xa <div style="width:20%;display:inline-block;">\xd
<input type="text" name="user_profile_attr_name[" . $GB . "]" value="" . $O0 . "" class="form-text" />\xd\xa </div>
<div style="width:30%;display:inline-block;">
<input type="text" name="user_profile_attr_value[" . $GB . "]" value="" . $oP . "" class="form-text" />
</div>\xd\xa </div>");
> $GB += 1;
> T7:
> }
> bK:
> VI:
> $form["markup_idp_user_attr_header2"] = array("#markup" => "<br />");
> $form["markup_role_1"] = array("#markup" => "<h3>Custom Role Mapping</h3>");
> $form["miniorange_saml_enable_rolemapping"] = array("#type" => "checkbox", "#title" => t("Check this option if you want to <b>enable Role Mapping</b>"), "#default_value" => variable_get("miniorange_saml_enable_rolemapping"), "#disabled" => $Ih);
> $form["miniorange_saml_disable_role_update"] = array("#type" => "checkbox", "#title" => t("Check this option if you do not want to update user role if roles not mapped"), "#default_value" => variable_get("miniorange_saml_disable_role_update"), "#disabled" => $Ih);
> $form["miniorange_saml_disable_autocreate_users"] = array("#type" => "checkbox", "#title" => t("Check this option if you want to disable <b>auto creation</b> of users if user does not exist."), "#default_value" => variable_get("miniorange_saml_disable_autocreate_users", ''), "#disabled" => $Ih);
> $LG = user_roles($ZR = TRUE);
> $G6 = array_search(variable_get("miniorange_saml_default_role", ''), $LG);
> $Mo = '';
> foreach ($LG as $ND) {
> $Mo .= "<option value=" . $ND . ">" . $ND . "</option>";
> g9:
> }
> ZV:
> $form["miniorange_saml_default_mapping"] = array("#type" => "select", "#title" => t("Select default group for the new users"), "#options" => $LG, "#default_value" => $G6, "#attributes" => array("style" => "width:73%"), "#disabled" => $Ih);
> $form["role_option_string"] = array("#markup" => "<p id="role_string" hidden>" . $Mo . "</p>");
> $form["markup_idp_user_role_header"] = array("#markup" => "</br><h3> Role Attributes<input type="button" class="btn btn-primary" style="width:3%;margin-left:2%;margin-right:2%;" value="+" onclick="add_role();" /> </h3>");
> $form["markup_idp_user_role_header1"] = array("#markup" => "<div id="userSpRoleDiv"><div class="row" id="before_role_list_upa">" . " <div style="width:25%;display:inline-block;"><b>SP Role</b></div><div style="width:30%;display:inline-block;">" . " <b> IdP Role</b></div></div>");
> $gL = 0;
> $m1 = variable_get("miniorange_saml_sp_role_names", '');
> if (empty($m1)) {
> goto Bj;
> }
> $jz = json_decode($m1, TRUE);
> foreach ($jz as $lE) {
> $S3 = '';
> foreach ($LG as $ND) {
> if ($lE == $ND) {
> goto eL;
> }
> $S3 .= "<option value=" . $ND . ">" . $ND . "</option>";
> goto Tm;
> eL:
> $S3 .= "<option value=" . $ND . " selected>" . $ND . "</option>";
> Tm:
> gc:
> }
> ID:
> $rA = str_replace(" ", '', $lE);
> $yL = variable_get("miniorange_saml_role_" . $rA, '');
> $form["markup_idp_user_role_list_" . $gL] = array("#markup" => "<div class="row userRole" style="padding-bottom:1%;" id="role_" . $gL . "" >\xd
<div style="width:25%;display:inline-block;">\xd\xa <select name="user_sp_role_name[" . $gL . "]" class="form-control sp_role_class">" . $S3 . "</select>
\xa </div>\xd\xa <div style="width:45%;display:inline-block;">
<input type="text" name="user_idp_role_name[" . $gL . "]" value="" . $yL . "" class="form-text" placeholder="semi-colon(;) separated"/>
</div>\xd
<div style="width:25%;display:inline-block;">
<input type="button" id="" . $gL . "" class="btn btn-danger" style="width:10%;" value="-" onclick="remove_role(this.id);" />\xd
</div>
</div>");
> $gL += 1;
> uj:
> }
> yc:
> Bj:
> $form["markup_idp_user_role_header2"] = array("#markup" => "<br />");
> $form["markup_idp_user_attr_header2"] = array("#markup" => "<br />");
> $form["markup_idp_log_url_header"] = array("#markup" => "<div id="logUrlDiv"><div class="row" id="before_log_url_upa"><h3>Custom Login/Logout (Optional)<input type="button" class="btn btn-primary" style="width:3%;margin-left:2%;margin-right:2%;" value="+" onclick="add_url();" /> </h3></div>");
> $Tf = 0;
> $Pj = variable_get("miniorange_saml_log_url_class", '');
> if (empty($Pj)) {
> goto a8;
> }
> $Pj = json_decode($Pj, true);
> foreach ($Pj as $lE) {
> $S3 = '';
> foreach ($LG as $ND) {
> if ($ND == $lE) {
> goto EU;
> }
> $S3 .= "<option value=" . $ND . ">" . $ND . "</option>";
> goto Ez;
> EU:
> $S3 .= "<option value=" . $ND . " selected>" . $ND . "</option>";
> Ez:
> Am:
> }
> Zq:
> $Ho = variable_get(str_replace(" ", '', $lE . "_sin"), '');
> $m3 = variable_get(str_replace(" ", '', $lE . "_sout"), '');
> $form["markup_idp_log_url_list_" . $Tf] = array("#markup" => "<div class="row logUrl" style="padding-bottom:1%;" id="url_" . $Tf . "" >\xd
<div style="width:68%;display:inline-block;">
<select name="role_class[" . $Tf . "]" class="form-control sp_role_class">" . $S3 . "</select>
\xa </div>\xd\xa <div style="width:25%;display:inline-block;margin-left:22px;">
\xa <input type="button" id="" . $Tf . "" class="btn btn-danger" style="width:10%;" value="-" onclick="remove_url(this.id);" />\xd
</div></br></br>\xd
<div style="width:76%;display:inline-block;">
\xa <input type="text" name="login_url[" . $Tf . "]" value="" . $Ho . "" class="form-text" placeholder="Enter Custom Login Url"/>\xd\xa </div></br></br>\xd\xa <div style="width:76%;display:inline-block;">\xd\xa <input type="text" name="logout_url[" . $Tf . "]" value="" . $m3 . "" class="form-text" placeholder="Enter Custom Logout Url"/>
\xa </div>\xd
</div>");
> $Tf += 1;
> IS:
> }
> Bl:
> a8:
> $form["miniorange_saml_div_end"] = array("#markup" => "<br>");
> $form["miniorange_saml_gateway_config_submit"] = array("#type" => "submit", "#value" => t("Save Configuration"), "#submit" => array("miniorange_saml_save_mapping_settings"), "#disabled" => $Ih);
> $form["miniorange_saml_support_srart"] = array("#markup" => "</div></div></div></div>");
128,246c128,246
< $w2 = $form["miniorange_saml_enable_rolemapping"]["#value"];
< $ON = $form["miniorange_saml_idp_attr1_name"]["#value"];
< $lf = $form["miniorange_saml_attr2_name"]["#value"];
< $LT = $form["miniorange_saml_idp_attr2_name"]["#value"];
< $eS = $form["miniorange_saml_attr3_name"]["#value"];
< $nF = $form["miniorange_saml_idp_attr3_name"]["#value"];
< $RH = $form["miniorange_saml_attr4_name"]["#value"];
< $pN = $form["miniorange_saml_idp_attr4_name"]["#value"];
< $vi = $form["miniorange_saml_attr5_name"]["#value"];
< $dQ = $form["miniorange_saml_idp_attr5_name"]["#value"];
< $xm = user_roles($ZN = TRUE);
< $rr = $form["miniorange_saml_account_username_by"]["#value"];
< $ym = $form["miniorange_saml_username_attribute"]["#value"];
< $UB = $form["miniorange_saml_email_attribute"]["#value"];
< $gl = $form["miniorange_saml_disable_role_update"]["#value"];
< $bX = $form["miniorange_saml_disable_autocreate_users"]["#value"];
< $De = $form["miniorange_saml_default_mapping"]["#value"];
< $u7 = array_key_exists("user_profile_attr_name", $_POST) ? $_POST["user_profile_attr_name"] : array();
< $lA = array_key_exists("user_profile_attr_value", $_POST) ? $_POST["user_profile_attr_value"] : array();
< $SU = array();
< foreach ($u7 as $mz => $rE) {
< if (!(!empty(trim($rE)) && !empty(trim($lA[$mz])))) {
< goto PI;
< }
< $gQ = trim($rE);
< $zc = trim($lA[$mz]);
< $SU[$gQ] = $zc;
< PI:
< au:
< }
< Jx:
< $SU = json_encode($SU);
< if ($w2 == 1) {
< goto Ng;
< }
< $w2 = FALSE;
< goto hf;
< Ng:
< $w2 = TRUE;
< hf:
< if ($bX == 1) {
< goto TJ;
< }
< $bX = FALSE;
< goto RR;
< TJ:
< $bX = TRUE;
< RR:
< if ($gl == 1) {
< goto Uh;
< }
< $gl = FALSE;
< goto r3;
< Uh:
< $gl = TRUE;
< r3:
< variable_set("miniorange_saml_enable_rolemapping", $w2);
< variable_set("miniorange_saml_idp_attr1_name", $ON);
< variable_set("miniorange_saml_attr2_name", $lf);
< variable_set("miniorange_saml_idp_attr2_name", $LT);
< variable_set("miniorange_saml_attr3_name", $eS);
< variable_set("miniorange_saml_idp_attr3_name", $nF);
< variable_set("miniorange_saml_attr4_name", $RH);
< variable_set("miniorange_saml_idp_attr4_name", $pN);
< variable_set("miniorange_saml_attr5_name", $vi);
< variable_set("miniorange_saml_idp_attr5_name", $dQ);
< variable_set("miniorange_saml_sp_user_attributes", $SU);
< if ($w2) {
< goto Dw;
< }
< foreach ($xm as $mz => $rE) {
< $y_ = str_replace(" ", '', $rE);
< variable_set("miniorange_saml_role_" . $y_, '');
< lb:
< }
< XG:
< variable_set("rolemap", '');
< variable_set("miniorange_saml_default_role", $xm[2]);
< goto yX;
< Dw:
< $aK = array();
< $kL = array_key_exists("user_sp_role_name", $_POST) ? $_POST["user_sp_role_name"] : array();
< $k_ = array_key_exists("user_idp_role_name", $_POST) ? $_POST["user_idp_role_name"] : array();
< foreach ($kL as $mz => $rE) {
< $y_ = str_replace(" ", '', $rE);
< $aU = $k_[$mz];
< variable_set("miniorange_saml_role_" . $y_, $aU);
< $g7 = explode(";", $aU);
< foreach ($g7 as $pW) {
< $aK[$pW] = $rE;
< Y2:
< }
< dE:
< Cl:
< }
< Zl:
< $kL = json_encode($kL);
< variable_set("miniorange_saml_sp_role_names", $kL);
< variable_set("rolemap", $aK);
< variable_set("miniorange_saml_default_role", $xm[$De]);
< yX:
< $JV = array();
< $w9 = array_key_exists("role_class", $_POST) ? $_POST["role_class"] : array();
< $F0 = array_key_exists("login_url", $_POST) ? $_POST["login_url"] : array();
< $fA = array_key_exists("logout_url", $_POST) ? $_POST["logout_url"] : array();
< foreach ($F0 as $mz => $rE) {
< variable_set(str_replace(" ", '', $w9[$mz] . "_sin"), $rE);
< variable_set(str_replace(" ", '', $w9[$mz] . "_sout"), $fA[$mz]);
< Ld:
< }
< Nf:
< $w9 = json_encode($w9);
< variable_set("miniorange_saml_log_url_class", $w9);
< variable_set("miniorange_saml_login_by", $rr);
< variable_set("miniorange_saml_username_attribute", $ym);
< variable_set("miniorange_saml_email_attribute", $UB);
< variable_set("miniorange_saml_disable_autocreate_users", $bX);
< variable_set("miniorange_saml_disable_role_update", $gl);
< drupal_set_message(t("Signin Settings successfully saved"));
---
> $v1 = $form["miniorange_saml_enable_rolemapping"]["#value"];
> $N6 = $form["miniorange_saml_idp_attr1_name"]["#value"];
> $re = $form["miniorange_saml_attr2_name"]["#value"];
> $c_ = $form["miniorange_saml_idp_attr2_name"]["#value"];
> $pg = $form["miniorange_saml_attr3_name"]["#value"];
> $bc = $form["miniorange_saml_idp_attr3_name"]["#value"];
> $Pf = $form["miniorange_saml_attr4_name"]["#value"];
> $Ay = $form["miniorange_saml_idp_attr4_name"]["#value"];
> $ek = $form["miniorange_saml_attr5_name"]["#value"];
> $ae = $form["miniorange_saml_idp_attr5_name"]["#value"];
> $LG = user_roles($ZR = TRUE);
> $Px = $form["miniorange_saml_account_username_by"]["#value"];
> $FL = $form["miniorange_saml_username_attribute"]["#value"];
> $Au = $form["miniorange_saml_email_attribute"]["#value"];
> $Zb = $form["miniorange_saml_disable_role_update"]["#value"];
> $zC = $form["miniorange_saml_disable_autocreate_users"]["#value"];
> $Lr = $form["miniorange_saml_default_mapping"]["#value"];
> $Tx = array_key_exists("user_profile_attr_name", $_POST) ? $_POST["user_profile_attr_name"] : array();
> $jy = array_key_exists("user_profile_attr_value", $_POST) ? $_POST["user_profile_attr_value"] : array();
> $F0 = array();
> foreach ($Tx as $ZE => $ND) {
> if (!(!empty(trim($ND)) && !empty(trim($jy[$ZE])))) {
> goto Ih;
> }
> $O0 = trim($ND);
> $oP = trim($jy[$ZE]);
> $F0[$O0] = $oP;
> Ih:
> mH:
> }
> Rv:
> $F0 = json_encode($F0);
> if ($v1 == 1) {
> goto dN;
> }
> $v1 = FALSE;
> goto PH;
> dN:
> $v1 = TRUE;
> PH:
> if ($zC == 1) {
> goto kp;
> }
> $zC = FALSE;
> goto Td;
> kp:
> $zC = TRUE;
> Td:
> if ($Zb == 1) {
> goto mi;
> }
> $Zb = FALSE;
> goto wr;
> mi:
> $Zb = TRUE;
> wr:
> variable_set("miniorange_saml_enable_rolemapping", $v1);
> variable_set("miniorange_saml_idp_attr1_name", $N6);
> variable_set("miniorange_saml_attr2_name", $re);
> variable_set("miniorange_saml_idp_attr2_name", $c_);
> variable_set("miniorange_saml_attr3_name", $pg);
> variable_set("miniorange_saml_idp_attr3_name", $bc);
> variable_set("miniorange_saml_attr4_name", $Pf);
> variable_set("miniorange_saml_idp_attr4_name", $Ay);
> variable_set("miniorange_saml_attr5_name", $ek);
> variable_set("miniorange_saml_idp_attr5_name", $ae);
> variable_set("miniorange_saml_sp_user_attributes", $F0);
> if ($v1) {
> goto pc;
> }
> foreach ($LG as $ZE => $ND) {
> $rA = str_replace(" ", '', $ND);
> variable_set("miniorange_saml_role_" . $rA, '');
> oI:
> }
> cz:
> variable_set("rolemap", '');
> variable_set("miniorange_saml_default_role", $LG[2]);
> goto IR;
> pc:
> $NP = array();
> $UT = array_key_exists("user_sp_role_name", $_POST) ? $_POST["user_sp_role_name"] : array();
> $vX = array_key_exists("user_idp_role_name", $_POST) ? $_POST["user_idp_role_name"] : array();
> foreach ($UT as $ZE => $ND) {
> $rA = str_replace(" ", '', $ND);
> $te = $vX[$ZE];
> variable_set("miniorange_saml_role_" . $rA, $te);
> $G2 = explode(";", $te);
> foreach ($G2 as $QP) {
> $NP[$QP] = $ND;
> k1:
> }
> yH:
> LW:
> }
> MS:
> $UT = json_encode($UT);
> variable_set("miniorange_saml_sp_role_names", $UT);
> variable_set("rolemap", $NP);
> variable_set("miniorange_saml_default_role", $LG[$Lr]);
> IR:
> $Q2 = array();
> $to = array_key_exists("role_class", $_POST) ? $_POST["role_class"] : array();
> $Ho = array_key_exists("login_url", $_POST) ? $_POST["login_url"] : array();
> $m3 = array_key_exists("logout_url", $_POST) ? $_POST["logout_url"] : array();
> foreach ($Ho as $ZE => $ND) {
> variable_set(str_replace(" ", '', $to[$ZE] . "_sin"), $ND);
> variable_set(str_replace(" ", '', $to[$ZE] . "_sout"), $m3[$ZE]);
> xP:
> }
> yt:
> $to = json_encode($to);
> variable_set("miniorange_saml_log_url_class", $to);
> variable_set("miniorange_saml_login_by", $Px);
> variable_set("miniorange_saml_username_attribute", $FL);
> variable_set("miniorange_saml_email_attribute", $Au);
> variable_set("miniorange_saml_disable_autocreate_users", $zC);
> variable_set("miniorange_saml_disable_role_update", $Zb);
> drupal_set_message(t("Signin Settings successfully saved"));
250,253c250,253
< $hE = $form["miniorange_saml_email_address"]["#value"];
< $cA = $form["miniorange_saml_phone_number"]["#value"];
< $v5 = $form["miniorange_saml_support_query"]["#value"];
< Utilities::send_query($hE, $cA, $v5);
---
> $fa = $form["miniorange_saml_email_address"]["#value"];
> $PA = $form["miniorange_saml_phone_number"]["#value"];
> $Mp = $form["miniorange_saml_support_query"]["#value"];
> Utilities::send_query($fa, $PA, $Mp);
257,258c257,258
< variable_del("miniorange_saml_attrs_list");
< variable_del("miniorange_saml_email_id_value");
---
> variable_del("miniorange_saml_attrs_list");
> variable_del("miniorange_saml_email_id_value");
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/miniorange_saml_support.inc" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/miniorange_saml_support.inc"
6,14c6,14
< drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/bootstrap.min.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
< drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
< $form["header_top_style_2"] = array("#markup" => "<div class="mo_saml_table_layout_1">
<div class="mo_saml_table_layout mo_saml_container">");
< $form["markup_1"] = array("#markup" => "<h3>Support</h3><hr><div><br/>Need any help? Just send us a query so we can help you.<br /><br /></div>");
< $form["miniorange_saml_email_address"] = array("#type" => "textfield", "#title" => t("Email Address"), "#attributes" => array("style" => "width:65%", "placeholder" => "Enter your email"), "#required" => TRUE);
< $form["miniorange_saml_phone_number"] = array("#type" => "textfield", "#title" => t("Phone number"), "#attributes" => array("style" => "width:65%", "placeholder" => "Enter your phone number"));
< $form["miniorange_saml_support_query"] = array("#type" => "textarea", "#title" => t("Query"), "#cols" => "10", "#rows" => "5", "#attributes" => array("style" => "width:65%", "placeholder" => "Write your query here"), "#required" => TRUE, "#resizable" => False);
< $form["miniorange_saml_support_submit"] = array("#type" => "submit", "#value" => t("Submit Query"), "#submit" => array("miniorange_saml_send_query"));
< $form["miniorange_saml_support_note"] = array("#markup" => "<div>If you want custom features in the module, just drop an email to <a href="mailto:[email protected]">[email protected]</a></div></div></div>");
---
> drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/bootstrap.min.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
> drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
> $form["header_top_style_2"] = array("#markup" => "<div class="mo_saml_table_layout_1">\xd\xa <div class="mo_saml_table_layout mo_saml_container">");
> $form["markup_1"] = array("#markup" => "<h3>Support</h3><hr><div><br/>Need any help? Just send us a query so we can help you.<br /><br /></div>");
> $form["miniorange_saml_email_address"] = array("#type" => "textfield", "#title" => t("Email Address"), "#attributes" => array("style" => "width:65%", "placeholder" => "Enter your email"), "#required" => TRUE);
> $form["miniorange_saml_phone_number"] = array("#type" => "textfield", "#title" => t("Phone number"), "#attributes" => array("style" => "width:65%", "placeholder" => "Enter your phone number"));
> $form["miniorange_saml_support_query"] = array("#type" => "textarea", "#title" => t("Query"), "#cols" => "10", "#rows" => "5", "#attributes" => array("style" => "width:65%", "placeholder" => "Write your query here"), "#required" => TRUE, "#resizable" => False);
> $form["miniorange_saml_support_submit"] = array("#type" => "submit", "#value" => t("Submit Query"), "#submit" => array("miniorange_saml_send_query"));
> $form["miniorange_saml_support_note"] = array("#markup" => "<div>If you want custom features in the module, just drop an email to <a href="mailto:[email protected]">[email protected]</a></div></div></div>");
19,25c19,25
< $hE = $form["miniorange_saml_email_address"]["#value"];
< $cA = $form["miniorange_saml_phone_number"]["#value"];
< $v5 = $form["miniorange_saml_support_query"]["#value"];
< $BO = new MiniOrangeSamlSupport($hE, $cA, $v5);
< $KH = $BO->sendSupportQuery();
< if ($KH) {
< goto FH;
---
> $fa = $form["miniorange_saml_email_address"]["#value"];
> $PA = $form["miniorange_saml_phone_number"]["#value"];
> $Mp = $form["miniorange_saml_support_query"]["#value"];
> $cv = new MiniOrangeSamlSupport($fa, $PA, $Mp);
> $Jr = $cv->sendSupportQuery();
> if ($Jr) {
> goto m1;
27,31c27,31
< drupal_set_message(t("Error sending support query"), "error");
< goto c1;
< FH:
< drupal_set_message(t("Support query successfully sent"));
< c1:
---
> drupal_set_message(t("Error sending support query"), "error");
> goto Ao;
> m1:
> drupal_set_message(t("Support query successfully sent"));
> Ao:
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/miniorange_sp_information.inc" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/miniorange_sp_information.inc"
7,14c7,14
< drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/bootstrap.min.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
< drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
< $u1 = variable_get("miniorange_saml_entity_id", '');
< $q9 = Utilities::miniorange_get_baseURL();
< $vn = isset($u1) && !empty($u1) ? $u1 : $base_url;
< $n8 = drupal_get_path("module", "miniorange_saml");
< if (substr($q9, -1) == "/") {
< goto Cs;
---
> drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/bootstrap.min.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
> drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
> $jm = variable_get("miniorange_saml_entity_id", '');
> $gu = Utilities::miniorange_get_baseURL();
> $iF = isset($jm) && !empty($jm) ? $jm : $base_url;
> $Ip = drupal_get_path("module", "miniorange_saml");
> if (substr($gu, -1) == "/") {
> goto UA;
16,35c16,35
< $NA = $q9 . "/?q=samlassertion";
< $fA = $q9 . "/user/logout";
< goto cs;
< Cs:
< $NA = $q9 . "?q=samlassertion";
< $fA = $q9 . "user/logout";
< cs:
< $ww = Utilities::isCustomerRegistered($form, $form_state);
< $form["header_top_style_1"] = array("#markup" => "<div class="mo_saml_table_layout_1">");
< $form["markup_top"] = array("#markup" => "<div class="mo_saml_table_layout mo_saml_container"><h3>CONFIGURE IDENTITY PROVIDER</h3><hr><br>");
< $form["mo_saml_metadata_options"] = array("#markup" => "<br><div style="color: #5cb85c;"><b>Provide this module information to your Identity Provider team. You can choose any one of the below options:</b></div>");
< $form["mo_saml_metadata_urls"] = array("#markup" => "<br><b>a) Provide this metadata URL to your Identity Provider:</b><br>");
< $form["markupsp_sp_md_2"] = array("#markup" => "<div><div class="mo_saml_highlight_background_url_note" "><code id="mo_saml_idp_vt_metadata"><b>" . "<span id="idp_metadata_url"><a target="_blank" href="" . $base_url . "/?q=mosp_metadata">" . $base_url . "/includes/metadata/?q=mosp_metadata" . "</a></span></b></code></div>\xd\xa <img class ="fa fa-fw fa-lg fa-copy mo_copy" style="margin-left: 10px;" onclick="copyToClipboard('#idp_metadata_url');" src="" . $base_url . "/" . $n8 . "/includes/images/copy-regular.svg"><br></div>");
< $form["mo_saml_download_btn_title"] = array("#markup" => "<br><br><div><b>b) Download the Module XML metadata and upload it on your Identity Provider : </b>
\xa <span><a href="" . $base_url . "/?q=mosp_download_metadata" class="btn btn-primary btn-large mo_saml_btn" style="padding: 4px 10px;">Download XML Metadata</a></span></div>");
< $form["mo_saml_copy_endpoints"] = array("#markup" => "<br><br><div><b>c) Provide the following information to your Identity Provider. Copy it and keep it handy.</b></div><br>");
< $form["mo_saml_attrs_list_idp"] = array("#markup" => "<div class="table-responsive" style="font-family: sans-serif;font-size: 12px;">
\xa <table class="mo_guide_table mo_guide_table-striped mo_guide_table-bordered" style="border: 1px solid #ddd;max-width: 100%;border-collapse: collapse;">
<thead>
\xa <tr>
\xa <th class="mo_guide_text-center mo_td_values">ATTRIBUTE</th>
<th class="mo_guide_text-center mo_td_values">VALUE</th>\xd
<tbody style="font-size: 12px;color:gray;">\xd\xa <tr>
<td style="font-weight:bold;padding: 15px;">Issuer</td>\xd
<td>\xd\xa\x9\x9 <span id="issuer_id">" . $vn . "</span>
<img class ="fa fa-fw fa-pull-right fa-lg fa-copy mo_copy" onclick="copyToClipboard('#issuer_id');" src="" . $base_url . "/" . $n8 . "/includes/images/copy-regular.svg">
\x9 \x9 \x9 </td>\xd
</tr>\xd\xa <tr>
\xa <td style="font-weight:bold;padding: 15px;">ACS URL</td>
<td>
\x9 \x9 <span id="acs_url">" . $NA . "</span>\xd
\x9\x9\x9\x9 \x9 <img class ="fa fa-fw fa-pull-right fa-lg fa-copy mo_copy" onclick="copyToClipboard('#acs_url');" src="" . $base_url . "/" . $n8 . "/includes/images/copy-regular.svg">\xd
\x9\x9 </td>
</tr>
<tr>
<td style="font-weight:bold;padding: 15px;">Audience URI</td>
<td>
\xa\x9\x9\x9\x9\x9\x9 <span id="base_url">" . $vn . "</span>\xd
\x9 <img class ="fa fa-fw fa-pull-right fa-lg fa-copy mo_copy" onclick="copyToClipboard('#base_url');" src="" . $base_url . "/" . $n8 . "/includes/images/copy-regular.svg">
\x9 \x9 </td>\xd
</tr>\xd\xa <tr>\xd
<td style="font-weight:bold;padding: 15px;">Recipient URL</td>
\xa <td>\xd
\x9 <span id="bacs_url">" . $NA . "</span>\xd\xa \x9 <img class ="fa fa-fw fa-pull-right fa-lg fa-copy mo_copy" onclick="copyToClipboard('#bacs_url');" src="" . $base_url . "/" . $n8 . "/includes/images/copy-regular.svg">\xd\xa\x9 \x9\x9 </td>
\xa </tr><tr>
\xa <td style="font-weight:bold;padding: 15px;">Destination URL</td>\xd
<td>\xd\xa \x9 \x9 <span id="destination">" . $NA . "</span>
\x9\x9 \x9\x9 <img class ="fa fa-fw fa-pull-right fa-lg fa-copy mo_copy" onclick="copyToClipboard('#destination');" src="" . $base_url . "/" . $n8 . "/includes/images/copy-regular.svg">\xd\xa\x9 \x9 </td>
</tr>
\xa <tr>\xd\xa <td style="font-weight:bold;padding: 15px;">Single Logout URL</td>\xd
<td>\xd\xa <span id="slout">" . $fA . "</span>\xd\xa\x9 \x9 \x9\x9 <img class ="fa fa-fw fa-pull-right fa-lg fa-copy mo_copy" onclick="copyToClipboard('#slout');" src="" . $base_url . "/" . $n8 . "/includes/images/copy-regular.svg">
\xa </td>\xd\xa </tr>");
< $q5 = Utilities::getPublicCertificate();
< $RU = "<tr>
\xa <td style="font-weight:bold;padding: 15px;">Certificate (Optional)</td>
<td><a href="" . $base_url . "/?q=mosp_download_metadata&certificate=true" target="_blank">Click here</a> to download the certificate.</td>\xd
</tr>";
< $form["miniorange_saml_sp_metadata_script"] = array("#markup" => "<tr>" . $RU . "</tr>
<tr>\xd\xa <td style="font-weight:bold;padding: 15px;">NameID Format</td>\xd\xa <td style="padding: 15px;">urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</td>\xd
</tr>
\xa </tbody>
</tr>
\xa </thead>\xd
</table>
<script>\xd
function copyToClipboard(element) {
jQuery(".selected-text").removeClass("selected-text");
\xa var temp = jQuery("<input>");\xd\xa jQuery("body").append(temp);
\xa jQuery(element).addClass("selected-text");
temp.val(jQuery(element).text()).select();\xd
document.execCommand("copy");\xd
temp.remove();
\xa }\xd\xa jQuery(window).click(function(e) {
console.log(e.target.className);\xd\xa if( e.target.className == undefined || e.target.className.indexOf("mo_copy") == -1)\xd
jQuery(".selected-text").removeClass("selected-text");\xd
});
\xa </script>");
< $form["mo_saml_div_sep_end"] = array("#markup" => "</div></div>");
---
> $XZ = $gu . "/?q=samlassertion";
> $m3 = $gu . "/user/logout";
> goto Au;
> UA:
> $XZ = $gu . "?q=samlassertion";
> $m3 = $gu . "user/logout";
> Au:
> $Ih = Utilities::isCustomerRegistered($form, $form_state);
> $form["header_top_style_1"] = array("#markup" => "<div class="mo_saml_table_layout_1">");
> $form["markup_top"] = array("#markup" => "<div class="mo_saml_table_layout mo_saml_container"><h3>CONFIGURE IDENTITY PROVIDER</h3><hr><br>");
> $form["mo_saml_metadata_options"] = array("#markup" => "<br><div style="color: #5cb85c;"><b>Provide this module information to your Identity Provider team. You can choose any one of the below options:</b></div>");
> $form["mo_saml_metadata_urls"] = array("#markup" => "<br><b>a) Provide this metadata URL to your Identity Provider:</b><br>");
> $form["markupsp_sp_md_2"] = array("#markup" => "<div><div class="mo_saml_highlight_background_url_note" "><code id="mo_saml_idp_vt_metadata"><b>" . "<span id="idp_metadata_url"><a target="_blank" href="" . $base_url . "/?q=mosp_metadata">" . $base_url . "/includes/metadata/?q=mosp_metadata" . "</a></span></b></code></div>
\xa <img class ="fa fa-fw fa-lg fa-copy mo_copy" style="margin-left: 10px;" onclick="copyToClipboard('#idp_metadata_url');" src="" . $base_url . "/" . $Ip . "/includes/images/copy-regular.svg"><br></div>");
> $form["mo_saml_download_btn_title"] = array("#markup" => "<br><br><div><b>b) Download the Module XML metadata and upload it on your Identity Provider : </b>\xd\xa <span><a href="" . $base_url . "/?q=mosp_download_metadata" class="btn btn-primary btn-large mo_saml_btn" style="padding: 4px 10px;">Download XML Metadata</a></span></div>");
> $form["mo_saml_copy_endpoints"] = array("#markup" => "<br><br><div><b>c) Provide the following information to your Identity Provider. Copy it and keep it handy.</b></div><br>");
> $form["mo_saml_attrs_list_idp"] = array("#markup" => "<div class="table-responsive" style="font-family: sans-serif;font-size: 12px;">
<table class="mo_guide_table mo_guide_table-striped mo_guide_table-bordered" style="border: 1px solid #ddd;max-width: 100%;border-collapse: collapse;">\xd\xa <thead>\xd\xa <tr>\xd\xa <th class="mo_guide_text-center mo_td_values">ATTRIBUTE</th>
\xa <th class="mo_guide_text-center mo_td_values">VALUE</th>
<tbody style="font-size: 12px;color:gray;">
<tr>
\xa <td style="font-weight:bold;padding: 15px;">Issuer</td>\xd\xa <td>
\x9\x9\x9 <span id="issuer_id">" . $iF . "</span>
\xa <img class ="fa fa-fw fa-pull-right fa-lg fa-copy mo_copy" onclick="copyToClipboard('#issuer_id');" src="" . $base_url . "/" . $Ip . "/includes/images/copy-regular.svg">
\x9 \x9\x9 </td>
</tr>\xd\xa <tr>\xd
<td style="font-weight:bold;padding: 15px;">ACS URL</td>
<td>
\x9\x9\x9 \x9 <span id="acs_url">" . $XZ . "</span>
\xa\x9\x9\x9 \x9 <img class ="fa fa-fw fa-pull-right fa-lg fa-copy mo_copy" onclick="copyToClipboard('#acs_url');" src="" . $base_url . "/" . $Ip . "/includes/images/copy-regular.svg">\xd
\x9 \x9 </td>\xd
</tr>\xd\xa <tr>\xd\xa <td style="font-weight:bold;padding: 15px;">Audience URI</td>\xd
<td>
\xa\x9\x9\x9 \x9\x9 <span id="base_url">" . $iF . "</span>
\xa\x9\x9 \x9 <img class ="fa fa-fw fa-pull-right fa-lg fa-copy mo_copy" onclick="copyToClipboard('#base_url');" src="" . $base_url . "/" . $Ip . "/includes/images/copy-regular.svg">
\x9 \x9\x9 </td>\xd\xa </tr>
<tr>\xd\xa <td style="font-weight:bold;padding: 15px;">Recipient URL</td>
<td>\xd\xa \x9\x9 \x9\x9 <span id="bacs_url">" . $XZ . "</span>\xd\xa \x9 \x9 \x9 <img class ="fa fa-fw fa-pull-right fa-lg fa-copy mo_copy" onclick="copyToClipboard('#bacs_url');" src="" . $base_url . "/" . $Ip . "/includes/images/copy-regular.svg">
\x9 </td>
</tr><tr>\xd
<td style="font-weight:bold;padding: 15px;">Destination URL</td>\xd
<td>\xd\xa\x9 \x9 \x9 <span id="destination">" . $XZ . "</span>
\x9 \x9 \x9 <img class ="fa fa-fw fa-pull-right fa-lg fa-copy mo_copy" onclick="copyToClipboard('#destination');" src="" . $base_url . "/" . $Ip . "/includes/images/copy-regular.svg">
\x9 \x9 </td>
</tr>\xd\xa <tr>\xd
<td style="font-weight:bold;padding: 15px;">Single Logout URL</td>\xd
<td>\xd
<span id="slout">" . $m3 . "</span>
\x9 <img class ="fa fa-fw fa-pull-right fa-lg fa-copy mo_copy" onclick="copyToClipboard('#slout');" src="" . $base_url . "/" . $Ip . "/includes/images/copy-regular.svg">
\xa </td>\xd
</tr>");
> $Dq = Utilities::getPublicCertificate();
> $k_ = "<tr>\xd
<td style="font-weight:bold;padding: 15px;">Certificate (Optional)</td>\xd
<td><a href="" . $base_url . "/?q=mosp_download_metadata&certificate=true" target="_blank">Click here</a> to download the certificate.</td>\xd
</tr>";
> $form["miniorange_saml_sp_metadata_script"] = array("#markup" => "<tr>" . $k_ . "</tr>
\xa <tr>
\xa <td style="font-weight:bold;padding: 15px;">NameID Format</td>\xd\xa <td style="padding: 15px;">urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</td>
</tr>
\xa </tbody>\xd
</tr>\xd\xa </thead>
</table>
<script>\xd
function copyToClipboard(element) {\xd
jQuery(".selected-text").removeClass("selected-text");\xd\xa var temp = jQuery("<input>");
jQuery("body").append(temp);
\xa jQuery(element).addClass("selected-text");
\xa temp.val(jQuery(element).text()).select();\xd
document.execCommand("copy");
\xa temp.remove();\xd
}
\xa jQuery(window).click(function(e) {
console.log(e.target.className);\xd\xa if( e.target.className == undefined || e.target.className.indexOf("mo_copy") == -1)\xd\xa jQuery(".selected-text").removeClass("selected-text");
\xa });
\xa </script>");
> $form["mo_saml_div_sep_end"] = array("#markup" => "</div></div>");
38,41c38,41
< $form["mo_saml_endpoints_div"] = array("#markup" => "<div class="mo_saml_table_layout mo_saml_container"><h4>SERVICE PROVIDER ENDPOINTS:</h4><hr><br>");
< $form["miniorange_saml_base_url"] = array("#type" => "textfield", "#title" => t("SP Base URL:"), "#default_value" => $q9, "#attributes" => array("style" => "width:73%"), "#disabled" => $ww);
< $form["miniorange_saml_entity_id"] = array("#type" => "textfield", "#title" => t("SP Entity ID/Issuer:"), "#default_value" => $vn, "#attributes" => array("style" => "width:73%"), "#description" => t("<b>Note:</b> If you have already shared the above URLs or Metadata with your IdP, do NOT change SP EntityID.<br> It might break your existing login flow."), "#disabled" => $ww);
< $form["miniorange_saml_config_submit"] = array("#type" => "submit", "#value" => t("Update"), "#submit" => array("miniorange_saml_save_config"), "#disabled" => $ww);
---
> $form["mo_saml_endpoints_div"] = array("#markup" => "<div class="mo_saml_table_layout mo_saml_container"><h4>SERVICE PROVIDER ENDPOINTS:</h4><hr><br>");
> $form["miniorange_saml_base_url"] = array("#type" => "textfield", "#title" => t("SP Base URL:"), "#default_value" => $gu, "#attributes" => array("style" => "width:73%"), "#disabled" => $Ih);
> $form["miniorange_saml_entity_id"] = array("#type" => "textfield", "#title" => t("SP Entity ID/Issuer:"), "#default_value" => $iF, "#attributes" => array("style" => "width:73%"), "#description" => t("<b>Note:</b> If you have already shared the above URLs or Metadata with your IdP, do NOT change SP EntityID.<br> It might break your existing login flow."), "#disabled" => $Ih);
> $form["miniorange_saml_config_submit"] = array("#type" => "submit", "#value" => t("Update"), "#submit" => array("miniorange_saml_save_config"), "#disabled" => $Ih);
46,49c46,49
< $q9 = $form["miniorange_saml_base_url"]["#value"];
< $vn = $form["miniorange_saml_entity_id"]["#value"];
< variable_set("miniorange_saml_base_url", $q9);
< variable_set("miniorange_saml_entity_id", $vn);
---
> $gu = $form["miniorange_saml_base_url"]["#value"];
> $iF = $form["miniorange_saml_entity_id"]["#value"];
> variable_set("miniorange_saml_base_url", $gu);
> variable_set("miniorange_saml_entity_id", $iF);
53,56c53,56
< $hE = $form["miniorange_saml_email_address"]["#value"];
< $cA = $form["miniorange_saml_phone_number"]["#value"];
< $v5 = $form["miniorange_saml_support_query"]["#value"];
< Utilities::send_query($hE, $cA, $v5);
---
> $fa = $form["miniorange_saml_email_address"]["#value"];
> $PA = $form["miniorange_saml_phone_number"]["#value"];
> $Mp = $form["miniorange_saml_support_query"]["#value"];
> Utilities::send_query($fa, $PA, $Mp);
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/mo_saml_add_custom_certificate.inc" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/mo_saml_add_custom_certificate.inc"
7,40c7,40
< drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/bootstrap.min.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
< drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
< $ww = Utilities::isCustomerRegistered($form, $form_state);
< $form["header_top_style_1"] = array("#markup" => "<div class="mo_saml_table_layout_1"><div class="mo_saml_table_layout mo_saml_container">");
< $form["miniorange_saml_generate_metadata"] = array("#markup" => "<div id="mo_gen_tab"></div>");
< $form["mo_saml_metadata"] = array("#markup" => "<div border="1" id="generate_certificate_form" style="background-color:#FFFFFF; border:0px solid #CCCCCC; padding:1px 1px 1px 10px; display:none;" >\xd\xa <table style="width:100%;">\xd\xa <h4>GENERATE CUSTOM CERTIFICATE<span style="float:right;margin-right:25px;">
\xa \x9\x9\x9<input type="button" class="btn btn-sm btn-danger" value="Back" onclick = "hide_gen_cert_form()"/></a><br>\xd
\x9\x9 </span><br><br><b><hr></b><br>");
< $form["mo_saml_certificate_country_code"] = array("#markup" => "<tr>
\xa <td width="20%"><h4 style="margin-left: 44px;">Country code :</h4></td><td width="10%">");
< $form["mo_saml_country_code_text"] = array("#type" => "textfield", "#attributes" => array("style" => "width:80%", "placeholder" => "Enter Country code:"), "#description" => t("<b>NOTE: </b>Check your country code <a href="https://www.digicert.com/kb/ssl-certificate-country-codes.htm" target="_blank">here.</a>"), "#default_value" => variable_get("mo_saml_country_code_text", ''));
< $form["mo_saml_certificate_state"] = array("#markup" => "<tr>
<td width="20%"><h4 style="margin-left: 44px;">State :</h4></td>\xd\xa <td width="30%">");
< $form["mo_saml_certificate_state_name"] = array("#type" => "textfield", "#attributes" => array("style" => "width:80%", "placeholder" => "State Name:"), "#default_value" => variable_get("mo_saml_certificate_state_name", ''));
< $form["mo_saml_certificate_company"] = array("#markup" => "<tr>
\xa <td width="20%"><h4 style="margin-left: 44px;">Company :</h4></td><td width="10%">");
< $form["mo_saml_certificate_company_name"] = array("#type" => "textfield", "#attributes" => array("style" => "width:80%", "placeholder" => "Company Name:"), "#default_value" => variable_get("mo_saml_certificate_company_name", ''));
< $form["metadata_unit"] = array("#markup" => "<tr>\xd
<td width="20%"><b style="margin-left: 44px;font-size: 14px;">Unit :</b></td><td width="10%">");
< $form["miniorange_saml_unit_name"] = array("#type" => "textfield", "#attributes" => array("style" => "width:80%", "placeholder" => "Unit name"), "#default_value" => variable_get("miniorange_saml_unit_name", ''));
< $form["mo_saml_certificate_common"] = array("#markup" => "<tr>
<td width="20%"><b style="margin-left: 44px;font-size: 14px;">Common :</b></td>\xd
<td width="10%">");
< $form["mo_saml_certificate_common_name"] = array("#type" => "textfield", "#attributes" => array("style" => "width:80%", "placeholder" => "Common Name:"), "#default_value" => variable_get("mo_saml_certificate_common_name", ''));
< $form["mo_saml_digest_algo"] = array("#markup" => "<tr>\xd\xa <td width="20%"><h4 style="margin-left: 44px;">Digest Algorithm :</h4></td>\xd
<td width="10%">");
< $form["mo_saml_select_digest_algo"] = array("#type" => "select", "#options" => array("sha512" => t("SHA512"), "sha384" => t("SHA384"), "sha256" => t("SHA256"), "sha1" => t("SHA1")), "#attributes" => array("style" => "width:55%"), "#default_value" => variable_get("mo_saml_select_digest_algo", ''), "#disabled" => FALSE);
< $form["mo_saml_private_key_bits"] = array("#markup" => "<tr>
\xa <td width="20%"><h4 style="margin-left: 44px;">Bits to generate the private key :</h4></td>
<td width="10%">");
< $form["mo_saml_select_private_key_bit"] = array("#type" => "select", "#options" => array("2048" => t("2048 bits"), "1024" => t("1024 bits")), "#attributes" => array("style" => "width:55%"), "#default_value" => variable_get("mo_saml_select_private_key_bit", ''), "#disabled" => FALSE);
< $form["mo_saml_valid_days"] = array("#markup" => "<tr>
<td width="20%"><h4 style="margin-left: 44px;">Valid Days :</h4></td>
\xa <td width="10%">");
< $form["mo_saml_select_valid_days"] = array("#type" => "select", "#options" => array("365" => t("365 days"), "180" => t("180 days"), "90" => t("90 days"), "45" => t("45 days"), "30" => t("30 days"), "15" => t("45 days"), "7" => t("7 days")), "#attributes" => array("style" => "width:55%"), "#default_value" => variable_get("mo_saml_select_valid_days", ''), "#disabled" => FALSE);
< $form["metadata_5"] = array("#markup" => "</td></tr></table>");
< $form["generate_config_elements"] = array("#type" => "submit", "#value" => t("Generate Self-Signed Certs"), "#prefix" => "<td>", "#suffix" => "</td>", "#submit" => array("miniorange_saml_generate_custom_certificate"), "#attributes" => array("style" => "display:block;margin-left:auto;margin-right:auto;border-radius:4px;background: #337ab7;color: #ffffff;text-shadow: 0 -1px 1px #337ab7, 1px 0 1px #337ab7, 0 1px 1px #337ab7, -1px 0 1px #337ab7;box-shadow: 0 1px 0 #337ab7;border-color: #337ab7 #337ab7 #337ab7;"), "#disabled" => $ww);
< $form["metadata_i"] = array("#markup" => "</div><div id="mo_gen_cert">");
< $form["markup_1"] = array("#markup" => "<h3>ADD CUSTOM CERTIFICATE </h3><hr><br/>");
< $form["miniorange_saml_private_certificate"] = array("#type" => "textarea", "#title" => t("X.509 Private Certificate"), "#cols" => 5, "#rows" => 5, "#default_value" => variable_get("miniorange_saml_private_certificate", ''), "#attributes" => array("style" => "width:77%", "placeholder" => "Copy and Paste the content from the downloaded certificate or copy the content enclosed in X509Certificate tag (has parent tag KeyDescriptor use=signing) in IdP-Metadata XML file."), "#resizable" => False, "#disabled" => $ww);
< $form["miniorange_saml_idp_cert_format1"] = array("#markup" => "<strong>NOTE :</strong> Format of the certificate:<br /><strong>-----BEGIN PRIVATE KEY-----<br />" . "XXXXXXXXXXXXXXXXXXXXXXXXXXX<br />-----END PRIVATE KEY-----</strong><br /><br /><br />");
< $form["miniorange_saml_publ_certificate"] = array("#type" => "textarea", "#title" => t("X.509 Public Certificate "), "#cols" => 5, "#rows" => 5, "#default_value" => variable_get("miniorange_saml_publ_certificate", ''), "#attributes" => array("style" => "width:77%", "placeholder" => "Copy and Paste the content from the downloaded certificate or copy the content enclosed in X509Certificate tag (has parent tag KeyDescriptor use=signing) in IdP-Metadata XML file."), "#resizable" => False, "#disabled" => $ww);
< $form["miniorange_saml_idp_cert_format"] = array("#markup" => "<strong>NOTE :</strong> Format of the certificate:<br /><strong>-----BEGIN CERTIFICATE-----<br />" . "XXXXXXXXXXXXXXXXXXXXXXXXXXX<br />-----END CERTIFICATE-----</strong><br /><br /><br /><br />");
< $form["save_config_elements"] = array("#type" => "submit", "#name" => "submit", "#value" => t("Upload"), "#prefix" => "<td>", "#suffix" => "</td>", "#submit" => array("miniorange_saml_upload_custom_certificate"), "#disabled" => $ww, "#attributes" => array("style" => "border-radius: 4px;background: #337ab7;color: #ffffff;text-shadow: 0 -1px 1px #337ab7, 1px 0 1px #337ab7, 0 1px 1px #337ab7, -1px 0 1px #337ab7;box-shadow: 0 1px 0 #337ab7;border-color: #337ab7 #337ab7 #337ab7;"));
< $form["save_config_elements1"] = array("#type" => "submit", "#value" => t("Reset"), "#prefix" => "<td>", "#suffix" => "</td>", "#submit" => array("miniorange_saml_reset_custom_certificate"), "#disabled" => $ww, "#attributes" => array("style" => "border-radius: 4px;background: #337ab7;color: #ffffff;text-shadow: 0 -1px 1px #337ab7, 1px 0 1px #337ab7, 0 1px 1px #337ab7, -1px 0 1px #337ab7;box-shadow: 0 1px 0 #337ab7;border-color: #337ab7 #337ab7 #337ab7;"));
< $form["miniorange_saml_generate_metadata_button"] = array("#markup" => "<a class="btn btn-primary btn-large" id="mosaml_upload" style="padding:3px 7px;" onclick="show_gen_cert_form()">" . "Generate</a><br><br>");
< $form["miniorange_saml_support_div_end"] = array("#markup" => "</div></div>");
---
> drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/bootstrap.min.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
> drupal_add_css(drupal_get_path("module", "miniorange_saml") . "/css/style_settings.css", array("group" => CSS_DEFAULT, "every_page" => TRUE));
> $Ih = Utilities::isCustomerRegistered($form, $form_state);
> $form["header_top_style_1"] = array("#markup" => "<div class="mo_saml_table_layout_1"><div class="mo_saml_table_layout mo_saml_container">");
> $form["miniorange_saml_generate_metadata"] = array("#markup" => "<div id="mo_gen_tab"></div>");
> $form["mo_saml_metadata"] = array("#markup" => "<div border="1" id="generate_certificate_form" style="background-color:#FFFFFF; border:0px solid #CCCCCC; padding:1px 1px 1px 10px; display:none;" >
<table style="width:100%;">
<h4>GENERATE CUSTOM CERTIFICATE<span style="float:right;margin-right:25px;">\xd
\x9 \x9<input type="button" class="btn btn-sm btn-danger" value="Back" onclick = "hide_gen_cert_form()"/></a><br>\xd
\x9 </span><br><br><b><hr></b><br>");
> $form["mo_saml_certificate_country_code"] = array("#markup" => "<tr>
<td width="20%"><h4 style="margin-left: 44px;">Country code :</h4></td><td width="10%">");
> $form["mo_saml_country_code_text"] = array("#type" => "textfield", "#attributes" => array("style" => "width:80%", "placeholder" => "Enter Country code:"), "#description" => t("<b>NOTE: </b>Check your country code <a href="https://www.digicert.com/kb/ssl-certificate-country-codes.htm" target="_blank">here.</a>"), "#default_value" => variable_get("mo_saml_country_code_text", ''));
> $form["mo_saml_certificate_state"] = array("#markup" => "<tr>
\xa <td width="20%"><h4 style="margin-left: 44px;">State :</h4></td>\xd
<td width="30%">");
> $form["mo_saml_certificate_state_name"] = array("#type" => "textfield", "#attributes" => array("style" => "width:80%", "placeholder" => "State Name:"), "#default_value" => variable_get("mo_saml_certificate_state_name", ''));
> $form["mo_saml_certificate_company"] = array("#markup" => "<tr>
\xa <td width="20%"><h4 style="margin-left: 44px;">Company :</h4></td><td width="10%">");
> $form["mo_saml_certificate_company_name"] = array("#type" => "textfield", "#attributes" => array("style" => "width:80%", "placeholder" => "Company Name:"), "#default_value" => variable_get("mo_saml_certificate_company_name", ''));
> $form["metadata_unit"] = array("#markup" => "<tr>\xd
<td width="20%"><b style="margin-left: 44px;font-size: 14px;">Unit :</b></td><td width="10%">");
> $form["miniorange_saml_unit_name"] = array("#type" => "textfield", "#attributes" => array("style" => "width:80%", "placeholder" => "Unit name"), "#default_value" => variable_get("miniorange_saml_unit_name", ''));
> $form["mo_saml_certificate_common"] = array("#markup" => "<tr>\xd\xa <td width="20%"><b style="margin-left: 44px;font-size: 14px;">Common :</b></td>
\xa <td width="10%">");
> $form["mo_saml_certificate_common_name"] = array("#type" => "textfield", "#attributes" => array("style" => "width:80%", "placeholder" => "Common Name:"), "#default_value" => variable_get("mo_saml_certificate_common_name", ''));
> $form["mo_saml_digest_algo"] = array("#markup" => "<tr>\xd\xa <td width="20%"><h4 style="margin-left: 44px;">Digest Algorithm :</h4></td>\xd
<td width="10%">");
> $form["mo_saml_select_digest_algo"] = array("#type" => "select", "#options" => array("sha512" => t("SHA512"), "sha384" => t("SHA384"), "sha256" => t("SHA256"), "sha1" => t("SHA1")), "#attributes" => array("style" => "width:55%"), "#default_value" => variable_get("mo_saml_select_digest_algo", ''), "#disabled" => FALSE);
> $form["mo_saml_private_key_bits"] = array("#markup" => "<tr>\xd
<td width="20%"><h4 style="margin-left: 44px;">Bits to generate the private key :</h4></td>
\xa <td width="10%">");
> $form["mo_saml_select_private_key_bit"] = array("#type" => "select", "#options" => array("2048" => t("2048 bits"), "1024" => t("1024 bits")), "#attributes" => array("style" => "width:55%"), "#default_value" => variable_get("mo_saml_select_private_key_bit", ''), "#disabled" => FALSE);
> $form["mo_saml_valid_days"] = array("#markup" => "<tr>
<td width="20%"><h4 style="margin-left: 44px;">Valid Days :</h4></td>
\xa <td width="10%">");
> $form["mo_saml_select_valid_days"] = array("#type" => "select", "#options" => array("365" => t("365 days"), "180" => t("180 days"), "90" => t("90 days"), "45" => t("45 days"), "30" => t("30 days"), "15" => t("45 days"), "7" => t("7 days")), "#attributes" => array("style" => "width:55%"), "#default_value" => variable_get("mo_saml_select_valid_days", ''), "#disabled" => FALSE);
> $form["metadata_5"] = array("#markup" => "</td></tr></table>");
> $form["generate_config_elements"] = array("#type" => "submit", "#value" => t("Generate Self-Signed Certs"), "#prefix" => "<td>", "#suffix" => "</td>", "#submit" => array("miniorange_saml_generate_custom_certificate"), "#attributes" => array("style" => "display:block;margin-left:auto;margin-right:auto;border-radius:4px;background: #337ab7;color: #ffffff;text-shadow: 0 -1px 1px #337ab7, 1px 0 1px #337ab7, 0 1px 1px #337ab7, -1px 0 1px #337ab7;box-shadow: 0 1px 0 #337ab7;border-color: #337ab7 #337ab7 #337ab7;"), "#disabled" => $Ih);
> $form["metadata_i"] = array("#markup" => "</div><div id="mo_gen_cert">");
> $form["markup_1"] = array("#markup" => "<h3>ADD CUSTOM CERTIFICATE </h3><hr><br/>");
> $form["miniorange_saml_private_certificate"] = array("#type" => "textarea", "#title" => t("X.509 Private Certificate"), "#cols" => 5, "#rows" => 5, "#default_value" => variable_get("miniorange_saml_private_certificate", ''), "#attributes" => array("style" => "width:77%", "placeholder" => "Copy and Paste the content from the downloaded certificate or copy the content enclosed in X509Certificate tag (has parent tag KeyDescriptor use=signing) in IdP-Metadata XML file."), "#resizable" => False, "#disabled" => $Ih);
> $form["miniorange_saml_idp_cert_format1"] = array("#markup" => "<strong>NOTE :</strong> Format of the certificate:<br /><strong>-----BEGIN PRIVATE KEY-----<br />" . "XXXXXXXXXXXXXXXXXXXXXXXXXXX<br />-----END PRIVATE KEY-----</strong><br /><br /><br />");
> $form["miniorange_saml_publ_certificate"] = array("#type" => "textarea", "#title" => t("X.509 Public Certificate "), "#cols" => 5, "#rows" => 5, "#default_value" => variable_get("miniorange_saml_publ_certificate", ''), "#attributes" => array("style" => "width:77%", "placeholder" => "Copy and Paste the content from the downloaded certificate or copy the content enclosed in X509Certificate tag (has parent tag KeyDescriptor use=signing) in IdP-Metadata XML file."), "#resizable" => False, "#disabled" => $Ih);
> $form["miniorange_saml_idp_cert_format"] = array("#markup" => "<strong>NOTE :</strong> Format of the certificate:<br /><strong>-----BEGIN CERTIFICATE-----<br />" . "XXXXXXXXXXXXXXXXXXXXXXXXXXX<br />-----END CERTIFICATE-----</strong><br /><br /><br /><br />");
> $form["save_config_elements"] = array("#type" => "submit", "#name" => "submit", "#value" => t("Upload"), "#prefix" => "<td>", "#suffix" => "</td>", "#submit" => array("miniorange_saml_upload_custom_certificate"), "#disabled" => $Ih, "#attributes" => array("style" => "border-radius: 4px;background: #337ab7;color: #ffffff;text-shadow: 0 -1px 1px #337ab7, 1px 0 1px #337ab7, 0 1px 1px #337ab7, -1px 0 1px #337ab7;box-shadow: 0 1px 0 #337ab7;border-color: #337ab7 #337ab7 #337ab7;"));
> $form["save_config_elements1"] = array("#type" => "submit", "#value" => t("Reset"), "#prefix" => "<td>", "#suffix" => "</td>", "#submit" => array("miniorange_saml_reset_custom_certificate"), "#disabled" => $Ih, "#attributes" => array("style" => "border-radius: 4px;background: #337ab7;color: #ffffff;text-shadow: 0 -1px 1px #337ab7, 1px 0 1px #337ab7, 0 1px 1px #337ab7, -1px 0 1px #337ab7;box-shadow: 0 1px 0 #337ab7;border-color: #337ab7 #337ab7 #337ab7;"));
> $form["miniorange_saml_generate_metadata_button"] = array("#markup" => "<a class="btn btn-primary btn-large" id="mosaml_upload" style="padding:3px 7px;" onclick="show_gen_cert_form()">" . "Generate</a><br><br>");
> $form["miniorange_saml_support_div_end"] = array("#markup" => "</div></div>");
46,48c46,48
< $qO = $form["miniorange_saml_publ_certificate"]["#value"];
< if (empty($qO)) {
< goto iy;
---
> $Pz = $form["miniorange_saml_publ_certificate"]["#value"];
> if (empty($Pz)) {
> goto fi;
50,54c50,54
< $qO = Utilities::sanitize_certificate($form["miniorange_saml_publ_certificate"]["#value"]);
< iy:
< $kb = $form["miniorange_saml_private_certificate"]["#value"];
< if (empty($kb)) {
< goto Gc;
---
> $Pz = Utilities::sanitize_certificate($form["miniorange_saml_publ_certificate"]["#value"]);
> fi:
> $fT = $form["miniorange_saml_private_certificate"]["#value"];
> if (empty($fT)) {
> goto zf;
56,59c56,59
< $kb = Utilities::sanitize_private_key($form["miniorange_saml_private_certificate"]["#value"]);
< Gc:
< if (!(empty($qO) || empty($kb))) {
< goto wJ;
---
> $fT = Utilities::sanitize_private_key($form["miniorange_saml_private_certificate"]["#value"]);
> zf:
> if (!(empty($Pz) || empty($fT))) {
> goto zR;
61c61
< drupal_set_message(t("The <b><u>X.509 Private Certificate</u></b> and <b><u>X.509 Public Certificate</u></b> fields are mandatory."), "error");
---
> drupal_set_message(t("The <b><u>X.509 Private Certificate</u></b> and <b><u>X.509 Public Certificate</u></b> fields are mandatory."), "error");
63,66c63,66
< wJ:
< variable_set("miniorange_saml_publ_certificate", $qO);
< variable_set("miniorange_saml_private_certificate", $kb);
< drupal_set_message(t("Custom Certificate updated successfully."));
---
> zR:
> variable_set("miniorange_saml_publ_certificate", $Pz);
> variable_set("miniorange_saml_private_certificate", $fT);
> drupal_set_message(t("Custom Certificate updated successfully."));
70,80c70,80
< variable_del("miniorange_saml_publ_certificate");
< variable_del("miniorange_saml_private_certificate");
< variable_set("mo_saml_country_code_text", '');
< variable_set("mo_saml_certificate_state_name", '');
< variable_set("mo_saml_certificate_company_name", '');
< variable_set("miniorange_saml_unit_name", '');
< variable_set("mo_saml_certificate_common_name", '');
< variable_set("mo_saml_select_digest_algo", '');
< variable_set("mo_saml_select_private_key_bit", '');
< variable_set("mo_saml_select_valid_days", '');
< drupal_set_message(t("Reset Certificate successfully."));
---
> variable_del("miniorange_saml_publ_certificate");
> variable_del("miniorange_saml_private_certificate");
> variable_set("mo_saml_country_code_text", '');
> variable_set("mo_saml_certificate_state_name", '');
> variable_set("mo_saml_certificate_company_name", '');
> variable_set("miniorange_saml_unit_name", '');
> variable_set("mo_saml_certificate_common_name", '');
> variable_set("mo_saml_select_digest_algo", '');
> variable_set("mo_saml_select_private_key_bit", '');
> variable_set("mo_saml_select_valid_days", '');
> drupal_set_message(t("Reset Certificate successfully."));
84,93c84,93
< $Kn = $form["mo_saml_country_code_text"]["#value"];
< $jH = $form["mo_saml_certificate_state_name"]["#value"];
< $xt = $form["mo_saml_certificate_company_name"]["#value"];
< $t5 = $form["miniorange_saml_unit_name"]["#value"];
< $Kx = $form["mo_saml_certificate_common_name"]["#value"];
< $FL = $form["mo_saml_select_digest_algo"]["#value"];
< $NV = $form["mo_saml_select_private_key_bit"]["#value"];
< $gJ = $form["mo_saml_select_valid_days"]["#value"];
< if (!(empty($Kn) || empty($jH) || empty($xt) || empty($t5) || empty($Kx))) {
< goto s6;
---
> $Kv = $form["mo_saml_country_code_text"]["#value"];
> $Tm = $form["mo_saml_certificate_state_name"]["#value"];
> $GW = $form["mo_saml_certificate_company_name"]["#value"];
> $NU = $form["miniorange_saml_unit_name"]["#value"];
> $fr = $form["mo_saml_certificate_common_name"]["#value"];
> $h3 = $form["mo_saml_select_digest_algo"]["#value"];
> $jB = $form["mo_saml_select_private_key_bit"]["#value"];
> $Bu = $form["mo_saml_select_valid_days"]["#value"];
> if (!(empty($Kv) || empty($Tm) || empty($GW) || empty($NU) || empty($fr))) {
> goto fM;
95c95
< drupal_set_message(t("The <b><u>Country code </u></b>, <b><u>State name</u></b> , <u><b>Company name</b></u> , <u><b> Unit name</b></u> and <u><b>Common name</b></u> fields are mandatory."), "error");
---
> drupal_set_message(t("The <b><u>Country code </u></b>, <b><u>State name</u></b> , <u><b>Company name</b></u> , <u><b> Unit name</b></u> and <u><b>Common name</b></u> fields are mandatory."), "error");
97,110c97,110
< s6:
< variable_set("mo_saml_country_code_text", $Kn);
< variable_set("mo_saml_certificate_state_name", $jH);
< variable_set("mo_saml_certificate_company_name", $xt);
< variable_set("miniorange_saml_unit_name", $t5);
< variable_set("mo_saml_certificate_common_name", $Kx);
< variable_set("mo_saml_select_digest_algo", $FL);
< variable_set("mo_saml_select_private_key_bit", $NV);
< variable_set("mo_saml_select_valid_days", $gJ);
< $gm = variable_get("miniorange_saml_customer_admin_email", '');
< $Wr = isset($gm) ? $gm : '';
< $d2 = array("countryName" => $Kn, "stateOrProvinceName" => $jH, "organizationName" => $xt, "organizationalUnitName" => $t5, "commonName" => $Kx, "emailAddress" => $Wr);
< Utilities::generateCertificate($d2, $FL, $NV, $gJ);
< drupal_set_message(t("Successfully genertated new certificates. Please update your service provider configuration with new metadata file."));
---
> fM:
> variable_set("mo_saml_country_code_text", $Kv);
> variable_set("mo_saml_certificate_state_name", $Tm);
> variable_set("mo_saml_certificate_company_name", $GW);
> variable_set("miniorange_saml_unit_name", $NU);
> variable_set("mo_saml_certificate_common_name", $fr);
> variable_set("mo_saml_select_digest_algo", $h3);
> variable_set("mo_saml_select_private_key_bit", $jB);
> variable_set("mo_saml_select_valid_days", $Bu);
> $NA = variable_get("miniorange_saml_customer_admin_email", '');
> $vb = isset($NA) ? $NA : '';
> $Np = array("countryName" => $Kv, "stateOrProvinceName" => $Tm, "organizationName" => $GW, "organizationalUnitName" => $NU, "commonName" => $fr, "emailAddress" => $vb);
> Utilities::generateCertificate($Np, $h3, $jB, $Bu);
> drupal_set_message(t("Successfully genertated new certificates. Please update your service provider configuration with new metadata file."));
114,117c114,117
< $hE = $form["miniorange_saml_email_address"]["#value"];
< $cA = $form["miniorange_saml_phone_number"]["#value"];
< $v5 = $form["miniorange_saml_support_query"]["#value"];
< Utilities::send_query($hE, $cA, $v5);
---
> $fa = $form["miniorange_saml_email_address"]["#value"];
> $PA = $form["miniorange_saml_phone_number"]["#value"];
> $Mp = $form["miniorange_saml_support_query"]["#value"];
> Utilities::send_query($fa, $PA, $Mp);
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/saml_assertion.php" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/saml_assertion.php"
4,6c4,6
< include "includes/AuthnRequest.php";
< $BS = new MiniOrangeAuthnRequest();
< $BS->initiateLogin();
---
> include "includes/AuthnRequest.php";
> $lq = new MiniOrangeAuthnRequest();
> $lq->initiateLogin();
Only in C:\Users\wkaifer\Documents\MFA\mo_saml: samldiff.txt
?>
Did this file decode correctly?
Original Code
Only in C:\Users\wkaifer\OneDrive - POWERTRAIN INC\Plugins\drupal_miniorange_saml: .git
Only in C:\Users\wkaifer\OneDrive - POWERTRAIN INC\Plugins\drupal_miniorange_saml: .idea
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/includes/Acs.php" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/includes/Acs.php"
6c6
< public function processSamlResponse($post, $base_url, $Ho, $ym, $FQ, $im)
---
> public function processSamlResponse($post, $base_url, $nW, $FL, $mm, $Nt)
8,9c8,9
< if (array_key_exists("\123\101\115\114\122\x65\x73\x70\157\x6e\163\145", $post)) {
< goto T7;
---
> if (array_key_exists("\123\101\x4d\114\122\x65\x73\x70\157\x6e\163\x65", $post)) {
> goto Ju;
11,80c11,80
< throw new Exception("\115\151\163\163\x69\x6e\147\x20\x53\101\x4d\x4c\122\145\x71\165\145\163\x74\40\157\x72\x20\x53\101\x4d\114\x52\145\163\160\x6f\x6e\163\145\40\160\141\x72\x61\155\145\x74\x65\162\x2e");
< goto bQ;
< T7:
< $JY = $post["\123\x41\115\x4c\122\x65\x73\160\x6f\x6e\163\x65"];
< bQ:
< if (array_key_exists("\x52\145\154\141\x79\x53\164\141\164\x65", $post)) {
< goto wV;
< }
< $gB = '';
< goto oU;
< wV:
< $gB = $post["\122\x65\154\x61\171\123\x74\141\x74\145"];
< oU:
< $JY = base64_decode($JY);
< if (!($gB == "\x73\x68\x6f\x77\x53\141\x6d\154\x52\145\163\160\x6f\x6e\163\x65")) {
< goto nB;
< }
< Utilities::Print_SAML_Request($JY, "\144\151\x73\160\x6c\141\171\x53\x61\155\154\122\x65\x73\x70\157\156\x73\145");
< nB:
< $Ej = new DOMDocument();
< $Ej->loadXML($JY);
< $aQ = $Ej->firstChild;
< $JY = new SAML2_Response($aQ);
< $u1 = current($JY->getAssertions())->getIssuer();
< $ZQ = db_query("\x53\x45\x4c\105\103\x54\40\x2a\x20\106\122\117\x4d\x20\x7b\155\151\156\151\157\x72\x61\x6e\x67\x65\137\163\x61\155\x6c\137\151\144\160\x5f\x6c\x69\x73\164\x7d\x20\127\x48\x45\x52\105\40\155\157\x5f\151\x64\x70\137\x69\x73\163\x75\x65\162\x20\x3d\x20\47{$u1}\47");
< $IX = $ZQ->fetchAssoc();
< if (!empty($IX)) {
< goto b_;
< }
< throw new Exception("\x49\x64\145\x6e\164\x69\x74\x79\x20\x50\x72\x6f\166\151\144\x65\x72\40\156\157\x74\40\x63\x6f\x6e\146\151\147\165\x72\x65\144\56\40\x49\x66\x20\171\157\165\x20\150\x61\x76\145\x20\x63\157\x6e\146\151\x67\x75\162\145\x64\x20\x74\x68\x65\x20\111\x44\120\40\x74\150\145\x6e\40\x70\x6c\145\141\163\x65\x20\x6d\x61\153\145\x20\x73\165\162\145\x20\171\x6f\165\x20\x61\162\x65\40\165\x73\151\x6e\147\40\143\157\x72\x72\145\x63\x74\40\111\163\x73\x75\x65\162\x20\126\x61\x6c\165\145");
< b_:
< $_SESSION["\x49\x44\x50\x5f\x49\123\x53\x55\x45\x52"] = $u1;
< $yu = Utilities::miniorange_get_baseURL();
< $NA = $yu . "\57\77\161\75\163\x61\155\x6c\x61\x73\163\145\162\164\x69\157\156";
< $Uf = $IX["\x6d\x6f\x5f\x69\144\160\137\143\x65\162\x74"];
< $u1 = $IX["\155\x6f\x5f\151\144\x70\x5f\x69\163\163\x75\x65\x72"];
< $OZ = $Ej->documentElement;
< $Ec = new DOMXpath($Ej);
< $Ec->registerNamespace("\x73\x61\155\x6c\x70", "\165\162\156\72\x6f\141\x73\x69\x73\72\x6e\141\x6d\145\x73\x3a\164\143\72\x53\x41\115\x4c\72\x32\x2e\x30\72\160\162\x6f\164\x6f\143\157\154");
< $Ec->registerNamespace("\163\x61\x6d\x6c", "\165\162\x6e\72\157\x61\x73\151\163\72\156\x61\x6d\145\x73\72\x74\x63\x3a\123\101\x4d\x4c\72\x32\56\x30\x3a\x61\x73\163\145\162\x74\x69\x6f\x6e");
< $o7 = $Ec->query("\x2f\x73\x61\155\x6c\160\x3a\x52\145\x73\160\157\x6e\163\x65\x2f\163\x61\155\154\160\x3a\123\164\141\164\x75\163\x2f\163\x61\155\x6c\x70\x3a\123\x74\x61\164\165\x73\x43\157\x64\145", $OZ);
< $lh = $o7->item(0)->getAttribute("\x56\141\154\165\x65");
< $aq = '';
< if (!($o7->item(0)->firstChild !== null)) {
< goto pW;
< }
< $aq = $o7->item(0)->firstChild->getAttribute("\126\141\154\165\145");
< pW:
< $o7 = explode("\72", $lh)[7];
< if (!($o7 != "\123\x75\x63\x63\x65\163\163")) {
< goto lF;
< }
< if (empty($aq)) {
< goto Cn;
< }
< $o7 = explode("\x3a", $aq)[7];
< Cn:
< $this->show_error_message($o7, $gB);
< lF:
< if (is_null($Uf)) {
< goto vF;
< }
< $Jl = XMLSecurityKey::getRawThumbprint($Uf);
< $W1 = preg_replace("\x2f\x5c\x73\53\x2f", '', $Jl);
< $Uf = iconv("\125\124\106\55\x38", "\103\x50\61\x32\65\62\57\x2f\111\107\116\117\122\105", $W1);
< vF:
< $NX = $JY->getSignatureData();
< $UZ = current($JY->getAssertions())->getSignatureData();
< if (!(is_null($NX) && is_null($UZ))) {
< goto ZY;
---
> throw new Exception("\x4d\x69\163\163\151\156\147\40\123\101\115\x4c\x52\145\x71\x75\x65\163\x74\x20\157\162\40\123\101\x4d\114\122\x65\x73\x70\x6f\156\163\x65\40\160\141\162\141\x6d\x65\164\145\162\x2e");
> goto UF;
> Ju:
> $KV = $post["\x53\101\115\x4c\122\145\x73\x70\157\x6e\163\x65"];
> UF:
> if (array_key_exists("\122\145\x6c\141\171\x53\164\141\164\x65", $post)) {
> goto pb;
> }
> $dV = '';
> goto wG;
> pb:
> $dV = $post["\122\145\154\x61\171\x53\164\x61\164\145"];
> wG:
> $KV = base64_decode($KV);
> if (!($dV == "\163\150\x6f\167\123\x61\155\x6c\x52\x65\163\x70\157\x6e\163\x65")) {
> goto St;
> }
> Utilities::Print_SAML_Request($KV, "\x64\151\x73\x70\x6c\x61\171\x53\141\155\x6c\x52\x65\x73\x70\x6f\x6e\163\x65");
> St:
> $nD = new DOMDocument();
> $nD->loadXML($KV);
> $wi = $nD->firstChild;
> $KV = new SAML2_Response($wi);
> $jm = current($KV->getAssertions())->getIssuer();
> $rX = db_query("\x53\x45\x4c\105\x43\124\x20\x2a\x20\x46\x52\117\115\40\173\155\151\156\151\157\162\x61\156\x67\145\x5f\x73\x61\155\154\x5f\151\x64\x70\x5f\154\151\x73\x74\175\40\x57\x48\105\x52\105\x20\155\x6f\137\151\x64\x70\x5f\x69\x73\x73\165\145\162\40\75\40\x27{$jm}\47");
> $zN = $rX->fetchAssoc();
> if (!empty($zN)) {
> goto Ob;
> }
> throw new Exception("\x49\x64\145\x6e\164\x69\x74\171\x20\x50\162\x6f\x76\151\x64\145\x72\40\x6e\x6f\164\x20\143\x6f\x6e\146\x69\x67\x75\x72\145\144\x2e\x20\x49\x66\x20\x79\157\x75\x20\x68\x61\166\x65\40\143\x6f\156\x66\151\147\x75\x72\x65\x64\40\x74\150\145\x20\111\x44\x50\x20\164\150\145\x6e\40\x70\154\145\x61\x73\145\x20\155\141\x6b\145\40\x73\x75\x72\x65\x20\171\x6f\x75\x20\141\x72\x65\40\x75\x73\151\x6e\147\40\x63\157\x72\x72\145\x63\x74\x20\x49\163\163\x75\145\162\x20\126\141\x6c\x75\x65");
> Ob:
> $_SESSION["\x49\104\120\x5f\111\x53\x53\x55\105\x52"] = $jm;
> $Gx = Utilities::miniorange_get_baseURL();
> $XZ = $Gx . "\57\77\x71\x3d\x73\x61\155\154\x61\163\x73\x65\x72\164\151\x6f\x6e";
> $YX = $zN["\x6d\157\x5f\x69\x64\x70\x5f\x63\145\x72\164"];
> $jm = $zN["\155\x6f\x5f\151\x64\160\x5f\151\163\x73\165\145\x72"];
> $je = $nD->documentElement;
> $BF = new DOMXpath($nD);
> $BF->registerNamespace("\x73\141\x6d\x6c\x70", "\x75\162\x6e\x3a\x6f\141\x73\151\x73\72\x6e\141\x6d\x65\163\72\x74\x63\72\x53\x41\115\114\x3a\62\56\60\72\160\x72\x6f\x74\x6f\143\x6f\154");
> $BF->registerNamespace("\163\x61\155\154", "\x75\x72\156\72\157\141\x73\151\163\72\156\x61\x6d\x65\x73\72\x74\x63\72\123\101\115\114\x3a\62\56\60\x3a\x61\163\x73\145\x72\164\151\x6f\x6e");
> $dG = $BF->query("\57\163\141\155\x6c\160\x3a\x52\145\x73\160\x6f\x6e\163\145\57\163\141\155\154\x70\x3a\x53\x74\x61\x74\x75\x73\x2f\163\x61\155\154\160\x3a\123\164\x61\x74\x75\163\x43\157\x64\x65", $je);
> $Ri = $dG->item(0)->getAttribute("\x56\x61\154\165\x65");
> $JD = '';
> if (!($dG->item(0)->firstChild !== null)) {
> goto wf;
> }
> $JD = $dG->item(0)->firstChild->getAttribute("\126\x61\154\x75\x65");
> wf:
> $dG = explode("\x3a", $Ri)[7];
> if (!($dG != "\123\x75\143\x63\145\x73\163")) {
> goto xD;
> }
> if (empty($JD)) {
> goto q6;
> }
> $dG = explode("\72", $JD)[7];
> q6:
> $this->show_error_message($dG, $dV);
> xD:
> if (is_null($YX)) {
> goto Av;
> }
> $H8 = XMLSecurityKey::getRawThumbprint($YX);
> $EU = preg_replace("\x2f\134\163\53\57", '', $H8);
> $YX = iconv("\125\x54\106\55\x38", "\x43\x50\x31\62\x35\x32\x2f\x2f\111\x47\x4e\117\x52\105", $EU);
> Av:
> $ud = $KV->getSignatureData();
> $zn = current($KV->getAssertions())->getSignatureData();
> if (!(is_null($ud) && is_null($zn))) {
> goto ou;
82c82
< echo "\116\145\151\164\150\x65\162\40\x72\145\x73\x70\157\156\x73\x65\x20\x6e\157\162\40\x61\x73\163\x65\x72\x74\151\x6f\x6e\x20\151\163\40\x73\x69\x67\x6e\x65\144";
---
> echo "\116\x65\151\x74\x68\x65\x72\40\162\x65\x73\x70\157\x6e\163\145\x20\156\x6f\162\40\141\x73\163\x65\162\x74\151\x6f\x6e\40\x69\x73\x20\163\x69\147\156\145\144";
84,90c84,90
< ZY:
< if (is_null($NX)) {
< goto Vz;
< }
< $rq = Utilities::processResponse($NA, $Uf, $NX, $JY, $gB);
< if ($rq) {
< goto Tp;
---
> ou:
> if (is_null($ud)) {
> goto xk;
> }
> $p0 = Utilities::processResponse($XZ, $YX, $ud, $KV, $dV);
> if ($p0) {
> goto ND;
92c92
< echo "\x49\x6e\x76\x61\x6c\x69\x64\40\x53\151\x67\156\141\164\165\162\145\40\x69\156\40\x53\101\115\114\40\122\145\163\160\x6f\x6e\x73\145";
---
> echo "\111\x6e\x76\141\154\151\144\40\123\x69\x67\x6e\x61\x74\x75\162\x65\40\x69\x6e\x20\x53\101\115\x4c\40\122\x65\163\x70\x6f\x6e\x73\x65";
94,101c94,101
< Tp:
< Vz:
< if (is_null($UZ)) {
< goto qX;
< }
< $uS = Utilities::processResponse($NA, $Uf, $UZ, $JY, $gB);
< if ($uS) {
< goto y2;
---
> ND:
> xk:
> if (is_null($zn)) {
> goto MX;
> }
> $ju = Utilities::processResponse($XZ, $YX, $zn, $KV, $dV);
> if ($ju) {
> goto TJ;
103c103
< echo "\x49\x6e\x76\x61\x6c\151\x64\40\123\x69\147\156\141\x74\x75\x72\x65\x20\x69\156\x20\123\x41\115\114\x20\x41\163\163\x65\162\164\151\157\x6e";
---
> echo "\111\x6e\x76\141\x6c\x69\144\x20\123\151\147\x6e\x61\x74\x75\x72\x65\x20\151\156\x20\123\x41\x4d\114\40\101\x73\163\x65\162\164\151\157\156";
105,244c105,244
< y2:
< qX:
< $Px = current($JY->getAssertions())->getNotOnOrAfter();
< $hl = current($JY->getAssertions())->getNotBefore();
< if (empty($Px)) {
< goto sN;
< }
< variable_set("\155\151\x6e\151\157\x72\x61\156\147\x65\137\x73\141\x6d\x6c\137\x61\163\163\145\162\x74\x69\157\x6e\137\156\x6f\164\137\x61\x66\x74\145\x72", $Px);
< if (!(gmdate(time()) >= $Px)) {
< goto g2;
< }
< $this->show_error_message("\101\163\x73\x65\162\164\151\x6f\x6e\x4e\157\164\101\146\164\145\x72", $gB);
< g2:
< sN:
< if (empty($hl)) {
< goto mJ;
< }
< variable_set("\x6d\151\156\x69\157\x72\141\156\x67\145\137\x73\141\x6d\154\137\141\x73\x73\145\x72\x74\151\157\x6e\x5f\156\x6f\164\137\x62\145\146\157\162\x65", $hl);
< if (!(gmdate(time()) < $hl)) {
< goto HA;
< }
< $this->show_error_message("\101\x73\x73\145\162\x74\x69\157\156\116\x6f\x74\102\145\x66\x6f\162\x65", $gB);
< HA:
< mJ:
< $NA = substr($NA, 0, strpos($NA, "\x3f"));
< Utilities::validateIssuerAndAudience($JY, $Ho, $u1, $base_url, $gB);
< $Ci = current($JY->getAssertions())->getAttributes();
< variable_set("\155\x69\156\151\x6f\x72\141\156\147\145\x5f\x73\141\155\x6c\x5f\141\x74\x74\x72\x73\137\x6c\x69\163\164", $Ci);
< if ($ym != "\116\141\x6d\145\x49\104") {
< goto WD;
< }
< $Ea = current(current($JY->getAssertions())->getNameId());
< goto uZ;
< WD:
< if (array_key_exists($ym, $Ci)) {
< goto NA;
< }
< $Ea = current(current($JY->getAssertions())->getNameId());
< goto iT;
< NA:
< $Ea = $Ci[$ym][0];
< iT:
< uZ:
< $UB = variable_get("\x6d\151\156\x69\157\x72\141\156\x67\x65\x5f\x73\141\155\x6c\137\x65\x6d\x61\x69\154\x5f\141\x74\164\x72\x69\142\165\164\x65", "\x4e\141\x6d\145\111\x44");
< if ($UB == "\116\141\155\145\111\104") {
< goto c4;
< }
< $uj = $Ci[$UB][0];
< goto k4;
< c4:
< $uj = current(current($JY->getAssertions())->getNameId());
< k4:
< variable_set("\x6d\x69\156\x69\x6f\x72\141\156\x67\145\x5f\163\141\x6d\154\x5f\x65\155\x61\x69\154\137\151\144\x5f\x76\x61\154\x75\x65", $uj);
< $qG = '';
< if (!array_key_exists("\122\145\154\x61\171\123\164\141\x74\x65", $post)) {
< goto rM;
< }
< if ($post["\x52\x65\154\141\x79\123\164\141\164\x65"] == "\x74\x65\x73\164\x56\141\154\x69\144\x61\164\145") {
< goto GM;
< }
< $qG = $post["\122\145\154\141\x79\123\164\141\x74\145"];
< goto RO;
< GM:
< $this->showTestResults($Ea, $Ci);
< RO:
< rM:
< $gF = current($JY->getAssertions())->getSessionIndex();
< $b3 = current(current($JY->getAssertions())->getNameId());
< $Tr = array();
< foreach ($FQ as $mz => $rE) {
< if (!array_key_exists($rE, $Ci)) {
< goto kb;
< }
< $zc = $Ci[$rE][0];
< $Tr[$mz] = $zc;
< kb:
< eH:
< }
< zW:
< $MB = variable_get("\x6d\x69\x6e\x69\157\x72\x61\x6e\x67\145\137\x73\x61\155\154\137\x69\x64\x70\x5f\x61\x74\x74\162\x31\x5f\156\141\x6d\x65", '');
< if (!(isset($MB) && !empty($MB) && isset($Ci[$MB]))) {
< goto uM;
< }
< $vJ = $Ci[$MB];
< $vJ[0] = preg_replace("\x2f\134\163\x2b\57", '', $vJ[0]);
< $Er = strpos($vJ[0], "\x2c");
< if (!(sizeof($Ci[$MB]) == 1 && $Er !== false)) {
< goto un;
< }
< $eH = explode("\x2c", $vJ[0]);
< $Ci[$MB] = $eH;
< un:
< $Eo = 0;
< mM:
< if (!($Eo < sizeof($Ci[$MB]))) {
< goto tz;
< }
< $QL[$Eo] = $Ci[$MB][$Eo];
< Q0:
< $Eo++;
< goto mM;
< tz:
< $VQ = array();
< if (variable_get("\x6d\x69\x6e\x69\x6f\x72\x61\x6e\x67\x65\137\x73\141\155\x6c\137\144\151\163\x61\142\x6c\x65\x5f\162\x6f\x6c\145\137\x75\x70\144\x61\x74\x65")) {
< goto Tx;
< }
< $Eo = 0;
< QP:
< if (!($Eo < sizeof($QL))) {
< goto Bc;
< }
< foreach ($im as $mz => $rE) {
< if (!(!empty($mz) && !is_null($mz) && !strcasecmp($QL[$Eo], $mz))) {
< goto lZ;
< }
< $RJ = array_search($rE, user_roles());
< $VQ[$RJ] = $rE;
< lZ:
< NI:
< }
< W9:
< I8:
< $Eo++;
< goto QP;
< Bc:
< Tx:
< uM:
< $Dj = array();
< $Dj["\145\x6d\141\x69\154"] = isset($uj) ? $uj : '';
< $Dj["\x75\x73\145\162\156\x61\x6d\145"] = isset($Ea) ? $Ea : '';
< $Dj["\x4e\141\155\x65\111\x44"] = isset($b3) ? $b3 : '';
< $Dj["\x73\x65\163\x73\151\x6f\156\111\156\144\145\x78"] = isset($gF) ? $gF : '';
< $Dj["\x63\x75\x73\x74\157\x6d\106\151\145\x6c\x64\x41\x74\x74\162\151\142\165\x74\x65\x73"] = isset($Tr) ? $Tr : '';
< $Dj["\143\x75\x73\x74\157\155\106\x69\x65\x6c\x64\122\157\x6c\145\163"] = isset($VQ) ? $VQ : '';
< if (empty($qG)) {
< goto fH;
< }
< $Dj["\162\x65\x6c\x61\171\137\x73\x74\x61\164\145"] = $qG;
< fH:
< return $Dj;
---
> TJ:
> MX:
> $DI = current($KV->getAssertions())->getNotOnOrAfter();
> $og = current($KV->getAssertions())->getNotBefore();
> if (empty($DI)) {
> goto Ug;
> }
> variable_set("\x6d\151\156\151\x6f\x72\x61\x6e\x67\145\x5f\163\x61\x6d\154\137\141\x73\x73\145\x72\x74\x69\x6f\x6e\137\156\x6f\x74\x5f\x61\x66\164\145\162", $DI);
> if (!(gmdate(time()) >= $DI)) {
> goto xw;
> }
> $this->show_error_message("\101\x73\x73\x65\162\x74\151\x6f\156\x4e\157\x74\101\146\164\x65\162", $dV);
> xw:
> Ug:
> if (empty($og)) {
> goto vK;
> }
> variable_set("\155\x69\156\151\x6f\x72\x61\156\147\145\x5f\x73\141\155\x6c\x5f\141\163\163\145\x72\164\x69\157\x6e\137\x6e\x6f\x74\137\x62\145\146\x6f\x72\x65", $og);
> if (!(gmdate(time()) < $og)) {
> goto lB;
> }
> $this->show_error_message("\101\163\x73\x65\x72\164\151\x6f\x6e\x4e\x6f\164\x42\145\x66\157\x72\145", $dV);
> lB:
> vK:
> $XZ = substr($XZ, 0, strpos($XZ, "\x3f"));
> Utilities::validateIssuerAndAudience($KV, $nW, $jm, $base_url, $dV);
> $S_ = current($KV->getAssertions())->getAttributes();
> variable_set("\x6d\x69\x6e\151\x6f\x72\141\x6e\147\145\x5f\x73\141\x6d\x6c\x5f\x61\164\x74\x72\163\x5f\154\151\x73\x74", $S_);
> if ($FL != "\116\141\155\145\111\x44") {
> goto pS;
> }
> $q1 = current(current($KV->getAssertions())->getNameId());
> goto p2;
> pS:
> if (array_key_exists($FL, $S_)) {
> goto Ph;
> }
> $q1 = current(current($KV->getAssertions())->getNameId());
> goto tL;
> Ph:
> $q1 = $S_[$FL][0];
> tL:
> p2:
> $Au = variable_get("\155\x69\x6e\151\x6f\162\x61\x6e\147\x65\137\x73\x61\155\154\137\145\x6d\141\x69\154\x5f\141\x74\x74\162\x69\142\x75\164\x65", "\116\141\155\x65\111\104");
> if ($Au == "\x4e\141\155\x65\x49\104") {
> goto C1;
> }
> $An = $S_[$Au][0];
> goto hU;
> C1:
> $An = current(current($KV->getAssertions())->getNameId());
> hU:
> variable_set("\155\x69\156\x69\x6f\162\141\x6e\x67\x65\x5f\163\x61\155\154\x5f\145\155\x61\151\x6c\x5f\151\144\137\x76\141\x6c\x75\145", $An);
> $e1 = '';
> if (!array_key_exists("\122\x65\154\141\171\123\x74\141\164\145", $post)) {
> goto sW;
> }
> if ($post["\122\145\154\x61\171\123\x74\x61\164\145"] == "\x74\x65\163\164\126\141\154\x69\144\x61\164\x65") {
> goto t9;
> }
> $e1 = $post["\122\145\x6c\141\171\123\x74\141\x74\145"];
> goto Fb;
> t9:
> $this->showTestResults($q1, $S_);
> Fb:
> sW:
> $Hr = current($KV->getAssertions())->getSessionIndex();
> $Jb = current(current($KV->getAssertions())->getNameId());
> $BK = array();
> foreach ($mm as $ZE => $ND) {
> if (!array_key_exists($ND, $S_)) {
> goto nE;
> }
> $oP = $S_[$ND][0];
> $BK[$ZE] = $oP;
> nE:
> Iz:
> }
> Y_:
> $dp = variable_get("\155\151\156\x69\157\162\141\x6e\x67\145\x5f\x73\x61\x6d\x6c\x5f\151\x64\x70\137\141\x74\164\x72\x31\x5f\x6e\141\x6d\145", '');
> if (!(isset($dp) && !empty($dp) && isset($S_[$dp]))) {
> goto U8;
> }
> $Ro = $S_[$dp];
> $Ro[0] = preg_replace("\x2f\134\x73\x2b\57", '', $Ro[0]);
> $E_ = strpos($Ro[0], "\x2c");
> if (!(sizeof($S_[$dp]) == 1 && $E_ !== false)) {
> goto eE;
> }
> $Bm = explode("\x2c", $Ro[0]);
> $S_[$dp] = $Bm;
> eE:
> $Xc = 0;
> vI:
> if (!($Xc < sizeof($S_[$dp]))) {
> goto up;
> }
> $SK[$Xc] = $S_[$dp][$Xc];
> Lm:
> $Xc++;
> goto vI;
> up:
> $j_ = array();
> if (variable_get("\155\x69\156\x69\157\162\x61\156\147\x65\137\163\141\155\154\x5f\144\151\163\x61\142\154\145\137\x72\x6f\154\x65\137\165\x70\x64\x61\164\145")) {
> goto YN;
> }
> $Xc = 0;
> v4:
> if (!($Xc < sizeof($SK))) {
> goto vg;
> }
> foreach ($Nt as $ZE => $ND) {
> if (!(!empty($ZE) && !is_null($ZE) && !strcasecmp($SK[$Xc], $ZE))) {
> goto Tl;
> }
> $G9 = array_search($ND, user_roles());
> $j_[$G9] = $ND;
> Tl:
> m6:
> }
> Xc:
> F2:
> $Xc++;
> goto v4;
> vg:
> YN:
> U8:
> $yH = array();
> $yH["\145\x6d\141\x69\154"] = isset($An) ? $An : '';
> $yH["\x75\x73\x65\x72\156\141\x6d\x65"] = isset($q1) ? $q1 : '';
> $yH["\x4e\141\155\145\x49\104"] = isset($Jb) ? $Jb : '';
> $yH["\163\x65\163\x73\151\157\x6e\111\x6e\x64\x65\170"] = isset($Hr) ? $Hr : '';
> $yH["\x63\x75\x73\164\x6f\155\106\x69\145\154\x64\x41\164\164\162\151\x62\165\164\x65\x73"] = isset($BK) ? $BK : '';
> $yH["\x63\x75\x73\x74\x6f\155\x46\x69\145\154\144\x52\x6f\154\145\x73"] = isset($j_) ? $j_ : '';
> if (empty($e1)) {
> goto E7;
> }
> $yH["\x72\x65\x6c\141\171\137\163\x74\x61\164\145"] = $e1;
> E7:
> return $yH;
246c246
< function show_error_message($HP, $vd)
---
> function show_error_message($vV, $vA)
248,249c248,249
< if ($vd == "\x74\145\163\164\126\x61\x6c\x69\x64\x61\164\145") {
< goto Tf;
---
> if ($vA == "\x74\145\163\164\126\141\x6c\x69\x64\x61\x74\145") {
> goto Wm;
251,252c251,252
< if ($HP == "\122\145\x71\x75\x65\x73\x74\104\x65\x6e\x69\x65\144") {
< goto Mt;
---
> if ($vV == "\x52\x65\161\165\145\x73\164\104\145\156\x69\145\x64") {
> goto oo;
254c254
< echo "\127\x65\40\x63\157\x75\x6c\x64\40\156\x6f\164\x20\163\151\x67\156\x20\x79\157\165\40\151\x6e\56\40\120\154\x65\141\163\x65\x20\x63\x6f\156\164\x61\x63\x74\x20\171\x6f\x75\x72\40\101\144\155\x69\156\151\x73\x74\162\x61\164\157\x72\x2e";
---
> echo "\127\145\40\x63\x6f\x75\154\x64\x20\156\x6f\164\x20\x73\151\x67\x6e\40\171\x6f\165\x20\151\156\56\x20\120\154\145\141\163\145\x20\x63\x6f\156\164\141\143\x74\x20\x79\x6f\x75\162\x20\x41\144\x6d\151\x6e\x69\x73\x74\x72\x61\164\157\x72\56";
256,258c256,258
< goto Hm;
< Mt:
< echo "\131\x6f\x75\x20\x61\162\x65\40\156\x6f\x74\40\141\154\x6c\x6f\x77\145\144\x20\x74\x6f\40\x6c\157\147\151\x6e\x20\151\x6e\x74\157\x20\164\150\x65\40\x73\151\x74\x65\56\40\x50\154\145\141\x73\x65\40\143\157\x6e\x74\141\x63\164\40\171\x6f\165\x72\x20\101\144\x6d\x69\156\x69\163\164\162\141\x74\157\x72\56";
---
> goto ud;
> oo:
> echo "\x59\157\x75\40\x61\162\145\x20\156\157\x74\40\141\x6c\x6c\157\167\x65\x64\40\x74\x6f\40\x6c\157\x67\x69\x6e\x20\151\156\x74\157\40\164\150\x65\40\x73\151\x74\x65\56\40\120\154\x65\x61\163\x65\x20\143\157\x6e\x74\x61\143\x74\x20\171\x6f\165\x72\x20\x41\x64\x6d\151\x6e\x69\163\x74\x72\x61\x74\x6f\162\x2e";
260,264c260,264
< Hm:
< goto kq;
< Tf:
< echo "\74\144\x69\x76\40\163\164\171\154\x65\75\x22\146\x6f\156\x74\x2d\x66\x61\x6d\x69\154\171\x3a\x43\141\x6c\151\142\x72\x69\x3b\x70\x61\144\x64\151\x6e\x67\72\60\x20\63\x25\73\x22\76";
< echo "\x3c\144\x69\x76\x20\163\164\171\x6c\145\x3d\x22\143\157\154\x6f\x72\72\40\x23\141\x39\x34\x34\x34\62\x3b\142\x61\143\x6b\x67\x72\157\x75\156\x64\x2d\x63\x6f\154\x6f\162\x3a\40\43\146\x32\x64\x65\144\145\x3b\x70\x61\144\144\151\x6e\147\x3a\40\x31\65\x70\170\73\155\x61\x72\147\x69\x6e\55\x62\157\x74\164\x6f\x6d\x3a\40\62\60\160\x78\73\164\145\x78\164\x2d\x61\154\151\147\x6e\x3a\143\145\x6e\164\x65\162\x3b\142\x6f\162\144\x65\162\72\x31\160\170\40\x73\157\154\151\144\x20\43\105\x36\x42\63\102\62\73\x66\x6f\x6e\x74\55\163\151\x7a\145\x3a\x31\x38\x70\x74\x3b\x22\x3e\40\105\x52\122\x4f\x52\74\x2f\x64\151\166\76\xd\xa\x9\11\11\x3c\144\151\x76\x20\163\164\x79\154\x65\75\x22\x63\x6f\154\157\162\72\40\x23\141\71\x34\64\x34\x32\73\x66\x6f\x6e\164\55\163\151\172\145\72\61\64\160\x74\x3b\40\x6d\141\162\147\151\x6e\55\142\x6f\x74\164\157\155\x3a\x32\x30\x70\170\x3b\x22\x3e\x3c\x70\76\74\163\x74\x72\157\156\147\x3e\105\162\162\x6f\x72\x3a\x20\x3c\x2f\163\x74\x72\157\x6e\147\76\x20\x49\x6e\x76\x61\x6c\151\144\40\123\x41\x4d\x4c\40\x52\x65\163\x70\x6f\x6e\163\145\x20\x53\x74\x61\164\165\163\56\74\57\x70\x3e\15\xa\x9\x9\11\x3c\x70\76\74\163\x74\162\x6f\x6e\x67\x3e\103\x61\x75\x73\145\x73\74\57\163\x74\162\157\156\x67\76\x3a\40\111\144\x65\156\x74\x69\x74\x79\x20\120\162\x6f\x76\151\144\145\162\40\x68\141\163\x20\x73\x65\x6e\x74\40\x27" . $HP . "\47\x20\x73\x74\x61\x74\x75\163\x20\x63\x6f\x64\145\40\151\156\40\x53\101\115\114\40\122\145\x73\x70\x6f\156\x73\145\56\40\74\x2f\160\76\xd\12\11\x9\11\11\11\x9\x9\74\x70\76\x3c\x73\x74\162\157\156\147\x3e\x52\145\x61\163\157\156\x3c\57\163\x74\162\157\x6e\147\x3e\x3a\x20" . $this->get_status_message($HP) . "\74\x2f\160\x3e\74\142\162\x3e\xd\xa\11\11\x9\x3c\57\144\151\x76\x3e\15\xa\15\12\11\x9\x9\74\x64\151\166\x20\x73\164\171\x6c\145\75\42\x6d\141\162\147\x69\x6e\72\x33\x25\73\x64\151\x73\x70\154\x61\x79\72\x62\154\157\143\153\x3b\164\145\x78\164\x2d\141\154\x69\x67\x6e\x3a\x63\x65\156\x74\145\x72\x3b\x22\76\xd\12\11\11\11\74\144\x69\x76\x20\x73\164\171\x6c\x65\75\42\x6d\141\x72\147\x69\156\x3a\63\x25\x3b\144\x69\x73\160\x6c\x61\x79\x3a\x62\x6c\157\143\153\x3b\164\x65\x78\x74\55\x61\154\x69\x67\156\x3a\x63\145\156\x74\x65\162\73\x22\76\x3c\x69\x6e\x70\x75\x74\x20\163\x74\x79\x6c\x65\x3d\42\x70\x61\144\144\151\156\147\x3a\61\x25\x3b\167\151\x64\164\x68\x3a\x31\60\x30\x70\x78\73\x62\x61\143\153\147\162\157\165\x6e\x64\72\x20\43\x30\x30\x39\x31\x43\104\x20\156\157\156\x65\x20\x72\145\x70\x65\141\164\40\x73\x63\x72\157\x6c\154\40\x30\x25\40\60\45\73\143\x75\x72\x73\x6f\x72\72\40\x70\x6f\151\x6e\x74\145\x72\x3b\146\x6f\156\164\55\x73\151\x7a\145\72\x31\x35\160\170\73\142\x6f\162\144\x65\162\x2d\167\151\x64\x74\150\x3a\40\61\160\x78\73\x62\157\162\144\x65\x72\55\163\164\x79\154\x65\72\40\x73\x6f\154\151\x64\x3b\x62\157\162\x64\x65\162\x2d\162\141\x64\x69\x75\163\72\40\x33\x70\170\73\x77\x68\x69\164\x65\x2d\x73\x70\141\x63\x65\x3a\40\x6e\157\x77\x72\x61\160\x3b\x62\157\170\55\x73\151\172\151\x6e\147\72\x20\142\x6f\x72\x64\145\x72\x2d\142\157\170\73\x62\157\x72\144\x65\x72\55\143\157\154\x6f\x72\x3a\40\43\60\60\x37\63\101\x41\x3b\x62\x6f\x78\55\163\x68\141\x64\157\x77\x3a\x20\x30\x70\x78\x20\x31\x70\170\x20\60\160\x78\40\162\x67\x62\141\x28\x31\x32\x30\x2c\40\x32\x30\x30\x2c\40\62\x33\60\54\40\x30\x2e\x36\51\40\x69\156\x73\145\164\x3b\x63\x6f\154\157\162\x3a\40\x23\x46\x46\106\73\x22\164\171\160\x65\x3d\42\x62\165\x74\164\157\x6e\x22\x20\166\141\154\165\x65\75\42\x44\x6f\x6e\x65\42\40\x6f\156\103\x6c\151\x63\153\x3d\x22\163\145\154\x66\x2e\143\x6c\x6f\x73\145\x28\51\x3b\42\76\74\x2f\144\151\x76\76";
---
> ud:
> goto Ae;
> Wm:
> echo "\x3c\x64\151\x76\40\x73\164\171\154\x65\75\x22\x66\157\x6e\164\55\146\141\155\x69\x6c\171\x3a\103\141\x6c\151\142\x72\x69\x3b\x70\141\144\144\151\x6e\147\x3a\x30\x20\x33\45\73\x22\76";
> echo "\74\144\151\166\40\x73\164\x79\154\x65\75\42\143\157\x6c\x6f\x72\x3a\x20\x23\141\x39\64\64\x34\x32\x3b\142\141\x63\x6b\147\162\x6f\165\156\x64\x2d\x63\157\x6c\157\x72\x3a\40\x23\x66\62\144\145\144\x65\x3b\160\x61\x64\144\x69\156\x67\x3a\x20\61\65\x70\170\x3b\x6d\141\x72\147\x69\156\x2d\x62\157\164\x74\157\x6d\x3a\x20\x32\60\160\x78\x3b\x74\145\170\x74\x2d\141\154\x69\147\x6e\72\x63\x65\156\x74\145\162\73\x62\157\162\144\x65\162\x3a\61\160\170\40\x73\x6f\154\151\144\40\x23\x45\66\x42\63\102\x32\73\x66\x6f\x6e\x74\55\163\151\x7a\x65\72\x31\x38\x70\164\x3b\42\x3e\x20\x45\x52\x52\x4f\x52\74\x2f\144\151\x76\76\15\xa\x9\11\x9\74\144\x69\166\40\x73\x74\171\154\145\75\x22\x63\x6f\154\157\x72\72\40\43\141\x39\64\x34\64\62\x3b\x66\157\156\x74\x2d\163\x69\x7a\145\72\x31\x34\x70\164\73\x20\x6d\x61\162\147\151\x6e\x2d\x62\157\x74\x74\157\155\x3a\x32\60\x70\170\73\x22\76\x3c\160\x3e\x3c\x73\x74\x72\x6f\156\x67\x3e\x45\x72\x72\x6f\162\72\x20\74\x2f\163\164\x72\157\x6e\x67\x3e\x20\x49\x6e\166\x61\154\151\144\40\x53\101\x4d\114\x20\122\145\x73\x70\157\156\x73\145\40\x53\164\x61\164\x75\x73\x2e\74\x2f\x70\76\xd\12\x9\x9\11\74\x70\76\74\163\x74\x72\157\x6e\147\x3e\103\141\165\163\x65\x73\74\57\163\164\x72\x6f\156\147\76\72\x20\x49\144\145\156\x74\151\164\x79\x20\120\162\157\x76\x69\144\145\x72\x20\150\141\163\40\163\145\x6e\164\x20\x27" . $vV . "\47\40\x73\164\x61\164\165\x73\40\x63\x6f\x64\x65\x20\x69\156\x20\x53\101\115\114\x20\x52\145\163\x70\x6f\156\x73\145\x2e\40\74\x2f\160\x3e\15\xa\x9\x9\x9\11\x9\11\x9\74\160\x3e\74\163\164\x72\x6f\156\x67\76\x52\145\141\163\x6f\x6e\74\x2f\163\164\x72\x6f\156\x67\x3e\x3a\x20" . $this->get_status_message($vV) . "\74\x2f\x70\x3e\x3c\142\162\x3e\15\12\x9\x9\x9\x3c\x2f\144\151\x76\76\xd\12\xd\xa\11\x9\11\x3c\x64\x69\x76\40\x73\x74\171\x6c\145\x3d\42\155\x61\162\147\151\156\x3a\63\45\x3b\144\151\x73\x70\154\x61\x79\x3a\142\154\x6f\143\153\73\164\x65\170\164\55\x61\x6c\x69\x67\x6e\x3a\x63\x65\x6e\164\x65\x72\73\x22\x3e\xd\xa\11\11\x9\74\144\x69\166\40\x73\164\x79\154\x65\x3d\x22\155\141\x72\147\x69\x6e\x3a\63\x25\73\x64\151\x73\x70\154\x61\171\72\142\x6c\x6f\x63\153\x3b\164\x65\170\x74\55\x61\x6c\151\x67\x6e\72\x63\x65\x6e\x74\145\x72\x3b\x22\76\x3c\x69\x6e\160\x75\x74\40\163\164\x79\154\145\75\x22\x70\x61\x64\x64\151\x6e\147\72\61\45\x3b\167\x69\x64\164\x68\x3a\x31\60\60\x70\x78\73\x62\141\x63\153\147\162\x6f\165\x6e\144\72\x20\x23\60\60\x39\61\x43\x44\x20\x6e\x6f\x6e\x65\40\x72\145\x70\145\x61\164\x20\x73\143\162\157\154\x6c\x20\x30\x25\40\60\45\73\x63\x75\x72\163\157\162\x3a\x20\x70\x6f\x69\156\164\145\x72\x3b\x66\157\156\x74\55\163\x69\x7a\145\72\61\x35\x70\x78\x3b\x62\157\x72\x64\145\162\55\167\x69\144\164\x68\x3a\x20\61\x70\x78\73\142\157\162\x64\x65\x72\55\163\164\171\x6c\x65\x3a\x20\x73\157\x6c\x69\144\x3b\142\157\162\x64\145\162\55\162\x61\144\151\x75\163\72\x20\x33\x70\170\x3b\x77\x68\x69\x74\x65\55\163\160\141\143\x65\x3a\40\x6e\x6f\x77\162\141\160\73\142\x6f\x78\x2d\163\x69\x7a\x69\x6e\147\x3a\x20\x62\157\162\144\x65\162\55\142\x6f\170\73\x62\x6f\x72\144\x65\162\x2d\143\157\x6c\x6f\162\72\40\x23\x30\x30\x37\x33\101\x41\x3b\142\157\x78\55\x73\x68\141\144\x6f\x77\x3a\40\60\x70\170\x20\61\x70\170\40\60\160\x78\x20\162\x67\142\141\x28\61\x32\60\x2c\x20\62\60\x30\54\x20\x32\x33\60\x2c\40\x30\x2e\x36\x29\x20\151\156\x73\145\x74\x3b\x63\157\154\157\162\x3a\40\43\x46\x46\x46\x3b\42\x74\171\x70\x65\75\x22\x62\x75\x74\164\157\x6e\42\40\166\141\x6c\165\x65\75\x22\104\x6f\156\145\x22\40\157\x6e\103\x6c\151\x63\153\x3d\42\x73\145\154\x66\x2e\143\x6c\x6f\x73\x65\50\51\73\x22\76\x3c\57\x64\151\x76\x3e";
266c266
< kq:
---
> Ae:
268c268
< function get_status_message($HP)
---
> function get_status_message($vV)
270,290c270,290
< switch ($HP) {
< case "\x52\145\x71\165\145\x73\164\104\x65\156\x69\x65\x64":
< return "\x59\157\x75\40\x61\x72\145\40\156\x6f\x74\40\x61\x6c\154\x6f\x77\x65\x64\x20\x74\157\40\154\x6f\147\x69\156\x20\151\x6e\164\157\x20\164\150\145\40\x73\x69\x74\145\56\40\x50\x6c\x65\x61\x73\145\40\143\157\x6e\x74\x61\143\x74\40\171\x6f\x75\x72\x20\101\144\155\x69\x6e\151\163\x74\162\x61\164\x6f\x72\56";
< goto t_;
< case "\x52\145\161\165\145\163\164\145\162":
< return "\x54\x68\145\x20\x72\x65\x71\x75\145\163\164\40\143\157\165\154\x64\x20\156\157\164\40\142\x65\40\160\x65\x72\x66\157\162\x6d\x65\x64\40\144\x75\145\40\164\x6f\x20\141\156\40\x65\x72\162\x6f\x72\40\157\156\40\x74\x68\x65\40\x70\x61\162\164\x20\157\146\40\164\x68\x65\40\162\x65\x71\x75\x65\x73\164\145\162\56";
< goto t_;
< case "\x52\145\x73\160\157\156\144\145\x72":
< return "\x54\x68\x65\x20\x72\145\161\x75\x65\163\164\x20\x63\157\165\154\144\x20\x6e\157\x74\x20\x62\145\40\x70\145\x72\x66\x6f\162\155\145\x64\40\x64\x75\145\40\x74\157\x20\141\156\40\145\x72\x72\x6f\162\40\x6f\x6e\x20\164\x68\145\x20\160\141\x72\x74\x20\157\x66\40\164\x68\145\x20\x53\101\x4d\x4c\x20\x72\x65\163\x70\157\156\x64\x65\x72\x20\157\162\x20\123\101\x4d\x4c\40\141\x75\x74\x68\x6f\162\151\x74\171\x2e";
< goto t_;
< case "\x56\x65\162\163\x69\x6f\x6e\115\151\163\x6d\141\x74\x63\150":
< return "\x54\x68\145\x20\x53\101\115\114\x20\x72\x65\163\160\x6f\156\x64\x65\x72\40\x63\x6f\165\x6c\144\40\x6e\x6f\x74\x20\x70\x72\157\143\x65\163\x73\40\x74\x68\x65\x20\x72\x65\x71\165\x65\x73\x74\40\142\145\x63\141\165\x73\x65\x20\164\x68\145\x20\x76\x65\x72\x73\x69\157\156\40\157\146\40\164\150\145\x20\x72\x65\161\165\145\x73\164\40\x6d\145\163\x73\x61\x67\145\40\x77\141\x73\x20\x69\x6e\x63\157\162\162\145\x63\164\56";
< goto t_;
< case "\101\x73\x73\145\162\x74\151\x6f\156\116\x6f\164\101\x66\x74\145\x72":
< $Px = variable_get("\x6d\151\156\x69\x6f\162\141\x6e\x67\145\x5f\163\x61\155\x6c\137\x61\163\163\145\x72\x74\x69\157\156\137\156\157\164\x5f\x61\146\x74\x65\x72", '');
< return "\x53\x41\x4d\x4c\x20\101\x73\163\x65\162\164\x69\x6f\x6e\40\151\163\40\x65\170\x70\151\162\x65\144\x20\157\x6e\40" . date("\115\x20\152\54\x20\131\x20\x67\x3a\x69\x20\x61\56", $Px);
< goto t_;
< case "\101\x73\x73\145\x72\x74\x69\x6f\156\116\157\164\102\x65\146\x6f\x72\145":
< $hl = variable_get("\x6d\x69\156\151\x6f\162\x61\156\147\x65\x5f\163\141\155\x6c\x5f\x61\163\163\x65\162\x74\151\157\x6e\137\x6e\x6f\164\x5f\x62\x65\x66\x6f\x72\x65", '');
< return "\123\x41\x4d\114\x20\x41\163\x73\x65\162\164\151\157\x6e\40\151\163\40\x6e\157\164\x20\x76\x61\x6c\151\x64\x20\x62\x65\146\x6f\162\145\x20" . date("\115\40\x6a\54\x20\x59\x20\x67\72\151\40\141\x2e", $hl);
< goto t_;
---
> switch ($vV) {
> case "\122\145\x71\165\145\x73\164\104\x65\x6e\151\145\144":
> return "\x59\x6f\x75\40\x61\162\x65\40\156\157\x74\40\141\154\x6c\x6f\x77\x65\144\40\x74\x6f\40\154\157\147\x69\156\40\151\156\164\157\x20\x74\150\x65\x20\x73\x69\x74\145\x2e\40\x50\154\145\x61\x73\x65\40\x63\x6f\156\164\x61\143\164\x20\x79\x6f\165\162\40\x41\144\x6d\x69\156\151\163\x74\162\x61\164\x6f\x72\56";
> goto qq;
> case "\x52\x65\x71\165\145\163\164\x65\x72":
> return "\x54\150\145\40\x72\145\161\x75\x65\x73\164\40\x63\157\x75\154\x64\40\156\157\164\x20\142\145\x20\x70\x65\162\x66\x6f\162\155\x65\144\x20\x64\165\145\x20\x74\157\x20\x61\x6e\40\x65\162\162\x6f\x72\40\x6f\x6e\40\x74\150\x65\x20\x70\141\x72\x74\x20\x6f\x66\40\x74\150\x65\x20\162\x65\161\165\x65\163\164\145\162\56";
> goto qq;
> case "\122\x65\163\160\157\x6e\x64\145\x72":
> return "\124\150\x65\40\x72\x65\x71\x75\145\163\164\x20\143\157\165\x6c\x64\x20\x6e\157\164\x20\x62\145\x20\160\145\x72\146\157\x72\155\145\144\40\x64\165\x65\x20\164\x6f\40\x61\156\x20\145\x72\x72\157\x72\40\157\156\x20\x74\x68\145\x20\160\141\x72\164\x20\157\x66\x20\x74\150\145\x20\123\101\x4d\114\40\x72\x65\163\x70\x6f\156\x64\145\162\40\x6f\162\40\123\101\x4d\114\40\x61\165\164\x68\x6f\x72\151\x74\x79\x2e";
> goto qq;
> case "\x56\x65\x72\163\x69\x6f\x6e\x4d\x69\163\x6d\141\164\143\x68":
> return "\x54\x68\145\x20\x53\101\115\114\x20\x72\x65\163\160\157\x6e\144\x65\x72\40\x63\157\165\x6c\x64\40\156\x6f\x74\x20\160\162\157\143\145\163\x73\40\x74\x68\145\x20\x72\145\161\x75\x65\163\x74\40\x62\145\x63\141\x75\163\x65\40\x74\x68\145\x20\166\145\162\163\151\157\156\x20\157\146\x20\164\x68\x65\40\162\x65\161\165\x65\x73\164\40\x6d\x65\163\x73\x61\x67\145\x20\x77\x61\x73\40\x69\x6e\x63\157\162\162\x65\x63\164\56";
> goto qq;
> case "\101\x73\x73\x65\162\x74\x69\157\x6e\x4e\157\164\101\x66\164\x65\x72":
> $DI = variable_get("\x6d\x69\156\x69\157\x72\x61\156\x67\x65\x5f\163\x61\x6d\154\137\141\163\x73\145\162\164\x69\x6f\156\137\156\x6f\164\x5f\141\146\164\x65\162", '');
> return "\123\101\115\x4c\40\101\x73\x73\145\x72\x74\x69\157\156\40\151\163\40\x65\170\160\151\x72\145\144\x20\x6f\156\40" . date("\115\40\x6a\54\40\131\40\147\72\x69\x20\141\56", $DI);
> goto qq;
> case "\101\x73\x73\x65\x72\x74\151\157\156\116\x6f\164\x42\x65\x66\157\162\145":
> $og = variable_get("\155\151\x6e\x69\157\162\141\x6e\147\x65\x5f\163\x61\155\x6c\x5f\x61\163\x73\x65\162\x74\151\x6f\156\137\x6e\157\x74\x5f\x62\145\x66\x6f\x72\145", '');
> return "\123\x41\115\x4c\40\x41\x73\163\x65\x72\x74\x69\x6f\156\x20\151\163\x20\156\157\x74\x20\x76\141\154\x69\144\40\142\145\x66\157\x72\145\x20" . date("\115\x20\x6a\54\40\x59\40\x67\72\151\40\x61\x2e", $og);
> goto qq;
292c292
< return "\x55\156\153\156\x6f\x77\x6e";
---
> return "\125\156\x6b\x6e\157\167\x6e";
294,295c294,295
< kk:
< t_:
---
> t3:
> qq:
297c297
< public function showTestResults($Ea, $Ci)
---
> public function showTestResults($q1, $S_)
300,325c300,325
< $n8 = drupal_get_path("\155\157\144\x75\x6c\x65", "\x6d\151\156\x69\x6f\x72\141\x6e\x67\145\x5f\x73\141\x6d\154");
< echo "\x3c\144\x69\x76\x20\x73\x74\x79\x6c\145\x3d\42\x66\157\x6e\x74\55\x66\x61\155\x69\154\x79\72\103\x61\154\x69\x62\x72\151\73\x70\141\144\x64\151\x6e\147\72\60\40\x33\45\73\42\x3e";
< if (!empty($Ea)) {
< goto T1;
< }
< echo "\74\x64\x69\x76\x20\163\164\x79\x6c\145\x3d\x22\143\157\154\157\162\x3a\40\43\x61\x39\x34\64\x34\62\73\142\141\x63\x6b\147\x72\157\165\x6e\x64\55\x63\x6f\154\x6f\x72\72\x20\x23\x66\62\144\x65\144\145\x3b\x70\141\x64\x64\151\x6e\147\x3a\x20\x31\65\160\x78\x3b\x6d\x61\x72\147\x69\x6e\55\142\x6f\164\x74\x6f\x6d\72\x20\x32\60\x70\x78\x3b\x74\145\170\164\55\x61\154\x69\x67\x6e\72\x63\145\x6e\x74\145\x72\x3b\x62\x6f\162\x64\x65\162\x3a\x31\x70\170\40\163\x6f\154\151\x64\40\x23\105\x36\x42\63\102\62\x3b\146\157\156\164\55\x73\151\172\145\x3a\x31\x38\x70\164\x3b\42\x3e\124\105\x53\x54\40\106\101\x49\x4c\x45\104\74\x2f\x64\x69\x76\x3e\xd\xa\x20\40\40\x20\x20\x20\x20\x20\x20\40\74\x64\x69\x76\40\x73\164\x79\x6c\x65\x3d\x22\143\157\x6c\157\x72\72\40\43\141\x39\x34\x34\64\x32\73\146\x6f\x6e\x74\x2d\163\151\x7a\x65\x3a\61\64\160\x74\73\40\155\x61\162\x67\x69\x6e\x2d\x62\157\x74\164\157\x6d\72\x32\x30\160\x78\x3b\42\x3e\x57\x41\122\116\x49\116\x47\72\40\x53\x6f\x6d\x65\x20\101\164\164\x72\151\x62\165\x74\x65\163\x20\104\x69\x64\x20\116\157\164\40\x4d\141\164\x63\150\x2e\74\57\144\x69\166\76\xd\xa\40\40\x20\x20\40\40\x20\40\x20\40\x3c\x64\151\x76\x20\163\164\171\x6c\145\x3d\42\x64\151\163\x70\154\141\x79\72\142\x6c\157\x63\153\73\164\x65\x78\x74\x2d\141\x6c\151\147\x6e\x3a\x63\145\x6e\x74\145\162\x3b\155\141\162\x67\151\156\55\142\x6f\164\164\157\x6d\72\x34\x25\x3b\42\x3e\x3c\x69\155\x67\40\163\x74\171\x6c\x65\x3d\x22\x77\x69\144\164\150\72\61\x35\x25\x3b\42\163\x72\x63\75\x22" . $n8 . "\151\x6e\x63\154\x75\x64\x65\x73\57\x69\x6d\x61\147\145\163\57\167\x72\x6f\x6e\147\x2e\x70\x6e\147\42\x3e\x3c\57\144\x69\x76\76";
< goto DN;
< T1:
< echo "\x3c\x64\x69\x76\x20\x73\164\171\x6c\145\x3d\42\x63\x6f\x6c\157\162\72\x20\x23\x33\143\x37\66\63\x64\x3b\x62\x61\143\x6b\x67\162\157\x75\x6e\x64\55\x63\x6f\x6c\x6f\162\x3a\40\x23\x64\146\x66\60\144\70\73\x20\x70\x61\144\144\151\x6e\x67\x3a\62\45\73\x6d\141\x72\x67\151\156\x2d\x62\157\x74\x74\x6f\x6d\x3a\x32\60\x70\x78\73\x74\x65\170\164\55\141\x6c\151\x67\156\x3a\143\x65\156\164\x65\x72\x3b\40\x62\157\x72\x64\145\162\72\61\x70\170\x20\x73\x6f\x6c\151\x64\40\43\101\105\x44\102\x39\101\x3b\40\146\157\156\x74\x2d\163\x69\x7a\x65\72\x31\70\x70\164\73\42\76\x54\x45\x53\x54\x20\x53\125\x43\x43\105\x53\x53\x46\125\x4c\74\x2f\144\x69\166\x3e\xd\xa\x20\40\x20\x20\40\x20\x20\40\x20\40\x3c\144\x69\166\x20\163\x74\171\154\145\x3d\42\144\x69\x73\160\154\141\x79\x3a\x62\154\157\x63\x6b\x3b\164\145\170\164\55\141\x6c\x69\147\156\72\x63\145\156\x74\145\162\x3b\155\141\x72\x67\x69\156\x2d\x62\157\164\164\157\155\x3a\x34\45\73\42\x3e\x3c\151\x6d\x67\40\163\164\171\154\x65\75\42\x77\151\x64\164\x68\72\x31\x35\45\73\42\163\162\x63\x3d\42" . $n8 . "\x2f\x69\x6e\x63\x6c\x75\x64\x65\x73\57\151\155\141\147\145\x73\57\147\x72\145\x65\x6e\x5f\x63\x68\x65\143\153\x2e\160\x6e\147\x22\x3e\74\57\144\x69\166\x3e";
< DN:
< echo "\74\x73\160\141\156\40\163\x74\x79\x6c\145\75\x22\146\157\x6e\164\x2d\163\151\x7a\145\x3a\61\x34\x70\x74\73\x22\76\74\142\76\110\x65\x6c\x6c\x6f\74\57\x62\x3e\x2c\x20" . $Ea . "\x3c\x2f\163\x70\141\x6e\76\74\x62\x72\x2f\76\74\160\40\163\x74\171\154\145\x3d\x22\146\x6f\156\x74\x2d\167\145\151\x67\150\x74\x3a\142\x6f\x6c\x64\73\146\x6f\156\x74\x2d\163\x69\x7a\145\x3a\61\64\160\164\x3b\x6d\141\x72\147\151\x6e\55\x6c\x65\146\164\72\61\45\73\42\76\101\124\124\122\111\102\125\x54\x45\123\x20\x52\105\103\x45\x49\126\x45\x44\x3a\x3c\x2f\x70\x3e\xd\12\40\40\x20\x20\x20\40\x20\x20\x20\x20\74\x74\141\x62\x6c\145\x20\163\x74\x79\154\x65\x3d\x22\142\157\162\144\145\x72\x2d\143\x6f\154\154\x61\x70\163\x65\x3a\143\157\154\x6c\141\160\163\x65\73\x62\157\x72\144\x65\162\x2d\163\x70\x61\143\x69\x6e\x67\x3a\60\x3b\40\144\x69\163\x70\154\141\x79\x3a\164\x61\x62\154\145\x3b\x77\151\144\164\x68\x3a\x31\60\x30\x25\73\x20\146\x6f\x6e\164\x2d\163\x69\172\145\72\x31\x34\x70\x74\x3b\x62\x61\143\x6b\x67\162\157\x75\x6e\144\55\143\157\x6c\x6f\x72\72\x23\x45\104\105\104\x45\x44\x3b\x22\x3e\15\12\40\x20\x20\x20\40\40\x20\40\40\40\74\x74\162\x20\x73\164\x79\154\x65\75\42\x74\145\x78\x74\x2d\x61\154\x69\147\x6e\x3a\143\145\156\164\145\x72\73\x22\76\74\x74\144\40\163\x74\x79\154\145\x3d\42\x66\157\156\x74\x2d\167\x65\x69\x67\x68\x74\72\142\157\154\x64\x3b\142\x6f\162\144\145\162\x3a\62\x70\170\40\163\x6f\154\151\x64\40\43\x39\64\71\60\x39\x30\x3b\x70\141\144\144\x69\156\x67\72\x32\x25\x3b\42\76\x41\x54\124\x52\x49\x42\x55\124\x45\40\116\101\x4d\105\x3c\57\x74\144\76\74\164\x64\x20\163\164\171\154\145\x3d\x22\x66\157\x6e\164\55\x77\x65\151\147\x68\x74\x3a\x62\x6f\x6c\x64\73\x70\x61\x64\144\151\x6e\147\x3a\x32\x25\x3b\142\x6f\x72\144\x65\162\x3a\x32\160\x78\40\163\157\154\x69\x64\x20\43\71\x34\x39\60\x39\60\x3b\40\167\157\162\x64\x2d\167\x72\141\x70\x3a\142\162\145\x61\x6b\55\x77\157\162\x64\x3b\42\76\x41\x54\x54\122\111\x42\125\124\x45\40\126\x41\x4c\x55\x45\x3c\57\164\x64\76\74\x2f\x74\x72\x3e";
< if (!empty($Ci)) {
< goto cF;
< }
< echo "\74\x74\162\x3e\74\x74\x64\x20\163\x74\x79\154\x65\75\x27\x66\x6f\x6e\x74\x2d\x77\145\x69\147\150\x74\72\142\x6f\154\144\73\x62\157\162\144\x65\162\x3a\62\x70\x78\x20\163\157\x6c\151\144\40\x23\71\64\x39\60\x39\60\73\160\141\144\144\x69\x6e\147\x3a\62\x25\x3b\47\76\x4e\x61\155\x65\x49\x44\74\x2f\x74\144\x3e\x3c\164\x64\x20\163\164\171\x6c\145\x3d\x27\160\x61\144\x64\x69\x6e\147\72\62\x25\x3b\x62\x6f\x72\144\145\162\72\x32\x70\x78\x20\163\x6f\x6c\151\144\x20\43\x39\x34\71\x30\71\60\73\40\x77\x6f\x72\x64\55\167\162\141\x70\72\x62\162\145\x61\x6b\55\167\157\162\144\73\47\76" . $Ea . "\x3c\x2f\x74\x64\x3e\x3c\x2f\x74\x72\x3e";
< goto DP;
< cF:
< echo "\x3c\x74\x72\76\74\164\144\40\163\164\171\154\x65\x3d\x27\146\157\156\164\55\167\145\x69\147\x68\x74\72\142\x6f\x6c\144\x3b\142\157\162\x64\x65\x72\x3a\62\x70\170\40\163\x6f\x6c\151\144\40\43\x39\x34\71\x30\71\x30\x3b\x70\141\144\144\x69\x6e\x67\72\x32\x25\73\47\76\x4e\x61\155\x65\111\104\74\x2f\x74\144\76\x3c\x74\144\40\163\x74\171\154\145\75\47\x70\141\x64\x64\x69\x6e\147\x3a\62\x25\73\142\157\162\144\x65\x72\x3a\62\160\170\40\163\x6f\x6c\151\144\x20\x23\x39\64\71\x30\71\x30\73\x20\x77\157\162\x64\x2d\x77\162\x61\x70\x3a\142\162\145\x61\153\55\x77\157\x72\x64\73\x27\76" . $Ea . "\x3c\x2f\164\144\76\74\57\x74\x72\x3e";
< foreach ($Ci as $mz => $rE) {
< echo "\74\164\162\x3e\74\164\x64\40\x73\x74\x79\154\x65\75\x27\146\x6f\x6e\164\55\167\145\x69\147\x68\x74\x3a\x62\157\x6c\144\73\142\157\x72\144\145\162\x3a\62\x70\170\40\163\157\x6c\x69\x64\40\x23\x39\64\71\60\71\x30\x3b\x70\x61\144\144\x69\x6e\147\x3a\62\45\73\47\x3e" . $mz . "\74\57\x74\144\x3e\74\x74\144\x20\x73\164\171\154\145\75\47\x70\141\144\x64\x69\156\147\x3a\62\45\73\x62\157\x72\x64\x65\162\72\x32\x70\x78\x20\163\x6f\x6c\151\144\x20\43\x39\64\71\x30\71\60\x3b\x20\x77\x6f\162\x64\55\167\162\141\160\x3a\142\162\145\x61\153\55\x77\157\x72\144\73\47\76" . implode("\x3c\142\162\57\x3e", $rE) . "\74\x2f\x74\144\76\x3c\57\164\x72\x3e";
< gt:
< }
< Yf:
< DP:
< echo "\74\x2f\x74\141\x62\154\x65\76\x3c\x2f\144\x69\x76\76";
< echo "\74\x64\x69\x76\40\x73\164\171\x6c\145\75\42\155\x61\x72\x67\151\x6e\72\63\45\73\x64\151\x73\160\x6c\x61\x79\x3a\142\x6c\x6f\x63\x6b\73\164\x65\x78\164\55\141\154\151\x67\156\72\x63\x65\x6e\x74\145\x72\73\42\x3e\15\12\x20\x20\40\40\40\40\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\x3c\x69\156\160\x75\x74\40\163\x74\x79\x6c\x65\75\42\x70\141\144\144\151\x6e\x67\72\x31\x25\73\x77\x69\x64\x74\x68\x3a\x33\x37\x25\73\x62\141\143\153\x67\162\157\x75\156\144\x3a\x20\43\60\x30\x39\61\x43\x44\x20\x6e\157\x6e\145\x20\x72\x65\160\x65\x61\164\40\163\143\x72\x6f\x6c\154\x20\x30\45\x20\60\45\73\x63\165\x72\163\x6f\x72\72\x20\x70\157\x69\156\164\x65\x72\x3b\146\157\156\164\55\x73\151\x7a\145\x3a\61\x35\x70\170\73\xd\xa\x20\x20\40\x20\40\40\40\x20\x20\40\40\40\40\x20\40\x20\x62\157\162\x64\145\x72\x2d\167\151\x64\164\x68\72\x20\x31\160\x78\x3b\x62\x6f\x72\x64\145\162\55\163\164\x79\154\x65\x3a\40\x73\157\154\x69\144\x3b\x62\x6f\162\x64\145\x72\x2d\x72\141\144\x69\165\x73\72\x20\x33\x70\x78\x3b\x77\150\151\164\145\55\x73\x70\141\x63\145\x3a\x20\x6e\x6f\x77\x72\x61\160\73\142\157\170\55\163\x69\x7a\151\156\147\x3a\40\142\157\162\x64\145\162\x2d\x62\157\x78\x3b\142\x6f\x72\144\x65\162\55\143\157\154\x6f\x72\x3a\40\x23\x30\x30\x37\x33\x41\101\73\15\xa\40\x20\40\x20\x20\x20\x20\40\40\40\40\40\40\40\40\x20\x62\x6f\170\x2d\x73\x68\141\x64\157\167\72\40\x30\x70\170\40\x31\160\170\40\x30\x70\x78\40\162\x67\142\x61\50\x31\x32\x30\x2c\x20\x32\60\x30\x2c\40\x32\x33\x30\54\40\60\56\x36\51\40\151\x6e\x73\x65\164\73\143\x6f\x6c\157\x72\72\40\x23\x46\106\x46\x3b\42\164\x79\160\x65\75\x22\x62\165\164\164\x6f\156\x22\40\x76\x61\154\x75\x65\x3d\42\x43\x6f\156\146\151\x67\165\162\x65\40\101\x74\x74\162\x69\x62\x75\x74\145\x2f\x52\157\x6c\145\40\x4d\141\x70\x70\x69\x6e\147\42\40\157\x6e\103\x6c\x69\143\153\75\42\143\x6c\157\163\145\137\141\x6e\x64\x5f\x72\x65\x64\151\162\145\143\x74\x28\x29\73\42\x3e\xd\12\x20\x20\x20\40\x20\40\x20\40\40\40\40\x20\x20\x20\40\40\x20\x3c\x69\156\x70\165\x74\x20\163\164\171\x6c\x65\x3d\42\160\x61\144\x64\x69\x6e\x67\72\x31\45\x3b\x77\151\144\164\x68\72\61\x30\60\160\x78\73\142\141\x63\x6b\147\162\x6f\165\x6e\x64\72\x20\x23\60\60\x39\61\x43\x44\40\156\x6f\156\x65\40\162\145\160\x65\141\164\x20\x73\143\x72\157\154\x6c\40\60\x25\x20\60\x25\73\143\x75\x72\x73\157\162\x3a\x20\160\157\x69\x6e\164\145\x72\73\x66\x6f\x6e\x74\x2d\163\x69\x7a\x65\72\61\65\x70\x78\73\xd\xa\x20\x20\40\40\40\x20\x20\40\40\40\x20\40\x20\x20\x20\40\x20\40\x20\x20\142\157\162\x64\145\x72\x2d\167\151\144\x74\x68\72\40\61\160\x78\x3b\x62\157\162\144\x65\x72\55\163\x74\171\x6c\x65\x3a\x20\163\157\x6c\151\144\73\x62\x6f\162\144\x65\162\55\162\141\144\151\x75\163\x3a\x20\63\160\170\73\x77\x68\151\x74\x65\55\163\x70\x61\x63\145\72\x20\x6e\x6f\167\162\141\x70\73\x62\157\x78\55\x73\x69\172\151\156\x67\72\40\142\157\162\144\145\162\x2d\x62\x6f\170\73\142\157\x72\144\x65\x72\55\143\x6f\x6c\157\162\x3a\40\x23\60\x30\67\63\101\101\x3b\xd\xa\x20\x20\x20\40\x20\x20\40\40\40\x20\40\40\40\x20\40\40\40\40\40\40\142\x6f\x78\55\x73\x68\141\x64\x6f\167\x3a\x20\60\160\170\40\x31\160\x78\x20\x30\160\170\40\x72\x67\x62\141\50\61\x32\60\54\x20\62\60\x30\54\x20\x32\x33\60\x2c\40\x30\x2e\66\x29\x20\151\156\163\x65\164\73\x63\x6f\x6c\x6f\162\72\x20\43\106\x46\106\73\x22\x74\171\160\145\x3d\x22\142\x75\164\x74\157\156\x22\40\166\141\x6c\165\145\x3d\42\x44\157\156\145\42\x20\157\x6e\103\x6c\x69\x63\x6b\75\42\x73\145\x6c\x66\x2e\143\154\157\163\x65\50\51\x3b\x22\76\xd\xa\x20\40\40\x20\x20\40\x20\40\40\40\40\40\x3c\57\144\x69\166\76\15\xa\x20\40\x20\x20\x20\x20\40\40\x20\x20\x20\x20\74\163\143\162\x69\x70\164\x3e\xd\xa\x20\x20\40\40\40\40\x20\x20\x20\40\x20\x20\40\x20\40\x20\x20\146\x75\x6e\x63\x74\151\157\156\x20\143\154\157\x73\x65\137\x61\x6e\x64\137\x72\x65\144\151\x72\145\143\164\x28\51\173\xd\12\x20\40\40\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\40\40\40\40\40\40\167\151\x6e\x64\157\167\x2e\x6f\x70\x65\x6e\x65\x72\x2e\x72\145\x64\x69\x72\145\143\x74\137\164\157\137\141\x74\x74\x72\x69\142\165\x74\145\137\x6d\141\x70\x70\x69\x6e\147\x28\51\x3b\xd\xa\x20\40\40\x20\x20\40\40\40\x20\40\x20\40\40\x20\x20\x20\40\x20\x20\x20\163\145\154\x66\x2e\143\x6c\157\x73\x65\50\x29\73\15\12\x20\40\40\40\x20\x20\40\x20\x20\40\40\40\x20\x20\40\x20\x20\x7d\15\12\x20\x20\x20\x20\40\x20\40\x20\x20\40\x20\x20\74\x2f\163\143\162\151\160\x74\x3e";
---
> $Ip = drupal_get_path("\x6d\157\x64\165\x6c\145", "\x6d\151\156\x69\157\x72\x61\x6e\x67\145\x5f\163\x61\x6d\x6c");
> echo "\x3c\x64\151\x76\x20\x73\164\x79\154\x65\x3d\42\x66\x6f\156\164\55\x66\x61\x6d\x69\154\171\72\103\x61\154\x69\142\x72\151\x3b\x70\141\x64\x64\x69\156\147\x3a\60\40\63\45\x3b\42\76";
> if (!empty($q1)) {
> goto FM;
> }
> echo "\74\144\x69\166\x20\x73\164\x79\154\x65\75\42\143\x6f\x6c\x6f\162\x3a\x20\43\x61\71\64\64\x34\62\x3b\142\x61\143\153\x67\x72\x6f\x75\x6e\144\55\143\157\x6c\x6f\x72\x3a\40\43\146\62\144\145\144\145\73\160\x61\144\x64\151\x6e\147\72\x20\61\65\x70\x78\x3b\x6d\x61\x72\147\x69\156\55\x62\157\164\164\x6f\155\x3a\40\62\x30\160\170\73\164\145\x78\164\x2d\141\x6c\x69\147\x6e\72\143\145\x6e\164\145\x72\73\142\157\162\x64\x65\x72\x3a\61\160\170\x20\x73\x6f\154\x69\144\x20\43\x45\x36\x42\63\x42\x32\x3b\x66\157\156\x74\55\163\151\x7a\145\72\61\70\x70\x74\73\x22\x3e\124\x45\x53\x54\40\x46\x41\x49\114\x45\104\74\57\x64\x69\x76\76\xd\12\40\40\x20\40\x20\x20\x20\x20\x20\40\x3c\x64\x69\x76\x20\163\164\171\154\145\x3d\42\x63\x6f\154\157\x72\x3a\40\x23\x61\x39\x34\64\x34\x32\x3b\x66\x6f\156\x74\55\163\151\172\145\x3a\61\64\160\x74\73\x20\155\141\162\x67\151\x6e\55\142\x6f\164\x74\157\155\x3a\62\60\x70\170\x3b\42\x3e\x57\x41\122\116\111\116\x47\x3a\40\x53\157\155\145\40\101\x74\164\x72\151\x62\x75\164\x65\x73\x20\x44\151\144\x20\116\x6f\x74\40\x4d\x61\164\x63\x68\56\74\x2f\x64\x69\166\x3e\15\xa\40\x20\x20\x20\40\x20\x20\x20\x20\40\x3c\x64\151\x76\40\x73\x74\171\154\x65\x3d\42\144\151\x73\x70\x6c\x61\171\x3a\x62\x6c\x6f\143\x6b\73\x74\145\170\164\55\x61\154\151\147\156\72\143\145\156\164\145\x72\x3b\155\x61\162\147\151\x6e\55\142\157\x74\164\157\x6d\x3a\64\45\x3b\42\76\x3c\x69\x6d\x67\40\x73\x74\171\154\145\75\42\167\151\144\x74\x68\72\x31\65\x25\x3b\42\x73\162\143\75\42" . $Ip . "\x69\156\x63\x6c\165\x64\x65\x73\x2f\x69\155\x61\147\145\x73\57\x77\x72\157\x6e\x67\x2e\160\x6e\x67\42\x3e\74\x2f\x64\x69\x76\x3e";
> goto Qr;
> FM:
> echo "\x3c\144\151\x76\40\x73\x74\171\154\145\75\42\143\x6f\154\x6f\x72\x3a\x20\43\x33\x63\x37\x36\63\144\x3b\142\x61\143\153\147\162\157\165\x6e\x64\x2d\x63\157\154\157\x72\x3a\40\x23\144\146\x66\x30\x64\70\x3b\x20\160\141\144\144\151\x6e\147\72\x32\45\x3b\x6d\141\x72\147\151\x6e\x2d\142\157\164\164\x6f\x6d\72\62\60\160\x78\x3b\x74\145\170\164\55\x61\154\x69\147\x6e\72\143\x65\156\164\x65\162\73\x20\x62\157\x72\x64\x65\x72\x3a\61\x70\x78\40\x73\157\154\x69\x64\x20\43\x41\x45\x44\102\x39\x41\73\x20\146\157\156\164\55\163\x69\172\x65\72\x31\70\x70\164\x3b\42\76\x54\x45\123\124\40\x53\x55\103\103\x45\x53\x53\106\x55\x4c\x3c\57\144\x69\166\x3e\xd\xa\40\x20\40\x20\40\40\40\x20\40\40\x3c\144\151\166\40\163\x74\x79\x6c\145\75\42\144\x69\163\x70\x6c\x61\171\72\x62\x6c\157\143\x6b\73\x74\145\170\x74\x2d\141\x6c\x69\147\x6e\x3a\x63\145\156\x74\145\162\x3b\x6d\x61\162\x67\x69\156\55\142\x6f\164\x74\x6f\x6d\72\64\45\73\42\x3e\x3c\x69\155\147\40\163\164\171\154\145\75\42\167\151\144\164\x68\x3a\x31\65\x25\x3b\x22\x73\x72\x63\75\x22" . $Ip . "\x2f\151\156\x63\x6c\x75\144\x65\163\x2f\x69\155\141\147\x65\163\57\147\162\x65\145\156\x5f\x63\x68\145\x63\153\x2e\x70\x6e\x67\42\76\74\x2f\144\x69\166\76";
> Qr:
> echo "\74\163\160\141\x6e\x20\x73\164\x79\154\145\x3d\x22\x66\157\x6e\x74\55\163\151\172\x65\x3a\x31\64\160\164\73\x22\x3e\x3c\142\x3e\110\x65\x6c\154\157\x3c\57\142\x3e\x2c\40" . $q1 . "\74\57\x73\x70\141\x6e\x3e\x3c\x62\x72\x2f\x3e\74\160\x20\163\164\x79\154\x65\x3d\x22\x66\157\x6e\x74\x2d\x77\x65\151\147\150\x74\x3a\x62\157\154\x64\x3b\146\157\156\164\55\x73\x69\172\145\x3a\x31\64\x70\164\73\155\x61\162\147\151\156\55\154\x65\x66\x74\72\61\45\73\x22\x3e\x41\124\124\x52\x49\x42\125\124\x45\123\40\x52\x45\103\x45\x49\126\105\104\72\74\x2f\x70\76\15\xa\40\x20\40\40\x20\x20\x20\x20\40\x20\74\164\x61\x62\154\145\x20\x73\x74\171\154\x65\75\42\142\x6f\x72\x64\x65\x72\x2d\x63\157\154\x6c\x61\x70\x73\x65\x3a\143\x6f\x6c\x6c\x61\160\163\x65\x3b\142\x6f\162\144\145\162\x2d\163\x70\141\143\151\x6e\x67\72\x30\73\x20\144\x69\163\160\x6c\x61\171\72\164\x61\x62\x6c\145\x3b\167\151\x64\164\150\72\x31\60\x30\x25\73\40\146\157\156\164\x2d\163\x69\172\x65\72\x31\x34\x70\x74\x3b\x62\141\x63\x6b\147\162\157\165\x6e\144\x2d\x63\x6f\x6c\x6f\162\72\43\105\x44\105\104\x45\x44\73\x22\x3e\15\12\40\x20\40\40\40\40\x20\x20\40\x20\74\x74\x72\40\x73\164\171\154\145\75\x22\164\145\170\164\x2d\141\154\151\147\x6e\72\x63\145\156\x74\145\x72\73\42\76\x3c\x74\144\x20\x73\x74\171\154\145\75\x22\146\x6f\156\x74\55\167\145\151\147\150\164\x3a\x62\157\x6c\144\x3b\x62\157\162\144\x65\x72\x3a\x32\160\170\40\163\x6f\154\151\144\x20\x23\x39\64\x39\60\x39\60\x3b\160\x61\144\x64\x69\x6e\147\x3a\62\45\x3b\42\76\x41\x54\124\x52\111\102\x55\x54\x45\x20\116\x41\x4d\x45\x3c\57\x74\144\x3e\x3c\164\x64\40\163\164\x79\154\145\x3d\x22\x66\157\156\x74\55\167\145\x69\x67\150\164\x3a\142\157\154\144\x3b\x70\141\x64\x64\x69\x6e\147\x3a\x32\x25\73\142\157\162\144\145\x72\72\62\x70\x78\40\163\x6f\x6c\151\x64\40\x23\x39\64\71\60\x39\x30\x3b\40\x77\157\162\144\55\167\162\141\x70\x3a\x62\162\145\x61\x6b\55\167\x6f\162\144\73\x22\x3e\101\x54\x54\x52\x49\102\125\x54\105\x20\126\101\x4c\x55\105\x3c\x2f\164\x64\76\74\57\164\162\76";
> if (!empty($S_)) {
> goto IA;
> }
> echo "\74\x74\x72\x3e\x3c\164\x64\40\163\164\171\x6c\x65\75\x27\146\x6f\x6e\x74\x2d\167\145\x69\147\150\164\x3a\142\x6f\x6c\x64\73\142\x6f\x72\x64\x65\162\x3a\x32\x70\x78\40\x73\x6f\154\x69\144\40\x23\x39\64\x39\x30\71\60\x3b\160\x61\x64\144\151\156\147\72\x32\x25\73\47\x3e\x4e\x61\155\x65\x49\104\74\x2f\164\144\x3e\74\164\144\40\x73\164\171\154\145\75\x27\x70\x61\144\144\151\156\x67\x3a\x32\x25\x3b\142\157\x72\144\x65\162\x3a\62\x70\170\x20\x73\157\x6c\151\x64\x20\x23\x39\x34\x39\x30\71\x30\x3b\x20\x77\157\162\x64\55\x77\x72\141\x70\x3a\142\162\145\x61\x6b\55\x77\x6f\x72\144\x3b\47\x3e" . $q1 . "\74\57\x74\144\x3e\x3c\57\x74\x72\76";
> goto gk;
> IA:
> echo "\x3c\164\x72\x3e\74\164\x64\x20\x73\x74\x79\154\145\75\x27\146\x6f\156\164\55\167\145\151\147\150\x74\x3a\142\157\x6c\144\x3b\142\x6f\x72\x64\145\x72\72\x32\x70\170\x20\x73\x6f\x6c\151\x64\40\43\x39\64\x39\60\71\x30\x3b\160\x61\x64\x64\x69\156\147\x3a\62\x25\x3b\47\76\116\141\155\145\111\x44\x3c\57\x74\x64\x3e\74\164\x64\x20\x73\x74\171\x6c\x65\x3d\x27\x70\141\144\144\151\156\147\72\62\45\73\142\157\162\144\x65\x72\72\x32\x70\x78\40\x73\157\x6c\x69\144\x20\x23\x39\64\x39\60\71\x30\73\x20\167\x6f\162\x64\55\x77\162\x61\x70\72\x62\162\x65\141\153\55\x77\157\x72\144\73\x27\76" . $q1 . "\x3c\57\x74\x64\x3e\x3c\57\164\162\x3e";
> foreach ($S_ as $ZE => $ND) {
> echo "\74\x74\x72\x3e\74\x74\144\x20\163\x74\x79\x6c\145\x3d\x27\x66\157\x6e\x74\x2d\167\x65\151\x67\150\x74\x3a\x62\157\154\x64\73\x62\x6f\x72\x64\145\x72\72\x32\160\170\x20\163\157\x6c\151\144\x20\x23\71\x34\71\x30\71\x30\73\160\x61\144\x64\151\x6e\147\72\x32\45\x3b\47\76" . $ZE . "\74\x2f\x74\144\76\74\x74\x64\40\x73\164\171\154\145\75\x27\x70\x61\144\144\151\156\x67\72\62\x25\73\x62\x6f\162\x64\x65\x72\x3a\x32\x70\170\x20\x73\x6f\x6c\x69\144\40\x23\71\64\71\x30\71\x30\x3b\40\x77\157\x72\x64\55\167\162\141\x70\x3a\142\x72\145\x61\x6b\55\167\157\162\144\x3b\x27\76" . implode("\x3c\x62\x72\x2f\x3e", $ND) . "\74\57\x74\x64\76\74\57\164\x72\76";
> o_:
> }
> x1:
> gk:
> echo "\74\x2f\x74\x61\x62\154\x65\76\74\57\x64\151\x76\x3e";
> echo "\74\144\151\166\40\x73\x74\171\154\x65\75\x22\x6d\141\x72\147\151\156\72\63\x25\73\144\x69\163\x70\154\141\x79\x3a\x62\x6c\157\x63\x6b\73\x74\145\x78\164\x2d\141\x6c\x69\147\156\x3a\x63\x65\x6e\164\145\x72\x3b\x22\x3e\xd\12\40\x20\40\40\40\40\x20\40\40\x20\40\x20\40\40\x20\40\x20\74\x69\156\160\x75\164\40\x73\164\171\154\x65\75\42\x70\141\x64\x64\151\156\x67\x3a\x31\x25\73\x77\151\144\164\x68\x3a\x33\67\x25\x3b\142\141\x63\x6b\147\x72\x6f\x75\156\x64\x3a\40\x23\x30\60\x39\x31\x43\x44\x20\x6e\157\x6e\145\40\x72\x65\160\145\141\x74\40\163\x63\162\x6f\x6c\154\40\x30\x25\40\60\45\73\143\165\x72\163\157\162\x3a\x20\160\x6f\151\x6e\x74\145\x72\x3b\146\157\x6e\x74\x2d\x73\x69\x7a\145\72\61\x35\160\170\73\xd\12\x20\x20\40\x20\40\x20\40\40\x20\40\40\40\x20\x20\x20\40\142\x6f\162\144\x65\162\55\x77\x69\x64\164\x68\72\40\61\160\x78\73\142\x6f\x72\144\145\x72\x2d\x73\x74\171\x6c\x65\72\40\x73\x6f\x6c\x69\144\x3b\142\x6f\x72\x64\x65\x72\x2d\x72\x61\x64\x69\165\x73\x3a\40\x33\160\170\73\167\150\x69\x74\145\55\163\160\141\143\145\x3a\40\x6e\157\167\162\x61\160\x3b\142\157\x78\x2d\x73\x69\x7a\x69\156\147\x3a\x20\x62\157\x72\144\x65\x72\x2d\x62\x6f\x78\x3b\142\x6f\162\144\145\162\55\143\157\154\157\162\x3a\40\43\60\x30\x37\63\x41\101\73\15\12\40\x20\x20\x20\x20\x20\40\40\40\40\40\40\x20\40\40\x20\142\157\x78\x2d\x73\150\x61\144\x6f\x77\x3a\x20\60\160\170\x20\61\160\170\40\x30\x70\170\x20\x72\147\x62\141\x28\x31\62\x30\54\x20\x32\60\60\x2c\40\62\x33\60\x2c\x20\x30\x2e\66\51\x20\x69\x6e\x73\x65\164\73\x63\x6f\x6c\x6f\x72\72\40\x23\x46\x46\x46\73\42\x74\171\160\x65\x3d\42\142\x75\x74\x74\157\x6e\x22\40\x76\141\x6c\x75\145\x3d\42\103\157\x6e\146\x69\x67\165\162\x65\x20\x41\164\x74\x72\151\142\165\164\145\57\122\x6f\154\145\x20\115\141\160\x70\x69\x6e\x67\x22\x20\x6f\x6e\103\154\151\143\x6b\75\x22\143\154\x6f\x73\145\137\x61\x6e\x64\x5f\162\x65\144\151\x72\x65\143\164\50\x29\73\42\x3e\xd\12\x20\40\x20\40\40\40\40\40\40\40\40\x20\x20\x20\x20\x20\40\x3c\151\156\x70\165\164\40\x73\164\171\154\x65\x3d\x22\x70\x61\x64\x64\x69\156\147\72\61\x25\73\167\151\144\x74\150\x3a\x31\60\x30\160\x78\73\142\x61\143\153\147\162\x6f\x75\156\144\x3a\x20\x23\x30\x30\x39\61\x43\x44\40\156\157\156\x65\x20\x72\145\160\145\141\x74\40\x73\143\162\x6f\x6c\154\x20\x30\45\x20\60\x25\73\x63\x75\x72\163\157\x72\x3a\x20\x70\157\x69\x6e\x74\145\x72\73\146\x6f\156\x74\55\163\151\x7a\145\x3a\61\x35\x70\170\73\15\12\x20\x20\x20\40\x20\40\x20\x20\x20\40\40\x20\40\40\x20\x20\40\40\x20\40\x62\157\x72\144\145\162\x2d\x77\x69\x64\164\150\x3a\x20\61\160\170\73\x62\x6f\x72\144\x65\162\55\x73\x74\x79\154\145\72\x20\163\x6f\x6c\x69\144\x3b\x62\x6f\162\144\x65\162\55\x72\x61\144\x69\165\x73\72\x20\x33\160\170\x3b\167\150\151\x74\145\x2d\163\160\141\x63\145\x3a\x20\x6e\x6f\167\162\141\160\x3b\142\x6f\x78\55\x73\151\172\x69\156\x67\72\x20\142\x6f\x72\x64\x65\x72\55\142\157\x78\73\142\157\x72\x64\x65\x72\55\143\157\x6c\157\162\x3a\40\x23\x30\60\x37\x33\x41\x41\x3b\15\12\40\x20\40\x20\40\x20\40\40\x20\x20\40\40\40\40\x20\40\40\x20\40\x20\142\x6f\170\x2d\163\x68\x61\x64\x6f\x77\72\40\x30\160\x78\x20\61\160\170\x20\x30\160\170\40\x72\147\142\x61\50\x31\x32\x30\x2c\40\62\60\x30\x2c\40\62\x33\60\54\x20\x30\56\66\x29\x20\x69\156\163\x65\164\73\143\x6f\154\157\x72\72\x20\43\106\x46\x46\73\42\x74\171\x70\x65\x3d\42\x62\x75\x74\164\x6f\x6e\42\x20\166\x61\x6c\x75\145\x3d\x22\104\157\156\145\x22\40\x6f\156\103\x6c\151\143\x6b\x3d\x22\x73\x65\x6c\146\x2e\143\154\157\x73\145\50\51\x3b\x22\76\xd\xa\40\x20\40\x20\40\x20\40\x20\x20\40\40\x20\x3c\x2f\x64\151\x76\x3e\15\xa\x20\40\x20\x20\40\x20\x20\40\40\40\40\40\74\163\x63\162\151\x70\x74\x3e\xd\12\x20\x20\40\40\x20\40\x20\40\40\x20\x20\x20\x20\x20\40\x20\40\146\x75\156\x63\164\x69\157\156\40\143\x6c\x6f\x73\145\137\x61\x6e\144\x5f\162\145\x64\151\x72\x65\143\164\x28\51\x7b\15\xa\x20\40\40\x20\x20\x20\x20\x20\x20\x20\x20\40\40\40\x20\40\40\x20\x20\x20\167\151\x6e\x64\157\x77\56\157\160\145\156\x65\x72\56\x72\145\x64\x69\x72\145\x63\164\x5f\x74\x6f\137\x61\x74\164\162\x69\x62\165\164\x65\x5f\x6d\141\160\x70\151\156\x67\50\51\73\xd\12\x20\x20\x20\40\40\x20\40\40\40\40\x20\x20\x20\40\x20\40\x20\x20\40\40\x73\x65\x6c\146\x2e\143\154\x6f\x73\x65\50\51\x3b\15\12\40\x20\40\40\x20\x20\40\40\40\40\x20\x20\x20\40\40\40\40\175\xd\xa\x20\40\40\x20\40\40\40\x20\40\40\40\40\x3c\x2f\163\x63\162\x69\160\164\x3e";
diff -r -b "C:\\Users\\wkaifer\\OneDrive - POWERTRAIN INC\\Plugins\\drupal_miniorange_saml/includes/Assertion.php" "C:\\Users\\wkaifer\\Documents\\MFA\\mo_saml/includes/Assertion.php"
4c4
< include_once "\125\x74\x69\x6c\151\164\x69\x65\163\x2e\160\x68\160";
---
> include_once "\125\164\151\x6c\151\x74\x69\145\163\x2e\160\x68\160";
32c32
< public function __construct(DOMElement $gp = NULL)
---
> public function __construct(DOMElement $nV = NULL)
39c39
< $this->nameFormat = "\x75\x72\x6e\x3a\157\x61\163\x69\163\x3a\156\x61\155\x65\163\x3a\x74\143\x3a\123\x41\x4d\x4c\x3a\x31\x2e\x31\x3a\x6e\x61\155\x65\151\x64\x2d\x66\157\x72\155\141\x74\72\x75\156\163\x70\145\x63\151\x66\x69\x65\144";
---
> $this->nameFormat = "\x75\x72\x6e\x3a\x6f\x61\163\151\x73\x3a\x6e\141\x6d\145\163\x3a\x74\143\x3a\123\x41\115\114\x3a\61\56\61\x3a\156\141\x6d\x65\151\144\55\x66\x6f\x72\155\141\x74\72\165\156\x73\x70\145\x63\x69\x66\151\145\x64";
43,44c43,44
< if (!($gp === NULL)) {
< goto tw;
---
> if (!($nV === NULL)) {
> goto pg;
47,113c47,113
< tw:
< if (!($gp->localName === "\x45\156\143\162\x79\160\x74\145\144\101\163\163\145\162\164\x69\x6f\x6e")) {
< goto F3;
< }
< $IX = Utilities::xpQuery($gp, "\x2e\57\x78\145\156\x63\x3a\x45\156\143\x72\171\160\x74\145\x64\x44\x61\164\x61");
< $Qe = Utilities::xpQuery($gp, "\56\57\170\x65\x6e\143\x3a\x45\x6e\x63\162\x79\x70\164\x65\144\104\x61\164\x61\57\144\163\72\x4b\145\171\x49\x6e\x66\157\x2f\x78\x65\156\x63\72\105\156\x63\x72\x79\x70\x74\145\x64\113\x65\171");
< $GA = '';
< if (empty($Qe)) {
< goto ow;
< }
< $GA = $Qe[0]->firstChild->getAttribute("\x41\x6c\x67\157\x72\x69\164\150\155");
< goto Zp;
< ow:
< $Qe = Utilities::xpQuery($gp, "\x2e\x2f\x78\x65\x6e\143\72\x45\x6e\143\162\x79\160\164\x65\x64\x4b\145\x79\x2f\x78\x65\156\143\72\105\x6e\143\x72\171\160\164\x69\x6f\156\x4d\x65\164\x68\x6f\144");
< $GA = $Qe[0]->getAttribute("\101\154\x67\157\x72\151\x74\x68\x6d");
< Zp:
< $pq = Utilities::getEncryptionAlgorithm($GA);
< if (count($IX) === 0) {
< goto T8;
< }
< if (count($IX) > 1) {
< goto ei;
< }
< goto sK;
< T8:
< throw new Exception("\x4d\x69\163\x73\x69\x6e\x67\x20\145\x6e\x63\x72\171\x70\x74\145\x64\x20\144\141\x74\x61\40\151\156\40\x3c\x73\141\x6d\154\72\105\156\143\162\x79\x70\164\145\x64\101\163\x73\145\162\x74\151\157\156\76\56");
< goto sK;
< ei:
< throw new Exception("\115\157\x72\145\40\164\150\x61\156\40\157\156\x65\x20\145\x6e\x63\x72\x79\160\164\x65\144\x20\144\141\164\x61\x20\x65\x6c\145\x6d\x65\156\164\40\151\x6e\x20\x3c\x73\x61\155\x6c\x3a\105\x6e\x63\162\x79\x70\164\145\x64\x41\163\x73\x65\x72\164\x69\157\156\76\x2e");
< sK:
< $gS = Utilities::getPrivateKey();
< $mz = new XMLSecurityKey($pq, array("\x74\171\160\x65" => "\x70\x72\x69\x76\141\x74\x65"));
< $mz->loadKey($gS, FALSE);
< $uB = array();
< $gp = Utilities::decryptElement($IX[0], $mz, $uB);
< F3:
< if ($gp->hasAttribute("\111\x44")) {
< goto l4;
< }
< throw new Exception("\115\x69\x73\x73\x69\156\147\40\x49\104\40\141\x74\164\x72\151\142\x75\164\x65\x20\x6f\x6e\x20\123\x41\x4d\114\x20\x61\163\163\145\x72\x74\x69\x6f\156\56");
< l4:
< $this->id = $gp->getAttribute("\x49\x44");
< if (!($gp->getAttribute("\126\145\162\x73\151\157\x6e") !== "\x32\56\x30")) {
< goto LX;
< }
< throw new Exception("\x55\156\x73\165\x70\160\x6f\x72\164\x65\144\40\166\x65\162\x73\151\157\156\x3a\40" . $gp->getAttribute("\x56\145\x72\163\151\x6f\x6e"));
< LX:
< $this->issueInstant = Utilities::xsDateTimeToTimestamp($gp->getAttribute("\111\x73\x73\165\145\x49\156\x73\164\x61\156\x74"));
< $u1 = Utilities::xpQuery($gp, "\56\57\x73\141\155\154\x5f\x61\163\x73\x65\x72\164\151\x6f\x6e\72\111\x73\163\x75\x65\x72");
< if (!empty($u1)) {
< goto D7;
< }
< throw new Exception("\x4d\x69\163\163\151\x6e\x67\x20\x3c\x73\x61\155\154\72\x49\163\163\165\145\x72\76\x20\151\156\x20\x61\x73\163\145\162\x74\x69\x6f\156\56");
< D7:
< $this->issuer = trim($u1[0]->textContent);
< $this->parseConditions($gp);
< $this->parseAuthnStatement($gp);
< $this->parseAttributes($gp);
< $this->parseEncryptedAttributes($gp);
< $this->parseSignature($gp);
< $this->parseSubject($gp);
< }
< private function parseSubject(DOMElement $gp)
< {
< $sU = Utilities::xpQuery($gp, "\56\57\x73\141\x6d\154\137\141\163\163\x65\x72\164\151\157\x6e\x3a\123\165\142\x6a\145\143\x74");
< if (empty($sU)) {
< goto Ge;
---
> pg:
> if (!($nV->localName === "\105\156\143\x72\x79\x70\164\x65\x64\x41\x73\163\x65\x72\164\151\x6f\156")) {
> goto vi;
> }
> $zN = Utilities::xpQuery($nV, "\56\x2f\170\x65\x6e\x63\x3a\x45\156\x63\162\x79\x70\164\x65\x64\x44\x61\164\x61");
> $E8 = Utilities::xpQuery($nV, "\56\x2f\170\x65\156\x63\x3a\105\x6e\x63\x72\x79\160\164\x65\x64\x44\141\x74\x61\x2f\144\163\x3a\113\x65\x79\111\156\146\157\x2f\170\x65\x6e\x63\x3a\105\156\143\162\x79\x70\164\145\x64\x4b\145\171");
> $LM = '';
> if (empty($E8)) {
> goto CZ;
> }
> $LM = isset($E8[0]->firstChild) ? $E8[0]->firstChild->getAttribute("\x41\x6c\x67\157\x72\x69\x74\150\x6d") : "\150\x74\x74\x70\x3a\x2f\x2f\167\x77\167\x2e\x77\63\x2e\157\x72\147\x2f\62\60\60\x31\x2f\x30\x34\57\170\x6d\154\x65\x6e\x63\43\x72\163\x61\x2d\x6f\x61\145\160\55\x6d\x67\x66\61\x70";
> goto RM;
> CZ:
> $E8 = Utilities::xpQuery($nV, "\56\x2f\x78\x65\156\x63\72\x45\156\x63\x72\x79\160\164\x65\144\113\x65\171\57\170\x65\156\x63\x3a\105\x6e\x63\162\171\160\x74\151\157\x6e\115\145\164\150\157\x64");
> $LM = $E8[0]->getAttribute("\x41\154\x67\157\x72\151\164\x68\x6d");
> RM:
> $Py = Utilities::getEncryptionAlgorithm($LM);
> if (count($zN) === 0) {
> goto q2;
> }
> if (count($zN) > 1) {
> goto NS;
> }
> goto BC;
> q2:
> throw new Exception("\115\151\163\x73\x69\x6e\147\x20\x65\156\x63\x72\x79\160\x74\x65\x64\40\x64\141\164\x61\40\x69\156\x20\74\x73\x61\x6d\x6c\72\105\x6e\143\x72\171\160\164\145\x64\101\163\163\145\x72\x74\151\157\156\76\x2e");
> goto BC;
> NS:
> throw new Exception("\x4d\x6f\x72\145\40\x74\x68\141\x6e\x20\x6f\156\x65\40\145\x6e\143\162\x79\160\164\x65\x64\x20\144\141\164\x61\40\145\x6c\145\x6d\x65\156\x74\x20\x69\156\40\x3c\x73\141\x6d\154\x3a\x45\156\143\x72\171\160\x74\x65\x64\101\163\163\x65\x72\164\151\157\x6e\76\56");
> BC:
> $ID = Utilities::getPrivateKey();
> $ZE = new XMLSecurityKey($Py, array("\164\171\160\145" => "\x70\x72\x69\166\x61\164\x65"));
> $ZE->loadKey($ID, FALSE);
> $zI = array();
> $nV = Utilities::decryptElement($zN[0], $ZE, $zI);
> vi:
> if ($nV->hasAttribute("\x49\104")) {
> goto w5;
> }
> throw new Exception("\115\151\x73\x73\x69\156\147\40\111\x44\x20\x61\x74\x74\162\151\x62\165\x74\145\x20\x6f\x6e\x20\123\101\115\x4c\x20\141\x73\x73\x65\x72\x74\x69\x6f\156\56");
> w5:
> $this->id = $nV->getAttribute("\x49\104");
> if (!($nV->getAttribute("\x56\145\x72\163\x69\157\x6e") !== "\x32\56\60")) {
> goto wq;
> }
> throw new Exception("\x55\x6e\x73\165\160\x70\157\x72\164\145\144\40\x76\145\x72\163\x69\157\x6e\72\x20" . $nV->getAttribute("\126\145\x72\x73\151\157\x6e"));
> wq:
> $this->issueInstant = Utilities::xsDateTimeToTimestamp($nV->getAttribute("\x49\x73\163\x75\x65\x49\156\163\x74\x61\156\164"));
> $jm = Utilities::xpQuery($nV, "\x2e\57\x73\x61\155\x6c\137\x61\x73\163\x65\x72\x74\151\x6f\x6e\x3a\x49\163\x73\165\145\x72");
> if (!empty($jm)) {
> goto Ku;
> }
> throw new Exception("\115\151\163\x73\151\156\147\40\x3c\163\x61\x6d\154\x3a\111\x73\163\x75\145\162\x3e\40\x69\x6e\x20\x61\x73\x73\x65\162\x74\x69\157\x6e\56");
> Ku:
> $this->issuer = trim($jm[0]->textContent);
> $this->parseConditions($nV);
> $this->parseAuthnStatement($nV);
> $this->parseAttributes($nV);
> $this->parseEncryptedAttributes($nV);
> $this->parseSignature($nV);
> $this->parseSubject($nV);
> }
> private function parseSubject(DOMElement $nV)
> {
> $Vw = Utilities::xpQuery($nV, "\56\x2f\163\x61\x6d\x6c\x5f\x61\163\x73\x65\162\164\151\157\x6e\72\x53\165\x62\152\x65\x63\x74");
> if (empty($Vw)) {
> goto IX;
115,116c115,116
< if (count($sU) > 1) {
< goto xh;
---
> if (count($Vw) > 1) {
> goto m9;
118,119c118,119
< goto mo;
< Ge:
---
> goto oW;
> IX:
121,154c121,154
< goto mo;
< xh:
< throw new Exception("\x4d\x6f\x72\x65\40\164\x68\x61\156\x20\x6f\156\145\40\74\163\141\155\x6c\x3a\123\x75\x62\152\145\x63\164\x3e\40\151\x6e\x20\x3c\163\141\155\x6c\72\101\163\163\x65\x72\164\151\x6f\156\76\56");
< mo:
< $sU = $sU[0];
< $b3 = Utilities::xpQuery($sU, "\56\x2f\x73\x61\x6d\x6c\x5f\141\x73\x73\145\162\164\x69\x6f\156\x3a\x4e\x61\x6d\145\111\104\x20\174\x20\56\x2f\163\x61\x6d\154\137\x61\163\x73\x65\162\x74\x69\x6f\156\72\105\156\x63\162\x79\x70\x74\145\x64\x49\x44\57\170\145\156\x63\72\x45\156\143\x72\171\x70\164\x65\144\x44\x61\164\141");
< if (empty($b3)) {
< goto aR;
< }
< if (count($b3) > 1) {
< goto KN;
< }
< goto MW;
< aR:
< throw new Exception("\x4d\x69\163\163\x69\156\x67\40\x3c\x73\141\x6d\154\x3a\x4e\141\x6d\x65\x49\x44\x3e\40\x6f\162\40\74\163\x61\155\154\x3a\105\156\x63\162\x79\x70\x74\x65\x64\x49\104\76\x20\151\x6e\40\x3c\x73\x61\155\x6c\x3a\123\x75\x62\x6a\x65\x63\x74\x3e\x2e");
< goto MW;
< KN:
< throw new Exception("\x4d\x6f\x72\x65\40\x74\150\141\x6e\40\x6f\156\145\x20\74\x73\141\x6d\x6c\x3a\116\141\155\x65\111\104\x3e\40\157\162\x20\x3c\163\141\155\x6c\72\105\156\143\162\x79\x70\x74\x65\x64\x44\x3e\x20\x69\x6e\40\74\x73\141\x6d\x6c\x3a\x53\165\142\152\145\x63\164\76\56");
< MW:
< $b3 = $b3[0];
< if ($b3->localName === "\105\156\x63\x72\x79\160\164\x65\144\x44\x61\x74\x61") {
< goto aC;
< }
< $this->nameId = Utilities::parseNameId($b3);
< goto CQ;
< aC:
< $this->encryptedNameId = $b3;
< CQ:
< }
< private function parseConditions(DOMElement $gp)
< {
< $Rh = Utilities::xpQuery($gp, "\x2e\57\x73\141\x6d\x6c\x5f\x61\163\x73\145\x72\164\151\x6f\156\x3a\103\157\x6e\144\x69\x74\151\157\156\x73");
< if (empty($Rh)) {
< goto yM;
---
> goto oW;
> m9:
> throw new Exception("\115\x6f\x72\145\x20\164\150\141\x6e\40\157\156\x65\40\x3c\163\141\x6d\x6c\x3a\123\165\142\152\145\143\x74\76\40\x69\x6e\40\x3c\x73\141\155\154\x3a\x41\163\x73\x65\162\164\x69\157\x6e\76\56");
> oW:
> $Vw = $Vw[0];
> $Jb = Utilities::xpQuery($Vw, "\x2e\x2f\163\x61\x6d\154\x5f\x61\163\163\x65\x72\164\x69\x6f\x6e\x3a\x4e\x61\155\x65\x49\104\x20\x7c\40\x2e\57\163\141\155\154\137\x61\x73\163\145\162\x74\151\157\156\x3a\105\156\x63\162\x79\160\164\x65\x64\111\x44\57\x78\x65\156\143\72\105\156\x63\162\x79\160\164\145\x64\104\x61\164\x61");
> if (empty($Jb)) {
> goto w8;
> }
> if (count($Jb) > 1) {
> goto wd;
> }
> goto sy;
> w8:
> throw new Exception("\x4d\151\x73\163\151\x6e\147\x20\74\x73\x61\x6d\x6c\x3a\116\141\155\145\111\x44\76\40\x6f\162\40\x3c\163\x61\x6d\154\72\105\x6e\x63\162\171\160\x74\x65\x64\111\104\76\x20\151\x6e\x20\74\163\x61\155\154\x3a\x53\165\x62\x6a\x65\x63\x74\x3e\56");
> goto sy;
> wd:
> throw new Exception("\115\x6f\162\145\40\164\150\141\x6e\x20\x6f\x6e\145\x20\74\163\141\x6d\x6c\x3a\x4e\x61\155\x65\x49\x44\76\40\x6f\x72\40\x3c\163\x61\155\x6c\72\x45\156\143\162\x79\160\164\145\x64\104\76\40\151\156\x20\x3c\x73\x61\x6d\x6c\72\x53\x75\x62\152\x65\143\164\76\56");
> sy:
> $Jb = $Jb[0];
> if ($Jb->localName === "\105\156\x63\162\171\160\x74\x65\x64\x44\141\x74\141") {
> goto os;
> }
> $this->nameId = Utilities::parseNameId($Jb);
> goto lX;
> os:
> $this->encryptedNameId = $Jb;
> lX:
> }
> private function parseConditions(DOMElement $nV)
> {
> $GK = Utilities::xpQuery($nV, "\x2e\57\163\141\155\x6c\137\x61\x73\163\x65\x72\164\151\x6f\156\72\103\157\x6e\144\151\x74\151\x6f\156\x73");
> if (empty($GK)) {
> goto a0;
156,157c156,157
< if (count($Rh) > 1) {
< goto p_;
---
> if (count($GK) > 1) {
> goto QY;
159,160c159,160
< goto rn;
< yM:
---
> goto fC;
> a0:
162,204c162,204
< goto rn;
< p_:
< throw new Exception("\115\x6f\x72\145\x20\x74\x68\x61\x6e\40\x6f\x6e\x65\x20\x3c\163\x61\x6d\154\72\x43\157\x6e\x64\x69\164\151\x6f\156\163\76\x20\151\156\x20\x3c\163\141\155\154\x3a\101\163\x73\145\x72\x74\x69\x6f\156\x3e\x2e");
< rn:
< $Rh = $Rh[0];
< if (!$Rh->hasAttribute("\116\157\164\102\145\x66\x6f\162\145")) {
< goto Iu;
< }
< $pa = Utilities::xsDateTimeToTimestamp($Rh->getAttribute("\x4e\x6f\164\x42\145\x66\x6f\x72\x65"));
< if (!($this->notBefore === NULL || $this->notBefore < $pa)) {
< goto o7;
< }
< $this->notBefore = $pa;
< o7:
< Iu:
< if (!$Rh->hasAttribute("\116\x6f\x74\117\156\117\x72\101\x66\164\x65\x72")) {
< goto LT;
< }
< $DA = Utilities::xsDateTimeToTimestamp($Rh->getAttribute("\116\157\164\x4f\156\117\x72\101\146\x74\x65\162"));
< if (!($this->notOnOrAfter === NULL || $this->notOnOrAfter > $DA)) {
< goto rK;
< }
< $this->notOnOrAfter = $DA;
< rK:
< LT:
< $HF = $Rh->firstChild;
< Ph:
< if (!($HF !== NULL)) {
< goto tV;
< }
< if (!$HF instanceof DOMText) {
< goto R9;
< }
< goto zX;
< R9:
< if (!($HF->namespaceURI !== "\165\162\156\72\x6f\x61\x73\151\x73\72\x6e\x61\155\145\x73\72\164\143\x3a\x53\x41\x4d\114\72\x32\x2e\x30\72\x61\163\163\145\x72\164\x69\x6f\x6e")) {
< goto ko;
< }
< throw new Exception("\125\156\153\156\x6f\x77\x6e\x20\156\x61\x6d\145\x73\x70\x61\x63\x65\x20\157\x66\40\143\157\x6e\144\151\x74\x69\157\x6e\x3a\x20" . var_export($HF->namespaceURI, TRUE));
< ko:
< switch ($HF->localName) {
< case "\x41\x75\x64\x69\145\156\143\x65\122\145\163\x74\x72\x69\x63\x74\x69\157\x6e":
< $gg = Utilities::extractStrings($HF, "\x75\x72\156\72\157\x61\163\x69\x73\x3a\x6e\141\155\x65\163\x3a\164\x63\x3a\123\101\x4d\x4c\72\62\x2e\x30\x3a\x61\x73\x73\x65\162\x74\151\x6f\x6e", "\101\165\144\x69\x65\x6e\x63\145");
---
> goto fC;
> QY:
> throw new Exception("\115\x6f\x72\x65\x20\x74\x68\141\x6e\40\x6f\x6e\145\40\74\163\141\155\x6c\72\x43\x6f\x6e\144\x69\x74\x69\157\x6e\x73\x3e\x20\151\x6e\x20\x3c\163\x61\x6d\154\72\x41\x73\x73\x65\x72\x74\x69\157\x6e\x3e\56");
> fC:
> $GK = $GK[0];
> if (!$GK->hasAttribute("\x4e\x6f\164\102\x65\146\157\162\145")) {
> goto tr;
> }
> $g8 = Utilities::xsDateTimeToTimestamp($GK->getAttribute("\116\x6f\x74\102\x65\146\157\162\x65"));
> if (!($this->notBefore === NULL || $this->notBefore < $g8)) {
> goto rt;
> }
> $this->notBefore = $g8;
> rt:
> tr:
> if (!$GK->hasAttribute("\116\157\164\117\x6e\117\162\101\x66\164\x65\162")) {
> goto SD;
> }
> $wk = Utilities::xsDateTimeToTimestamp($GK->getAttribute("\116\x6f\x74\x4f\156\x4f\162\101\x66\x74\x65\x72"));
> if (!($this->notOnOrAfter === NULL || $this->notOnOrAfter > $wk)) {
> goto Ky;
> }
> $this->notOnOrAfter = $wk;
> Ky:
> SD:
> $Dx = $GK->firstChild;
> BG:
> if (!($Dx !== NULL)) {
> goto YJ;
> }
> if (!$Dx instanceof DOMText) {
> goto Wx;
> }
> goto Op;
> Wx:
> if (!($Dx->namespaceURI !== "\x75\x72\x6e\x3a\x6f\x61\x73\151\x73\x3a\156\141\x6d\x65\x73\72\164\143\x3a\x53\101\x4d\x4c\72\x32\x2e\60\72\141\163\x73\145\x72\x74\x69\x6f\x6e")) {
> goto Go;
> }
> throw new Exception("\125\x6e\153\156\157\x77\x6e\x20\x6e\x61\x6d\145\x73\160\x61\x63\x65\40\157\146\x20\143\x6f\x6e\144\151\x74\151\157\156\x3a\x20" . var_export($Dx->namespaceURI, TRUE));
> Go:
> switch ($Dx->localName) {
> case "\101\x75\x64\x69\145\156\143\x65\x52\x65\163\x74\x72\151\143\164\151\x6f\156":
> $sI = Utilities::extractStrings($Dx, "\165\x72\156\72\x6f\141\x73\x69\x73\72\156\x61\x6d\x65\x73\x3a\164\x63\x3a\x53\x41\115\114\x3a\x32\56\x30\x3a\x61\163\163\145\162\x74\x69\x6f\x6e", "\x41\165\x64\x69\x65\x6e\143\x65");
206c206
< goto OW;
---
> goto Bx;
208,217c208,217
< $this->validAudiences = array_intersect($this->validAudiences, $gg);
< goto w4;
< OW:
< $this->validAudiences = $gg;
< w4:
< goto N2;
< case "\117\156\145\124\151\155\145\x55\x73\x65":
< goto N2;
< case "\x50\162\x6f\170\171\122\x65\x73\164\x72\x69\x63\x74\151\157\x6e":
< goto N2;
---
> $this->validAudiences = array_intersect($this->validAudiences, $sI);
> goto uT;
> Bx:
> $this->validAudiences = $sI;
> uT:
> goto P5;
> case "\x4f\x6e\145\x54\x69\x6d\x65\x55\163\x65":
> goto P5;
> case "\120\x72\157\170\x79\x52\145\x73\164\x72\151\x63\x74\151\x6f\x6e":
> goto P5;
219c219
< throw new Exception("\125\156\153\156\157\x77\x6e\40\143\x6f\x6e\x64\151\x74\x69\x6f\x6e\72\x20" . var_export($HF->localName, TRUE));
---
> throw new Exception("\x55\156\x6b\x6e\157\x77\156\40\x63\157\x6e\144\x69\164\151\157\x6e\72\40" . var_export($Dx->localName, TRUE));
221,232c221,232
< d1:
< N2:
< zX:
< $HF = $HF->nextSibling;
< goto Ph;
< tV:
< }
< private function parseAuthnStatement(DOMElement $gp)
< {
< $gj = Utilities::xpQuery($gp, "\56\57\x73\x61\x6d\x6c\x5f\141\x73\x73\145\x72\x74\151\x6f\x6e\x3a\101\165\x74\150\x6e\x53\x74\141\x74\145\155\145\x6e\x74");
< if (empty($gj)) {
< goto LA;
---
> l1:
> P5:
> Op:
> $Dx = $Dx->nextSibling;
> goto BG;
> YJ:
> }
> private function parseAuthnStatement(DOMElement $nV)
> {
> $MJ = Utilities::xpQuery($nV, "\56\57\163\x61\155\x6c\x5f\141\x73\x73\145\162\164\x69\157\x6e\x3a\x41\165\x74\x68\x6e\123\x74\141\x74\x65\155\x65\x6e\164");
> if (empty($MJ)) {
> goto E4;
234,235c234,235
< if (count($gj) > 1) {
< goto Rk;
---
> if (count($MJ) > 1) {
> goto ya;
237,238c237,238
< goto Kh;
< LA:
---
> goto JI;
> E4:
241,324c241,262
< goto Kh;
< Rk:
< throw new Exception("\x4d\157\x72\145\x20\x74\150\x61\x74\x20\x6f\156\145\40\74\163\x61\155\x6c\x3a\101\x75\164\150\x6e\x53\x74\141\x74\145\155\145\156\164\76\x20\x69\x6e\x20\74\x73\x61\155\x6c\72\x41\163\163\145\162\x74\x69\157\156\x3e\40\x6e\157\164\x20\163\x75\x70\x70\157\162\164\x65\144\x2e");
< Kh:
< $pB = $gj[0];
< if ($pB->hasAttribute("\101\165\x74\x68\x6e\111\x6e\x73\164\x61\x6e\x74")) {
< goto by;
< }
< throw new Exception("\x4d\x69\x73\x73\x69\156\147\40\x72\145\161\x75\x69\x72\x65\144\x20\101\x75\x74\x68\156\x49\156\x73\x74\x61\x6e\164\x20\x61\164\x74\x72\151\x62\165\164\x65\40\x6f\x6e\x20\x3c\163\x61\x6d\x6c\72\101\x75\x74\x68\156\x53\164\141\x74\145\x6d\x65\x6e\164\x3e\x2e");
< by:
< $this->authnInstant = Utilities::xsDateTimeToTimestamp($pB->getAttribute("\x41\165\164\x68\x6e\x49\x6e\x73\164\x61\156\x74"));
< if (!$pB->hasAttribute("\x53\x65\163\x73\x69\x6f\x6e\x4e\157\x74\117\x6e\117\162\x41\x66\164\145\162")) {
< goto Hl;
< }
< $this->sessionNotOnOrAfter = Utilities::xsDateTimeToTimestamp($pB->getAttribute("\x53\x65\163\163\151\157\x6e\x4e\157\164\117\x6e\117\162\x41\146\x74\145\162"));
< Hl:
< if (!$pB->hasAttribute("\x53\x65\163\x73\x69\x6f\156\111\156\144\145\170")) {
< goto fM;
< }
< $this->sessionIndex = $pB->getAttribute("\x53\x65\163\x73\x69\157\156\x49\x6e\x64\x65\x78");
< fM:
< $this->parseAuthnContext($pB);
< }
< private function parseAuthnContext(DOMElement $Yp)
< {
< $w5 = Utilities::xpQuery($Yp, "\x2e\x2f\163\141\155\x6c\137\x61\163\x73\x65\162\x74\x69\x6f\x6e\72\x41\165\x74\x68\x6e\x43\x6f\x6e\164\145\x78\x74");
< if (count($w5) > 1) {
< goto vG;
< }
< if (empty($w5)) {
< goto HE;
< }
< goto NV;
< vG:
< throw new Exception("\x4d\157\162\145\x20\164\x68\x61\156\40\157\156\145\40\x3c\163\141\155\154\x3a\101\165\164\150\156\x43\157\x6e\164\145\x78\164\x3e\40\151\x6e\x20\74\163\x61\155\x6c\72\x41\x75\164\150\x6e\123\x74\x61\x74\145\155\x65\156\x74\76\56");
< goto NV;
< HE:
< throw new Exception("\115\151\x73\163\x69\x6e\147\40\x72\145\x71\165\151\162\145\x64\x20\x3c\163\x61\155\154\x3a\101\165\164\150\x6e\103\x6f\x6e\x74\145\170\164\x3e\40\151\156\40\x3c\163\x61\155\x6c\72\x41\x75\164\x68\156\x53\164\x61\164\x65\x6d\x65\x6e\x74\x3e\x2e");
< NV:
< $Ht = $w5[0];
< $iG = Utilities::xpQuery($Ht, "\x2e\x2f\x73\141\x6d\x6c\137\141\x73\x73\x65\x72\164\151\157\156\72\101\165\164\150\156\x43\x6f\x6e\164\145\x78\164\104\145\143\x6c\122\145\146");
< if (count($iG) > 1) {
< goto it;
< }
< if (count($iG) === 1) {
< goto LQ;
< }
< goto at;
< it:
< throw new Exception("\x4d\x6f\162\145\40\x74\x68\141\x6e\40\x6f\x6e\145\x20\x3c\x73\141\x6d\154\72\101\165\x74\x68\156\103\157\x6e\164\x65\x78\x74\x44\145\x63\154\122\145\146\x3e\40\x66\157\165\x6e\144\x3f");
< goto at;
< LQ:
< $this->setAuthnContextDeclRef(trim($iG[0]->textContent));
< at:
< $Xx = Utilities::xpQuery($Ht, "\x2e\x2f\163\141\155\154\137\x61\163\x73\145\x72\x74\x69\x6f\x6e\72\101\165\x74\x68\x6e\103\x6f\x6e\x74\x65\170\164\x44\145\x63\154");
< if (count($Xx) > 1) {
< goto pV;
< }
< if (count($Xx) === 1) {
< goto ic;
< }
< goto k0;
< pV:
< throw new Exception("\115\157\162\145\40\x74\150\141\x6e\40\x6f\156\145\x20\x3c\x73\141\155\154\x3a\x41\x75\x74\x68\156\x43\x6f\156\164\145\x78\x74\104\145\143\x6c\76\40\146\157\x75\156\x64\x3f");
< goto k0;
< ic:
< $this->setAuthnContextDecl(new SAML2_XML_Chunk($Xx[0]));
< k0:
< $SO = Utilities::xpQuery($Ht, "\x2e\57\163\141\x6d\x6c\x5f\141\163\163\x65\162\x74\151\x6f\x6e\x3a\101\165\164\x68\x6e\x43\x6f\x6e\x74\x65\x78\x74\x43\x6c\141\x73\x73\122\145\146");
< if (count($SO) > 1) {
< goto rb;
< }
< if (count($SO) === 1) {
< goto hN;
< }
< goto jT;
< rb:
< throw new Exception("\x4d\157\162\x65\40\164\150\141\x6e\40\157\156\x65\x20\74\x73\x61\155\x6c\72\101\x75\164\x68\x6e\x43\157\156\x74\x65\x78\x74\103\154\x61\163\163\122\x65\146\76\x20\x69\156\x20\x3c\163\141\x6d\154\72\x41\x75\164\150\x6e\103\157\x6e\164\145\170\164\x3e\x2e");
< goto jT;
< hN:
< $this->setAuthnContextClassRef(trim($SO[0]->textContent));
< jT:
< if (!(empty($this->authnContextClassRef) && empty($this->authnContextDecl) && empty($this->authnContextDeclRef))) {
< goto ZB;
---
> goto JI;
> ya:
> throw new Exception("\x4d\x6f\x72\x65\40\x74\150\141\x74\40\157\x6e\x65\40\74\x73\141\x6d\x6c\72\x41\x75\x74\x68\156\123\164\141\164\x65\x6d\x65\x6e\164\76\x20\x69\156\x20\x3c\163\141\x6d\x6c\x3a\101\163\x73\x65\162\x74\x69\x6f\x6e\x3e\40\156\157\x74\40\x73\165\x70\160\157\x72\164\145\x64\x2e");
> JI:
> $EP = $MJ[0];
> if ($EP->hasAttribute("\x41\165\x74\150\156\x49\x6e\x73\164\141\x6e\164")) {
> goto m3;
> }
> throw new Exception("\x4d\x69\x73\163\x69\x6e\147\40\x72\145\161\x75\x69\x72\145\144\40\101\x75\164\x68\156\111\156\x73\x74\x61\x6e\164\40\141\164\x74\x72\x69\x62\x75\164\145\40\x6f\156\40\x3c\x73\x61\155\x6c\x3a\x41\x75\x74\150\x6e\x53\164\x61\164\145\155\145\156\164\76\x2e");
> m3:
> $this->authnInstant = Utilities::xsDateTimeToTimestamp($EP->getAttribute("\101\165\164\150\x6e\111\x6e\163\164\141\x6e\164"));
> if (!$EP->hasAttribute("\123\145\163\163\151\x6f\156\116\x6f\x74\117\156\x4f\x72\101\x66\164\145\x72")) {
> goto HG;
> }
> $this->sessionNotOnOrAfter = Utilities::xsDateTimeToTimestamp($EP->getAttribute("\x53\x65\163\163\x69\157\x6e\116\157\164\117\156\x4f\162\101\x66\x74\x65\162"));
> HG:
> if (!$EP->hasAttribute("\123\x65\x73\163\x69\x6f\x6e\111\156\144\145\x78")) {
> goto Uo;
> }
> $this->sessionIndex = $EP->getAttribute("\123\x65\x73\163\151\157\156\111\156\x64\x65\x78");
> Uo:
> $this->parseAuthnContext($EP);
326,344c264,267
< throw new Exception("\x4d\x69\163\x73\x69\156\x67\40\145\151\164\x68\x65\162\x20\x3c\163\x61\x6d\154\72\101\165\x74\x68\x6e\103\157\x6e\x74\x65\170\x74\103\x6c\x61\x73\163\x52\145\146\76\40\157\162\40\x3c\163\141\x6d\154\72\101\x75\x74\150\x6e\103\x6f\x6e\164\x65\170\x74\x44\145\143\154\x52\145\146\x3e\40\157\162\40\x3c\x73\x61\155\x6c\x3a\x41\x75\x74\150\x6e\x43\x6f\156\164\145\170\164\x44\x65\143\x6c\x3e");
< ZB:
< $this->AuthenticatingAuthority = Utilities::extractStrings($Ht, "\165\162\156\x3a\x6f\x61\x73\x69\163\72\x6e\141\x6d\145\163\72\164\x63\x3a\123\x41\115\114\x3a\x32\56\x30\72\141\x73\163\145\162\164\151\157\156", "\101\165\164\150\145\x6e\x74\151\x63\141\164\x69\156\x67\x41\x75\164\x68\x6f\162\x69\x74\x79");
< }
< private function parseAttributes(DOMElement $gp)
< {
< $BC = TRUE;
< $AZ = Utilities::xpQuery($gp, "\56\57\x73\141\x6d\x6c\137\141\x73\163\x65\x72\164\x69\x6f\156\72\x41\x74\164\162\151\142\165\164\145\123\x74\x61\x74\145\155\x65\x6e\164\x2f\163\x61\x6d\x6c\x5f\x61\163\163\145\162\x74\151\x6f\x6e\72\101\x74\164\162\x69\x62\165\164\x65");
< foreach ($AZ as $IB) {
< if ($IB->hasAttribute("\x4e\141\155\145")) {
< goto N8;
< }
< throw new Exception("\115\x69\163\163\x69\x6e\147\40\x6e\141\155\145\40\x6f\x6e\x20\x3c\163\x61\x6d\154\x3a\x41\x74\164\162\x69\142\165\x74\145\x3e\x20\145\154\145\155\145\x6e\x74\x2e");
< N8:
< $SS = $IB->getAttribute("\116\x61\x6d\145");
< if ($IB->hasAttribute("\x4e\141\x6d\145\106\x6f\162\x6d\141\x74")) {
< goto zd;
< }
< $AB = "\x75\x72\x6e\x3a\157\141\x73\151\163\72\156\141\155\x65\163\72\x74\143\72\123\101\x4d\x4c\x3a\x31\56\x31\72\156\141\x6d\145\151\x64\55\x66\x6f\x72\155\x61\x74\72\165\x6e\163\x70\x65\143\x69\146\151\x65\x64";
---
> private function parseAuthnContext(DOMElement $XX)
> {
> $H_ = Utilities::xpQuery($XX, "\56\57\x73\x61\x6d\x6c\x5f\141\x73\x73\145\162\x74\151\x6f\156\72\101\x75\164\150\156\x43\x6f\x6e\164\145\x78\164");
> if (count($H_) > 1) {
346,350d268
< zd:
< $AB = $IB->getAttribute("\x4e\141\x6d\145\106\157\x72\x6d\x61\164");
< vo:
< if ($BC) {
< goto nD;
352,353c270,271
< if (!($this->nameFormat !== $AB)) {
< goto Nr;
---
> if (empty($H_)) {
> goto bh;
355,370c273,311
< $this->nameFormat = "\165\162\x6e\72\x6f\141\163\151\163\x3a\x6e\141\155\145\x73\72\164\x63\72\123\x41\x4d\114\x3a\x31\56\x31\x3a\156\x61\x6d\145\151\144\55\146\157\x72\x6d\x61\164\72\165\x6e\x73\x70\145\143\x69\146\151\x65\144";
< Nr:
< goto EC;
< nD:
< $this->nameFormat = $AB;
< $BC = FALSE;
< EC:
< if (array_key_exists($SS, $this->attributes)) {
< goto GP;
< }
< $this->attributes[$SS] = array();
< GP:
< $Wj = Utilities::xpQuery($IB, "\x2e\57\x73\141\155\x6c\137\x61\x73\x73\145\162\164\151\x6f\x6e\x3a\101\x74\164\x72\x69\142\x75\164\145\126\141\x6c\165\145");
< foreach ($Wj as $rE) {
< $this->attributes[$SS][] = trim($rE->textContent);
< BB:
---
> goto R9;
> vo:
> throw new Exception("\115\x6f\x72\x65\40\164\150\141\156\40\x6f\x6e\145\x20\74\163\x61\155\154\72\x41\x75\164\150\x6e\x43\157\156\x74\x65\x78\164\x3e\40\x69\156\x20\x3c\x73\141\155\154\x3a\x41\165\164\150\156\123\164\141\x74\x65\x6d\x65\156\x74\x3e\56");
> goto R9;
> bh:
> throw new Exception("\x4d\151\x73\163\151\156\x67\40\162\x65\161\x75\x69\x72\145\x64\40\x3c\x73\x61\155\154\x3a\101\165\164\x68\156\x43\157\x6e\164\x65\x78\164\x3e\x20\x69\x6e\40\x3c\x73\141\155\154\x3a\101\x75\164\x68\x6e\123\x74\x61\x74\145\x6d\x65\x6e\164\76\x2e");
> R9:
> $lO = $H_[0];
> $Pw = Utilities::xpQuery($lO, "\56\57\163\141\x6d\x6c\137\141\x73\x73\x65\x72\164\x69\157\x6e\x3a\x41\165\x74\x68\156\x43\x6f\156\164\145\170\164\x44\x65\143\x6c\x52\145\146");
> if (count($Pw) > 1) {
> goto vV;
> }
> if (count($Pw) === 1) {
> goto Hp;
> }
> goto UR;
> vV:
> throw new Exception("\x4d\x6f\162\145\x20\164\x68\141\156\x20\x6f\156\x65\40\74\x73\141\x6d\154\x3a\101\x75\164\x68\x6e\x43\x6f\x6e\164\x65\x78\x74\x44\145\x63\x6c\122\x65\x66\x3e\x20\x66\x6f\165\x6e\x64\77");
> goto UR;
> Hp:
> $this->setAuthnContextDeclRef(trim($Pw[0]->textContent));
> UR:
> $Uv = Utilities::xpQuery($lO, "\x2e\57\x73\141\x6d\x6c\137\141\x73\x73\x65\x72\x74\151\x6f\x6e\x3a\x41\165\164\150\x6e\103\x6f\x6e\164\145\170\164\104\145\x63\154");
> if (count($Uv) > 1) {
> goto MR;
> }
> if (count($Uv) === 1) {
> goto va;
> }
> goto Q2;
> MR:
> throw new Exception("\x4d\157\x72\145\x20\164\x68\x61\156\x20\157\156\x65\x20\74\x73\x61\155\154\72\101\165\x74\x68\x6e\103\157\156\x74\145\170\x74\x44\x65\x63\154\76\x20\x66\x6f\165\x6e\144\x3f");
> goto Q2;
> va:
> $this->setAuthnContextDecl(new SAML2_XML_Chunk($Uv[0]));
> Q2:
> $pe = Utilities::xpQuery($lO, "\x2e\x2f\163\x61\155\x6c\x5f\141\x73\x73\145\162\164\x69\x6f\x6e\x3a\x41\165\164\150\x6e\x43\157\156\x74\x65\x78\164\103\154\x61\x73\163\122\145\146");
> if (count($pe) > 1) {
> goto Ni;
372,373c313,314
< Tc:
< TK:
---
> if (count($pe) === 1) {
> goto yb;
375c316,324
< R8:
---
> goto k8;
> Ni:
> throw new Exception("\115\x6f\x72\x65\x20\164\x68\x61\x6e\x20\157\x6e\x65\40\x3c\163\141\x6d\154\72\101\x75\x74\x68\x6e\x43\157\x6e\x74\x65\x78\164\103\154\141\x73\163\122\x65\146\76\40\151\156\40\x3c\163\141\155\154\x3a\x41\x75\164\150\156\x43\157\x6e\164\145\x78\164\76\x2e");
> goto k8;
> yb:
> $this->setAuthnContextClassRef(trim($pe[0]->textContent));
> k8:
> if (!(empty($this->authnContextClassRef) && empty($this->authnContextDecl) && empty($this->authnContextDeclRef))) {
> goto BB;
377,379c326,328
< private function parseEncryptedAttributes(DOMElement $gp)
< {
< $this->encryptedAttribute = Utilities::xpQuery($gp, "\56\x2f\x73\141\x6d\x6c\x5f\141\163\x73\145\162\164\x69\157\156\72\x41\x74\x74\162\151\142\x75\164\145\x53\x74\141\x74\145\155\145\156\x74\x2f\163\x61\x6d\154\x5f\141\x73\163\145\x72\x74\151\157\x6e\x3a\105\x6e\x63\162\171\160\x74\145\144\x41\x74\x74\162\x69\x62\x75\164\145");
---
> throw new Exception("\115\151\x73\x73\151\156\x67\x20\x65\151\x74\150\x65\x72\x20\74\163\x61\155\154\x3a\101\x75\x74\150\x6e\x43\x6f\156\x74\x65\x78\x74\103\154\141\163\x73\x52\x65\146\76\x20\x6f\x72\x20\74\163\141\x6d\x6c\72\101\x75\164\150\156\x43\157\x6e\x74\145\170\164\104\145\143\x6c\x52\x65\x66\76\x20\x6f\162\40\74\x73\141\x6d\154\72\101\x75\164\150\x6e\x43\157\x6e\164\x65\x78\x74\x44\145\143\154\76");
> BB:
> $this->AuthenticatingAuthority = Utilities::extractStrings($lO, "\165\x72\x6e\72\x6f\141\x73\151\163\x3a\156\141\x6d\145\x73\x3a\164\143\x3a\123\x41\115\x4c\x3a\x32\56\60\x3a\141\163\x73\145\x72\x74\151\x6f\x6e", "\x41\165\164\150\145\x6e\x74\x69\x63\141\164\x69\x6e\x67\101\x75\x74\x68\157\162\x69\x74\171");
381c330
< private function parseSignature(DOMElement $gp)
---
> private function parseAttributes(DOMElement $nV)
383,385c332,385
< $tw = Utilities::validateElement($gp);
< if (!($tw !== FALSE)) {
< goto S7;
---
> $Zn = TRUE;
> $D1 = Utilities::xpQuery($nV, "\56\57\x73\141\x6d\x6c\137\x61\163\163\x65\x72\164\x69\x6f\x6e\72\x41\164\x74\x72\x69\x62\x75\164\x65\x53\x74\141\x74\145\155\x65\x6e\164\x2f\x73\x61\x6d\x6c\137\141\163\163\145\162\x74\151\157\x6e\x3a\101\164\164\x72\x69\142\x75\164\145");
> foreach ($D1 as $nK) {
> if ($nK->hasAttribute("\116\141\155\145")) {
> goto WE;
> }
> throw new Exception("\x4d\151\163\x73\151\x6e\x67\40\156\x61\x6d\145\x20\x6f\x6e\40\74\163\x61\x6d\x6c\72\101\x74\164\x72\151\x62\x75\164\x65\x3e\40\145\x6c\145\x6d\145\x6e\164\x2e");
> WE:
> $l2 = $nK->getAttribute("\116\141\155\145");
> if ($nK->hasAttribute("\x4e\x61\155\x65\x46\x6f\x72\x6d\141\164")) {
> goto FC;
> }
> $OJ = "\x75\x72\x6e\x3a\x6f\x61\x73\151\x73\x3a\156\141\155\x65\163\x3a\x74\143\x3a\x53\101\x4d\114\x3a\61\56\61\x3a\156\x61\x6d\x65\151\144\x2d\146\157\x72\155\x61\x74\72\165\156\x73\160\x65\x63\x69\146\151\145\144";
> goto JW;
> FC:
> $OJ = $nK->getAttribute("\x4e\x61\155\145\106\157\162\155\x61\164");
> JW:
> if ($Zn) {
> goto Rj;
> }
> if (!($this->nameFormat !== $OJ)) {
> goto nJ;
> }
> $this->nameFormat = "\165\162\156\x3a\x6f\141\x73\151\163\x3a\x6e\141\155\145\163\x3a\x74\x63\x3a\x53\x41\x4d\x4c\x3a\x31\56\x31\x3a\156\x61\155\145\x69\144\x2d\x66\157\162\x6d\141\x74\72\165\x6e\x73\160\145\143\151\146\x69\x65\144";
> nJ:
> goto wJ;
> Rj:
> $this->nameFormat = $OJ;
> $Zn = FALSE;
> wJ:
> if (array_key_exists($l2, $this->attributes)) {
> goto hp;
> }
> $this->attributes[$l2] = array();
> hp:
> $tm = Utilities::xpQuery($nK, "\x2e\x2f\163\141\x6d\x6c\x5f\141\163\x73\x65\x72\164\x69\x6f\156\72\x41\x74\164\162\151\142\x75\x74\x65\126\x61\154\x75\x65");
> foreach ($tm as $ND) {
> $this->attributes[$l2][] = trim($ND->textContent);
> oq:
> }
> c1:
> O2:
> }
> Dx:
> }
> private function parseEncryptedAttributes(DOMElement $nV)
> {
> $this->encryptedAttribute = Utilities::xpQuery($nV, "\x2e\x2f\163\141\155\154\x5f\x61\163\163\145\x72\164\151\x6f\x6e\x3a\x41\x74\x74\162\x69\x62\x75\164\145\123\164\x61\164\145\x6d\x65\x6e\x74\x2f\x73\141\x6d\x6c\x5f\141\x73\x73\145\162\x74\x69\x6f\x6e\x3a\x45\x6e\143\x72\171\x70\164\145\144\101\164\x74\162\x69\142\165\164\x65");
> }
> private function parseSignature(DOMElement $nV)
> {
> $TI = Utilities::validateElement($nV);
> if (!($TI !== FALSE)) {
> goto HD;
388,390c388,390
< $this->certificates = $tw["\103\x65\162\x74\151\x66\x69\143\x61\164\x65\163"];
< $this->signatureData = $tw;
< S7:
---
> $this->certificates = $TI["\103\x65\x72\164\x69\146\x69\x63\141\x74\x65\163"];
> $this->signatureData = $TI;
> HD:
392c392
< public function validate(XMLSecurityKey $mz)
---
> public function validate(XMLSecurityKey $ZE)
395c395
< goto kp;
---
> goto r8;
398,399c398,399
< kp:
< Utilities::validateSignature($this->signatureData, $mz);
---
> r8:
> Utilities::validateSignature($this->signatureData, $ZE);
406c406
< public function setId($BA)
---
> public function setId($jj)
408c408
< $this->id = $BA;
---
> $this->id = $jj;
414c414
< public function setIssueInstant($xw)
---
> public function setIssueInstant($zU)
416c416
< $this->issueInstant = $xw;
---
> $this->issueInstant = $zU;
422c422
< public function setIssuer($u1)
---
> public function setIssuer($jm)
424c424
< $this->issuer = $u1;
---
> $this->issuer = $jm;
429c429
< goto nU;
---
> goto ez;
431,432c431,432
< throw new Exception("\x41\x74\164\145\x6d\160\x74\x65\x64\40\164\157\40\x72\x65\x74\x72\x69\145\166\145\x20\145\x6e\x63\x72\x79\x70\164\145\144\x20\116\141\155\145\111\x44\40\167\151\164\150\157\x75\x74\x20\144\x65\143\162\x79\x70\164\x69\156\x67\40\151\x74\40\146\x69\x72\x73\x74\56");
< nU:
---
> throw new Exception("\101\x74\x74\145\x6d\x70\164\145\144\x20\x74\x6f\40\x72\x65\164\162\x69\145\x76\x65\40\x65\x6e\143\x72\171\x70\x74\x65\x64\x20\x4e\141\155\x65\x49\x44\40\x77\151\164\150\157\x75\x74\x20\x64\x65\143\x72\171\x70\x74\151\156\x67\40\151\164\x20\146\x69\162\x73\164\56");
> ez:
435c435
< public function setNameId($b3)
---
> public function setNameId($Jb)
437c437
< $this->nameId = $b3;
---
> $this->nameId = $Jb;
442c442
< goto yb;
---
> goto UX;
445c445
< yb:
---
> UX:
448c448
< public function encryptNameId(XMLSecurityKey $mz)
---
> public function encryptNameId(XMLSecurityKey $ZE)
450,462c450,462
< $OZ = new DOMDocument();
< $rZ = $OZ->createElement("\x72\157\157\164");
< $OZ->appendChild($rZ);
< Utilities::addNameId($rZ, $this->nameId);
< $b3 = $rZ->firstChild;
< Utilities::getContainer()->debugMessage($b3, "\145\x6e\x63\162\x79\160\x74");
< $kF = new XMLSecEnc();
< $kF->setNode($b3);
< $kF->type = XMLSecEnc::Element;
< $Gg = new XMLSecurityKey(XMLSecurityKey::AES128_CBC);
< $Gg->generateSessionKey();
< $kF->encryptKey($mz, $Gg);
< $this->encryptedNameId = $kF->encryptNode($Gg);
---
> $je = new DOMDocument();
> $bF = $je->createElement("\x72\x6f\157\x74");
> $je->appendChild($bF);
> Utilities::addNameId($bF, $this->nameId);
> $Jb = $bF->firstChild;
> Utilities::getContainer()->debugMessage($Jb, "\145\156\x63\162\x79\x70\164");
> $Ma = new XMLSecEnc();
> $Ma->setNode($Jb);
> $Ma->type = XMLSecEnc::Element;
> $s1 = new XMLSecurityKey(XMLSecurityKey::AES128_CBC);
> $s1->generateSessionKey();
> $Ma->encryptKey($ZE, $s1);
> $this->encryptedNameId = $Ma->encryptNode($s1);
465c465
< public function decryptNameId(XMLSecurityKey $mz, array $uB = array())
---
> public function decryptNameId(XMLSecurityKey $ZE, array $zI = array())
468c468
< goto o5;
---
> goto MV;
471,474c471,474
< o5:
< $b3 = Utilities::decryptElement($this->encryptedNameId, $mz, $uB);
< Utilities::getContainer()->debugMessage($b3, "\x64\145\x63\x72\171\160\164");
< $this->nameId = Utilities::parseNameId($b3);
---
> MV:
> $Jb = Utilities::decryptElement($this->encryptedNameId, $ZE, $zI);
> Utilities::getContainer()->debugMessage($Jb, "\144\145\143\x72\171\x70\x74");
> $this->nameId = Utilities::parseNameId($Jb);
477c477
< public function decryptAttributes(XMLSecurityKey $mz, array $uB = array())
---
> public function decryptAttributes(XMLSecurityKey $ZE, array $zI = array())
480c480
< goto NQ;
---
> goto b0;
483,523c483,516
< NQ:
< $BC = TRUE;
< $AZ = $this->encryptedAttribute;
< foreach ($AZ as $bx) {
< $IB = Utilities::decryptElement($bx->getElementsByTagName("\x45\156\x63\162\171\x70\x74\x65\x64\104\141\x74\141")->item(0), $mz, $uB);
< if ($IB->hasAttribute("\x4e\x61\155\145")) {
< goto KD;
< }
< throw new Exception("\x4d\151\163\x73\x69\156\x67\40\156\x61\155\145\x20\157\x6e\x20\x3c\163\x61\155\x6c\72\x41\x74\164\162\151\142\x75\x74\145\76\x20\145\x6c\x65\x6d\x65\x6e\x74\56");
< KD:
< $SS = $IB->getAttribute("\116\141\155\145");
< if ($IB->hasAttribute("\x4e\141\x6d\145\106\x6f\x72\155\141\x74")) {
< goto qj;
< }
< $AB = "\x75\x72\156\x3a\x6f\141\x73\151\163\72\156\x61\x6d\x65\163\72\164\143\x3a\123\x41\x4d\x4c\x3a\x32\x2e\60\x3a\x61\x74\x74\x72\156\141\x6d\145\x2d\146\157\162\x6d\141\x74\x3a\x75\x6e\x73\160\145\x63\151\x66\151\145\x64";
< goto ox;
< qj:
< $AB = $IB->getAttribute("\116\x61\x6d\x65\x46\x6f\x72\155\x61\x74");
< ox:
< if ($BC) {
< goto Us;
< }
< if (!($this->nameFormat !== $AB)) {
< goto QR;
< }
< $this->nameFormat = "\165\x72\x6e\x3a\x6f\141\x73\151\x73\72\x6e\141\x6d\145\x73\72\164\143\72\x53\101\x4d\x4c\x3a\x32\56\x30\72\141\x74\164\162\156\141\155\x65\55\x66\x6f\x72\155\x61\164\x3a\x75\156\163\x70\x65\143\151\x66\x69\x65\x64";
< QR:
< goto sS;
< Us:
< $this->nameFormat = $AB;
< $BC = FALSE;
< sS:
< if (array_key_exists($SS, $this->attributes)) {
< goto OX;
< }
< $this->attributes[$SS] = array();
< OX:
< $Wj = Utilities::xpQuery($IB, "\x2e\x2f\x73\141\x6d\x6c\x5f\x61\x73\x73\145\162\x74\x69\x6f\156\72\101\164\164\x72\151\x62\165\164\145\x56\x61\154\x75\x65");
< foreach ($Wj as $rE) {
< $this->attributes[$SS][] = trim($rE->textContent);
< W4:
---
> b0:
> $Zn = TRUE;
> $D1 = $this->encryptedAttribute;
> foreach ($D1 as $gX) {
> $nK = Utilities::decryptElement($gX->getElementsByTagName("\105\156\143\162\171\x70\164\145\x64\104\141\x74\141")->item(0), $ZE, $zI);
> if ($nK->hasAttribute("\x4e\141\x6d\145")) {
> goto tH;
> }
> throw new Exception("\115\x69\163\x73\x69\x6e\147\40\156\141\x6d\x65\x20\x6f\x6e\40\x3c\x73\141\x6d\154\x3a\101\x74\164\x72\x69\x62\165\164\x65\76\40\x65\x6c\x65\155\145\x6e\164\56");
> tH:
> $l2 = $nK->getAttribute("\x4e\141\155\x65");
> if ($nK->hasAttribute("\116\141\155\145\x46\157\x72\155\141\164")) {
> goto Mp;
> }
> $OJ = "\165\x72\x6e\72\x6f\141\163\x69\x73\72\156\141\155\x65\163\72\164\143\72\123\101\115\114\72\62\56\60\x3a\x61\164\164\x72\x6e\141\x6d\x65\x2d\146\157\x72\x6d\141\164\72\165\x6e\x73\160\x65\143\151\x66\151\x65\x64";
> goto oi;
> Mp:
> $OJ = $nK->getAttribute("\116\141\x6d\x65\106\157\x72\x6d\x61\x74");
> oi:
> if ($Zn) {
> goto Uq;
> }
> if (!($this->nameFormat !== $OJ)) {
> goto kY;
> }
> $this->nameFormat = "\x75\x72\x6e\72\x6f\141\x73\x69\x73\72\156\x61\155\x65\x73\72\164\x63\72\x53\101\115\114\x3a\62\56\x30\72\141\x74\x74\162\x6e\x61\x6d\145\x2d\146\x6f\x72\155\x61\x74\x3a\165\156\x73\x70\x65\x63\x69\146\151\145\144";
> kY:
> goto fV;
> Uq:
> $this->nameFormat = $OJ;
> $Zn = FALSE;
> fV:
> if (array_key_exists($l2, $this->attributes)) {
> goto H9;
525,526c518,526
< UT:
< BP:
---
> $this->attributes[$l2] = array();
> H9:
> $tm = Utilities::xpQuery($nK, "\56\57\x73\141\x6d\154\x5f\141\x73\x73\145\x72\164\x69\157\x6e\72\101\x74\x74\162\x69\142\165\x74\x65\x56\x61\x6c\165\145");
> foreach ($tm as $ND) {
> $this->attributes[$l2][] = trim($ND->textContent);
> Gv:
> }
> FW:
> vm:
528c528
< Kt:
---
> xV:
534c534
< public function setNotBefore($pa)
---
> public function setNotBefore($g8)
536c536
< $this->notBefore = $pa;
---
> $this->notBefore = $g8;
542c542
< public function setNotOnOrAfter($DA)
---
> public function setNotOnOrAfter($wk)
544c544
< $this->notOnOrAfter = $DA;
---
> $this->notOnOrAfter = $wk;
546c546
< public function setEncryptedAttributes($Ga)
---
> public function setEncryptedAttributes($V0)
548c548
< $this->requiredEncAttributes = $Ga;
---
> $this->requiredEncAttributes = $V0;
554c554
< public function setValidAudiences(array $ws = NULL)
---
> public function setValidAudiences(array $qJ = NULL)
556c556
< $this->validAudiences = $ws;
---
> $this->validAudiences = $qJ;
562c562
< public function setAuthnInstant($yv)
---
> public function setAuthnInstant($Zm)
564c564
< $this->authnInstant = $yv;
---
> $this->authnInstant = $Zm;
570c570
< public function setSessionNotOnOrAfter($Cp)
---
> public function setSessionNotOnOrAfter($Tz)
572c572
< $this->sessionNotOnOrAfter = $Cp;
---
> $this->sessionNotOnOrAfter = $Tz;
578c578
< public function setSessionIndex($gF)
---
> public function setSessionIndex($Hr)
580c580
< $this->sessionIndex = $gF;
---
> $this->sessionIndex = $Hr;
585c585
< goto h3;
---
> goto YP;
588c588
< h3:
---
> YP:
590c590
< goto m1;
---
> goto Vy;
593c593
< m1:
---
> Vy:
596c596
< public function setAuthnContext($CJ)
---
> public function setAuthnContext($ul)
598c598
< $this->setAuthnContextClassRef($CJ);
---
> $this->setAuthnContextClassRef($ul);
604c604
< public function setAuthnContextClassRef($sg)
---
> public function setAuthnContextClassRef($xQ)
606c606
< $this->authnContextClassRef = $sg;
---
> $this->authnContextClassRef = $xQ;
608c608
< public function setAuthnContextDecl(SAML2_XML_Chunk $yc)
---
> public function setAuthnContextDecl(SAML2_XML_Chunk $s_)
611c611
< goto xR;
---
> goto tx;
613,615c613,615
< throw new Exception("\x41\x75\x74\150\x6e\x43\157\156\164\x65\x78\164\x44\x65\x63\x6c\x52\x65\x66\x20\x69\163\x20\x61\154\162\145\141\x64\171\40\x72\145\x67\151\x73\x74\x65\162\x65\x64\x21\x20\115\x61\171\40\157\156\154\171\x20\x68\141\x76\145\40\x65\x69\164\x68\145\162\40\141\x20\x44\145\143\x6c\40\x6f\162\x20\x61\x20\x44\x65\143\154\x52\145\146\54\40\156\x6f\164\40\x62\157\164\x68\x21");
< xR:
< $this->authnContextDecl = $yc;
---
> throw new Exception("\x41\165\x74\x68\156\103\x6f\x6e\164\x65\170\x74\x44\145\143\154\122\145\x66\40\151\163\40\x61\x6c\x72\145\141\144\171\40\x72\x65\147\151\163\164\145\162\x65\x64\41\40\115\141\x79\40\157\156\x6c\x79\x20\150\x61\166\x65\40\x65\x69\x74\x68\x65\162\40\x61\40\104\145\x63\x6c\x20\x6f\162\x20\141\x20\104\x65\x63\154\x52\x65\146\x2c\40\156\x6f\164\x20\x62\x6f\x74\150\41");
> tx:
> $this->authnContextDecl = $s_;
621c621
< public function setAuthnContextDeclRef($zh)
---
> public function setAuthnContextDeclRef($MP)
624c624
< goto mK;
---
> goto i8;
626,628c626,628
< throw new Exception("\101\x75\x74\x68\x6e\x43\x6f\x6e\164\145\x78\164\x44\145\143\x6c\x20\x69\x73\40\141\x6c\x72\145\x61\x64\171\40\162\145\x67\151\163\164\x65\162\145\144\x21\40\115\x61\x79\40\x6f\x6e\x6c\x79\x20\150\x61\x76\145\x20\x65\x69\164\150\x65\162\40\141\x20\x44\145\143\x6c\40\x6f\162\x20\141\x20\x44\x65\143\154\122\x65\x66\x2c\x20\x6e\x6f\164\40\142\157\x74\x68\x21");
< mK:
< $this->authnContextDeclRef = $zh;
---
> throw new Exception("\x41\x75\x74\x68\156\x43\x6f\x6e\x74\x65\x78\164\104\145\143\154\x20\x69\163\x20\x61\x6c\x72\145\x61\x64\171\40\x72\x65\147\151\163\164\x65\162\x65\x64\41\x20\115\141\171\40\x6f\x6e\x6c\171\x20\150\x61\166\145\x20\x65\151\164\150\x65\162\40\x61\x20\x44\145\143\154\40\157\x72\40\141\x20\104\x65\x63\x6c\122\145\146\54\x20\156\x6f\x74\x20\x62\157\x74\x68\x21");
> i8:
> $this->authnContextDeclRef = $MP;
638c638
< public function setAuthenticatingAuthority($zG)
---
> public function setAuthenticatingAuthority($DK)
640c640
< $this->AuthenticatingAuthority = $zG;
---
> $this->AuthenticatingAuthority = $DK;
646c646
< public function setAttributes(array $AZ)
---
> public function setAttributes(array $D1)
648c648
< $this->attributes = $AZ;
---
> $this->attributes = $D1;
654c654
< public function setAttributeNameFormat($AB)
---
> public function setAttributeNameFormat($OJ)
656c656
< $this->nameFormat = $AB;
---
> $this->nameFormat = $OJ;
662c662
< public function setSubjectConfirmation(array $wB)
---
> public function setSubjectConfirmation(array $b1)
664c664
< $this->SubjectConfirmation = $wB;
---
> $this->SubjectConfirmation = $b1;
674c674
< public function setSignatureKey(XMLsecurityKey $ew = NULL)
---
> public function setSignatureKey(XMLsecurityKey $tc = NULL)
676c676
< $this->signatureKey = $ew;
---
> $this->signatureKey = $tc;
682c682
< public function setEncryptionKey(XMLSecurityKey $Aq = NULL)
---
> public function setEncryptionKey(XMLSecurityKey $uW = NULL)
684c684
< $this->encryptionKey = $Aq;
---
> $this->encryptionKey = $uW;
686c686
< public function setCertificates(array $MI)
---
> public function setCertificates(array $By)
688c688
< $this->certificates = $MI;
---
> $this->certificates = $By;
698c698
< public function toXML(DOMNode $Z1 = NULL)
---
> public function toXML(DOMNode $Vb = NULL)
700,701c700,701
< if ($Z1 === NULL) {
< goto JF;
---
> if ($Vb === NULL) {
> goto gb;
703,723c703,723
< $Ej = $Z1->ownerDocument;
< goto lh;
< JF:
< $Ej = new DOMDocument();
< $Z1 = $Ej;
< lh:
< $rZ = $Ej->createElementNS("\165\162\x6e\x3a\157\141\163\x69\163\x3a\x6e\141\x6d\x65\x73\72\x74\x63\x3a\123\x41\115\114\72\x32\56\x30\x3a\141\163\163\x65\162\x74\x69\x6f\x6e", "\x73\x61\x6d\154\x3a" . "\x41\x73\x73\145\x72\164\151\157\156");
< $Z1->appendChild($rZ);
< $rZ->setAttributeNS("\165\162\x6e\x3a\x6f\141\163\151\x73\72\x6e\141\x6d\x65\x73\72\164\x63\72\x53\101\115\x4c\72\x32\x2e\60\72\160\x72\157\164\157\x63\157\154", "\163\141\155\x6c\x70\x3a\x74\155\160", "\x74\155\160");
< $rZ->removeAttributeNS("\165\162\156\x3a\x6f\x61\163\x69\x73\72\156\x61\x6d\145\163\x3a\x74\143\72\123\x41\x4d\114\72\62\x2e\60\x3a\x70\162\157\x74\x6f\x63\x6f\x6c", "\x74\155\160");
< $rZ->setAttributeNS("\150\x74\164\x70\72\x2f\57\x77\x77\167\56\167\63\56\157\162\x67\57\62\x30\x30\x31\57\130\115\114\x53\143\x68\x65\155\141\55\151\156\x73\x74\141\156\143\x65", "\x78\x73\x69\72\x74\x6d\x70", "\164\155\x70");
< $rZ->removeAttributeNS("\x68\164\x74\x70\72\x2f\x2f\167\167\x77\56\167\63\x2e\157\x72\147\57\62\x30\60\x31\x2f\x58\x4d\x4c\123\x63\x68\145\x6d\141\55\151\156\x73\164\x61\x6e\x63\145", "\x74\155\x70");
< $rZ->setAttributeNS("\x68\x74\164\160\72\57\57\167\167\167\56\x77\x33\x2e\157\162\147\x2f\62\60\x30\x31\x2f\130\115\x4c\123\143\x68\x65\155\141", "\x78\x73\72\x74\x6d\160", "\164\x6d\x70");
< $rZ->removeAttributeNS("\x68\x74\164\160\x3a\57\x2f\167\x77\x77\56\x77\63\56\x6f\x72\147\x2f\62\60\60\61\57\130\115\x4c\x53\143\150\x65\155\141", "\164\155\160");
< $rZ->setAttribute("\111\104", $this->id);
< $rZ->setAttribute("\x56\145\x72\x73\151\x6f\x6e", "\x32\56\x30");
< $rZ->setAttribute("\x49\x73\x73\165\145\x49\156\163\x74\x61\x6e\x74", gmdate("\x59\55\x6d\55\x64\x5c\124\x48\72\x69\72\163\134\x5a", $this->issueInstant));
< $u1 = Utilities::addString($rZ, "\165\162\x6e\72\157\x61\163\151\x73\x3a\x6e\x61\155\x65\163\72\164\x63\72\x53\101\115\x4c\72\62\x2e\x30\x3a\141\163\x73\x65\162\164\x69\157\x6e", "\x73\141\x6d\x6c\x3a\x49\x73\163\165\x65\x72", $this->issuer);
< $this->addSubject($rZ);
< $this->addConditions($rZ);
< $this->addAuthnStatement($rZ);
---
> $nD = $Vb->ownerDocument;
> goto BH;
> gb:
> $nD = new DOMDocument();
> $Vb = $nD;
> BH:
> $bF = $nD->createElementNS("\165\162\x6e\72\157\141\x73\x69\163\72\x6e\x61\155\x65\x73\x3a\x74\x63\72\123\101\115\114\72\62\56\60\72\141\x73\x73\145\x72\164\151\157\x6e", "\x73\x61\155\154\x3a" . "\x41\163\163\x65\x72\x74\x69\157\156");
> $Vb->appendChild($bF);
> $bF->setAttributeNS("\x75\x72\156\72\x6f\141\163\151\x73\72\x6e\x61\155\145\163\72\164\143\72\123\x41\x4d\114\x3a\62\x2e\60\72\x70\162\x6f\164\x6f\x63\x6f\154", "\163\x61\155\154\160\72\x74\155\160", "\x74\155\160");
> $bF->removeAttributeNS("\x75\x72\x6e\x3a\x6f\141\163\x69\x73\72\x6e\x61\x6d\145\x73\72\x74\143\72\123\x41\115\114\72\x32\56\60\x3a\x70\x72\x6f\x74\x6f\x63\157\154", "\x74\x6d\160");
> $bF->setAttributeNS("\150\164\164\160\72\57\57\167\x77\167\56\x77\63\56\x6f\x72\x67\57\x32\x30\60\x31\57\130\x4d\x4c\123\x63\150\x65\155\141\55\x69\156\x73\164\x61\156\x63\145", "\170\x73\151\x3a\164\155\x70", "\x74\155\160");
> $bF->removeAttributeNS("\150\x74\164\160\72\57\x2f\x77\167\x77\x2e\x77\63\x2e\157\x72\x67\x2f\62\60\60\61\57\130\x4d\114\123\x63\150\x65\x6d\141\x2d\x69\156\x73\164\x61\x6e\x63\x65", "\164\155\x70");
> $bF->setAttributeNS("\x68\164\164\x70\72\x2f\57\x77\167\x77\56\167\63\x2e\x6f\162\x67\x2f\x32\x30\x30\61\57\130\x4d\x4c\x53\143\x68\x65\155\x61", "\x78\163\x3a\164\x6d\x70", "\164\x6d\x70");
> $bF->removeAttributeNS("\x68\x74\164\160\72\x2f\57\167\x77\x77\56\x77\x33\x2e\157\x72\147\x2f\62\60\x30\61\x2f\x58\115\x4c\x53\143\150\145\155\x61", "\164\155\x70");
> $bF->setAttribute("\111\104", $this->id);
> $bF->setAttribute("\x56\145\x72\x73\151\157\156", "\x32\56\x30");
> $bF->setAttribute("\111\163\163\165\145\x49\156\163\x74\x61\156\164", gmdate("\131\55\155\55\144\x5c\x54\x48\72\151\x3a\x73\x5c\x5a", $this->issueInstant));
> $jm = Utilities::addString($bF, "\165\x72\156\x3a\157\x61\163\x69\163\x3a\x6e\x61\x6d\x65\163\x3a\x74\143\x3a\x53\101\x4d\x4c\72\x32\56\60\72\141\x73\x73\145\162\x74\x69\157\x6e", "\163\x61\x6d\154\x3a\111\x73\163\x75\145\162", $this->issuer);
> $this->addSubject($bF);
> $this->addConditions($bF);
> $this->addAuthnStatement($bF);
725c725
< goto Gm;
---
> goto nj;
727,731c727,731
< $this->addEncryptedAttributeStatement($rZ);
< goto O0;
< Gm:
< $this->addAttributeStatement($rZ);
< O0:
---
> $this->addEncryptedAttributeStatement($bF);
> goto gO;
> nj:
> $this->addAttributeStatement($bF);
> gO:
733c733
< goto bv;
---
> goto Wr;
735,737c735,737
< Utilities::insertSignature($this->signatureKey, $this->certificates, $rZ, $u1->nextSibling);
< bv:
< return $rZ;
---
> Utilities::insertSignature($this->signatureKey, $this->certificates, $bF, $jm->nextSibling);
> Wr:
> return $bF;
739c739
< private function addSubject(DOMElement $rZ)
---
> private function addSubject(DOMElement $bF)
742c742
< goto II;
---
> goto vB;
745,747c745,747
< II:
< $sU = $rZ->ownerDocument->createElementNS("\165\162\x6e\72\x6f\141\163\x69\163\72\x6e\x61\x6d\145\x73\72\164\x63\x3a\x53\x41\115\x4c\72\x32\56\60\x3a\141\x73\163\145\x72\164\x69\157\156", "\x73\x61\155\154\72\x53\165\x62\x6a\x65\x63\164");
< $rZ->appendChild($sU);
---
> vB:
> $Vw = $bF->ownerDocument->createElementNS("\165\162\x6e\72\x6f\x61\163\151\x73\x3a\x6e\x61\x6d\x65\163\x3a\x74\x63\x3a\123\101\115\x4c\72\x32\56\60\72\x61\163\x73\x65\162\164\x69\x6f\x6e", "\x73\x61\155\154\72\x53\165\x62\x6a\145\143\x74");
> $bF->appendChild($Vw);
749c749
< goto Ew;
---
> goto jy;
751,768c751,768
< $fm = $sU->ownerDocument->createElementNS("\x75\162\x6e\72\x6f\x61\163\x69\163\x3a\x6e\141\x6d\145\163\x3a\x74\x63\72\x53\x41\x4d\114\x3a\x32\x2e\60\72\x61\163\x73\x65\162\164\151\157\156", "\x73\141\155\x6c\x3a" . "\105\x6e\143\x72\171\x70\x74\145\x64\x49\104");
< $sU->appendChild($fm);
< $fm->appendChild($sU->ownerDocument->importNode($this->encryptedNameId, TRUE));
< goto zY;
< Ew:
< Utilities::addNameId($sU, $this->nameId);
< zY:
< foreach ($this->SubjectConfirmation as $z5) {
< $z5->toXML($sU);
< ov:
< }
< sG:
< }
< private function addConditions(DOMElement $rZ)
< {
< $Ej = $rZ->ownerDocument;
< $Rh = $Ej->createElementNS("\165\x72\x6e\x3a\x6f\141\x73\151\x73\72\x6e\x61\155\145\163\72\x74\x63\x3a\x53\x41\115\114\72\x32\56\x30\x3a\x61\163\x73\x65\x72\164\x69\157\x6e", "\163\141\x6d\154\72\x43\x6f\x6e\x64\151\164\151\157\156\x73");
< $rZ->appendChild($Rh);
---
> $ko = $Vw->ownerDocument->createElementNS("\165\162\x6e\72\157\x61\163\151\x73\72\156\141\155\145\x73\72\x74\143\72\123\101\x4d\x4c\x3a\x32\x2e\60\72\x61\163\163\x65\x72\x74\x69\157\156", "\163\x61\x6d\x6c\x3a" . "\x45\156\x63\x72\x79\x70\164\145\144\x49\104");
> $Vw->appendChild($ko);
> $ko->appendChild($Vw->ownerDocument->importNode($this->encryptedNameId, TRUE));
> goto fb;
> jy:
> Utilities::addNameId($Vw, $this->nameId);
> fb:
> foreach ($this->SubjectConfirmation as $cu) {
> $cu->toXML($Vw);
> Vz:
> }
> Et:
> }
> private function addConditions(DOMElement $bF)
> {
> $nD = $bF->ownerDocument;
> $GK = $nD->createElementNS("\x75\x72\x6e\x3a\x6f\141\x73\x69\x73\x3a\156\141\x6d\x65\x73\x3a\x74\143\x3a\123\x41\x4d\114\72\62\56\x30\x3a\x61\163\163\145\162\x74\151\x6f\156", "\x73\x61\155\x6c\72\103\x6f\156\x64\x69\164\x69\x6f\156\163");
> $bF->appendChild($GK);
770c770
< goto xj;
---
> goto g5;
772,773c772,773
< $Rh->setAttribute("\x4e\x6f\164\102\145\x66\157\x72\145", gmdate("\x59\55\x6d\55\144\134\124\x48\x3a\x69\72\x73\134\x5a", $this->notBefore));
< xj:
---
> $GK->setAttribute("\x4e\x6f\x74\102\x65\x66\x6f\x72\x65", gmdate("\x59\55\x6d\x2d\144\x5c\124\x48\72\x69\x3a\x73\x5c\x5a", $this->notBefore));
> g5:
775c775
< goto Uv;
---
> goto SG;
777,778c777,778
< $Rh->setAttribute("\x4e\157\164\x4f\156\117\x72\101\146\x74\x65\162", gmdate("\131\x2d\x6d\55\144\134\124\x48\72\151\72\x73\134\132", $this->notOnOrAfter));
< Uv:
---
> $GK->setAttribute("\x4e\157\x74\x4f\156\x4f\x72\101\x66\164\145\162", gmdate("\x59\x2d\x6d\55\x64\x5c\x54\110\x3a\x69\72\163\x5c\x5a", $this->notOnOrAfter));
> SG:
780c780
< goto sF;
---
> goto gL;
782,785c782,785
< $JQ = $Ej->createElementNS("\x75\x72\x6e\72\x6f\141\x73\151\163\72\156\x61\155\x65\163\x3a\x74\143\x3a\123\x41\x4d\x4c\x3a\62\x2e\x30\x3a\141\163\x73\x65\x72\164\151\157\x6e", "\163\141\155\154\72\101\x75\x64\x69\x65\156\143\x65\x52\145\163\x74\x72\x69\143\x74\x69\157\156");
< $Rh->appendChild($JQ);
< Utilities::addStrings($JQ, "\x75\162\x6e\72\x6f\141\163\151\163\x3a\156\141\155\145\163\x3a\x74\143\x3a\x53\101\115\x4c\x3a\62\x2e\60\72\141\x73\x73\145\162\x74\x69\x6f\x6e", "\163\141\155\154\x3a\101\165\144\151\145\x6e\x63\145", FALSE, $this->validAudiences);
< sF:
---
> $P0 = $nD->createElementNS("\165\162\x6e\72\x6f\x61\x73\x69\x73\72\156\x61\155\x65\163\x3a\x74\x63\x3a\123\101\115\x4c\72\62\56\60\x3a\141\x73\x73\145\x72\x74\x69\157\156", "\163\141\155\x6c\x3a\101\165\x64\x69\145\x6e\143\x65\x52\145\x73\164\x72\x69\143\164\x69\x6f\x6e");
> $GK->appendChild($P0);
> Utilities::addStrings($P0, "\165\162\x6e\x3a\157\x61\x73\151\x73\x3a\x6e\x61\x6d\145\163\72\x74\x63\x3a\x53\x41\115\x4c\72\x32\x2e\x30\x3a\x61\163\163\x65\162\164\x69\157\x6e", "\163\x61\155\x6c\x3a\x41\x75\144\x69\x65\x6e\143\145", FALSE, $this->validAudiences);
> gL:
787c787
< private function addAuthnStatement(DOMElement $rZ)
---
> private function addAuthnStatement(DOMElement $bF)
790c790
< goto lK;
---
> goto jJ;
793,797c793,797
< lK:
< $Ej = $rZ->ownerDocument;
< $Yp = $Ej->createElementNS("\165\x72\156\72\157\x61\163\x69\x73\x3a\156\x61\x6d\x65\163\x3a\x74\x63\72\x53\101\115\x4c\x3a\62\x2e\x30\x3a\141\x73\163\x65\162\x74\151\x6f\x6e", "\x73\141\x6d\x6c\x3a\x41\165\x74\150\x6e\123\164\x61\x74\x65\x6d\x65\156\x74");
< $rZ->appendChild($Yp);
< $Yp->setAttribute("\x41\165\x74\150\156\111\156\163\x74\x61\x6e\x74", gmdate("\x59\55\x6d\x2d\144\x5c\124\110\x3a\x69\72\163\x5c\x5a", $this->authnInstant));
---
> jJ:
> $nD = $bF->ownerDocument;
> $XX = $nD->createElementNS("\x75\x72\x6e\x3a\157\141\x73\151\163\72\x6e\141\x6d\x65\x73\x3a\164\143\x3a\123\101\115\x4c\x3a\62\x2e\60\x3a\141\163\x73\x65\162\164\x69\157\156", "\163\141\155\154\x3a\101\x75\164\x68\156\x53\x74\141\x74\145\x6d\145\156\x74");
> $bF->appendChild($XX);
> $XX->setAttribute("\x41\165\x74\x68\x6e\111\156\x73\164\141\x6e\164", gmdate("\x59\x2d\155\x2d\144\134\124\x48\x3a\x69\72\163\134\132", $this->authnInstant));
799c799
< goto hX;
---
> goto VE;
801,802c801,802
< $Yp->setAttribute("\123\145\163\163\151\x6f\156\x4e\x6f\164\117\x6e\117\162\x41\146\x74\145\x72", gmdate("\131\55\155\55\144\x5c\124\110\x3a\151\x3a\163\x5c\x5a", $this->sessionNotOnOrAfter));
< hX:
---
> $XX->setAttribute("\123\x65\x73\x73\151\157\x6e\116\x6f\x74\x4f\156\117\x72\101\x66\164\145\x72", gmdate("\131\55\155\x2d\144\x5c\124\110\x3a\x69\72\163\x5c\x5a", $this->sessionNotOnOrAfter));
> VE:
804c804
< goto KW;
---
> goto WO;
806,809c806,809
< $Yp->setAttribute("\123\x65\163\163\x69\157\156\111\156\144\x65\x78", $this->sessionIndex);
< KW:
< $Ht = $Ej->createElementNS("\165\x72\x6e\x3a\157\141\163\151\x73\x3a\156\x61\x6d\145\163\72\x74\143\x3a\x53\x41\115\x4c\72\62\x2e\x30\72\x61\x73\x73\145\162\x74\x69\x6f\x6e", "\x73\x61\x6d\x6c\72\x41\x75\164\x68\x6e\103\x6f\x6e\164\x65\x78\x74");
< $Yp->appendChild($Ht);
---
> $XX->setAttribute("\123\x65\163\163\x69\x6f\x6e\x49\156\x64\x65\170", $this->sessionIndex);
> WO:
> $lO = $nD->createElementNS("\165\x72\x6e\72\157\x61\x73\x69\163\72\156\x61\155\145\x73\x3a\164\143\72\123\x41\115\114\72\62\x2e\60\72\141\163\163\145\x72\x74\151\157\156", "\163\141\x6d\154\72\101\x75\164\x68\156\x43\x6f\x6e\x74\x65\x78\x74");
> $XX->appendChild($lO);
811c811
< goto FA;
---
> goto Gk;
813,814c813,814
< Utilities::addString($Ht, "\165\162\156\72\157\141\x73\151\x73\x3a\156\x61\x6d\145\x73\x3a\x74\143\x3a\123\101\x4d\114\x3a\62\x2e\x30\72\x61\163\163\145\162\x74\x69\157\x6e", "\x73\x61\155\154\72\x41\x75\x74\150\156\x43\157\x6e\164\145\170\164\x43\x6c\141\163\163\x52\145\x66", $this->authnContextClassRef);
< FA:
---
> Utilities::addString($lO, "\165\162\156\72\157\141\x73\x69\x73\72\156\x61\x6d\x65\x73\72\164\x63\72\123\x41\115\x4c\72\x32\x2e\x30\72\141\163\x73\x65\x72\164\x69\x6f\x6e", "\x73\x61\155\154\72\x41\165\x74\150\x6e\x43\157\156\x74\x65\170\164\103\154\x61\x73\x73\122\145\x66", $this->authnContextClassRef);
> Gk:
816c816
< goto ED;
---
> goto j3;
818,819c818,819
< $this->authnContextDecl->toXML($Ht);
< ED:
---
> $this->authnContextDecl->toXML($lO);
> j3:
821c821
< goto bj;
---
> goto gR;
823,825c823,825
< Utilities::addString($Ht, "\x75\x72\x6e\x3a\157\x61\163\151\x73\72\x6e\141\155\145\x73\x3a\164\143\x3a\123\101\x4d\x4c\72\x32\x2e\60\72\x61\163\163\145\x72\x74\x69\157\x6e", "\x73\141\x6d\154\72\x41\165\164\150\x6e\x43\157\156\x74\145\170\x74\104\x65\143\154\x52\145\146", $this->authnContextDeclRef);
< bj:
< Utilities::addStrings($Ht, "\165\x72\x6e\x3a\x6f\x61\x73\151\163\72\x6e\x61\x6d\x65\163\72\164\x63\x3a\123\101\x4d\x4c\72\62\56\60\72\141\x73\x73\x65\x72\x74\x69\x6f\x6e", "\x73\141\155\x6c\x3a\101\165\x74\150\x65\x6e\x74\151\x63\x61\x74\x69\156\147\x41\x75\x74\x68\x6f\x72\x69\x74\171", FALSE, $this->AuthenticatingAuthority);
---
> Utilities::addString($lO, "\x75\162\156\72\157\141\163\151\163\72\156\141\x6d\x65\163\x3a\x74\143\x3a\123\101\x4d\114\x3a\x32\x2e\60\x3a\x61\163\163\145\x72\164\x69\x6f\x6e", "\163\141\x6d\x6c\72\101\165\x74\x68\156\x43\x6f\156\x74\145\170\164\x44\145\x63\154\x52\x65\x66", $this->authnContextDeclRef);
> gR:
> Utilities::addStrings($lO, "\x75\x72\x6e\x3a\x6f\x61\x73\151\x73\72\x6e\x61\x6d\145\x73\x3a\x74\x63\x3a\123\101\115\114\72\x32\56\60\72\x61\163\163\145\x72\x74\x69\157\156", "\x73\x61\x6d\154\72\101\x75\x74\x68\145\156\164\x69\x63\141\x74\151\x6e\147\101\x75\164\x68\x6f\162\x69\x74\x79", FALSE, $this->AuthenticatingAuthority);
827c827
< private function addAttributeStatement(DOMElement $rZ)
---
> private function addAttributeStatement(DOMElement $bF)
830c830
< goto UI;
---
> goto Pm;
833,891c833,891
< UI:
< $Ej = $rZ->ownerDocument;
< $if = $Ej->createElementNS("\165\x72\x6e\x3a\x6f\x61\x73\151\163\x3a\x6e\x61\155\145\163\72\164\143\x3a\123\101\x4d\114\x3a\x32\56\x30\72\141\x73\163\145\162\164\x69\157\156", "\x73\x61\155\154\x3a\101\164\x74\162\151\x62\x75\164\145\x53\x74\141\x74\x65\x6d\x65\x6e\164");
< $rZ->appendChild($if);
< foreach ($this->attributes as $SS => $Wj) {
< $IB = $Ej->createElementNS("\x75\162\x6e\72\x6f\141\x73\x69\163\x3a\x6e\x61\155\x65\x73\x3a\x74\143\x3a\123\x41\x4d\114\x3a\62\56\x30\x3a\x61\x73\x73\x65\x72\164\x69\157\x6e", "\163\x61\x6d\x6c\72\101\x74\164\x72\151\x62\165\164\x65");
< $if->appendChild($IB);
< $IB->setAttribute("\x4e\141\155\145", $SS);
< if (!($this->nameFormat !== "\165\x72\x6e\x3a\157\x61\163\x69\x73\72\156\141\155\145\x73\x3a\164\143\x3a\123\x41\115\114\72\x32\x2e\x30\72\141\x74\164\162\156\141\155\145\55\x66\157\162\x6d\141\x74\x3a\x75\156\x73\160\145\143\151\146\151\x65\x64")) {
< goto ec;
< }
< $IB->setAttribute("\x4e\141\x6d\145\x46\157\162\x6d\x61\164", $this->nameFormat);
< ec:
< foreach ($Wj as $rE) {
< if (is_string($rE)) {
< goto y4;
< }
< if (is_int($rE)) {
< goto gc;
< }
< $Ak = NULL;
< goto H9;
< y4:
< $Ak = "\170\163\x3a\163\164\x72\151\x6e\147";
< goto H9;
< gc:
< $Ak = "\170\x73\x3a\151\156\164\x65\147\145\x72";
< H9:
< $TQ = $Ej->createElementNS("\x75\x72\156\72\x6f\141\163\151\163\x3a\x6e\x61\x6d\x65\163\x3a\164\143\72\123\x41\x4d\114\x3a\x32\x2e\60\x3a\x61\163\163\145\162\x74\x69\157\156", "\x73\141\155\154\x3a\x41\x74\164\x72\151\x62\165\164\145\x56\x61\154\x75\x65");
< $IB->appendChild($TQ);
< if (!($Ak !== NULL)) {
< goto MD;
< }
< $TQ->setAttributeNS("\150\164\164\160\72\x2f\57\x77\x77\x77\x2e\x77\x33\x2e\157\162\x67\x2f\x32\60\60\x31\x2f\x58\115\114\123\x63\150\145\x6d\141\55\x69\x6e\x73\x74\141\x6e\143\145", "\x78\x73\151\x3a\x74\171\160\x65", $Ak);
< MD:
< if (!is_null($rE)) {
< goto k3;
< }
< $TQ->setAttributeNS("\150\164\164\x70\72\57\x2f\x77\x77\x77\56\167\63\56\157\x72\147\x2f\x32\x30\x30\61\57\130\x4d\x4c\123\143\150\145\x6d\x61\x2d\x69\x6e\163\x74\x61\156\x63\x65", "\170\163\x69\72\156\x69\x6c", "\164\x72\165\x65");
< k3:
< if ($rE instanceof DOMNodeList) {
< goto Vj;
< }
< $TQ->appendChild($Ej->createTextNode($rE));
< goto li;
< Vj:
< $Eo = 0;
< ib:
< if (!($Eo < $rE->length)) {
< goto pp;
< }
< $HF = $Ej->importNode($rE->item($Eo), TRUE);
< $TQ->appendChild($HF);
< ZS:
< $Eo++;
< goto ib;
< pp:
< li:
< rE:
---
> Pm:
> $nD = $bF->ownerDocument;
> $ev = $nD->createElementNS("\x75\x72\x6e\72\x6f\x61\x73\151\x73\x3a\156\x61\155\145\x73\x3a\164\x63\x3a\123\101\115\x4c\x3a\62\x2e\60\x3a\141\x73\x73\x65\162\x74\x69\157\x6e", "\163\x61\x6d\x6c\x3a\101\x74\164\162\151\x62\165\164\x65\x53\x74\141\164\145\155\x65\156\x74");
> $bF->appendChild($ev);
> foreach ($this->attributes as $l2 => $tm) {
> $nK = $nD->createElementNS("\x75\162\156\72\x6f\x61\x73\151\x73\72\156\x61\155\145\x73\x3a\x74\x63\72\123\x41\115\114\72\x32\56\x30\x3a\141\163\x73\145\x72\x74\151\157\x6e", "\x73\x61\155\x6c\72\x41\164\x74\162\x69\142\x75\164\145");
> $ev->appendChild($nK);
> $nK->setAttribute("\116\141\x6d\145", $l2);
> if (!($this->nameFormat !== "\165\x72\156\x3a\157\141\163\x69\x73\x3a\x6e\141\x6d\145\163\x3a\x74\143\72\123\x41\x4d\x4c\72\62\56\x30\x3a\141\x74\164\162\x6e\x61\x6d\145\x2d\146\x6f\x72\155\x61\164\x3a\x75\x6e\163\x70\145\143\151\x66\x69\x65\x64")) {
> goto Kd;
> }
> $nK->setAttribute("\116\x61\155\x65\x46\157\x72\155\141\x74", $this->nameFormat);
> Kd:
> foreach ($tm as $ND) {
> if (is_string($ND)) {
> goto dE;
> }
> if (is_int($ND)) {
> goto HQ;
> }
> $rV = NULL;
> goto pR;
> dE:
> $rV = "\170\x73\x3a\163\164\x72\x69\x6e\147";
> goto pR;
> HQ:
> $rV = "\170\x73\x3a\x69\156\x74\145\147\145\162";
> pR:
> $dX = $nD->createElementNS("\165\x72\x6e\72\x6f\141\163\151\x73\72\156\141\x6d\x65\x73\72\164\143\x3a\x53\101\115\114\72\x32\56\60\72\141\163\163\145\162\x74\151\x6f\x6e", "\163\x61\x6d\154\x3a\x41\164\x74\x72\x69\142\165\x74\145\x56\141\x6c\x75\x65");
> $nK->appendChild($dX);
> if (!($rV !== NULL)) {
> goto Kr;
> }
> $dX->setAttributeNS("\x68\x74\x74\160\x3a\x2f\57\167\167\167\x2e\x77\x33\x2e\157\x72\x67\57\x32\x30\x30\x31\57\x58\115\114\123\x63\x68\145\155\141\55\151\x6e\x73\x74\141\x6e\143\145", "\x78\x73\151\72\x74\171\160\145", $rV);
> Kr:
> if (!is_null($ND)) {
> goto pY;
> }
> $dX->setAttributeNS("\150\164\x74\x70\x3a\57\57\x77\x77\x77\56\x77\x33\56\x6f\x72\147\x2f\62\x30\60\61\x2f\x58\115\114\123\143\x68\145\x6d\x61\55\x69\x6e\163\x74\x61\156\x63\145", "\x78\163\x69\72\156\151\x6c", "\164\162\165\145");
> pY:
> if ($ND instanceof DOMNodeList) {
> goto zU;
> }
> $dX->appendChild($nD->createTextNode($ND));
> goto IZ;
> zU:
> $Xc = 0;
> La:
> if (!($Xc < $ND->length)) {
> goto R0;
> }
> $Dx = $nD->importNode($ND->item($Xc), TRUE);
> $dX->appendChild($Dx);
> i6:
> $Xc++;
> goto La;
> R0:
> IZ:
> MZ:
893,894c893,894
< DI:
< ss:
---
> m_:
> dw:
896c896
< p2:
---
> CO:
898c898
< private function addEncryptedAttributeStatement(DOMElement $rZ)
---
> private function addEncryptedAttributeStatement(DOMElement $bF)
901c901
< goto rW;
---
> goto UB;
904,972c904,972
< rW:
< $Ej = $rZ->ownerDocument;
< $if = $Ej->createElementNS("\x75\x72\156\x3a\x6f\141\x73\151\163\x3a\156\x61\x6d\x65\163\x3a\164\143\x3a\x53\x41\x4d\114\x3a\x32\x2e\x30\72\141\163\163\145\162\164\151\157\x6e", "\163\x61\155\154\x3a\101\164\x74\162\151\x62\x75\x74\x65\123\x74\x61\164\x65\x6d\x65\x6e\164");
< $rZ->appendChild($if);
< foreach ($this->attributes as $SS => $Wj) {
< $e1 = new DOMDocument();
< $IB = $e1->createElementNS("\165\162\x6e\72\157\x61\x73\x69\163\x3a\156\141\x6d\x65\163\x3a\164\143\72\x53\x41\x4d\x4c\x3a\x32\56\60\72\x61\163\163\145\162\x74\x69\x6f\x6e", "\163\x61\155\x6c\x3a\x41\x74\x74\162\151\x62\165\164\145");
< $IB->setAttribute("\116\141\x6d\x65", $SS);
< $e1->appendChild($IB);
< if (!($this->nameFormat !== "\x75\x72\156\x3a\157\x61\x73\x69\163\72\156\x61\155\x65\x73\x3a\x74\143\72\123\x41\115\x4c\72\x32\x2e\x30\72\x61\x74\164\162\x6e\x61\x6d\x65\55\x66\x6f\x72\x6d\x61\x74\x3a\165\x6e\163\160\145\x63\x69\x66\x69\x65\144")) {
< goto Xz;
< }
< $IB->setAttribute("\116\141\x6d\x65\106\x6f\x72\x6d\141\x74", $this->nameFormat);
< Xz:
< foreach ($Wj as $rE) {
< if (is_string($rE)) {
< goto bK;
< }
< if (is_int($rE)) {
< goto jm;
< }
< $Ak = NULL;
< goto Je;
< bK:
< $Ak = "\x78\163\72\x73\x74\x72\151\x6e\x67";
< goto Je;
< jm:
< $Ak = "\x78\x73\72\151\156\164\x65\x67\x65\x72";
< Je:
< $TQ = $e1->createElementNS("\165\x72\156\x3a\x6f\x61\x73\151\163\72\x6e\x61\x6d\145\163\72\x74\143\72\x53\x41\115\x4c\72\x32\x2e\60\72\141\163\163\145\x72\164\x69\157\x6e", "\163\x61\x6d\x6c\x3a\x41\164\164\x72\151\142\165\164\x65\126\141\x6c\x75\145");
< $IB->appendChild($TQ);
< if (!($Ak !== NULL)) {
< goto av;
< }
< $TQ->setAttributeNS("\150\164\164\x70\x3a\x2f\57\x77\x77\167\x2e\167\x33\x2e\157\x72\147\x2f\x32\x30\x30\x31\57\x58\x4d\114\123\x63\150\145\155\141\x2d\151\x6e\163\x74\141\x6e\143\x65", "\170\163\x69\72\x74\171\160\x65", $Ak);
< av:
< if ($rE instanceof DOMNodeList) {
< goto RL;
< }
< $TQ->appendChild($e1->createTextNode($rE));
< goto Aw;
< RL:
< $Eo = 0;
< qy:
< if (!($Eo < $rE->length)) {
< goto r1;
< }
< $HF = $e1->importNode($rE->item($Eo), TRUE);
< $TQ->appendChild($HF);
< fF:
< $Eo++;
< goto qy;
< r1:
< Aw:
< BU:
< }
< x1:
< $ha = new XMLSecEnc();
< $ha->setNode($e1->documentElement);
< $ha->type = "\150\164\x74\x70\x3a\x2f\57\167\167\167\56\x77\63\x2e\x6f\162\x67\57\x32\60\x30\61\57\60\64\x2f\x78\x6d\x6c\x65\156\x63\43\105\154\x65\x6d\x65\156\164";
< $Gg = new XMLSecurityKey(XMLSecurityKey::AES256_CBC);
< $Gg->generateSessionKey();
< $ha->encryptKey($this->encryptionKey, $Gg);
< $qM = $ha->encryptNode($Gg);
< $kw = $Ej->createElementNS("\165\162\x6e\72\157\141\163\x69\x73\72\x6e\141\155\145\x73\72\x74\143\72\123\x41\x4d\114\72\62\x2e\x30\72\x61\x73\163\145\x72\x74\x69\x6f\x6e", "\x73\141\x6d\154\x3a\105\156\x63\162\171\x70\164\145\x64\x41\x74\164\x72\x69\142\x75\x74\x65");
< $if->appendChild($kw);
< $dN = $Ej->importNode($qM, TRUE);
< $kw->appendChild($dN);
< JJ:
---
> UB:
> $nD = $bF->ownerDocument;
> $ev = $nD->createElementNS("\165\x72\156\x3a\157\141\163\151\x73\x3a\x6e\x