All salute.

Task: at the entrance to the site on Joomla 2.5 you need to make a start page on which all non-logged in users would get. On the page - a form with a login password. Those. you need to do the same thing that the "turn off site" function does in the "general settings", but allow not only administrators, but any registered users to the site.

There are 2 ways:

  1. Correct access rights for registered users (so that they start when the site is turned off) and turn off the site.
  2. Write the page with the entry form by adjusting index.php. I know php OOP, but I do not know Joomla api. Tell me which way to go (maybe there is a third one) and at least in general terms the implementation.

Thank you all for your attention.

    1 answer 1

    3. In the index.php template at the beginning, add a check to see if the user is logged in. Crooked, because works only when visiting pages that use the template. Like that:

    $user = JFactory::getUser(); if( $user->guest) { // форма чтобы залогиниться // exit(); } // дальше обычный темплейт 

    4. write a plugin that handles one of the events , for example, onAfterRoute . In the plugin, you need to check that the user is again, guest, and that any page is requested, except for the authorization form. Redirect anonymous authorization.

    5. Find the same ready-made plugin.

    • Thank. Found a very simple solution. Because My site is not big, I just changed access to all menu items and modules, except the login form to "for registered". It helped. Now not logged in user sees only the login form. But the information about $ user = JFactory :: getUser (); if ($ user-> guest) is useful. I'll know. - bigzhuk