Package user

Examples of user.UserAccount


        if(FacesContext.getCurrentInstance().isValidationFailed()) {
            return null;
        } else {
           
            UserAccount userAccount = userAccountDAO.findByPasswordRecoveryString(userManager.getSessionManager()
                    .getPasswordRecoveryString());
           
            if(userAccount != null) {
                userAccount.setUserPassword(newPassword);

                userAccountDAO.update(userAccount);

                userManager.getSessionManager().setBlocked(false);
               
View Full Code Here


    public UsersHolder() {
    }
  

    public void makeAdmin(Integer idUserAccount) {
        UserAccount userAccount = userAccountDAO.findById(idUserAccount);
        userAccount.setIsAdmin(true);
        userAccountDAO.update(userAccount);
    }
View Full Code Here

        userAccount.setIsAdmin(true);
        userAccountDAO.update(userAccount);
    }

    public void takeAdminRights(Integer idUserAccount) {
        UserAccount userAccount = userAccountDAO.findById(idUserAccount);
        userAccount.setIsAdmin(false);
        userAccountDAO.update(userAccount);
    }
View Full Code Here

                userManager.setWhenBlocked(new Date());
            }
            return null;
        }

        UserAccount result = userAccountDAO.findByMail(enteredMail);

        if(result == null) {
            inDatabase = false;
            context.addMessage("logInForm:enteredMail",
                    new FacesMessage(FacesMessage.SEVERITY_ERROR,
                    "There is no " + this.enteredMail + " in the database!", ""));
            context.validationFailed();

        } else {

            inDatabase = true;

            PasswordCrypto crypto = new PasswordCrypto();

            if(crypto.passwordsEqual(result.getUserPassword(), enteredPassword) == false
                    && enteredPassword.equals("") == false) {
                context.addMessage("logInForm:enteredPassword",
                        new FacesMessage(FacesMessage.SEVERITY_ERROR,
                        "Wrong password for " + this.enteredMail + "!", ""));
                context.validationFailed();
View Full Code Here

        StringBuffer urlBuffered = request.getRequestURL();

        String url = urlBuffered.append("?string=").append(uniqueString)
                .toString().replace("logIn.xhtml", "reseter.xhtml");

        UserAccount userAccount = userAccountDAO.findByMail(enteredMail);

        if(userAccount == null) {
            FacesContext.getCurrentInstance().addMessage("logInForm:enteredPassword", new FacesMessage(FacesMessage.SEVERITY_FATAL,
                    "Aw!", "It wasn't funny."));
            return null;
        }



        try {
            userAccount.setPasswordRecoveryString(uniqueString);
            userAccountDAO.update(userAccount);
        } catch(Exception e) {
            FacesContext.getCurrentInstance().addMessage("logInForm:enteredPassword", new FacesMessage(FacesMessage.SEVERITY_FATAL,
                    "Ups!", "Something went terribly wrong. We're working on that."));
            return null;

        }


        passwordRecoverer.sendMailViaSSL(userAccount.getMail(), url);

        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO,
                "Hey!", "Check Your mail."));
        return adressToRedirect;
View Full Code Here

    public String createNewAccount(String adressToRedirect) {

        checkPasswordsMatching();

        if(mailAval() == true && FacesContext.getCurrentInstance().isValidationFailed() == false) {
            UserAccount userAccount = new UserAccount(enteredMail, enteredPassword,
                    enteredName, enteredLastName);
           
            System.err.println("createAccount: " + enteredPassword);
            System.err.println("createAccount: " + new PasswordCrypto().passwordsEqual(new PasswordCrypto().encryptPassword(enteredPassword), enteredPassword));
View Full Code Here

        if(armm.isValidMail(enteredMail) == false) {
            return false;
        }

        UserAccount result = userAccountDAO.findByMail(enteredMail);

        if(result == null) {
            FacesContext.getCurrentInstance().addMessage("accountForm:mail",
                    new FacesMessage(FacesMessage.SEVERITY_INFO,
                    "This mail is available.", ""));
            return true;
        } else {
            FacesContext.getCurrentInstance().addMessage("accountForm:mail",
                    new FacesMessage(FacesMessage.SEVERITY_WARN,
                    result.getMail() + " is already taken!", ""));
            return false;
        }

    }
View Full Code Here

TOP

Related Classes of user.UserAccount

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.