Log In Required

Warning: This plugin has't been updated in over 54 years. It may no longer be maintained.

What you can do to help:

Secures elgg by allowing non-members to only see some pages available for public viewing.

Last updated

Require logged in user for all pages except for:

  • The Home page (of course)
  • Registeration page
  • Forgotten Password Page
  • The "externalpages" plugin pages (Terms, Privacy, About)

For developers: If you would like to add more allowed public view pages, you can register your own hook:

register_plugin_hook('login_required','login_required', 'your_function_name');

Make sure to return an array of page URL's. For more information, I have a working example in the plugin itself made for demonstration purposes.

To allow access to profile pages: Change the following:

if (!in_array(strtolower(trim($current_url)), array_map('strtolower', $allow)))

  gatekeeper();

to 

if (!in_array(strtolower(trim($current_url)), array_map('strtolower', $allow)) && get_context() !== 'profile' && get_context() !== 'widget')

  gatekeeper();

Note: If you do not want the widgets to show any content, you can remove the 

&& get_context() !== 'widget'

from the end of this statement. It will allow access to the profile page showing the profile information only.

 

Stats

  • Category: Site admin
  • License: GNU General Public License (GPL) version 2
  • Updated: 1970-1-1
  • Downloads: 2345
  • Recommendations: 11

Other Projects

View Khaled Afiouni's plugins