Package org.apache.roller.ui.core

Examples of org.apache.roller.ui.core.RollerSession


    public void initNew(HttpServletRequest request, HttpServletResponse response)
    {
        mLogger.debug("init new called");
       
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
        RollerSession rses = RollerSession.getRollerSession(request);
        if (rreq.getWebsite().getDefaultPlugins() != null)
        {
            setPluginsArray(StringUtils.split(
                    rreq.getWebsite().getDefaultPlugins(), ",") );
        }
View Full Code Here


       
        HttpSession session = mockRequest.getSession(true);
        UserManager umgr = RollerFactory.getRoller().getUserManager();
        UserData user = umgr.getUserByUserName(username);
       
        RollerSession rollerSession = new RollerSession();
        rollerSession.setAuthenticatedUser(user);
        session.setAttribute(RollerSession.ROLLER_SESSION, rollerSession);
    }
View Full Code Here

            HttpServletRequest  request,
            HttpServletResponse response)
            throws Exception {
        YourWebsitesForm form = (YourWebsitesForm)actionForm;
       
        RollerSession rses = RollerSession.getRollerSession(request);
        UserData user = rses.getAuthenticatedUser();
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
        WebsiteData website = rreq.getWebsite();
       
        UserManager userMgr = RollerFactory.getRoller().getUserManager();
        PermissionsData perms = userMgr.getPermissions(website, user);
View Full Code Here

       
        public YourWebsitesPageModel(HttpServletRequest request,
                HttpServletResponse response, ActionMapping mapping) throws RollerException {
            super("yourWebsites.title", request, response, mapping);
            Roller roller = RollerFactory.getRoller();
            RollerSession rollerSession = RollerSession.getRollerSession(request);
            UserData user = rollerSession.getAuthenticatedUser();
            permissions = roller.getUserManager().getAllPermissions(user);
            userWeblogCount = permissions.size();
            pendings = roller.getUserManager().getPendingPermissions(user);
            groupBloggingEnabled =
                    RollerConfig.getBooleanProperty("groupblogging.enabled");
View Full Code Here

            throws Exception {
       
        ActionForward forward = mapping.findForward("createWebsite.page");
        CreateWebsiteForm form = (CreateWebsiteForm)actionForm;
       
        RollerSession rses = RollerSession.getRollerSession(request);
        UserData user = rses.getAuthenticatedUser();
        form.setLocale(user.getLocale());
        form.setTimeZone(user.getTimeZone());
        form.setEmailAddress(user.getEmailAddress());
       
        if (!RollerConfig.getBooleanProperty("groupblogging.enabled")) {
View Full Code Here

            HttpServletRequest  request,
            HttpServletResponse response)
            throws IOException, ServletException {
        ActionForward forward = mapping.findForward("yourProfile.page");
        try {
            RollerSession rollerSession = RollerSession.getRollerSession(request);
            UserData ud = rollerSession.getAuthenticatedUser();
            UserFormEx form = (UserFormEx)actionForm;
            form.copyFrom(ud, request.getLocale());
            form.setPasswordText(null);
            form.setPasswordConfirm(null);
            form.setLocale(ud.getLocale());
View Full Code Here

        ActionMessages msgs = new ActionMessages();
        try {
            ActionMessages errors = validate(form, new ActionErrors());
            if (errors.size() == 0) {
                // We ONLY modify the user currently logged in
                RollerSession rollerSession = RollerSession.getRollerSession(request);
                UserData data = rollerSession.getAuthenticatedUser();
               
                // We want to be VERY selective about what data gets updated
                data.setFullName(form.getFullName());
                data.setEmailAddress(form.getEmailAddress());
                data.setLocale(form.getLocale());
View Full Code Here

    public void initNew(HttpServletRequest request, HttpServletResponse response)
    {
        mLogger.debug("init new called");
       
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
        RollerSession rses = RollerSession.getRollerSession(request);
        if (rreq.getWebsite().getDefaultPlugins() != null)
        {
            setPluginsArray(StringUtils.split(
                    rreq.getWebsite().getDefaultPlugins(), ",") );
        }
View Full Code Here

            HttpServletResponse response)
            throws IOException, ServletException, RollerException {
       
        CommentManagementForm queryForm = (CommentManagementForm)actionForm;
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
        RollerSession rses = RollerSession.getRollerSession(request);
       
        if (rreq.getWeblogEntry() != null) {
            queryForm.setEntryid(rreq.getWeblogEntry().getId());
            queryForm.setWeblog(rreq.getWeblogEntry().getWebsite().getHandle());
        }       
        else if (rreq.getWebsite() != null) {
            queryForm.setWeblog(rreq.getWebsite().getHandle());
        }       
        request.setAttribute("model", new CommentManagementPageModel(
           "commentManagement.title", request, response, mapping, queryForm));
        if (request.getAttribute("commentManagementForm") == null) {
            request.setAttribute("commentManagementForm", actionForm);
        }
       
        // Ensure user is authorized to view comments in weblog
        if (rreq.getWebsite() != null && rses.isUserAuthorized(rreq.getWebsite())) {
            return mapping.findForward("commentManagement.page");
        }
        // And ensure only global admins can see all comments
        else if (rses.isGlobalAdminUser()) {
            return mapping.findForward("commentManagementGlobal.page");
        }
        else {
            return mapping.findForward("access-denied");
        }
View Full Code Here

        else if (rreq.getWebsite() != null) {
            queryForm.setWeblog(rreq.getWebsite().getHandle());
        }
        else {
            // user needs Global Admin rights to access site-wide comments
            RollerSession rses = RollerSession.getRollerSession(request);
            if (!rses.isGlobalAdminUser()) {
                return mapping.findForward("access-denied");
            }
        }
        RollerSession rses = RollerSession.getRollerSession(request);
        try {
            if (rses.isGlobalAdminUser()
                || (rreq.getWebsite()!=null && rses.isUserAuthorizedToAuthor(rreq.getWebsite())) ) {
                WeblogManager mgr= RollerFactory.getRoller().getWeblogManager();
               
                // delete all comments with delete box checked
                CommentData deleteComment = null;
                String[] deleteIds = queryForm.getDeleteComments();
View Full Code Here

TOP

Related Classes of org.apache.roller.ui.core.RollerSession

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.