Ejemplo n.º 1
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);
  }
Ejemplo n.º 2
0
  private void populateAdminUserVO(ETSAdminUser estAdminUser, AdminUserVO adminUserVO) {

    adminUserVO.setAdminId(estAdminUser.getId());
    adminUserVO.setEmail(estAdminUser.getEmail());
    adminUserVO.setFirstName(estAdminUser.getFirstName());
    adminUserVO.setLastName(estAdminUser.getLastName());
    adminUserVO.setMiddleName(estAdminUser.getMiddleName());
  }
Ejemplo n.º 3
0
 @Override
 public TCAProfileVO authenthicate(String login, String password) {
   ETSAdminUser adminUser = (ETSAdminUser) adminSecurityService.readAdminUserByUserName(login);
   TCAProfileVO tcaProfile = null;
   if (null != adminUser) {
     tcaProfile = new TCAProfileVO();
     tcaProfile.setAdminUser(adminUser);
     if (null == password || !password.equalsIgnoreCase(adminUser.getPassword())) {
       tcaProfile = null;
     }
   }
   return tcaProfile;
 }
Ejemplo n.º 4
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;
 }
Ejemplo n.º 5
0
 @Override
 public void createPhone(ETSAdminUser adminUser) {
   ETSPhone phone = (ETSPhone) phoneService.create();
   adminUser.setEtsPhone(phone);
 }