[Flow] Re: Beginner Questions

Jan Herzog Jan-christoph-herzog at gmx.net
Mon Jan 13 16:33:22 CET 2014


Hello Steffen,

first of all - thank you very much. Sadly i got a new Problem.
Ive been trying to add an new Account using the code below. I called the create action, and got the flash message. But i cant login, and cant find the user in database (typo3_flow_security_account is empty). I cant figure out where my problem is


    /**
     * @Flow\Inject
     * @var \TYPO3\Flow\Security\Authentication\AuthenticationManagerInterface
     */
    protected $authenticationManager;

    /**
     * @var \TYPO3\Flow\Security\AccountRepository
     * @Flow\Inject
     */
    protected $accountRepository;

    /**
     * @var \TYPO3\Flow\Security\AccountFactory
     * @Flow\Inject
     */
    protected $accountFactory;


    public function createAction()
    {
        $identifier = 'andi';
        $password = 'secret';
        $roles = array('Administrator');
        $authenticationProviderName = 'DefaultProvider';

        $account = $this->accountFactory->createAccountWithPassword($identifier, $password, $roles, $authenticationProviderName);
        $this->accountRepository->add($account);

        $this->addFlashMessage("test", "test");
        $this->redirect('index');
    }



More information about the Flow mailing list