Classes/Controller/RegistrationController.php
protected function createTemporaryAccount($accountIdentifier, $password, $firstName, $lastName)
    {
        if (strlen($firstName) === 0 && strlen($lastName) === 0) {
            $firstName = 'Santa';
            $lastName = 'Claus';
        }

        $user = new User();
        $user->setName(new PersonName('', $firstName, '', $lastName));
        $user->getPreferences()->set('context.workspace', 'user-' . $accountIdentifier);
        $this->partyRepository->add($user);

        $account = $this->accountFactory->createAccountWithPassword($accountIdentifier, $password, array('Neos.Neos:Editor'), 'Neos.Neos:Backend');
        $this->partyService->assignAccountToParty($account, $user);
        $account->setExpirationDate(new \DateTime('+1 week'));

        $this->accountRepository->add($account);
    }
protected function createTemporaryAccount($accountIdentifier, $password, $firstName, $lastName)
    {
        if (strlen($firstName) === 0 && strlen($lastName) === 0) {
            $firstName = 'Santa';
            $lastName = 'Claus';
        }

        $user = new User();
        $user->setName(new PersonName('', $firstName, '', $lastName));
        $user->getPreferences()->set('context.workspace', 'user-' . $accountIdentifier);
        $this->partyRepository->add($user);

        $account = $this->accountFactory->createAccountWithPassword($accountIdentifier, $password, array('Neos.Neos:Editor'), 'Neos.Neos:Backend');
        $this->partyService->assignAccountToParty($account, $user);
        $account->setExpirationDate(new \DateTime('+1 week'));

        $this->accountRepository->add($account);
    }
protected function createTemporaryAccount ( $ accountIdentifier , $ password , $ firstName , $ lastName ) { if ( strlen ( $ firstName ) === 0 && strlen ( $ lastName ) === 0 ) { $ firstName = 'Santa' ; $ lastName = 'Claus' ; } $ user = new User ( ) ; $ user -> setName ( new PersonName ( '' , $ firstName , '' , $ lastName ) ) ; $ user -> getPreferences ( ) -> set ( 'context.workspace' , 'user-' . $ accountIdentifier ) ; $ this -> partyRepository -> add ( $ user ) ; $ account = $ this -> accountFactory -> createAccountWithPassword ( $ accountIdentifier , $ password , array ( 'Neos.Neos:Editor' ) , 'Neos.Neos:Backend' ) ; $ this -> partyService -> assignAccountToParty ( $ account , $ user ) ; $ account -> setExpirationDate ( new \ DateTime ( '+1 week' ) ) ; $ this -> accountRepository -> add ( $ account ) ; }
Creates a temporary account

@param string $accountIdentifier
@param string $password
@param string $firstName
@param string $lastName
@return Account
Creates a temporary account