@Override public User saveAdmin( User user, String password, String ip, Integer siteId, Integer groupId, Byte step, Boolean allChannels) { UnifiedUser unifiedUser = unifiedUserSvc.save(user.getUsername(), user.getEmail(), password, ip); user.forAdmin(unifiedUser); Group group = null; if (groupId != null) { group = groupSvc.findById(groupId); } else { group = groupSvc.getRegDef(); } if (group == null) { throw new RuntimeException("register default member group not setted!"); } user.setGroup(group); user.init(); getDao().save(user); if (user.getExt() == null) { user.setExt(new UserExt()); } userExtSvc.save(user.getExt(), user); if (siteId != null) { Site site; site = websiteSvc.findById(siteId); userSiteSvc.save(site, user, step, allChannels); } return user; }
@Override public User registerMember( String username, String email, String password, String ip, Integer groupId, UserExt userExt, Boolean activation, EmailSender sender, MessageTemplate msgTpl) { UnifiedUser unifiedUser = unifiedUserSvc.save(username, email, password, ip, activation, sender, msgTpl); User user = new User(); user.forMember(unifiedUser); Group group = null; if (groupId != null) { group = groupSvc.findById(groupId); } else { group = groupSvc.getRegDef(); } if (group == null) { throw new RuntimeException("register default member group not found!"); } user.setGroup(group); user.init(); getDao().save(user); userExtSvc.save(userExt, user); return user; }