0

The Goal

We have a subset of items on our site that are not Joomla pages, but other systems such as a selection of HTML5 and Flash (for now) Games:

  • /play
  • /photobooth
  • etc.

These should only be accessible after logging in through Joomla, but trying to intercept these URLS only leads to Joomla Errors Bypassing Joomla works, but then anyone can access them, and the connections we have don't work.

The Suggested Process

  1. Add new Menu Item (System -> URL)
    • So, when going to this Alias, rather than going directly to the subset of the site, it first goes through Joomla for Login.
    • See Below for Image of Configuration
  2. Add new Menu Item to Article / custom Menu
  3. Click on new Link
  4. If Logged in:

    1. Go to page
  5. If not Logged In:

    1. Redirect to Login Page
    2. Redirect back to Menu Alias

The Issue (Step 2)

"Internal" links that are not Joomla need to be accessed only when logged in with Joomla

Intended Behavior

  1. If Logged in:

    1. Go to page
  2. If not Logged In:

    1. Redirect to Login Page
    2. Redirect back to Menu Alias

Actual Behavior

  1. If Logged in:

    1. Redirects to "404 - Component not found."
      • (See Below)
  2. If not Logged In:

    1. Redirects to Login Page
    2. Redirects to "404 - Component not found."
      • (See Below)

System

  • Joomla: 3.8.10
  • PHP: 7.1.21
  • Database: 5.5.5-10.0.36-MariaDB

Images

404 - Component not Found

Default Joomla Error Page

Menu Item Configuration

Menu Item Configuration

  • Hello and welcome. You put a good amount of effort to make this a good question. The problem is that personally I still find it hard to follow you. I am also getting confused with the term "Internal Non Joomla links". Do you mean the system URL menu item type? And what are you linking with that? What is the menu Article custom menu? If you could add more clear and explanatory description of what you are trying to do, we might be in place to give you some guidance. – FFrewin Sep 7 '18 at 17:41
  • Okay, I updated the question to include more details. Thanks for the encouragement. Please let me know if you need any further information. – ZLHysong Sep 7 '18 at 17:54
0

The URLs you mention leads to html documents that are not part of the Joomla Application.
You can not implement Joomla's ACL on pages which are not part of Joomla and are otherwise publicly accessible.

When you link to an external (of the Joomla app) URL like the one you show in the screenshot: /play/cruiseship/lobby if that are url is a valid one, you will get there and your browser will load/display the content that exists there. But this is not Joomla anymore.

The Issue (Step 2)

"Internal" links that are not Joomla need to be accessed only when logged in with Joomla

Simply the above cannot happen. Unless you have coded those pages like this, it seems to be nothing that will tell if it's a user registered in your Joomla site or anything else related to Joomla. Restriction based on Joomla ACL cannot occur, no redirect for non-registered users can happen.

Regarding The 404 errors, I would guess that this is caused by wrong URL path you have given to the system links or something. Not sure how you have managed to make Joomla requesting a login. I guess something among the various settings you have tried. But I would guess, that still if you just try to access those html files directly using their correct path, you would be able to access/load them.

0

This can be done, with a bit of mucking about with .htaccess and PHP.

Roughly;

For each directory that contains external content, your http server should redirect the URI as a parameter to a PHP file.

That PHP file needs to fire up the necessary bits of Joomla, and then call Joomla to determine whether a user session currently exists.

If not, call mod_user for authorization; that call can include a parameter which is the URL of a Joomla page that is displayed upon a successful login. That page should include the links to the non-Joomla content hosted on your site.

If a user session exists, then simply open the requested file, and return the contents to the httpd daemon.

Note that it turns out that using a menu item that is a URL type no longer plays nicely with the post login redirect option on mod_login, for current versions of Joomla.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.