Esempio n. 1
0
  @SuppressWarnings("unused")
  private static void printCurrentUser(UserManager mgr) throws Exception {
    User currentUser = mgr.getCurrentUser();
    logger.debug("user="******"*****@*****.**");
    mgr.update(currentUser);
    logger.debug("updated user");

    User currentUser2 = mgr.getCurrentUser();
    logger.debug("updated user's mail: " + currentUser2.getMail());
  }
 public static void writeUser(User user, final JSONWriter writer) throws JSONException {
   JsonOutput.addIfNotNull(writer, "id", user.getId());
   JsonOutput.addIfNotNull(writer, "login", user.getLogin());
   JsonOutput.addIfNotNull(writer, "password", user.getPassword());
   JsonOutput.addIfNotNull(writer, "firstname", user.getFirstName());
   JsonOutput.addIfNotNull(writer, "lastname", user.getLastName());
   JsonOutput.addIfNotNull(writer, "name", user.getFullName());
   JsonOutput.addIfNotNull(writer, "mail", user.getMail());
   addIfNotNullFull(writer, "created_on", user.getCreatedOn());
   addIfNotNullFull(writer, "last_login_on", user.getLastLoginOn());
   writeCustomFields(writer, user.getCustomFields());
 }