Ejemplo n.º 1
0
 public function getAuthorEmail()
 {
     if (null === $this->author) {
         return $this->author_email;
     }
     return $this->author->getEmail();
 }
Ejemplo n.º 2
0
 public function isEqualTo(UserInterface $user)
 {
     if (!$user instanceof LdapUser || $user->getUsername() !== $this->username || $user->getEmail() !== $this->email || count(array_diff($user->getRoles(), $this->roles)) > 0 || $user->getDn() !== $this->dn) {
         return false;
     }
     return true;
 }
 public function authorizeUser(UserInterface $authenticatedUser)
 {
     $user = $this->userManager->findUserByEmail($authenticatedUser->getEmail());
     if (null == $user) {
         throw new FailureAuthorizedException(401, "XSolve Google Auth couldn't authorize user. User doesn't exists");
     }
     return $user;
 }
Ejemplo n.º 4
0
 /**
  * @param UserInterface $user
  * @return VanillaUser
  */
 public function createVanillaUser(UserInterface $user)
 {
     /** @var $user \FOS\UserBundle\Model\User */
     $vanillaUser = new VanillaUser($user->getUsername());
     $vanillaUser->setEmail($user->getEmail());
     if ($user->isSuperAdmin()) {
         $vanillaUser->setRoles([VanillaUser::ROLE_MEMBER, VanillaUser::ROLE_ADMINISTRATOR]);
     }
     return $vanillaUser;
 }
Ejemplo n.º 5
0
 public function notifyLateEmployee(UserInterface $user, Schedule $schedule)
 {
     $supervisors = $user->getSupervisors();
     foreach ($supervisors as $supervisor) {
         $context = array('user' => $user, 'supervisor' => $supervisor, 'position' => $schedule->getPosition());
         $this->dispatchMessage('OpenSkedgeBundle:Mailer:lateemployee_sup.txt.twig', $context, $this->parameters['senderEmail'], $supervisor->getEmail());
     }
     $context = array('user' => $user, 'position' => $schedule->getPosition());
     $this->dispatchMessage('OpenSkedgeBundle:Mailer:lateemployee_emp.txt.twig', $context, $this->parameters['senderEmail'], $user->getEmail());
 }
Ejemplo n.º 6
0
 /**
  * Method to send a mail to the user that his account has been created
  * or that his password has been reset.
  *
  * @param UserInterface $user
  * @param boolean $isReset
  */
 public function sendNewPasswordMail(UserInterface $user, $isReset = false)
 {
     $applicationName = $this->options['applicationName'];
     $subject = '[' . ($applicationName !== null && $applicationName != 'OPIT-HRM' ? $applicationName : 'OPIT-HRM') . '] - New account created';
     $template = 'newAccount';
     if ($isReset) {
         $subject = '[' . ($applicationName !== null && $applicationName != 'OPIT-HRM' ? $applicationName : 'OPIT-HRM') . '] - Password reset';
         $template = 'passwordReset';
     }
     $this->mail->setRecipient($user->getEmail());
     $this->mail->setSubject($subject);
     $this->mail->setBodyByTemplate('OpitOpitHrmUserBundle:Mail:' . $template . '.html.twig', array('password' => $this->password, 'user' => $user));
     $this->mail->sendMail();
 }
Ejemplo n.º 7
0
 public function equals(UserInterface $user)
 {
     if (!$user instanceof LdapUser) {
         return false;
     }
     if ($user->getUsername() !== $this->username) {
         return false;
     }
     if ($user->getEmail() !== $this->email) {
         return false;
     }
     if ($user->getRoles() !== $this->roles) {
         return false;
     }
     if ($user->getDn() !== $this->dn) {
         return false;
     }
     return true;
 }
Ejemplo n.º 8
0
 public function sendPaymentRequest(PaymentRequest $paymentRequest, UserInterface $user)
 {
     $message = $this->createMessage($paymentRequest->getTitle(), $user->getEmail(), 'CivixCoreBundle:Email:payment_request.html.twig', ['paymentRequest' => $paymentRequest, 'user' => $user, 'domain' => $this->domain]);
     $this->mailer->send($message);
 }
Ejemplo n.º 9
0
 public function isEqualTo(UserInterface $user)
 {
     return $this->email === $user->getEmail();
 }
Ejemplo n.º 10
0
 /**
  * @inheritDoc
  */
 public function isEqualTo(UserInterface $user)
 {
     if (!$user instanceof User) {
         return false;
     }
     if ($this->password !== $user->getPassword()) {
         return false;
     }
     if ($this->username !== $user->getUsername()) {
         return false;
     }
     if ($this->email !== $user->getEmail()) {
         return false;
     }
     return true;
 }
Ejemplo n.º 11
0
 /**
  * Método requerido por la interfaz UserInterface
  */
 function equals(\Symfony\Component\Security\Core\User\UserInterface $usuario)
 {
     return $this->getEmail() == $usuario->getEmail();
 }
Ejemplo n.º 12
0
 /**
  * Returns the users email or as a fallback the installation-email-adress.
  *
  * @param UserInterface $user
  *
  * @return string
  */
 private function getEmail(UserInterface $user)
 {
     if ($user->getEmail() !== null) {
         return $user->getEmail();
     }
     return $this->container->getParameter('sulu_admin.email');
 }
Ejemplo n.º 13
0
Archivo: User.php Proyecto: ndusan/tbq
    /**
     * @param UserInterface $user
     * @return Boolean
     */
    function equals(UserInterface $user)
    {
        if (!$user instanceof User) {
            return false;
        }
        
        if ($this->email !== $user->getEmail()) {
            return false;
        }

        if ($this->password !== $user->getPassword()) {
            return false;
        }

        if ($this->getSalt() !== $user->getSalt()) {
            return false;
        }

        return true;
    }
Ejemplo n.º 14
0
 /**
  * equals.
  *
  * @param UserInterface $account
  * @return bool
  */
 public function equals(\Symfony\Component\Security\Core\User\UserInterface $account)
 {
     if ($account->getUsername() != $this->getUsername()) {
         return false;
     }
     if ($account->getEmail() != $this->getEmail()) {
         return false;
     }
     return true;
 }
Ejemplo n.º 15
0
 /**
  * equals.
  *
  * @param UserInterface $account
  * @return bool
  */
 public function equals(UserInterface $account)
 {
     if ($account->getUsername() != $this->getUsername()) {
         return false;
     }
     if ($account->getEmail() != $this->getEmail()) {
         return false;
     }
     return true;
 }
Ejemplo n.º 16
0
 public function sendResetPasswordEmailMessage(UserInterface $user)
 {
     $url = $this->router->generate('_account_reset_passwd', array('token' => $user->getToken(), true), true);
     $this->sendEmailMessage('resetpwd.txt.twig', '', $this->mailer_from, $user->getEmail(), array('user' => $user, 'confirmationUrl' => $url));
 }