[Flow] Beginner Questions
Steffen Wickham
steffen at gaming-inc.de
Mon Jan 13 16:45:37 CET 2014
Hello again Jan,
if you try to call your createAction() through your browser by typing in
the url directly (e.g. www.domain.com/vendor.package/controller/create)
you send a GET request to the server which is considered as "safe
request", which means that no data will be safed. Try adding the
following line between your add() and addFlashMessage() call and retry:
$this->persistenceManager->persistAll();
But handle with care! Don't use this way too much!
Greetings
Steffen
Am 13.01.14 16:33, schrieb Jan Herzog:
> 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');
> }
>
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
More information about the Flow
mailing list