public void edit(EntityReference ref, Map<String, Object> inputVar, Context context) {
try {
int uid;
EPerson ePerson;
try {
uid = Integer.parseInt(ref.getId());
ePerson = EPerson.find(context, uid);
} catch (NumberFormatException ex) {
ePerson = EPerson.findByEmail(context, ref.getId());
}
String email = Utils.getMapValue(inputVar, "email");
String password = Utils.getMapValue(inputVar, "password");
String firstName = Utils.getMapValue(inputVar, "firstName");
String lastName = Utils.getMapValue(inputVar, "lastName");
String phone = Utils.getMapValue(inputVar, "phone");
String netId = Utils.getMapValue(inputVar, "netId");
String language = Utils.getMapValue(inputVar, "language");
String canLogIn = Utils.getMapValue(inputVar, "canLogIn");
String requireCertificate = Utils.getMapValue(inputVar, "requireCertificate");
String selfRegistered = Utils.getMapValue(inputVar, "selfRegistered");
if (ePerson != null) {
EPerson ep = EPerson.findByEmail(context, email);
if (ep == null || ePerson.getEmail().equalsIgnoreCase(ep.getEmail())) {
if (email != null) ePerson.setEmail(email);
if (firstName != null) ePerson.setFirstName(firstName);
if (lastName != null) ePerson.setLastName(lastName);
if (password != null && !"".equals(password)) ePerson.setPassword(password);
if (phone != null) ePerson.setMetadata("phone", phone);