OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



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
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

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", http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=3546&start=15#p18816

All seems to work right, except than when users (with "reader" role) log-in, they are redirected to an /index page (e.g. http://www.ojs-site.com/index) 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/PageRouter.inc.php in the redirectHome function.

The solution (checked with Alec, thanks!) is the modification in classes/core/PageRouter.inc.php where we changed
Code: Select all
if ($role->getRoleId() == ROLE_ID_READER) $request->redirect(null, 'index');
in
Code: Select all
if ($role->getRoleId() == ROLE_ID_READER) $request->redirect(null, 'user');
and it works.

Hope that this can help someone.
Andrea
--
Cineca - Sede operativa di Roma
http://www.cineca.it
marchitelli
 
Posts: 120
Joined: Tue May 22, 2007 12:44 am

Re: Fix wrong redirect to journal

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

Hi Andrea,

Thanks for the detailed posting!

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9047
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot] and 9 guests