public void disableUser(String username) throws UserNotFoundException, OpenTransactionException{
db = DbHelper.reconnectAsAdmin();
OUser user = db.getMetadata().getSecurity().getUser(username);
if (user==null) throw new UserNotFoundException("The user " + username + " does not exist.");
user.setAccountStatus(STATUSES.SUSPENDED);
user.save();
//cannot resume the old connection because now the user is disabled
}
public void enableUser(String username) throws UserNotFoundException, OpenTransactionException{
db = DbHelper.reconnectAsAdmin();