Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

public function createOrUpdateUser($pV) { $user = Utilities::fetchUserFromUs..

Decoded Output download

<?  public function createOrUpdateUser($pV) 
    { 
        $user = Utilities::fetchUserFromUsername($pV); 
        $XL = false; 
 
        /* EXTENDED - BEGIN */ 
        $this->checkForUserGroupToCreate(); //check and create user groups 
        /* EXTENDED - END */ 
 
        if ($user == false) { 
            goto Yb; 
        } 
        Utilities::log_php_error("USER EXISTS: ", $pV); 
        if (!($user["disable"] == 1)) { 
            goto x3; 
        } 
        Utilities::log_php_error("USER EXISTS BUT IS DISABLED", $pV); 
        exit("You are not allowed to login. Please contact your admin."); 
        x3: 
        $XL = true; 
        $As = GeneralUtility::makeInstance("TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository")->findByUid($user["uid"]); 
        goto Sx; 
        Yb: 
        Utilities::log_php_error("CREATING USER", $pV); 
        $As = new FrontendUser(); 
        $As->setUsername($pV); 
        $As->setPassword(SAMLUtilities::generateRandomAlphanumericValue(10)); 
        Sx: 
        $As->setEmail($this->attrsReceived[$this->amObject["saml_am_email"]]["0"]); 
        if (!(array_key_exists("saml_am_title", $this->amObject) && isset($this->attrsReceived[$this->amObject["saml_am_title"]]["0"]))) { 
            goto vw; 
        } 
        $As->setTitle($this->attrsReceived[$this->amObject["saml_am_title"]]["0"]); 
        vw: 
        if (!(array_key_exists("saml_am_fname", $this->amObject) && isset($this->attrsReceived[$this->amObject["saml_am_fname"]]["0"]))) { 
            goto h8; 
        } 
        $As->setFirstName($this->attrsReceived[$this->amObject["saml_am_fname"]]["0"]); 
        h8: 
        if (!(array_key_exists("saml_am_lname", $this->amObject) && isset($this->attrsReceived[$this->amObject["saml_am_lname"]]["0"]))) { 
            goto sP; 
        } 
        $As->setLastName($this->attrsReceived[$this->amObject["saml_am_lname"]]["0"]); 
        sP: 
        if (!(array_key_exists("saml_am_address", $this->amObject) && isset($this->attrsReceived[$this->amObject["saml_am_address"]]["0"]))) { 
            goto a2; 
        } 
        $As->setAddress($this->attrsReceived[$this->amObject["saml_am_address"]]["0"]); 
        a2: 
        if (!(array_key_exists("saml_am_country", $this->amObject) && isset($this->attrsReceived[$this->amObject["saml_am_country"]]["0"]))) { 
            goto LJ; 
        } 
        $As->setCountry($this->attrsReceived[$this->amObject["saml_am_country"]]["0"]); 
        LJ: 
        if (!(array_key_exists("saml_am_city", $this->amObject) && isset($this->attrsReceived[$this->amObject["saml_am_city"]]["0"]))) { 
            goto iU; 
        } 
        $As->setCity($this->attrsReceived[$this->amObject["saml_am_city"]]["0"]); 
        iU: 
        if (!(array_key_exists("saml_am_zip", $this->amObject) && isset($this->attrsReceived[$this->amObject["saml_am_zip"]]["0"]))) { 
            goto XR; 
        } 
        $As->setZip($this->attrsReceived[$this->amObject["saml_am_zip"]]["0"]); 
        XR: 
        if (!(array_key_exists("saml_am_phone", $this->amObject) && isset($this->attrsReceived[$this->amObject["saml_am_phone"]]["0"]))) { 
            goto Mi; 
        } 
        $As->setTelephone($this->attrsReceived[$this->amObject["saml_am_phone"]]["0"]); 
        Mi: 
        error_log("frontend user: " . print_r($As, true)); 
        Utilities::updateTable("usergroup", null, "fe_users"); 
 
        /* EXTENDED - BEGIN */ 
        /* USER GROUP HANDLING - IGNORE - WE DONT NEED THIS BECAUSE WE WANT IT DYNAMICALLY 
        /*$io = json_decode(self::fetchFromTable(Constants::SAML_GMOBJECT, Constants::TABLE_SAML), true); //GROUP MAPPING ARRAY - WE DONT NEED THIS BECAUSE WE WANT IT DYNAMICALLY 
        $r4 = $this->amObject[Constants::ATTRIBUTE_GROUPS]; 
        /*Utilities::log_php_error("groupAttribute", $r4); 
        if ($r4 == '' || !isset($r4)) { 
            goto E1; 
        } 
        error_log("Group Attribute Mapped."); 
        if (!isset($this->attrsReceived[$r4])) { 
            goto qG; 
        } 
        $K7 = $this->attrsReceived[$r4]; 
        qG: 
        $hH = 0; 
        if (!isset($K7)) { 
            goto mv; 
        } 
        Utilities::log_php_error("groupsReceived", print_r($K7, true)); 
        if (sizeof($K7) > 0) { 
            goto UC; 
        } 
        error_log("Groups not received. Either mapping is wrong or IDP is not sending it. \xa                    \xaRemove attribute mapping for groups to set default group"); 
        exit("Groups not assigned. Please contact your admin."); 
        goto Qy; 
        UC: 
        error_log("Group Attribute received from IDP"); 
        Utilities::log_php_error("GROUPS RECEIVED: UPDATING ", $pV); 
        Utilities::log_php_error("GROUPS RECEIVED:  ", $K7); 
        Utilities::log_php_error("gmObject:  ", $io);*/ 
        /*foreach ($K7 as $XV) { 
            $g8 = array_search($XV, $io); 
            Utilities::log_php_error("mappedTypo3Group ", $g8); 
            if (!$g8) { 
                goto b_; 
            } 
            error_log("Typo3 group mapped"); 
            $Jr = GeneralUtility::makeInstance("TYPO3\CMS\Extbase\Domain\Repository\FrontendUserGroupRepository")->findByUid($g8); 
            $As->addUsergroup($Jr); 
            $hH++; 
            b_: 
            Yt: 
        } 
        EI: 
        Qy: 
        mv: 
        if (isset($hH) && $hH == 0) { 
            goto fh; 
        } 
        goto Bz; 
        fh: 
        error_log("No groups received is assigned to User. So assigning Default Group."); 
        $g8 = $io["defaultUserGroup"]; 
        Utilities::log_php_error("Assigning DEFAULT group to user: ", $g8); 
        if ($g8) { 
            goto T8; 
        } 
        exit("Unable to assign user to default group. Please contact your admin." . $g8); 
        T8: 
        // WANTS TO ADD DEFAULT GROUP  
        $sS = Utilities::fetchUidFromGroupName($g8); 
        $Jr = GeneralUtility::makeInstance("TYPO3\CMS\Extbase\Domain\Repository\FrontendUserGroupRepository")->findByUid($sS); 
        $As->addUsergroup($Jr); 
        Bz: 
        goto YN; 
        E1: 
        error_log("GroupAttribute not mapped in Attribute Mapping Tab."); 
        if ($XL) { 
            goto Fk; 
        } 
        error_log("New User: Assigning Default Group."); 
        $g8 = $io["defaultUserGroup"]; 
        Utilities::log_php_error("Assigning DEFAULT group to user: ", $g8); 
        if ($g8) { 
            goto SK; 
        } 
        exit("Unable to assign user to default group. Please contact your admin." . $g8); 
        SK: 
        $sS = Utilities::fetchUidFromGroupName($g8); 
        $Jr = GeneralUtility::makeInstance("TYPO3\CMS\Extbase\Domain\Repository\FrontendUserGroupRepository")->findByUid($sS); 
        error_log("userGroup assigned will be: " . print_r($Jr)); 
        $As->addUsergroup($Jr); 
        Fk: 
        YN: 
        if ($XL) { 
            goto Hq; 
        } 
        $this->frontendUserRepository = GeneralUtility::makeInstance("TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository")->add($As); 
        goto jt; 
        Hq: 
        $this->frontendUserRepository = GeneralUtility::makeInstance("TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository")->update($As); 
        jt:*/ 
        /* EXTENDED - END */ 
 
 
        /* EXTENDED - BEGIN */ 
        $roleUids = []; 
        if(array_key_exists("Role",$this->attrsReceived)){ 
            if(!empty($this->attrsReceived['Role'])){ 
                foreach($this->attrsReceived['Role'] as $roleName){ 
                    /* --- Fetch Role UIDs --- */ 
                    $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('fe_groups'); 
                    $roleUid = $queryBuilder 
                       ->select('uid') 
                       ->from('fe_groups') 
                       ->where( 
                          $queryBuilder->expr()->eq('title', $queryBuilder->createNamedParameter($roleName)) 
                       ) 
                       ->execute()->fetchColumn(0); 
         
                    $roleUids[] = $roleUid; 
                    /* --- Fetch Role UIDs -- END --- */  
                } 
            } 
        } 
        $io = json_decode(self::fetchFromTable(Constants::SAML_GMOBJECT, Constants::TABLE_SAML), true); //GROUP MAPPING ARRAY 
        $frontendUserGroupRepository = GeneralUtility::makeInstance("TYPO3\CMS\Extbase\Domain\Repository\FrontendUserGroupRepository"); 
        if($roleUids){ 
            foreach($roleUids as $userGroupUid){ 
                $As->addUsergroup($frontendUserGroupRepository->findByUid($userGroupUid));   
            } 
        }else{ 
            $As->addUsergroup($frontendUserGroupRepository->findByUid(Utilities::fetchUidFromGroupName($io['defaultUserGroup']))); //Set the given defaultUserGroup (default-saml-user-group-v11) 
        }  
 
        if($As->getUid()){ 
            $this->frontendUserRepository = GeneralUtility::makeInstance("TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository")->update($As); 
        }else{ 
            $this->frontendUserRepository = GeneralUtility::makeInstance("TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository")->add($As); 
        } 
        /* EXTENDED - END */ 
         
        $this->persistenceManager = GeneralUtility::makeInstance("TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager")->persistAll(); 
        $ws = json_decode(self::fetchFromTable(Constants::SAML_CUSTOM_ATTROBJECT, Constants::TABLE_SAML), true); 
        if (!(isset($ws) or !empty($ws))) { 
            goto kX; 
        } 
        unset($ws["option"]); 
        $ja = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(Constants::TABLE_FE_USERS); 
        $AE = $ja->createNamedParameter($As->getUid(), PDO::PARAM_INT); 
        if (!(count($ws) > 0)) { 
            goto jw; 
        } 
        foreach ($ws as $bu => $Mc) { 
            $ja->update(Constants::TABLE_FE_USERS)->where($ja->expr()->eq("uid", $AE))->set($bu, $this->attrsReceived[$Mc]["0"])->execute(); 
            hq: 
        } 
        QS: 
        jw: 
        kX: 
        $user = Utilities::fetchUserFromUsername($pV); 
        return $user; 
    } ?>

Did this file decode correctly?

Original Code

public function createOrUpdateUser($pV)
    {
        $user = Utilities::fetchUserFromUsername($pV);
        $XL = false;

        /* EXTENDED - BEGIN */
        $this->checkForUserGroupToCreate(); //check and create user groups
        /* EXTENDED - END */

        if ($user == false) {
            goto Yb;
        }
        Utilities::log_php_error("\125\x53\105\x52\x20\x45\130\x49\123\124\123\72\x20", $pV);
        if (!($user["\x64\x69\163\141\142\x6c\x65"] == 1)) {
            goto x3;
        }
        Utilities::log_php_error("\125\123\x45\122\x20\x45\130\111\123\124\123\40\102\x55\x54\40\x49\123\x20\x44\x49\x53\x41\x42\x4c\105\104", $pV);
        exit("\x59\157\165\x20\x61\x72\145\40\x6e\x6f\x74\x20\141\x6c\154\157\x77\x65\x64\40\164\x6f\40\154\157\147\x69\x6e\56\40\120\x6c\145\141\163\x65\40\x63\x6f\x6e\164\x61\143\164\40\x79\x6f\x75\x72\x20\x61\x64\155\151\156\56");
        x3:
        $XL = true;
        $As = GeneralUtility::makeInstance("\124\131\120\117\x33\x5c\103\x4d\x53\x5c\x45\170\164\x62\141\163\x65\x5c\x44\157\x6d\x61\151\156\134\x52\145\160\x6f\x73\151\x74\157\x72\171\134\x46\162\x6f\156\164\x65\156\144\125\163\x65\162\122\145\160\157\x73\151\x74\157\x72\171")->findByUid($user["\165\x69\144"]);
        goto Sx;
        Yb:
        Utilities::log_php_error("\x43\122\105\x41\124\x49\x4e\107\x20\125\x53\105\122", $pV);
        $As = new FrontendUser();
        $As->setUsername($pV);
        $As->setPassword(SAMLUtilities::generateRandomAlphanumericValue(10));
        Sx:
        $As->setEmail($this->attrsReceived[$this->amObject["\163\141\155\x6c\x5f\141\155\x5f\145\x6d\x61\151\x6c"]]["\60"]);
        if (!(array_key_exists("\x73\x61\155\154\137\x61\155\x5f\x74\x69\x74\154\x65", $this->amObject) && isset($this->attrsReceived[$this->amObject["\163\x61\x6d\154\137\141\155\x5f\x74\151\164\154\145"]]["\60"]))) {
            goto vw;
        }
        $As->setTitle($this->attrsReceived[$this->amObject["\163\x61\x6d\x6c\137\141\155\x5f\164\151\x74\154\145"]]["\60"]);
        vw:
        if (!(array_key_exists("\x73\x61\155\x6c\x5f\141\x6d\137\x66\156\141\155\x65", $this->amObject) && isset($this->attrsReceived[$this->amObject["\x73\141\155\x6c\137\141\x6d\137\146\156\x61\x6d\x65"]]["\60"]))) {
            goto h8;
        }
        $As->setFirstName($this->attrsReceived[$this->amObject["\x73\141\155\x6c\137\x61\x6d\x5f\146\156\141\x6d\x65"]]["\x30"]);
        h8:
        if (!(array_key_exists("\x73\x61\x6d\154\137\141\155\137\154\156\141\x6d\x65", $this->amObject) && isset($this->attrsReceived[$this->amObject["\x73\x61\x6d\154\137\x61\155\137\154\x6e\x61\155\x65"]]["\x30"]))) {
            goto sP;
        }
        $As->setLastName($this->attrsReceived[$this->amObject["\163\141\155\x6c\137\141\x6d\137\154\x6e\x61\155\145"]]["\x30"]);
        sP:
        if (!(array_key_exists("\163\141\x6d\x6c\137\141\x6d\137\141\x64\x64\x72\x65\x73\163", $this->amObject) && isset($this->attrsReceived[$this->amObject["\163\141\x6d\x6c\137\x61\155\137\x61\144\x64\162\x65\163\163"]]["\x30"]))) {
            goto a2;
        }
        $As->setAddress($this->attrsReceived[$this->amObject["\x73\141\155\x6c\137\x61\x6d\x5f\x61\144\x64\x72\145\163\163"]]["\60"]);
        a2:
        if (!(array_key_exists("\163\141\x6d\154\137\141\x6d\x5f\x63\x6f\165\156\164\x72\171", $this->amObject) && isset($this->attrsReceived[$this->amObject["\x73\x61\x6d\x6c\x5f\x61\x6d\x5f\143\x6f\165\156\x74\162\x79"]]["\60"]))) {
            goto LJ;
        }
        $As->setCountry($this->attrsReceived[$this->amObject["\x73\141\x6d\154\x5f\141\x6d\137\x63\157\x75\156\164\162\x79"]]["\x30"]);
        LJ:
        if (!(array_key_exists("\163\x61\155\154\137\x61\155\x5f\x63\x69\x74\x79", $this->amObject) && isset($this->attrsReceived[$this->amObject["\163\141\x6d\x6c\x5f\x61\x6d\137\143\151\164\x79"]]["\x30"]))) {
            goto iU;
        }
        $As->setCity($this->attrsReceived[$this->amObject["\x73\x61\x6d\x6c\137\x61\155\137\x63\151\164\x79"]]["\60"]);
        iU:
        if (!(array_key_exists("\163\x61\155\154\137\141\155\137\x7a\151\160", $this->amObject) && isset($this->attrsReceived[$this->amObject["\163\141\x6d\154\137\x61\x6d\x5f\x7a\151\160"]]["\x30"]))) {
            goto XR;
        }
        $As->setZip($this->attrsReceived[$this->amObject["\x73\x61\155\x6c\x5f\x61\155\x5f\172\151\x70"]]["\60"]);
        XR:
        if (!(array_key_exists("\163\x61\x6d\154\x5f\x61\155\x5f\x70\x68\x6f\x6e\145", $this->amObject) && isset($this->attrsReceived[$this->amObject["\x73\x61\x6d\154\137\x61\155\x5f\x70\x68\x6f\156\x65"]]["\x30"]))) {
            goto Mi;
        }
        $As->setTelephone($this->attrsReceived[$this->amObject["\x73\x61\155\154\137\x61\155\x5f\160\150\157\156\145"]]["\x30"]);
        Mi:
        error_log("\146\x72\x6f\156\x74\x65\156\x64\x20\165\163\x65\162\x3a\x20" . print_r($As, true));
        Utilities::updateTable("\x75\x73\145\x72\147\162\157\x75\x70", null, "\x66\145\137\165\163\145\162\x73");

        /* EXTENDED - BEGIN */
        /* USER GROUP HANDLING - IGNORE - WE DONT NEED THIS BECAUSE WE WANT IT DYNAMICALLY
        /*$io = json_decode(self::fetchFromTable(Constants::SAML_GMOBJECT, Constants::TABLE_SAML), true); //GROUP MAPPING ARRAY - WE DONT NEED THIS BECAUSE WE WANT IT DYNAMICALLY
        $r4 = $this->amObject[Constants::ATTRIBUTE_GROUPS];
        /*Utilities::log_php_error("\x67\162\157\x75\x70\x41\x74\164\162\151\x62\165\164\x65", $r4);
        if ($r4 == '' || !isset($r4)) {
            goto E1;
        }
        error_log("\107\x72\157\165\x70\x20\101\164\x74\x72\151\142\x75\x74\145\40\115\x61\160\x70\x65\144\x2e");
        if (!isset($this->attrsReceived[$r4])) {
            goto qG;
        }
        $K7 = $this->attrsReceived[$r4];
        qG:
        $hH = 0;
        if (!isset($K7)) {
            goto mv;
        }
        Utilities::log_php_error("\147\162\157\165\x70\163\x52\145\143\x65\151\166\145\x64", print_r($K7, true));
        if (sizeof($K7) > 0) {
            goto UC;
        }
        error_log("\x47\162\157\165\x70\x73\40\156\157\x74\x20\162\145\143\x65\x69\x76\145\x64\x2e\40\105\x69\164\x68\145\162\40\x6d\141\160\x70\x69\x6e\x67\40\151\163\x20\167\162\x6f\x6e\x67\x20\x6f\162\x20\x49\x44\x50\x20\x69\x73\40\x6e\x6f\164\40\163\145\x6e\144\151\x6e\x67\40\151\x74\x2e\40\xa\x20\40\40\x20\40\40\40\40\x20\x20\40\40\x20\x20\x20\x20\40\40\40\40\xa\122\145\x6d\x6f\166\145\40\141\164\164\x72\151\x62\x75\164\145\40\155\141\160\160\x69\x6e\147\x20\146\157\162\x20\147\162\x6f\165\x70\x73\40\x74\x6f\x20\163\x65\x74\40\144\145\x66\x61\165\x6c\x74\x20\147\162\157\165\160");
        exit("\107\162\157\x75\160\163\x20\x6e\157\x74\x20\x61\163\x73\151\x67\156\145\144\x2e\40\120\154\145\141\x73\145\40\143\157\156\x74\x61\143\164\40\x79\157\x75\162\40\141\144\x6d\x69\156\56");
        goto Qy;
        UC:
        error_log("\107\x72\x6f\165\160\x20\x41\164\164\x72\x69\142\x75\x74\145\40\x72\145\x63\x65\151\166\x65\144\40\146\162\x6f\x6d\40\111\104\x50");
        Utilities::log_php_error("\x47\122\x4f\125\x50\x53\40\122\x45\103\x45\111\126\105\104\72\x20\125\x50\x44\101\124\111\116\x47\40", $pV);
        Utilities::log_php_error("\107\122\117\125\120\x53\x20\122\105\103\x45\111\x56\105\x44\72\x20\x20", $K7);
        Utilities::log_php_error("\147\x6d\x4f\142\152\145\x63\164\72\x20\40", $io);*/
        /*foreach ($K7 as $XV) {
            $g8 = array_search($XV, $io);
            Utilities::log_php_error("\155\x61\x70\x70\145\x64\124\x79\x70\157\x33\107\162\157\165\x70\40", $g8);
            if (!$g8) {
                goto b_;
            }
            error_log("\124\171\160\157\x33\40\x67\x72\x6f\165\160\x20\155\141\160\x70\x65\x64");
            $Jr = GeneralUtility::makeInstance("\124\x59\120\117\63\134\x43\115\123\134\x45\x78\164\142\141\x73\x65\134\104\157\x6d\x61\151\156\134\122\x65\160\157\163\151\164\x6f\162\x79\x5c\x46\162\157\x6e\164\x65\x6e\144\125\x73\x65\162\107\x72\x6f\x75\160\x52\x65\x70\157\163\x69\164\x6f\x72\171")->findByUid($g8);
            $As->addUsergroup($Jr);
            $hH++;
            b_:
            Yt:
        }
        EI:
        Qy:
        mv:
        if (isset($hH) && $hH == 0) {
            goto fh;
        }
        goto Bz;
        fh:
        error_log("\116\x6f\40\x67\162\x6f\x75\x70\x73\x20\162\x65\x63\x65\151\166\145\x64\40\x69\163\40\x61\163\163\x69\147\x6e\x65\x64\x20\x74\x6f\x20\x55\163\x65\162\x2e\x20\123\157\x20\141\x73\163\x69\x67\156\x69\x6e\147\x20\x44\145\146\141\165\x6c\x74\40\107\162\x6f\x75\x70\x2e");
        $g8 = $io["\x64\x65\x66\x61\165\154\x74\125\163\145\162\107\x72\157\x75\160"];
        Utilities::log_php_error("\x41\x73\x73\x69\147\x6e\x69\x6e\147\40\104\105\x46\x41\x55\x4c\x54\x20\147\162\x6f\x75\160\x20\164\x6f\40\165\x73\x65\x72\x3a\40", $g8);
        if ($g8) {
            goto T8;
        }
        exit("\x55\156\141\x62\x6c\145\x20\x74\x6f\x20\x61\x73\x73\151\147\156\40\165\x73\145\162\x20\164\157\x20\144\x65\146\x61\x75\154\x74\40\147\162\x6f\x75\x70\x2e\40\x50\x6c\x65\x61\163\x65\40\143\x6f\x6e\x74\141\x63\164\40\171\x6f\x75\162\40\x61\x64\155\x69\x6e\56" . $g8);
        T8:
        // WANTS TO ADD DEFAULT GROUP 
        $sS = Utilities::fetchUidFromGroupName($g8);
        $Jr = GeneralUtility::makeInstance("\124\131\x50\x4f\x33\x5c\x43\115\x53\x5c\105\170\164\142\x61\163\x65\134\104\157\x6d\x61\x69\x6e\134\122\145\x70\x6f\x73\x69\x74\x6f\162\x79\134\106\162\157\x6e\164\x65\156\144\125\x73\145\162\x47\x72\x6f\x75\160\122\x65\x70\x6f\163\x69\x74\157\x72\x79")->findByUid($sS);
        $As->addUsergroup($Jr);
        Bz:
        goto YN;
        E1:
        error_log("\x47\162\157\x75\x70\101\164\x74\162\151\x62\x75\x74\x65\x20\x6e\x6f\x74\x20\x6d\141\160\160\145\144\x20\151\x6e\40\x41\x74\164\162\151\142\165\164\145\x20\115\141\x70\x70\x69\x6e\147\x20\x54\x61\142\56");
        if ($XL) {
            goto Fk;
        }
        error_log("\x4e\145\167\40\125\163\145\162\72\40\x41\x73\163\151\147\156\x69\x6e\147\40\104\145\x66\141\165\x6c\164\x20\x47\162\157\x75\160\x2e");
        $g8 = $io["\x64\x65\146\x61\x75\154\x74\125\163\145\162\x47\x72\157\165\x70"];
        Utilities::log_php_error("\x41\x73\163\x69\147\156\x69\156\147\x20\104\x45\106\101\125\x4c\124\40\147\x72\157\x75\160\x20\164\x6f\40\x75\x73\145\162\72\40", $g8);
        if ($g8) {
            goto SK;
        }
        exit("\125\x6e\x61\142\154\x65\x20\x74\157\40\141\163\163\151\x67\156\x20\165\x73\x65\x72\x20\164\157\40\x64\145\x66\x61\165\x6c\164\x20\147\x72\x6f\x75\160\x2e\x20\120\154\145\x61\x73\145\x20\143\157\156\164\x61\x63\164\x20\171\x6f\165\162\x20\x61\x64\x6d\x69\156\x2e" . $g8);
        SK:
        $sS = Utilities::fetchUidFromGroupName($g8);
        $Jr = GeneralUtility::makeInstance("\x54\x59\120\117\63\134\x43\x4d\123\134\105\x78\x74\142\141\163\145\x5c\104\157\155\141\x69\156\134\122\145\160\157\x73\x69\164\157\x72\x79\x5c\x46\x72\x6f\156\164\x65\x6e\x64\x55\163\145\x72\x47\x72\157\x75\x70\122\x65\x70\x6f\163\151\x74\157\x72\x79")->findByUid($sS);
        error_log("\x75\163\145\162\x47\162\x6f\x75\x70\x20\141\163\x73\151\x67\x6e\x65\144\x20\x77\151\154\x6c\x20\142\x65\72\x20" . print_r($Jr));
        $As->addUsergroup($Jr);
        Fk:
        YN:
        if ($XL) {
            goto Hq;
        }
        $this->frontendUserRepository = GeneralUtility::makeInstance("\124\x59\x50\x4f\x33\134\103\115\123\x5c\105\x78\164\142\141\x73\x65\x5c\x44\157\x6d\x61\x69\x6e\x5c\x52\x65\x70\x6f\x73\151\164\x6f\162\171\134\x46\x72\157\x6e\164\145\156\144\x55\163\145\x72\x52\x65\160\157\163\151\164\157\162\x79")->add($As);
        goto jt;
        Hq:
        $this->frontendUserRepository = GeneralUtility::makeInstance("\x54\x59\120\117\x33\134\x43\115\x53\134\x45\x78\164\x62\x61\x73\145\134\x44\x6f\155\141\151\x6e\134\122\x65\160\x6f\163\x69\x74\x6f\x72\171\134\x46\x72\x6f\156\164\x65\x6e\x64\125\163\145\x72\122\145\160\157\x73\151\164\157\x72\x79")->update($As);
        jt:*/
        /* EXTENDED - END */


        /* EXTENDED - BEGIN */
        $roleUids = [];
        if(array_key_exists("Role",$this->attrsReceived)){
            if(!empty($this->attrsReceived['Role'])){
                foreach($this->attrsReceived['Role'] as $roleName){
                    /* --- Fetch Role UIDs --- */
                    $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('fe_groups');
                    $roleUid = $queryBuilder
                       ->select('uid')
                       ->from('fe_groups')
                       ->where(
                          $queryBuilder->expr()->eq('title', $queryBuilder->createNamedParameter($roleName))
                       )
                       ->execute()->fetchColumn(0);
        
                    $roleUids[] = $roleUid;
                    /* --- Fetch Role UIDs -- END --- */ 
                }
            }
        }
        $io = json_decode(self::fetchFromTable(Constants::SAML_GMOBJECT, Constants::TABLE_SAML), true); //GROUP MAPPING ARRAY
        $frontendUserGroupRepository = GeneralUtility::makeInstance("TYPO3\CMS\Extbase\Domain\Repository\FrontendUserGroupRepository");
        if($roleUids){
            foreach($roleUids as $userGroupUid){
                $As->addUsergroup($frontendUserGroupRepository->findByUid($userGroupUid));  
            }
        }else{
            $As->addUsergroup($frontendUserGroupRepository->findByUid(Utilities::fetchUidFromGroupName($io['defaultUserGroup']))); //Set the given defaultUserGroup (default-saml-user-group-v11)
        } 

        if($As->getUid()){
            $this->frontendUserRepository = GeneralUtility::makeInstance("\x54\x59\120\117\x33\134\x43\115\x53\134\x45\x78\164\x62\x61\x73\145\134\x44\x6f\155\141\151\x6e\134\122\x65\160\x6f\163\x69\x74\x6f\x72\171\134\x46\x72\x6f\156\164\x65\x6e\x64\125\163\145\x72\122\145\160\157\x73\151\164\157\x72\x79")->update($As);
        }else{
            $this->frontendUserRepository = GeneralUtility::makeInstance("\124\x59\x50\x4f\x33\134\103\115\123\x5c\105\x78\164\142\141\x73\x65\x5c\x44\157\x6d\x61\x69\x6e\x5c\x52\x65\x70\x6f\x73\151\164\x6f\162\171\134\x46\x72\157\x6e\164\145\156\144\x55\163\145\x72\x52\x65\160\157\163\151\164\157\162\x79")->add($As);
        }
        /* EXTENDED - END */
        
        $this->persistenceManager = GeneralUtility::makeInstance("\124\x59\120\x4f\63\x5c\103\115\x53\134\105\170\164\142\141\163\x65\134\x50\145\x72\x73\151\x73\164\x65\156\x63\x65\x5c\107\145\x6e\x65\162\x69\143\134\x50\x65\x72\163\151\x73\164\x65\x6e\x63\x65\x4d\141\156\141\147\145\162")->persistAll();
        $ws = json_decode(self::fetchFromTable(Constants::SAML_CUSTOM_ATTROBJECT, Constants::TABLE_SAML), true);
        if (!(isset($ws) or !empty($ws))) {
            goto kX;
        }
        unset($ws["\x6f\x70\164\151\x6f\x6e"]);
        $ja = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(Constants::TABLE_FE_USERS);
        $AE = $ja->createNamedParameter($As->getUid(), PDO::PARAM_INT);
        if (!(count($ws) > 0)) {
            goto jw;
        }
        foreach ($ws as $bu => $Mc) {
            $ja->update(Constants::TABLE_FE_USERS)->where($ja->expr()->eq("\165\151\144", $AE))->set($bu, $this->attrsReceived[$Mc]["\x30"])->execute();
            hq:
        }
        QS:
        jw:
        kX:
        $user = Utilities::fetchUserFromUsername($pV);
        return $user;
    }

Function Calls

None

Variables

None

Stats

MD5 59d51cd395a2ab994c14c18cfe48b502
Eval Count 0
Decode Time 41 ms