Verify the given $user.

@param User $user The user to verify.
@param bool $byAdmin Whether this action was initiated by an administrator or not.
@return bool|\Cake\Datasource\EntityInterface
974505
public function verify(User $user, $byAdmin = false)
    {
        return $this->save($user->verify($byAdmin));
    }
1200392
public function is_available(User $user)
    {
        if (! $this->app['registration.manager']->isRegistrationEnabled()) {
            return false;
        }

        return $this->app->getAclForUser($user)->has_right(\ACL::CANADMIN);
    }
713498
protected function hasValidCredentials($user, $credentials)
    {
        return $user !== null && $this->provider->validateCredentials($user, $credentials);
    }
611425
public function findByUser(User $user, $executeQuery = true)
    {
        $queryBuilder = $this->createQueryBuilder('p')
            ->andWhere('p.user = :userId')
            ->setParameter('userId', $user->getId())
        ;

        return $executeQuery ? $queryBuilder->getQuery()->getResult() : $queryBuilder->getQuery();
    }
465827
public function validate(IUser $user): bool
    {
        if (null === $password = make(IPasswordRepository::class)->getByUser($user)) {
            return false;
        }

        return make(IPasswordHandler::class)->verify($this->password, $password->value());
    }
334002
protected function CanEdit(User $user)
    {
        return self::Guard()->Allow(BackendAction::Edit(), $user)&&
            self::Guard()->Allow(BackendAction::UseIt(), new UserForm());
    }
28142
public function authenticate(User $user, array $params = [])
    {
        if ($user->isEnabled() && password_verify($params['password'], $user->getPassword())) {
            return $user->getId();
        }
        return false;
    }
937406
public function findByUserWithAccessToken(User $user, $executeQuery = true)
    {
        $query = $this->getEntityManager()
            ->createQuery(
                'SELECT c, at
                FROM ClarolineCoreBundle:Oauth\Client c
                JOIN c.accessTokens at
                WHERE at.user = :userId'
            )
            ->setParameter('userId', $user->getId());

        return $executeQuery ? $query->getResult() : $query;
    }
187975
public function verify(CanVerifyEmailContract $user, $token)
    {
        // If the responses from the validate method is not a user instance, we will
        // assume that it is a redirect and simply return it from this method and
        // the user is properly redirected having an error message on the post.
        $user = $this->validateVerification($user, $token);

        if (! $user instanceof CanVerifyEmailContract) {
            return $user;
        }

        $this->tokens->delete($token);

        $user->setVerified(true);

        $user->save();

        return VerifyEmailBrokerContract::EMAIL_VERIFIED;
    }
602755
public function completed(UserInterface $user)
    {
        $queryBuilder = $this->createQueryBuilder('a');

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

        $queryBuilder
            ->setParameters([
                'user' => $user,
                'completed' => true
            ]);

        try
        {
            return $queryBuilder->getQuery()->getSingleResult();
        }
        catch (NoResultException $e)
        {
            return false;
        }
    }
178766
def _is_admin(user_id):
    
    user = get_session().query(User).filter(User.id==user_id).one()

    if user.is_admin():
        return True
    else:
        return False
246254
def created_by?(check_user)
      return false unless check_user.present?
      return true if check_user.cornerstone_admin?
      self.user && self.user == check_user
    end
1042160
function isTyping(\CharlotteDunois\Yasmin\Models\User $user) {
        return $this->typings->has($user->id);
    }
742759
public function activate(User $user)
    {
        $this->authorize(UsersPolicy::PERMISSION_UPDATE);

        try {
            ($active = $user->isActive()) ? $user->deactivate() : $user->activate();

            $message = $this->transNotification(
                $active ? 'disabled' : 'enabled',
                ['name' => $user->full_name],
                $user->toArray()
            );

            return $this->jsonResponseSuccess(compact('message'));
        }
        catch (\Exception $e) {
            return $this->jsonResponseError(['message' => $e->getMessage()], 500);
        }
    }
723325
protected function verifyUser($user)
    {
        $user->verified = true;
        $user->verified_at = new Carbon('now');

        $user->save();

        Auth::guard($this->getGuard())->login($user);
    }
406455
public function create($user)
    {
        $user = User::findOrFail($user->id);

        return $user->hasPermission('laralum::users.create') || $user->superAdmin();
    }
1028178
public function ___user($user) {
        $user = posix_getpwnam($user);
        if ($user) {
            posix_setuid($user['uid']);
            posix_setgid($user['gid']);
        }
    }