/** * Log user in * * @param User $user * @param $login * @throws IllegalObjectTypeException */ protected function loginPreflight(User $user, $login) { if ($login) { // persist user (otherwise login may not be possible) $this->userRepository->update($user); $this->persistenceManager->persistAll(); if ($this->config['new.']['login'] === '1') { UserUtility::login($user, $this->allConfig['persistence']['storagePid']); $this->addFlashMessage(LocalizationUtility::translate('login'), '', FlashMessage::NOTICE); } } }
/** * Validation for Unique in the db * * @param string $value * @param string $field Fieldname like "username" or "email" * @param User $user Existing User * @return \bool */ protected function validateUniqueDb($value, $field, User $user = null) { $foundUser = $this->userRepository->checkUniqueDb($field, $value, $user); return !is_object($foundUser); }