Fix wrong redirect to journal

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.
Posts: 125
Joined: Tue May 22, 2007 12:44 am

Fix wrong redirect to journal

Postby marchitelli » Sun May 11, 2014 12:32 am

We have a multi-journal/multidomain OJS installation, hosting multiple journals for various customers on different domains.
We manage this with different virtual hosts an specific .htaccess files for each host, as explained in "Individual Domain name for each journal within one OJS installation",

All seems to work right, except than when users (with "reader" role) log-in, they are redirected to an /index page (e.g. that get a 404 error in a multisite installation with rewrite like that we made.

In this case, OJS is probably trying to redirect the user to the site-wide User Home, which may not work depending on the rewrite config.
(It'll be similar to the Site Administration link for logged-in site administrators, with "index" in place of the journal path.)

If so, this redirect is implemented in classes/core/ in the redirectHome function.

The solution (checked with Alec, thanks!) is the modification in classes/core/ where we changed

Code: Select all

if ($role->getRoleId() == ROLE_ID_READER) $request->redirect(null, 'index');

Code: Select all

if ($role->getRoleId() == ROLE_ID_READER) $request->redirect(null, 'user');
and it works.

Hope that this can help someone.
Cineca - Sede operativa di Roma

Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: Fix wrong redirect to journal

Postby asmecher » Mon May 12, 2014 9:00 am

Hi Andrea,

Thanks for the detailed posting!

Alec Smecher
Public Knowledge Project Team

Return to “OJS Technical Support”

Who is online

Users browsing this forum: No registered users and 2 guests