Пример #1
0
  @Override
  public void updateGUID(String guid, Long adminID) {
    TCAProfileVO profile = readByAdminUserId(adminID);
    profile.getAdminUser().setLdapGUIDID(guid);

    adminSecurityService.saveAdminUser(profile.getAdminUser());
  }
Пример #2
0
  private void sendConfirmationEmail(TCAProfileVO tcaProfile) {

    ETSAdminUser adminUser = tcaProfile.getAdminUser();
    HashMap<String, Object> vars = new HashMap<String, Object>();
    vars.put("admin", adminUser);
    emailService.sendTemplateEmail(adminUser.getEmail(), getSendAdminUserRegistrationMail(), vars);
  }
Пример #3
0
 @Override
 public String saveTCAProfile(TCAProfileVO tcaProfile, boolean newUser) {
   ETSAdminUser adminUser = tcaProfile.getAdminUser();
   Set<AdminPermission> permissionSet = new HashSet<AdminPermission>();
   AdminPermission adminPermission = adminSecurityService.readAdminPermissionById(TCA_PERMISSION);
   permissionSet.add(adminPermission);
   adminUser.setAllPermissions(permissionSet);
   adminUser.setInternalUserFlag(true);
   ETSAdminUser updatedAdminUser = (ETSAdminUser) adminSecurityService.saveAdminUser(adminUser);
   updatedAdminUser.setEtsPhone(adminUser.getEtsPhone());
   tcaProfile.setAdminUser(updatedAdminUser);
   savePhone(tcaProfile);
   // Integrate with EIAS
   String guidID = "";
   if (eregUtils.isOAMAuthentication()) {
     if (newUser) {
       guidID = eiasWebServiceClient.createUser(adminUser);
     } else {
       eiasWebServiceClient.modifyUser(adminUser);
     }
   }
   if (newUser) {
     sendConfirmationEmail(tcaProfile);
   }
   // authenticate
   return guidID;
 }
Пример #4
0
 @Override
 public DupCheckResponseObject checkDuplicateProfile(TCAProfileVO tcaProfile) {
   List<AdminUser> adminUsers = readUserByEmail(tcaProfile.getAdminUser().getEmail());
   DupCheckResponseObject duplicateObject = new DupCheckResponseObject(new ArrayList<String>());
   duplicateObject.setDuplicate(!adminUsers.isEmpty());
   return duplicateObject;
 }
Пример #5
0
 @Override
 public List<AdminUserVO> getDuplicateAdminProfiles(
     TCAProfileVO tcaProfile, boolean currentloggedCust) {
   List<AdminUser> adminUsers = readUserByEmail(tcaProfile.getAdminUser().getEmail());
   List<AdminUserVO> adminUserList = new ArrayList<AdminUserVO>();
   ETSAdminUser estAdminUser = null;
   AdminUserVO adminUserVO = null;
   for (AdminUser adminUser : adminUsers) {
     estAdminUser = (ETSAdminUser) adminUser;
     adminUserVO = new AdminUserVO();
     populateAdminUserVO(estAdminUser, adminUserVO);
     adminUserList.add(adminUserVO);
   }
   return adminUserList;
 }
Пример #6
0
  private void savePhone(TCAProfileVO tcaProfile) {
    ETSPhone etsPhone = tcaProfile.getAdminUser().getEtsPhone();
    if (etsPhone != null) {
      AdminUserPhone adminPhone = null;
      AdminUserPhoneId adminUserPhoneId = null;
      if (tcaProfile.getAdminUser().getAdminUserPhone() != null
          && tcaProfile.getAdminUser().getAdminUserPhone().getAdminUserPhoneId() != null) {
        adminPhone = tcaProfile.getAdminUser().getAdminUserPhone();
        etsPhone = tcaProfile.getAdminUser().getEtsPhone();
        etsPhone.setId(adminPhone.getEtsPhone().getId());
        copyPhone(tcaProfile.getAdminUser().getEtsPhone(), etsPhone);
        phoneService.savePhone(etsPhone);
      } else {
        etsPhone = (ETSPhone) phoneService.savePhone(tcaProfile.getAdminUser().getEtsPhone());
        adminUserPhoneId = new AdminUserPhoneId();
        adminUserPhoneId.setPhoneId(etsPhone.getId());
        adminUserPhoneId.setEtsAdminUserId(tcaProfile.getAdminUser().getId());
        tcaProfile.getAdminUser().setEtsPhone(etsPhone);

        ETSAdminUser adminUser = tcaProfile.getAdminUser();
        adminPhone = etsAdminUserPhoneService.createAdminUserPhone();
        adminPhone.setAdminUserPhoneId(adminUserPhoneId);
        adminPhone.setEtsAdminUser(adminUser);
        adminPhone.setEtsPhone(etsPhone);
        adminPhone.setName(ADMIN_PHONE_NAME);
      }

      etsAdminUserPhoneService.saveAdminUserPhone(adminPhone);
    }
    tcaProfile.getAdminUser().setEtsPhone(etsPhone);
  }