Package org.jmanage.core.auth

Examples of org.jmanage.core.auth.User


     * @param form
     * @return
     */
    private User buildUser(ActionForm form){
        UserForm userForm = (UserForm)form;
        User user = UserManager.getInstance().getUser(userForm.getUsername());
        assert user != null;

        List<Role> roles = new ArrayList<Role>(1);
        String[] rolesString = userForm.getRole();
        for(int ctr=0; ctr < rolesString.length; ctr++){
          roles.add(new Role(rolesString[ctr]));
        }
        user.setRoles(roles);
        if(!userForm.getPassword().equals(UserForm.FORM_PASSWORD)){
            String hashedPassword = Crypto.hash(userForm.getPassword());
            user.setPassword(hashedPassword);
        }
        user.setStatus(userForm.getStatus());
        return user;
    }
View Full Code Here


                                                        boolean isAuthRequired){
        ServiceContextImpl context = new ServiceContextImpl();
        if(isAuthRequired){
            assert command.getUsername() != null;
            assert command.getPassword() != null;
            User user = new User(command.getUsername(),
                    null, null, null, 0);
            user.setPlaintextPassword(command.getPassword());
            context.setUser(user);
        }
        return context;
    }
View Full Code Here

TOP

Related Classes of org.jmanage.core.auth.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.