Delete a user.

@param username The username of the user to delete.
@throws AuthenticationException if there was an error during deletion.
774093
@Override
    public void deleteUser(String username) throws AuthenticationException {
        String user = file_store.getProperty(username);
        if (user == null) {
            throw new AuthenticationException("User '" + username
                    + "' not found.");
        }
        file_store.remove(username);
        try {
            saveUsers();
        } catch (IOException e) {
            throw new AuthenticationException("Error deleting user: ", e);
        }
    }
1163544
@DELETE
    @Path("/{name}")
    public Response delete(@Auth final DbCredential credential, @PathParam("name") final String name){
        if(!credential.getRoles().contains(DbCredential.AvailableRoles.DATA_DELETER)){
            throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build());
        }

        LOG.info("Got a delete organization request.");
        getOrganizationHandler().deleteOrganization(name);

        return Response.ok("done").build();
    }
227142
public function deleteDrupalAccount($username) {
    $user = user_load_by_name($username);
    if (is_object($user)) {
      user_delete($user->uid);
      return TRUE;
    }
    else {
      return FALSE;
    }
  }
555064
public function delete_user($username)
	{
		if (empty($username))
		{
			throw new \SimpleUserUpdateException('Cannot delete user with empty username', 9);
		}

		$affected_rows = \DB::delete(\Config::get('simpleauth.table_name'))
			->where('username', '=', $username)
			->execute(\Config::get('simpleauth.db_connection'));

		return $affected_rows > 0;
	}
658461
public void removeMailServer(String hostName, String username) throws SecurityException {
	checkWriteAccess();

	Element mail = _getRootElement("mail");
	Element[] children = XMLConfigWebFactory.getChildren(mail, "server");
	String _hostName, _username;
	if (children.length > 0) {
	    for (int i = 0; i < children.length; i++) {
		Element el = children[i];
		_hostName = el.getAttribute("smtp");
		_username = el.getAttribute("username");
		if (StringUtil.emptyIfNull(_hostName).equalsIgnoreCase(StringUtil.emptyIfNull(hostName))
			&& StringUtil.emptyIfNull(_username).equalsIgnoreCase(StringUtil.emptyIfNull(username))) {
		    mail.removeChild(children[i]);
		}
	    }
	}
    }
722741
def delete_user(self, user):
        
        user_id = utils.get_id(user)
        uri = "users/%s" % user_id
        resp, resp_body = self.method_delete(uri)
        if resp.status_code == 404:
            raise exc.UserNotFound("User '%s' does not exist." % user)
        elif resp.status_code in (401, 403):
            raise exc.AuthorizationFailure("You are not authorized to delete "
                    "users.")
367140
def DeleteUser(username):
  """"""
  grr_api = maintenance_utils.InitGRRRootAPI()
  try:
    grr_api.GrrUser(username).Get().Delete()
  except api_errors.ResourceNotFoundError:
    raise UserNotFoundError(username)
1078247
public void clearCredential(String userId) throws AuthException {
        try {
            authorizationCodeFlow.getCredentialDataStore().delete(userId);
        } catch (IOException e) {
            throw new AuthException("Unable to clear credential.", e);
        }
    }
688197
def delete_user(username)
      userhref = userhref('/redfish/v1/AccountService/Accounts/', username)
      response = rest_delete(userhref)
      response_handler(response)
      true
    end
333984
public void setUsername(String username) {
        for (Authentication auth : authentications.values()) {
            if (auth instanceof HttpBasicAuth) {
                ((HttpBasicAuth) auth).setUsername(username);
                return;
            }
        }
        throw new RuntimeException("No HTTP basic authentication configured!");
    }
585622
public Response unlockUser(String username) {
		return restClient.delete("lockouts/" + username, new HashMap<String, String>());
	}
606790
public void deleteUser(CmsRequestContext context, String username) throws CmsException {

        CmsUser user = readUser(context, username);
        deleteUser(context, user, null);
    }
140054
public function delete($username)
    {
        $parameters['username'] = $username;
        return $this->apiClient->callEndpoint(
            'user',
            $parameters,
            null,
            HttpMethod::REQUEST_DELETE
        );
    }
218929
final public static function deleteOtpToken (string $username)
	{
		if ($username == $_SESSION['username']) {
			$tokenValue 				= NULL;
			$tokenTime 					= NULL;
			$_SESSION['otp_token'] 		= NULL;
			$_SESSION['otp_token_time'] = NULL;
		}
		return self::setUserOtpToken($username, $tokenValue);
	}
231882
@Override
    public void removeUser(int userID) {
        super.removeUser(userID);
        ratingsUser.remove(userID);
        usersStats.remove(userID);
    }
3080
public void login(AuthenticatedUser user) throws AuthenticationException
    {
        if (!user.isAnonymous() && !Auth.isExistingUser(user.getName()))
           throw new AuthenticationException(String.format("User %s doesn't exist - create it with CREATE USER query first",
                                                           user.getName()));
        this.user = user;
    }
231638
public synchronized void refreshWithPassword(String username, String password) throws AuthenticationException {
		refreshWithPassword(username, password, null);
	}