I'm creating an extension for visitors to sign up to the page.
When signing up, it should create a FE user in the backend which is disabled (and will be manually enabled by an admin). So I'll need to set the disable
field to 1
when creating the FE user.
This is the function inside my controller:
/**
* action create
*
* @param \Vendor\FeReg\Domain\Model\Dummy $newDummy
* @return void
*/
public function createAction(\Vendor\FeReg\Domain\Model\Dummy $newDummy)
{
// vars
$title = $newDummy->getTitle();
$atitle = $newDummy->getAtitle();
$fname = $newDummy->getFname();
$lname = $newDummy->getLname();
$street = $newDummy->getStreet();
$city = $newDummy->getCity();
$post = $newDummy->getPost();
$phone = $newDummy->getPhone();
$fax = $newDummy->getFax();
$email = $newDummy->getEmail();
$org = $newDummy->getOrg();
$cat = $newDummy->getCat();
$field = $newDummy->getField();
$uname = $newDummy->getUname();
$ppass = $newDummy->getPpass();
$cpass = $newDummy->getCpass();
$fulltitle = ($atitle ? $title." ".$atitle : $title);
$frontendUser = new FrontendUser();
$frontendUser->setUsername($uname);
$frontendUser->setPassword($ppass);
$frontendUser->setFirstname($fname);
$frontendUser->setLastname($lname);
$frontendUser->setAddress($street);
$frontendUser->setTelephone($phone);
$frontendUser->setFax($fax);
$frontendUser->setEmail($email);
$frontendUser->setTitle($fulltitle);
$frontendUser->setZip($post);
$frontendUser->setCity($city);
$frontendUser->setCompany($org);
$this->frontendUserRepository->add($frontendUser);
// $this->dummyRepository->add($newDummy);
// $this->addFlashMessage($title, '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
$this->redirect('new');
}
To make this work I'm also loading the $frontendUserRepository
.
I need something like $frontendUser->setDisable(1)
.
Environment: TYPO3 7.6.8 / PHP 5.6.24 / mysqlnd 5.0.11