Loading...
 
Features / Usability

Features / Usability


Page Not Found for Registered Users

posts: 37

1. Tiki 14

I am the sole editor of my wiki, which is odd, I know. Tiki just did such an amazing job with the structure that I didn't want to use Drupal. But I digress.

I know how, and have, set up a custom "Page Not Found" page for anonymous users. But I'd like to re-direct registered users to the same page. My students are only allowed to contribute to forums and edit their assigned student page. I know this wouldn't be a 'standard' feature, due to the community feel of wikis in general.

I'm assuming the redirect for anony. is in the code somewhere, and I'd have to set it up for a second group to be included in that if statement. I'm not sure where to look, however.

posts: 212

If you are willing to change the code to accomplish this, it is a small change, but you must remember that updates in the future may remove your change.

If you are redirecting to your custom "Page Not Found" page for anonymous users by having set the General, Navigation, "URL an anonymous is redirected when page not found" option, then that option is checked in tiki-index.php. The code that checks it looks like this:

if (!$isprefixed && !empty($prefs['url_anonymous_page_not_found']) && empty($user)) {
                $access->redirect($prefs['url_anonymous_page_not_found']);


When someone is logged in, the $user is not empty so they are not sent to the custom "Page Not Found". You can have it ignore if someone is logged in by removing the "&& empty($user)" so it looks like:

if (!$isprefixed && !empty($prefs['url_anonymous_page_not_found'])) {
                $access->redirect($prefs['url_anonymous_page_not_found']);


And then it will redirect even if the page was not found for a logged in user.

Tom

posts: 37

Perfect. Thank you. I have no problem changing the code at all.

I will get back to you if there are any problems!


Why Register?

Register at tiki.org and you'll be able to use the account at any *.tiki.org site, thanks to the InterTiki feature. A valid email address is required to receive site notifications and occasional newsletters. You can opt out of these items at any time.