[
https://jira.duraspace.org/browse/DS-488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=26362#comment-26362
]
Scott Phillips commented on DS-488:
-----------------------------------
We came across this issues as well when we were upgrading our DSpace instance.
It might not be the exact same thing situation as the original report, but it
sounds really close. The problem is that after login in as an administrator and
then trying to *assume* the login of another user DSpace redirects the user to
the page /admin which doesn't exist. We have pages that are under /admin/*.
The problem lies in administrative.js, ~line 803 in the
doEditEPerson(epersonID) function. When the application is mounted at the ROOT
the call to cocoon.request.getContextPath() returns a blank string, "". When
the browser receives a redirect to a blank string it uses the normal relative
processing that browsers do and trims the current filename portion of the URL
leaving just /admin. To fix this we added the following code.
https://github.com/DSpace/DSpace/blob/master/dspace-xmlui/src/main/resources/aspects/Administrative/administrative.js
else if (cocoon.request.get("submit_login_as"))
{
// Login as this user.
assertAdministrator();
result =
FlowEPersonUtils.processLoginAs(getDSContext(),getObjectModel(),epersonID);
if (result != null && result.getOutcome().equals("success"))
{
// the user is loged in as another user, we can't let
them continue on
// using this flow because they might not have
permissions. So forward
// them to the homepage.
var redirect = "/";
if (cocoon.request.getContextPath().length > 0)
redirect = cocoon.request.getContextPath();
cocoon.redirectTo(redirect,true);
getDSContext().complete();
cocoon.exit();
}
}
This checks if the current request is a blank string "" and if so redirects to
just "/". If the application is mounted somewhere other than root then it
continues to use that context path.
Hope this helps someone.
> Admin aspect URI's fail after logging in as adminstrator
> --------------------------------------------------------
>
> Key: DS-488
> URL: https://jira.duraspace.org/browse/DS-488
> Project: DSpace
> Issue Type: Bug
> Components: XMLUI
> Affects Versions: 1.5.2
> Reporter: Hilton Gibson
> Priority: Major
> Attachments: dspace-admin-aspect-error.png
>
>
> Our repository is setup to use the XMLUI by default.
> See: http://ir.sun.ac.za/wiki/index.php/Default_Interface
> However the https://scholar.sun.ac.za/admin links fail after the repository
> managers logs in.
> It seems that the "Administrator" cocoon aspect fails to build healthy URI's
> after an administrator login.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel