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");
}
%>
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.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.