Package com.sugar.users

Examples of com.sugar.users.UserImpl


       
        return dataFile;
    }

    private void fillSuperUserBean (ServletContext context) {
        UserImpl superUser = new UserImpl ();
       
        superUser.setLogin (context.getInitParameter (ADMINUSER_LOGIN_PARAM));
        superUser.setPassword (context.getInitParameter (ADMINUSER_PASSWORD_PARAM));
       
        context.setAttribute ("adminUser", superUser);
    }
View Full Code Here


        final User user = (User) request.getSession().getAttribute ("user");
       
        final String login = (String) request.getParameter("login");
        final String password = (String) request.getParameter("password");
       
        final UserImpl adminUser = (UserImpl) request.getServletContext().getAttribute ("adminUser");
        if (true == adminUser.getLogin().equals(login) && true == adminUser.getPassword().equals(password)) {
            user.setLogin (login);
            user.setPassword (password);
            user.setIsAdmin (true);

            response.sendRedirect("protected/index.jsp");
View Full Code Here

            final String password = (String) request.getParameter("password");

            final SystemUsers sysUsers = (SystemUsers) request.getServletContext().getAttribute("sysUsers");
            User user = (User) request.getSession().getAttribute ("user");
           
            final UserImpl adminUser = (UserImpl) request.getServletContext().getAttribute ("adminUser");
            if (true == adminUser.getLogin().equals(login) && true == adminUser.getPassword().equals(password)) {
                user.setLogin (login);
                user.setPassword (password);
                user.setIsAdmin (true);

                response.sendRedirect ("protected/index.jsp");
            } else {
                final User sysUser = sysUsers.getUserByLogin (login);
                if (null == sysUser) {
                    UserImpl newUser = new UserImpl();
                    newUser.setLogin (login);
                    newUser.setPassword (password);
                    newUser.setIsAdmin (false);

                    request.getSession().setAttribute("user", newUser);

                    sysUsers.addUser(newUser);
                } else {
View Full Code Here

TOP

Related Classes of com.sugar.users.UserImpl

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.