Package org.apache.roller.presentation

Examples of org.apache.roller.presentation.RollerSession


            WebsiteData wd = umgr.getWebsite(form.getId());
           
            // Set website in request, so subsequent action gets it
            RollerRequest.getRollerRequest(request).setWebsite(wd);
           
            RollerSession rollerSession = RollerSession.getRollerSession(request);
            if ( rollerSession.isUserAuthorizedToAdmin(wd)) {
                checkBlacklist(errors, messages, form.getBlacklist());
                if (errors.isEmpty()) {
                    // ensure getEnabled can't be changed
                    form.setEnabled(wd.getEnabled());
                    form.copyTo(wd, request.getLocale());
View Full Code Here


        WebsiteData website = umgr.getWebsite(form.getId());
        ActionForward forward = mapping.findForward("removeWebsite.page");
        request.setAttribute("model", new WebsitePageModel(
                "websiteRemove.title", request, response, mapping, website));
        try {
            RollerSession rses = RollerSession.getRollerSession(request);
            if (rses.isUserAuthorizedToAdmin(website)) {
                form.copyFrom(website, request.getLocale());
                request.setAttribute("website", website);
            } else {
                forward = mapping.findForward("access-denied");
            }
View Full Code Here

        try {
            UserManager umgr = RollerFactory.getRoller().getUserManager();
            WebsiteFormEx form = (WebsiteFormEx)actionForm;
            WebsiteData website = umgr.getWebsite(form.getId());
           
            RollerSession rses = RollerSession.getRollerSession(request);
            if ( rses.isUserAuthorizedToAdmin(website) ) {
               
                // remove website
                umgr.removeWebsite(website);
                RollerFactory.getRoller().flush();
               
View Full Code Here

    HttpServletRequest req, HttpServletResponse res)
    throws Exception
  {
        WeblogEntryData entry = null;
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        RollerSession rollerSession = RollerSession.getRollerSession(req);
        try
        {
            if (rreq.getWebsite() != null
                 && rollerSession.isUserAuthorizedToAuthor(rreq.getWebsite()) )
            {
                String refid = req.getParameter(RollerRequest.REFERERID_KEY);
                if ( refid != null )
                {
                    RefererManager refmgr =
View Full Code Here

        try
        {
            request.setAttribute("model", new BasePageModel(
                "pagesForm.title", request, response, mapping));  
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            RollerSession rses = RollerSession.getRollerSession(request);
            WebsiteData website = rreq.getWebsite();
            if ( rses.isUserAuthorizedToAdmin(website) )
            {
                WeblogTemplateForm form = (WeblogTemplateForm)actionForm;
                WeblogTemplate data = new WeblogTemplate();
                form.copyTo(data, request.getLocale());
                data.setWebsite(website);
View Full Code Here

        try
        {           
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            WeblogTemplate pd = (WeblogTemplate)rreq.getPage();
           
            RollerSession rses = RollerSession.getRollerSession(request);           
            if ( rses.isUserAuthorizedToAdmin(pd.getWebsite()) )
            {
                BasePageModel pageModel = new BasePageModel(
                    "pageForm.title", request, response, mapping);
                pageModel.setWebsite(pd.getWebsite());
                request.setAttribute("model", pageModel);
View Full Code Here

        ActionForward forward = mapping.findForward("editPages.page");
        try
        {
            WeblogTemplateForm form = (WeblogTemplateForm)actionForm;
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            RollerSession rses = RollerSession.getRollerSession(request);
            request.setAttribute("model", new BasePageModel(
                "pagesForm.title", request, response, mapping));
           
            WebsiteData website = rreq.getWebsite();
            if (website == null && form.getId()!=null)
            {
                UserManager mgr = RollerFactory.getRoller().getUserManager();               
                WeblogTemplate template = mgr.getPage(form.getId());
                website = template.getWebsite();
            }
           
            if ( rses.isUserAuthorizedToAdmin(website))
            {
                addModelObjects(request, response, mapping, website);
            }
            else
            {
View Full Code Here

            UserManager mgr = RollerFactory.getRoller().getUserManager();
            WeblogTemplateForm form = (WeblogTemplateForm)actionForm;
            WeblogTemplate template = mgr.getPage(form.getId());
            WebsiteData website = template.getWebsite();
           
            RollerSession rses = RollerSession.getRollerSession(request);         
            if ( rses.isUserAuthorizedToAdmin(website) )
            {
                if(!template.isRequired()) {
                   
                    mgr.removePage(template);
                    RollerFactory.getRoller().flush();
View Full Code Here

        throws IOException, ServletException
    {
        ActionForward forward = mapping.findForward("removePage.page");
        try
        {
            RollerSession rses = RollerSession.getRollerSession(request);
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            WeblogTemplate page = (WeblogTemplate) rreq.getPage();
            WebsiteData website = page.getWebsite();
            if ( rses.isUserAuthorizedToAdmin(website) )
            {
                WeblogTemplateForm form = (WeblogTemplateForm)actionForm;
                form.copyFrom(page, request.getLocale());

                addModelObjects(request, response, mapping, page.getWebsite());
               
                BasePageModel pageModel = new BasePageModel(
                    "editPages.title.removeOK", request, response, mapping);
                pageModel.setWebsite(website);
                request.setAttribute("model", pageModel);

                UserData ud = rses.getAuthenticatedUser();
                request.setAttribute("user",ud);
            }
            else
            {
                forward = mapping.findForward("access-denied");
View Full Code Here

            WeblogTemplateForm form = (WeblogTemplateForm)actionForm;
            UserManager mgr = RollerFactory.getRoller().getUserManager();
            WeblogTemplate data = mgr.getPage(form.getId());
            WebsiteData website = data.getWebsite();
           
            RollerSession rses = RollerSession.getRollerSession(request);
            if (rses.isUserAuthorizedToAdmin(website))
            {
                form.copyTo(data, request.getLocale());
                data.setLastModified( new java.util.Date() );

                validateLink( data );
View Full Code Here

TOP

Related Classes of org.apache.roller.presentation.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.