Package org.apache.roller.ui.core

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


            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("ping.networkConnectionFailed"));
        }
    }

    private boolean isAuthorized(RollerRequest rreq, WebsiteData website) throws RollerException {
        RollerSession rses = RollerSession.getRollerSession(rreq.getRequest());
        return rses.isUserAuthorizedToAdmin(website) && !PingConfig.getDisablePingUsage();
    }
View Full Code Here


        throws Exception
    {
        ActionForward forward = mapping.findForward("Bookmarks");
        FolderFormEx form = (FolderFormEx)actionForm;
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
        RollerSession rses = RollerSession.getRollerSession(request);
        BookmarkManager bmgr = RollerFactory.getRoller().getBookmarkManager();
        WebsiteData website = null;
               
        FolderData fd = null;
        if (null != form.getId() && !form.getId().trim().equals(""))
        {
            fd = bmgr.getFolder(form.getId());
            website = fd.getWebsite();
        }
        else
        {
            fd = new FolderData();
            String parentId = request.getParameter(RequestConstants.PARENT_ID);
            FolderData parent = bmgr.getFolder(parentId);
            website = parent.getWebsite();
            fd.setParent(parent);
            fd.setWebsite(website);
        }
       
        if (fd.getWebsite().hasUserPermissions(
                rses.getAuthenticatedUser(), PermissionsData.AUTHOR))
        {
            // Copy form values to object
            form.copyTo(fd, request.getLocale());
            bmgr.saveFolder(fd);
            RollerFactory.getRoller().flush();
View Full Code Here

            HttpServletResponse response)
            throws IOException, ServletException, RollerException {
       
        CommentManagementForm queryForm = (CommentManagementForm)actionForm;
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
        RollerSession rses = RollerSession.getRollerSession(request);
       
        ActionForward fwd = null;
        // Ensure user is authorized to view comments in weblog
        if (rreq.getWebsite() != null && rses.isUserAuthorized(rreq.getWebsite())) {
            fwd =  mapping.findForward("commentManagement.page");
        }
        // Ensure only global admins can see all comments
        else if (rses.isGlobalAdminUser()) {
            fwd =  mapping.findForward("commentManagementGlobal.page");
        }
        else {
            // And everybody else gets...
            return mapping.findForward("access-denied");
View Full Code Here

            HttpServletRequest  request,
            HttpServletResponse response)
            throws Exception {
        if ("POST".equals(request.getMethod())) {
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            RollerSession rses = RollerSession.getRollerSession(request);
            if (rreq.getWebsite() != null && rses.isUserAuthorized(rreq.getWebsite())
                || rses.isGlobalAdminUser()) {
                WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
                CommentManagementForm queryForm = (CommentManagementForm)actionForm;
                wmgr.removeMatchingComments(
                    rreq.getWebsite(),
                    rreq.getWeblogEntry(),
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

            WeblogCategoryData parentCat = wmgr.getWeblogCategory(pid);
            cd.setWebsite(parentCat.getWebsite());
            cd.setParent(parentCat);
        }

        RollerSession rses = RollerSession.getRollerSession(request);
        if (cd.getWebsite().hasUserPermissions(
            rses.getAuthenticatedUser(), PermissionsData.AUTHOR))
        {
            form.copyTo(cd, request.getLocale());
            try {
                wmgr.saveWeblogCategory(cd);
                RollerFactory.getRoller().flush();
View Full Code Here

                BookmarksForm form) throws RollerException
        {
            super("",  request, response, mapping);
           
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            RollerSession rollerSession = RollerSession.getRollerSession(request);
            BookmarkManager bmgr = RollerFactory.getRoller().getBookmarkManager();

            allFolders = new TreeSet(new FolderPathComparator());

            // Find folderid wherever it may be
View Full Code Here

            String disabledProp = RollerConfig.getProperty(mDisabledProperty);
            if (disabledProp != null && disabledProp.equalsIgnoreCase("true")) {
                return false;
            }
        }
        RollerSession rses = RollerSession.getRollerSession(req);
        boolean ret = true;
       
        if (rses != null && rses.isGlobalAdminUser()) return true;
       
        // next, make sure that users role permits it
        if (mRoles != null && mRoles.size() > 0) {
            ret = false;
            Iterator roles = mRoles.iterator();
            while (roles.hasNext()) {
                String role = (String)roles.next();
                if (req.isUserInRole(role) || role.equals("any")) {
                    ret = true;
                    break;
                }
            }
        }
       
        // finally make sure that user has required website permissions
        if (ret && mPerms != null && mPerms.size() > 0) {
            UserData user = null;
            if (rses != null) user = rses.getAuthenticatedUser();
           
            WebsiteData website = getRequestedWeblog(req);
            BasePageModel pageModel = (BasePageModel)req.getAttribute("model");
            if (pageModel != null) {
                website = pageModel.getWebsite();
View Full Code Here

            throws Exception {
       
        ActionForward fwd =  mapping.findForward("access-denied");
       
        WebsiteData website = getWebsite(request);
        RollerSession rses = RollerSession.getRollerSession(request);
        if (rses.isUserAuthorizedToAuthor(website)) {
           
            fwd = mapping.findForward("uploadFiles.page");
           
            // this is the path in the uploads area that is being used
            UploadFileForm uploadForm = (UploadFileForm) actionForm;
View Full Code Here

        ActionMessages messages = new ActionMessages();
        ActionErrors errors = new ActionErrors();
        UploadFileForm theForm = (UploadFileForm) actionForm;
       
        WebsiteData website = getWebsite(request);
        RollerSession rses = RollerSession.getRollerSession(request);
        if (rses.isUserAuthorizedToAuthor(website)) {
           
            // display the main uploads page with the results
            fwd = mapping.findForward("uploadFiles.page");
           
            FileManager fmgr = RollerFactory.getRoller().getFileManager();
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.