[opencms-dev] RE: [opencms] (6b3) Linking directly to theXMLcontent editor --> SOLVED AND WORKING OK

Jorge González informatico at hotelparadisepark.com
Wed May 11 14:16:05 CEST 2005


>The link i posted in the last mail works only from the workspace.
>I'm having a security problem accessing the content from the outside world.

>org.opencms.security.CmsSecurityException: Denied access to resource
>'/contents/blank', required permissions are +w [Code 303 - No permissions
to
>perform this operation]


Now it works, the problem (after a long afternoon) was

"The user were logged in correctly, but into the project online"


This is the working login code:

-----
		try
		{
			cmso.loginUser(username, password);
			cms = new CmsJspActionElement(pageContext, request, response);
			org.opencms.file.CmsProject proj = (org.opencms.file.CmsProject)
cmso.getAllAccessibleProjects().get(cmso.getAllAccessibleProjects().size()-1
); //this works for me
			cmso.getRequestContext().setCurrentProject(proj);

			if (forward != null)
				response.sendRedirect(forward);

		}
		catch(org.opencms.security.CmsSecurityException e)
		{
			out.println("<script type=\"javascript\">alert(\"Login failed\n\" +
e.getMessage());</script>");
		}
-----




More information about the opencms-dev mailing list