Complete reminder for the given user.

@param  User   $user
@param  string $code
@param  string $password

@return bool
337656
public function complete(UserInterface $user, $code, $password)
    {
        $reminder = $this->findIncomplete($user, $code);

        if ($reminder === null)
        {
            return false;
        }

        $credentials = ['password' => $password];

        if (! $this->users->validForUpdate($user, $credentials))
        {
            return false;
        }

        $entityManager = $this->getEntityManager();
        $entityManager->beginTransaction();

        try
        {
            $this->users->update($user, $credentials);

            $reminder->complete();
            $this->save($reminder);

            $entityManager->commit();
            return true;
        }
        catch (\Exception $e)
        {
            $entityManager->rollback();

            return false;
        }
    }
1290913
public function updateUser(User $user)
    {
        $query = $this->handler->createUpdateQuery();
        $query
            ->update($this->handler->quoteTable('ezuser'))
            ->set(
                $this->handler->quoteColumn('login'),
                $query->bindValue($user->login)
            )->set(
                $this->handler->quoteColumn('email'),
                $query->bindValue($user->email)
            )->set(
                $this->handler->quoteColumn('password_hash'),
                $query->bindValue($user->passwordHash)
            )->set(
                $this->handler->quoteColumn('password_hash_type'),
                $query->bindValue($user->hashAlgorithm)
            )->where(
                $query->expr->eq(
                    $this->handler->quoteColumn('contentobject_id'),
                    $query->bindValue($user->id, null, \PDO::PARAM_INT)
                )
            );
        $query->prepare()->execute();

        $query = $this->handler->createUpdateQuery();
        $query
            ->update($this->handler->quoteTable('ezuser_setting'))
            ->set(
                $this->handler->quoteColumn('is_enabled'),
                $query->bindValue($user->isEnabled, null, \PDO::PARAM_INT)
            )->set(
                $this->handler->quoteColumn('max_login'),
                $query->bindValue($user->maxLogin, null, \PDO::PARAM_INT)
            )->where(
                $query->expr->eq(
                    $this->handler->quoteColumn('user_id'),
                    $query->bindValue($user->id, null, \PDO::PARAM_INT)
                )
            );
        $query->prepare()->execute();
    }
531420
public static function isUsed($password, $user = null)
    {
        if (!User::isValid($user)) {
            throw new InvalidParamException('User Invalid.');
        }
        $passwords = static::find()->createdBy($user)->all();
        foreach ($passwords as $p) {
            /* @var $p static */
            if ($p->validatePassword($password)) {
                return $p;
            }
        }
        return false;
    }
196368
public function requestNewPassword(User $user)
    {
        $user->setPasswordRequestedAt(new \DateTime());
        $user->resetAuthenticationToken();
        $user->setEmailSent(false);
        $this->save($user);
    }
385088
protected function findIncomplete(UserInterface $user, $code = null)
    {
        $queryBuilder = $this->createQueryBuilder('a');

        $queryBuilder
            ->where('a.user = :user')
            ->andWhere('a.completed = :completed')
            ->andWhere('a.createdAt > :expires');

        $queryBuilder
            ->setParameter('user', $user)
            ->setParameter('completed', false)
            ->setParameter('expires', $this->expires());

        if ($code)
        {
            $queryBuilder
                ->andWhere('a.code = :code')
                ->setParameter('code', $code);
        }

        try
        {
            return $queryBuilder->getQuery()->getSingleResult();
        }
        catch (NoResultException $e)
        {
            return null;
        }
    }
579161
public function sendCreationEmailMessage(UserInterface $user, $password)
    {
        /** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $user */
        $siteName  = $this->settingsManager->getParameter('general.site_name');
        $userName = sprintf('%s %s', $user->getFirstName(), $user->getLastName());
        $login = $user->getUsername();

        if (0 === strlen($password)) {
            return 0;
        }

        if (null === $loginUrl = $this->getLoginUrl($user)) {
            return 0;
        }

        $rendered = $this->templating->render(
            'EkynaUserBundle:Admin/User:creation_email.html.twig',
            [
                'username'  => $userName,
                'sitename'  => $siteName,
                'login_url' => $loginUrl,
                'login'     => $login,
                'password'  => $password,
            ]
        );

        $subject = $this->translator->trans(
            'ekyna_user.email.creation.subject',
            ['%sitename%' => $siteName]
        );

        return $this->sendEmail($rendered, $user->getEmail(), $userName, $subject);
    }
526402
public function exists(UserInterface $user, $code = null)
    {
        return $this->findIncomplete($user, $code) !== null;
    }
804831
public function logIn(string $password, string $hash, array $user): bool
    {
        if (!$user || !password_verify($password, $hash)) {
            return false;
        }

        $this->session->set('user', $user);

        return true;
    }
1076699
public function checkUserCredentials($username, $password)
    {
        return isset($this->userCredentials[$username]) && $this->userCredentials[$username] === $password;
    }
131707
public function deleteUser(User $user, string $password) : bool {
		if ($user->doesPasswordMatch($password)) {
			$stmt = $this->db->prepare(
				"DELETE FROM accounts " .
				"WHERE id=? AND username=? AND email=?;"
			);
			$stmt->bind_param("iss",
				$user->id, $user->username, $user->email);
			$stmt->execute();
			$this->db->commit();
			return true;
		} else {
			return false;
		}
	}
491142
protected function setUserInfo($user = '', $password = '')
    {
        $this->uriString = null;

        if (! $user) {
            $this->userInfo = '';

            return $this;
        }
        $this->userInfo = rtrim($user, '@');

        if ($password) {
            $this->userInfo .= ':' . $password;
        }

        return $this;
    }
432481
protected function checkCurrentPassword(LoggedUserPasswordUpdate $request, $user)
    {
        return Hash::check($request->current_password, $user->password);
    }
988852
public static function verifyHashedPassword(User $user, $passwordGiven)
    {
        $bcrypt = new Bcrypt(array('cost' => 10));
        return $bcrypt->verify($passwordGiven, $user->getPassword());
    }
718312
public function login(UserInterface $user, $remember = false)
    {
        $this->updateSession($user->getAuthIdentifier());

        // If the user should be permanently "remembered" by the application we will
        // queue a permanent cookie that contains the encrypted copy of the user
        // identifier. We will then decrypt this later to retrieve the users.
        if ($remember) {
            $this->createRememberTokenIfDoesntExist($user);

            $this->queueRecallerCookie($user);
        }

        // If we have an event dispatcher instance set we will fire an event so that
        // any listeners will hook into the authentication events and run actions
        // based on the login and logout events fired from the guard instances.
        if (isset($this->events)) {
            $this->events->dispatch('auth.login', array($user, $remember));
        }

        $this->setUser($user);
    }
241637
public function verifyEmail(User $user, $token)
    {
        $this->_prepareEmail($user, __d('wasabi_core', 'Verify your email address'));
        $this->_email->template('Wasabi/Core.User/verify');
        $this->_email->viewVars([
            'user' => $user,
            'verifyEmailLink' => [
                'plugin' => 'Wasabi/Core',
                'controller' => 'Users',
                'action' => 'verifyByToken',
                'token' => $token
            ],
            'instanceName' => Wasabi::getInstanceName()
        ]);
    }
513078
public function login(
        User $user,
        $remember = false,
        $secure = ''
    ) {
        wp_set_auth_cookie($user->id, $remember, $secure);

        wp_set_current_user($user->id);
    }
984294
protected function setUserInfo($user, $password = null)
    {
        $this->userInfo = $user . ((null !== $password) ? (':' . $password) : '');
    }