}
    public void setUserStatus(Admin admin, String username, int status) throws AuthorizationDeniedException, FinderException {        debug(">setUserStatus("+username+", "+status+")");        // Check if administrator is authorized to edit user.        int caid = ILogSessionLocal.INTERNALCAID;        try{          UserDataPK pk = new UserDataPK(username);          UserDataLocal data1 = home.findByPrimaryKey(pk);          caid = data1.getCAId();          if(!authorizedToCA(admin, caid)){            logsession.log(admin, caid, LogEntry.MODULE_RA,  new java.util.Date(),username, null, LogEntry.EVENT_ERROR_CHANGEDENDENTITY,"Administrator not authorized to change status of user with current CA.");            throw new AuthorizationDeniedException("Administrator not authorized to set status to user with given CA.");          }          if(getGlobalConfiguration(admin).getEnableEndEntityProfileLimitations()){            if(!authorizedToEndEntityProfile(admin, data1.getEndEntityProfileId(), AvailableAccessRules.EDIT_RIGHTS)){                logsession.log(admin, caid, LogEntry.MODULE_RA, new java.util.Date(),username, null, LogEntry.EVENT_ERROR_CHANGEDENDENTITY,"Administrator not authorized to change status");                throw new AuthorizationDeniedException("Administrator not authorized to edit user.");            }          }          data1.setStatus(status);          data1.setTimeModified((new java.util.Date()).getTime());          logsession.log(admin, caid, LogEntry.MODULE_RA,  new java.util.Date(),username, null, LogEntry.EVENT_INFO_CHANGEDENDENTITY,("New status : " + status));        }        catch(FinderException e){          logsession.log(admin, caid, LogEntry.MODULE_RA, new java.util.Date(),username, null, LogEntry.EVENT_ERROR_CHANGEDENDENTITY,"Couldn't find username in database.");          throw e;        }        debug("<setUserStatus("+username+", "+status+")");    } // setUserStatus