Beispiel #1
0
 /**
  * @{inheritdoc}
  */
 public function reverseTransform($value)
 {
     // Only encode if $value holds something, empty means we shouldnt encode
     // anything at all.
     if (empty($value)) {
         return $value;
     }
     return $this->factory->getEncoder($this->user)->encodePassword($value, $this->user->getSalt());
 }
 public function isEqualTo(UserInterface $user)
 {
     if (!$user instanceof CorredorUser || $this->password !== $user->getPassword() || $this->salt !== $user->getSalt() || $this->username !== $user->getUsername()) {
         return false;
     }
     return true;
 }
Beispiel #3
0
 public function isEqualTo(UserInterface $user)
 {
     if (!$user instanceof RedisUser) {
         return false;
     }
     if ($this->password !== $user->getPassword()) {
         return false;
     }
     if ($this->salt !== $user->getSalt()) {
         return false;
     }
     if ($this->email !== $user->getUsername()) {
         return false;
     }
     return true;
 }
 public function equals(UserInterface $user)
 {
     if (!$user instanceof self) {
         return false;
     }
     if ($this->password !== $user->getPassword()) {
         return false;
     }
     if ($this->getSalt() !== $user->getSalt()) {
         return false;
     }
     if ($this->username !== $user->getUsername()) {
         return false;
     }
     return true;
 }
 public function isEqualTo(UserInterface $user)
 {
     if (!$user instanceof UsuariosService) {
         return false;
     }
     if ($this->password !== $user->getPassword()) {
         return false;
     }
     if ($this->salt !== $user->getSalt()) {
         return false;
     }
     if ($this->username !== $user->getUsername()) {
         return false;
     }
     return true;
 }
 public function getSalt()
 {
     return $this->user->getSalt();
 }
Beispiel #7
0
 public function isEqualTo(UserInterface $user)
 {
     return $user instanceof User && $this->getUsername() === $user->getUsername() && $this->getPassword() === $user->getPassword() && $this->getSalt() === $user->getSalt();
 }
 /**
  * Authenticate a token according to the user provided without any password encoders.
  *
  * @param \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token
  * @param \Symfony\Component\Security\Core\User\UserInterface                  $user
  *
  * @return boolean|\BackBee\Security\Token\UsernamePasswordToken
  */
 private function authenticateWithoutEncoder(TokenInterface $token, UserInterface $user)
 {
     if (null !== $user->getSalt() && call_user_func($user->getSalt(), $token->getCredentials()) === $user->getPassword()) {
         return new UsernamePasswordToken($user, $user->getPassword(), $user->getRoles());
     } elseif ($token->getCredentials() === $user->getPassword()) {
         return new UsernamePasswordToken($user, $user->getPassword(), $user->getRoles());
     } else {
         return false;
     }
 }
 /**
  * @param UserInterface $user
  * @return null|string
  */
 private function getSalt(UserInterface $user)
 {
     return $user->getSalt();
 }
 protected function getSalt(UserInterface $user)
 {
     return $user->getSalt();
 }
Beispiel #11
0
 /**
  * @inheritDoc
  */
 public function isEqualTo(UserInterface $user)
 {
     if (!$user instanceof WebserviceUser) {
         return false;
     }
     if ($this->getPassword() !== $user->getPassword()) {
         return false;
     }
     if ($this->getSalt() !== $user->getSalt()) {
         return false;
     }
     if ($this->getUsername() !== $user->getUsername()) {
         return false;
     }
     return true;
 }
 public function isEqualTo(UserInterface $user)
 {
     if (!$user instanceof Estabelecimento) {
         return false;
     }
     if ($this->password !== $user->getPassword()) {
         return false;
     }
     if ($this->salt !== $user->getSalt()) {
         return false;
     }
     // if ($this->username !== $user->getUsername()) {
     //     return false;
     // }
     return true;
 }
 public function isEqualTo(UserInterface $user)
 {
     if (!$user instanceof self) {
         return false;
     }
     if ($this->id !== $user->getId()) {
         return false;
     }
     if ($this->password !== $user->getPassword()) {
         return false;
     }
     if ($this->salt !== $user->getSalt()) {
         return false;
     }
     return true;
 }
Beispiel #14
0
 public function equals(UserInterface $user)
 {
     if (!$user instanceof User) {
         return false;
     }
     if ($this->password !== $user->getPassword()) {
         return false;
     }
     if ($this->getSalt() !== $user->getSalt()) {
         return false;
     }
     if ($this->isAccountNonExpired() !== $user->isAccountNonExpired()) {
         return false;
     }
     if (!$this->locked !== $user->isAccountNonLocked()) {
         return false;
     }
     if ($this->isCredentialsNonExpired() !== $user->isCredentialsNonExpired()) {
         return false;
     }
     if ($this->enabled !== $user->isEnabled()) {
         return false;
     }
     return true;
 }
Beispiel #15
0
    /**
     * @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;
    }
 /**
  *{@inheritdoc}
  */
 public function isEqualTo(UserInterface $user)
 {
     if (!$user instanceof User) {
         // @codeCoverageIgnoreStart
         return false;
         // @codeCoverageIgnoreEnd
     }
     if ($this->password !== $user->getPassword()) {
         // @codeCoverageIgnoreStart
         return false;
         // @codeCoverageIgnoreEnd
     }
     if ($this->salt !== $user->getSalt()) {
         // @codeCoverageIgnoreStart
         return false;
         // @codeCoverageIgnoreEnd
     }
     if ($this->username !== $user->getUsername()) {
         // @codeCoverageIgnoreStart
         return false;
         // @codeCoverageIgnoreEnd
     }
     return true;
 }
Beispiel #17
0
 public function isEqualTo(UserInterface $user)
 {
     if (!$user instanceof Lollypop\GearBundle\Entity\User) {
         return false;
     }
     if ($this->password !== $user->getPassword()) {
         return false;
     }
     if ($this->salt !== $user->getSalt()) {
         return false;
     }
     if ($this->username !== $user->getUsername()) {
         return false;
     }
     return true;
 }
Beispiel #18
0
 /**
  * The equality comparison should neither be done by referential equality
  * nor by comparing identities (i.e. getId() === getId()).
  *
  * However, you do not need to compare every attribute, but only those that
  * are relevant for assessing whether re-authentication is required.
  *
  * Also implementation should consider that $user instance may implement
  * the extended user interface `AdvancedUserInterface`.
  *
  * @param UserInterface $user
  *
  * @return bool
  */
 public function isEqualTo(UserInterface $user)
 {
     /** @var User $user */
     if (!$user instanceof self) {
         return false;
     }
     if ($this->password !== $user->getPassword()) {
         return false;
     }
     if ($this->salt !== $user->getSalt()) {
         return false;
     }
     if ($this->username !== $user->getUsername()) {
         return false;
     }
     if ($this->id->id() !== $user->id->id()) {
         return false;
     }
     return true;
 }
Beispiel #19
0
 /**
  * Verify if user is equalt to $user.
  *
  * @param UserInterface $user  User interface
  */
 public function isEqualTo(UserInterface $user)
 {
     if (!$user instanceof SamlUser) {
         return false;
     }
     if ($this->getSalt() !== $user->getSalt()) {
         return false;
     }
     if ($this->username !== $user->getUsername()) {
         return false;
     }
     return true;
 }
Beispiel #20
0
 /**
  * @inheritDoc
  */
 public function isEqualTo(BaseUserInterface $user)
 {
     if ($this->getPassword() !== $user->getPassword()) {
         return false;
     }
     if ($this->getSalt() !== $user->getSalt()) {
         return false;
     }
     if ($this->getUsername() !== $user->getUsername()) {
         return false;
     }
     return true;
 }
Beispiel #21
0
 public function getSalt()
 {
     return $this->wrappedUser->getSalt();
 }
Beispiel #22
0
 /**
  * Implementation of SecurityUserInterface.
  *
  * @param \Symfony\Component\Security\Core\User\UserInterface $user
  * @return Boolean
  */
 public function equals(SecurityUserInterface $user)
 {
     if (!$user instanceof User) {
         return false;
     }
     if ($this->getPassword() !== $user->getPassword()) {
         return false;
     }
     if ($this->getSalt() !== $user->getSalt()) {
         return false;
     }
     if ($this->getUsernameCanonical() !== $user->getUsernameCanonical()) {
         return false;
     }
     if ($this->isAccountNonExpired() !== $user->isAccountNonExpired()) {
         return false;
     }
     if ($this->isAccountNonLocked() !== $user->isAccountNonLocked()) {
         return false;
     }
     if ($this->isCredentialsNonExpired() !== $user->isCredentialsNonExpired()) {
         return false;
     }
     if ($this->isEnabled() !== $user->isEnabled()) {
         return false;
     }
     return true;
 }
Beispiel #23
0
 public function isEqualTo(UserInterface $user)
 {
     if (!$user instanceof User) {
         return false;
     }
     if ($this->salt !== $user->getSalt()) {
         return false;
     }
     return true;
 }