Package com.tapestry5book.tlog.core.entities

Examples of com.tapestry5book.tlog.core.entities.User


    @Inject
    private ApplicationStateManager applicationStateManager;

    public User authenticate(String userName, String password) {
        User user = blogService.findUserByName(userName);

        if (user != null) {
            String digest = DigestUtils.md5Hex(password);

            if (user.getPassword().equals(digest)) {
                return user;
            }
        }

        return null;
View Full Code Here


                article = new Article();
                article.setTitle(attributes.getValue("title"));
                article.setPublishDate(parseDate(attributes.getValue("publishDate")));
                article.setBlog(blog);
            }else if(localName.equals("user")){
                User user = new User();
                user.setName(attributes.getValue("name"));
                user.setPassword(DigestUtils.md5Hex(user.getName()));
                users.add(user);
            }else if(localName.equals("tag")){
                Tag tag = new Tag();
                tag.setName(attributes.getValue("name"));
                tags.add(tag);
View Full Code Here

    void onValidateFromLoginForm() throws ValidationException {

        if (loginForm.isValid()) {

            User authenticated = authenticator.authenticate(userName, password);

            if (authenticated == null) {
                loginForm.recordError(messages.get("invalid-username-or-password"));
            } else {
                user = authenticated;
View Full Code Here

TOP

Related Classes of com.tapestry5book.tlog.core.entities.User

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.