Package org.encuestame.utils.security

Examples of org.encuestame.utils.security.SignUpBean


    * @param userProfile
    * @return
    */
   private SignUpBean convertSocialConnectedAccountToBean(final SocialUserProfile userProfile){
       log.info("Social Account Profile "+userProfile.toString());
       final SignUpBean singUpBean = new SignUpBean();
       singUpBean.setEmail(userProfile.getEmail());
       singUpBean.setUsername(userProfile.getUsername());
       return singUpBean;
   }
View Full Code Here


    /**
     * Test {@link SignUpBean}.
     */
    @Test
    public void testSignUpBean(){
        final SignUpBean singUpBean = new SignUpBean();
        singUpBean.setEmail("juanATencuestame.org");
        singUpBean.setFullName("Juan");
        singUpBean.setPassword("12345");
        singUpBean.setUsername("jotadeveloper");
        singUpBean.setCaptcha("DlXdfP8x");
        assertNotNull(singUpBean.getEmail());
        assertNotNull(singUpBean.getFullName());
        assertNotNull(singUpBean.getPassword());
        assertNotNull(singUpBean.getUsername());
        assertNotNull(singUpBean.getCaptcha());
    }
View Full Code Here

        final Boolean privateHome = EnMePlaceHolderConfigurer.getBooleanProperty("application.signup.enabled");
        if (!privateHome) {
            log.debug("signup is disabled");
            return "redirect:/signin";
        } else {
            final SignUpBean user = new SignUpBean();
            final String captcha = getReCaptcha().createRecaptchaHtml(null, null);
            log.debug(captcha);
            user.setCaptcha(captcha);
            log.info("username "+user);
            model.addAttribute("user",user);
            return "signup";
        }
    }
View Full Code Here

            @RequestParam(value = "realName", required = true, defaultValue = "") String realName,
            @RequestParam(value = "password", required = true) String password,
            @RequestParam(value = "username", required = true) String usernameForm,
            @RequestParam(value = "email", required = true) String emailForm,
            final HttpServletRequest req) {
        final SignUpBean user = new SignUpBean();
        String finalPath = "/user/created";
        user.setEmail(filterValue(emailForm));
        user.setPassword(password);
        user.setFullName(filterValue(realName));
        user.setUsername(filterValue(usernameForm));
        final SecurityOperations _service = getSecurityService();
        final ValidateOperations validation = new ValidateOperations(_service);
        if (validation.validateSignUpForm(usernameForm, emailForm, password)) {
            log.debug(" the signup process successfull");
            try {
View Full Code Here

     * @throws EnMeNoResultsFoundException
     */
    @Test
    @Category(DefaultTest.class)
    public void testsingupUser() throws EnMeNoResultsFoundException {
        final SignUpBean bean = createSignUpBean("newUser", "newUser@gmail.com", "12345");
        this.securityService.singupUser(bean, false);
    }
View Full Code Here

    private List<SignUpBean> getUsers() throws IOException {
        CSVReader csv = readCSVFile("user.csv");
        String[] nextLine;
        final List<SignUpBean> list = new ArrayList<SignUpBean>();
        while ((nextLine = csv.readNext()) != null) {
            final SignUpBean user = new SignUpBean();
            user.setEmail(nextLine[0]+"."+nextLine[2]);
            user.setFullName(nextLine[3]);
            user.setPassword(nextLine[1]);
            user.setUsername(nextLine[0]);
            list.add(user);
        }
        return list;
    }
View Full Code Here

        final String captcha = "CaPtCHa";
        final String email = "dianmorales@gmail.com";
        final String fullName = "";
        final String password = "Diana Paola";
        final String username = "dianmorales";
        final SignUpBean sub = new SignUpBean();
        sub.setCaptcha(captcha);
        sub.setEmail(email);
        sub.setFullName(fullName);
        sub.setPassword(password);
        sub.setUsername(username);
        this.serviceMail.sendConfirmYourAccountEmail(sub, inviteCode);

    }
View Full Code Here

        //TODO: maybe we need create a table for editor permissions
        userAccount.setCompleteName(userBean.getName() == null ? "" : userBean.getUsername());
        userAccount.setUserStatus(Boolean.TRUE);
        userAccount.setEnjoyDate(Calendar.getInstance().getTime());
            // send to user the password to her emails
            final SignUpBean singUpBean = new SignUpBean();
            singUpBean.setEmail(userBean.getEmail());
            singUpBean.setFullName(userAccount.getCompleteName());
            singUpBean.setUsername(userBean.getUsername());
            singUpBean.setPassword(password);
            final String inviteCode =  UUID.randomUUID().toString();
            userAccount.setInviteCode(inviteCode);
            try {
                getMailService().sendConfirmYourAccountEmail(singUpBean, inviteCode);
            } catch (Exception e1) {
View Full Code Here

     * @return
     * @throws EnMeNoResultsFoundException
     */
    public UserAccountBean getUserAccountbyCode(final String inviteCode) throws EnMeNoResultsFoundException{
        final UserAccount userAcc;
        SignUpBean singUp = new SignUpBean();
        if (inviteCode == null) {
            throw new EnMeNoResultsFoundException("confirmation code is missing");
        } else {
            userAcc = getAccountDao().getUserAccountbyInvitationCode(inviteCode);
            if (userAcc!=null) {
View Full Code Here

     * @throws EnMeNoResultsFoundException
     */
    public void refreshInviteCode() throws EnMeNoResultsFoundException {
            final UserAccount userAccount = getUserAccount(getUserPrincipalUsername());
            if (userAccount.getInviteCode() != null) {
                final SignUpBean singUpBean = new SignUpBean();
                singUpBean.setEmail(userAccount.getUserEmail());
                singUpBean.setFullName(userAccount.getCompleteName());
                singUpBean.setUsername(userAccount.getUsername());
                final String inviteCode = UUID.randomUUID().toString();
                userAccount.setInviteCode(inviteCode);
                getAccountDao().saveOrUpdate(userAccount);
                try {
                    getMailService().sendConfirmYourAccountEmail(singUpBean, inviteCode);
View Full Code Here

TOP

Related Classes of org.encuestame.utils.security.SignUpBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.