05-27-2020 12:40 PM
Hi, we're using enterprise edition of Alfresco 5.2 Share. Here we want to redirect the users to document library page rather dashboard of enterprise site. After making below changes and build the project when i login I get the error screen “Back to My Dashboard” button redirects unprivileged users to their own home page(dashboard page). What could be issue here..please advise.
PS: When the admin is already a member to private site then he should be to login without error. What changes would need to be made to verify site membership and only redirect site members to the new document library page.
<!-- // site-index.jsp -->
<%@ page import="org.alfresco.web.site.*" %>
<%@ page import="org.springframework.extensions.surf.*" %>
<%@ page import="org.springframework.extensions.surf.site.*" %>
<%@ page import="org.springframework.extensions.surf.util.*" %>
<%@ page import="java.util.*" %>
<%
<!-- // retrieve user name from the session -->
String userid = (String)session.getAttribute(SlingshotUserFactory.SESSION_ATTRIBUTE_KEY_USER_ID);
<!-- // test user dashboard page exists? -->
RequestContext context = (RequestContext)request.getAttribute(RequestContext.ATTR_REQUEST_CONTEXT);
if (!context.getObjectService().hasPage("user/" + userid + "/dashboard"))
{
<!-- // no user dashboard page found! create initial dashboard for this user... -->
Map<String, String> tokens = new HashMap<String, String>();
tokens.put("userid", userid);
FrameworkUtil.getServiceRegistry().getPresetsManager().constructPreset("user-dashboard", tokens);
}
<!-- // redirect to site or user dashboard as appropriate -->
<!-- // String siteName = request.getParameter("site"); -->
siteName = "enterprise";
if (siteName == null || siteName.length() == 0)
{
<!-- // Get and forward to user's home page -->
SlingshotUserFactory slingshotUserFactory =
(SlingshotUserFactory) FrameworkUtil.getServiceRegistry().getUserFactory();
String userHomePage = slingshotUserFactory.getUserHomePage(context, userid);
response.sendRedirect(request.getContextPath() + userHomePage);
}
else
{
<!-- // forward to site specific dashboard page -->
response.sendRedirect(request.getContextPath() + "/page/site/" + URLEncoder.encode(siteName) + "/documentlibrary");
}
%>
05-28-2020 10:56 AM
There is already a post here: https://hub.alfresco.com/t5/alfresco-content-services-forum/how-to-change-the-alfresco-share-landing...
Dont create duplicate posts.
Explore our Alfresco products with the links below. Use labels to filter content by product module.