public function transformContent()
 {
     $form = $this->getForm('register');
     if ($form->isSent() && $form->isValid()) {
         $uM = $this->getManager();
         $user = new UmgtUser();
         $firstName = $form->getFormElementByName('firstname');
         $firstNameValue = $firstName->getValue();
         $user->setFirstName($firstNameValue);
         $lastName = $form->getFormElementByName('lastname');
         $lastNameValue = $lastName->getValue();
         $user->setLastName($lastNameValue);
         $street = $form->getFormElementByName('street');
         $user->setStreetName($street->getValue());
         $number = $form->getFormElementByName('number');
         $user->setStreetNumber($number->getValue());
         $zip = $form->getFormElementByName('zip');
         $user->setZIPCode($zip->getValue());
         $city = $form->getFormElementByName('city');
         $user->setCity($city->getValue());
         $email = $form->getFormElementByName('email');
         $user->setEMail($email->getValue());
         $userName = $form->getFormElementByName('username');
         $userNameValue = $userName->getValue();
         $user->setUsername($userNameValue);
         $password = $form->getFormElementByName('password');
         $user->setPassword($password->getValue());
         // assemble display name to have a more readable user within the umgt mgmt UI
         if (empty($firstNameValue) && empty($lastNameValue)) {
             $user->setDisplayName($userNameValue);
         } else {
             $user->setDisplayName($lastNameValue . ', ' . $firstNameValue);
         }
         // add initial groups and roles if applicable
         try {
             foreach ($this->getInitialGroups() as $initialGroup) {
                 $user->addGroup($initialGroup);
             }
             foreach ($this->getInitialRoles() as $initialRole) {
                 $user->addRole($initialRole);
             }
         } catch (ConfigurationException $e) {
             $l = Singleton::getInstance(Logger::class);
             /* @var $l Logger */
             $l->logEntry('registration', 'Registration cannot add initial groups or roles due to the following ' . 'exception: ' . $e . ' This may be ok, in case you have no initial groups and/or roles specified.', LogEntry::SEVERITY_INFO);
         }
         try {
             // Lets have a look if the username/email is always in use and show an error message
             try {
                 $config = $this->getConfiguration('APF\\modules\\usermanagement\\pres', 'login.ini');
                 $loginType = $config->getSection('Default')->getValue('login.type', 'username');
             } catch (ConfigurationException $e) {
                 $loginType = 'username';
             }
             if ($loginType === 'username') {
                 $regUser = $uM->loadUserByUserName($userNameValue);
             } else {
                 $regUser = $uM->loadUserByEMail($email->getValue());
             }
             if ($regUser === null) {
                 $uM->saveUser($user);
                 $this->getTemplate('register-ok')->transformOnPlace();
             } else {
                 $form->setPlaceHolder('register-error', $this->getTemplate('register-error-user-already-exists')->transformTemplate());
                 $form->transformOnPlace();
             }
         } catch (Exception $e) {
             $this->getTemplate('system-error')->transformOnPlace();
             $l = Singleton::getInstance(Logger::class);
             /* @var $l Logger */
             $l->logEntry('registration', 'Registration is not possible due to ' . $e, LogEntry::SEVERITY_ERROR);
         }
     } elseif ($form->isSent() && !$form->isValid()) {
         $form->setPlaceHolder('register-error', $this->getTemplate('register-error')->transformTemplate());
         $form->transformOnPlace();
     } else {
         $form->transformOnPlace();
     }
 }