/** * @param \TYPO3\FLOW3\Security\Account $account * @param array $password * @FLOW3\Validate(argumentName="password", type="\TYPO3\TYPO3\Validation\Validator\PasswordValidator", options={ "allowEmpty"=1, "minimum"=1, "maximum"=255 }) * @return void * @todo Handle validation errors for account (accountIdentifier) & check if there's another account with the same accountIdentifier when changing it * @todo Security */ public function updateAction(\TYPO3\FLOW3\Security\Account $account, array $password = array()) { $password = array_shift($password); if (strlen(trim(strval($password))) > 0) { $account->setCredentialsSource($this->hashService->hashPassword($password, 'default')); } $this->accountRepository->update($account); $this->partyRepository->update($account->getParty()); $this->addFlashMessage('The user profile has been updated.'); $this->redirect('index'); }
/** * @test */ public function setRolesHandlesStringValuesAsRole() { $account = new Account(); $account->setRoles(array($this->role1, 'role2')); $this->assertEquals(array($this->role1, $this->role2), $account->getRoles()); }