Removes a user from the group.

@param  \mako\gatekeeper\entities\user\User $user User
@throws \LogicException
@return bool
19107
public function removeUser(User $user): bool
	{
		if(!$this->isPersisted)
		{
			throw new LogicException('You can only remove a user from a group that exist in the database.');
		}

		if(!$user->isPersisted())
		{
			throw new LogicException('You can only remove a user that exist in the database from a group.');
		}

		return $this->users()->unlink($user);
	}
994857
public function removeUser($user)
    {
        if ($this->getUsers()->contains($user))
        {
            $this->getUsers()->removeElement($user);
            $user->removeGroup($this);
        }
        return $this;
    }
729331
public function destroy(UserPolicy $user, Category $category)
    {
        return $category->user_id == user_id() && $category->user_type == user_type();
    }
1314473
private function userAttemptBruteForceLockHasExceeded(User $user)
    {
        if ($user->login_attempt_lock_expiration > time()) {
            $user->updateAttributes(['login_attempt' => 0]);
            
            return true;
        }
        
        return false;
    }
127426
public function removeUser( core_kernel_classes_Resource $user)
    {
        $returnValue = (bool) false;

        if(!is_null($user)) {
            $this->checkCurrentUserAccess($this->getUserRoles($user));
			$returnValue = $this->generisUserService->removeUser($user);
            $this->getEventManager()->trigger(new UserRemovedEvent($user->getUri()));
		}

        return (bool) $returnValue;
    }
1152162
public function setUser(User $user)
    {
        $this->user = $user;

        unset($_SESSION[self::class][$this->getConfig()->getEntityID()]['user']);

        $_SESSION[self::class][$this->getConfig()->getEntityID()]['user'] = $this->user->toArray();
        $this->setRole($this->user->getCurrentRole());
        $this->setLocalUsername($this->user->getLocalUsername());

        return $this;
    }
77019
public function remove_user_from_group($user, $groupid) {
        global $DB;
        require_capability('moodle/course:managegroups', $this->context);
        $group = $this->get_group($groupid);
        if (!groups_remove_member_allowed($group, $user)) {
            return false;
        }
        if (!$group) {
            return false;
        }
        return groups_remove_member($group, $user);
    }
190248
public function removeUser(\CampaignChain\Location\FacebookBundle\Entity\User $users)
    {
        $this->users->removeElement($users);
    }
495105
public function createUser(UserInterface $user)
    {
        if (isset($this->users[strtolower($user->getUsername())])) {
            throw new \LogicException('Another user with the same username already exists.');
        }

        $this->users[strtolower($user->getUsername())] = $user;
    }
686761
public function addUser(User $user): bool
	{
		if(!$this->isPersisted)
		{
			throw new LogicException('You can only add a user to a group that exist in the database.');
		}

		if(!$user->isPersisted())
		{
			throw new LogicException('You can only add a user that exist in the database to a group.');
		}

		return $this->users()->link($user);
	}
739110
public function deleteUser(User $user)
    {
        if ($user->isGuest()) {
            Throw new UserException('Cannot delete a guest user.');
        }

        // Check the old password
        $this->db->delete($this->table, 'id_user=:id_user', [
            ':id_user' => $user->getId()
        ]);
    }
1264000
public function removeUser(ServerUser $user)
    {
        if ($this->users->contains($user) === true) {
            $user->setServer(null);
            $this->users->removeElement($user);
        }

        return $this;
    }
1049924
public function updateUser(User $user)
    {
        try {
            return $this->innerGateway->updateUser($user);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
249054
private function cleanUserSessions(User $user)
    {
        $sessions = $this->objectManager->getRepository('Phraseanet:Session')
            ->findByUser(['user' => $user]);

        foreach ($sessions as $session) {
            $this->objectManager->remove($session);
        }
    }
1217299
private function deleteToken(UserInterface $user)
    {
        $em = $this->getDoctrine()->getManager();
        $user->setPasswordResetToken(null);
        $user->setPasswordResetTokenExpiresAt(null);
        $user->setPasswordResetTokenEmailsSent(null);
        $em->persist($user);
        $em->flush();
    }
1348644
public function deleteUser($user) {
    if($this->userExists($user)) {
      $pattern = '/'.$user.'.*/';
      $this->htpwd = array_filter($this->htpwd,function($line) use ($pattern) {
        return (preg_match($pattern,$line) != 1);
      });
      $this->_save();
      return true;
    } else {
      return false;
    }
  }
350168
public function removeUserPermission($user, $permission)
    {
        $permissions=   $this->findPermissionByKey($permission);
        $user       =   $this->findUserById($user);

        return $user->remove($permission);
    }