application/models/bestitamazonpay4oxidloginclient.php
public function createOxidUser($oUserData)
    {
        $aFullName = explode(' ', trim($oUserData->name));
        $sLastName = array_pop($aFullName);
        $sFirstName = implode(' ', $aFullName);

        /** @var oxUser $oUser */
        $oUser = $this->getObjectFactory()->createOxidObject('oxUser');
        $oUser->assign(array(
            'oxregister' => 0,
            'oxshopid' => $this->getConfig()->getShopId(),
            'oxactive' => 1,
            'oxusername' => $oUserData->email,
            'oxfname' => $this->getAddressUtil()->encodeString($sFirstName),
            'oxlname' => $this->getAddressUtil()->encodeString($sLastName),
            'bestitamazonid' => $oUserData->user_id
        ));

        //Set user random password just to have it
        $sNewPass = substr(md5(time() . rand(0, 5000)), 0, 8);
        $oUser->setPassword($sNewPass);

        //Save all user data
        $blSuccess = $oUser->save();

        //Add user to two default OXID groups
        $oUser->addToGroup('oxidnewcustomer');
        $oUser->addToGroup('oxidnotyetordered');

        return $blSuccess;
    }
public function createOxidUser($oUserData)
    {
        $aFullName = explode(' ', trim($oUserData->name));
        $sLastName = array_pop($aFullName);
        $sFirstName = implode(' ', $aFullName);

        /** @var oxUser $oUser */
        $oUser = $this->getObjectFactory()->createOxidObject('oxUser');
        $oUser->assign(array(
            'oxregister' => 0,
            'oxshopid' => $this->getConfig()->getShopId(),
            'oxactive' => 1,
            'oxusername' => $oUserData->email,
            'oxfname' => $this->getAddressUtil()->encodeString($sFirstName),
            'oxlname' => $this->getAddressUtil()->encodeString($sLastName),
            'bestitamazonid' => $oUserData->user_id
        ));

        //Set user random password just to have it
        $sNewPass = substr(md5(time() . rand(0, 5000)), 0, 8);
        $oUser->setPassword($sNewPass);

        //Save all user data
        $blSuccess = $oUser->save();

        //Add user to two default OXID groups
        $oUser->addToGroup('oxidnewcustomer');
        $oUser->addToGroup('oxidnotyetordered');

        return $blSuccess;
    }
public function createOxidUser ( $ oUserData ) { $ aFullName = explode ( ' ' , trim ( $ oUserData -> name ) ) ; $ sLastName = array_pop ( $ aFullName ) ; $ sFirstName = implode ( ' ' , $ aFullName ) ; /** @var oxUser $oUser */ $ oUser = $ this -> getObjectFactory ( ) -> createOxidObject ( 'oxUser' ) ; $ oUser -> assign ( array ( 'oxregister' => 0 , 'oxshopid' => $ this -> getConfig ( ) -> getShopId ( ) , 'oxactive' => 1 , 'oxusername' => $ oUserData -> email , 'oxfname' => $ this -> getAddressUtil ( ) -> encodeString ( $ sFirstName ) , 'oxlname' => $ this -> getAddressUtil ( ) -> encodeString ( $ sLastName ) , 'bestitamazonid' => $ oUserData -> user_id ) ) ; //Set user random password just to have it $ sNewPass = substr ( md5 ( time ( ) . rand ( 0 , 5000 ) ) , 0 , 8 ) ; $ oUser -> setPassword ( $ sNewPass ) ; //Save all user data $ blSuccess = $ oUser -> save ( ) ; //Add user to two default OXID groups $ oUser -> addToGroup ( 'oxidnewcustomer' ) ; $ oUser -> addToGroup ( 'oxidnotyetordered' ) ; return $ blSuccess ; }
Create new oxid user with details from Amazon

@var stdClass $oUserData

@return boolean
@throws oxSystemComponentException
Create new oxid user with details from Amazon