Exemple #1
0
 /**
  * Return current logged in fe_user
  *
  * @return User
  */
 public function getCurrentUser()
 {
     if (!is_array($GLOBALS['TSFE']->fe_user->user)) {
         return NULL;
     }
     return $this->userRepository->findByUid($GLOBALS['TSFE']->fe_user->user['uid']);
 }
 /**
  * Prefix method to updateAction()
  * 		Update Confirmation from Admin is not necessary
  *
  * @param \In2\Femanager\Domain\Model\User $user
  * @return void
  */
 public function updateAllConfirmed(User $user)
 {
     // send notify email to admin
     if ($this->settings['edit']['notifyAdmin']) {
         $existingUser = $this->userRepository->findByUid($user->getUid());
         $dirtyProperties = Div::getDirtyPropertiesFromObject($existingUser, $user);
         $this->div->sendEmail('updateNotify', Div::makeEmailArray($this->settings['edit']['notifyAdmin'], $this->settings['edit']['email']['notifyAdmin']['receiver']['name']['value']), Div::makeEmailArray($user->getEmail(), $user->getUsername()), 'Profile update', array('user' => $user, 'changes' => $dirtyProperties, 'settings' => $this->settings), $this->config['edit.']['email.']['notifyAdmin.']);
     }
     // persist
     $this->userRepository->update($user);
     $this->persistenceManager->persistAll();
     $this->signalSlotDispatcher->dispatch(__CLASS__, __FUNCTION__ . 'AfterPersist', array($user, $this));
     $this->div->log(LocalizationUtility::translate('tx_femanager_domain_model_log.state.201', 'femanager'), 201, $user);
     $this->redirectByAction('edit');
     $this->flashMessageContainer->add(LocalizationUtility::translate('update', 'femanager'));
 }