[Elgg 1.8-1.12 & 2.X: Login required] v1.8.2

Release Notes


  • Added cache urls for css and js to allowed urls (thanks Hector),
  • fixed a deprecated function issue I had missed in start.php.

Tested in Elgg 1.8.1 and newer.

  • what do i need to add to use this plugin? http://community.elgg.org/pg/plugins/project/733084/developer/anirupdutta/facebook-api-elgg-18 Hey iionly i think you should add "doc" for this plugin you know? lol

  • @Flexx:

    The URLs to add to the allowed URLs list solely depends on the plugins you add and the pages you want to give access for anonymous visitors. Therefore, it's simply impossibly to give any instructions that always work. Sometimes, it's easy to guess what URLs need to be included. Sometimes, only trial and error helps. Or you could add the line

    error_log("Loginrequired blocked URL: $current_url");

    above the gatekeeper() line in start.php to get a message about the blocked URL written to your server log. If you know the URL, simply add what follows after your main site URL to the list of allowed URLs:

    $add[] = 'rest-of-urls-to-be-allowed;

    You can use ".*" as wildcard in URLs.

    I'm not sure what might be wrong with the members' listing. The elgg_list_entities call seems alright - and it surely worked for me. If the elgg_social_login has problems creating the icons, you might ask the developer if there's a bug in his plugin.

    The Facebook API seems to open up your site a lot (the readme says "Many endpoints have been exposed"). I'm not sure it makes much sense in using a walled-garden plugin to shield your site on the one hand when you want to give access on the other hand. Also, you mentioned you want configure your site like "users allow what others see". Actually, this is what Elgg does by default, and it's quite different to a walled-garden approach where you want to avoid "public" access.

    I am slightly reluctant to open up my site (even a test site only) to Facebook only to find out what connections the Facebook API builts up between Facebook and Elgg. Unfortunately, the plugin description contains no information about what the plugin does either. Therefore, I would ask you to find out what pages might be included in the list of allowed URLs on your own - it's really simply with using the error_log approach described above.

  • Thanks loads iionly! Ill look into all your suggestions! God bless!

  • Hi,

    is it possible to display login-widget + last blog-posts widget ? Where to configure this ?

  • @hollosch: it is possible to show the last blogs widget on the login page. Actually, it's pretty easy. The index page used by the Loginrequired plugin is built up in the same way as the index page by the Elgg core custom_index plugin. To add the blog widget you will have to edit the files mod/loginrequired/index.php and mod/loginrequired/views/default/page/layouts/loginrequired_index.php. You can look into the corresponding files of the custom_index plugin, i.e. mod/custom_index/index.php and mod/custom_index/views/default/page/layouts/custom_index.php, where you will find the code for the blogs widget. Simply add the this code to the Loginrequired plugin files.

  • It solves a small issue I am having with 1.8.4: When the registration is not approved, built in 1.8.4 walled garden returns the focus to login form, whereas I want it to stay on register form for the user to correct error and proceed. This plugin resolves this issue.

    One small issue with this plugin seems that on the register form, there is no "cancel" button (I am not sure if something to do with this plugin but with elgg's default walled garden, I can see this button).

    Thanks for the plugin!


  • @Burada: the Loginrequired plugin uses the default Elgg core register form and this form does not contain a cancel button. It seems only the Elgg core walled garden register form (which is different from the default core register form) has a cancel button included. I'm not sure if the cancel button was forgotten on the normal core register form or if there is some other reason a cancel button was included on the Elgg core walled-garden register form.

  • Hello iionly, i used the loginrequired plugin on elgg 1.8.4 with little twitts but double login is showing, what do i need to do, see link www.successland.org/dating/

  • @pee77: I only see the Elgg default walled-garden login page on your site right now. I assume the double login page was caused by using the Loginrequired plugin while still having the Elgg core option "Restrict pages to logged-in users" enabled. This won't work as I wrote in the "Requirements" section in the plugin description. The Loginrequired plugin replaces the built-in walled-garden feature of Elgg core. If you want to use Loginrequired you need to disable the option "Restrict pages to logged-in users" in the advanced site settings.

  • @iionly: thanks, sorted out. Meanwhile, how do i display events widget on the login page just like the new members?

  • @pee77: how to display events in a widget firstly depends on what event plugin you are actually using. Most likely the display of an events widget works quite similar to the way other widgets are created on the index page. I would suggest to take a look in the code of the bundled Custom_index plugin as the structure of the Loginrequired plugin code is based on it and the creation of widgets works in the same way. For any more specific information regarding fetching the latest events (or what kind of info you want to display in the widget) I would suggest to ask the developer of the event plugin you are using.


  • Category: Misc
  • License: GNU General Public License (GPL) version 2
  • Updated: 2016-12-11
  • Downloads: 8173
  • Recommendations: 26

Other Projects

View iionly's plugins