aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggSite.php
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-07-11 21:19:14 +0200
committerSem <sembrestels@riseup.net>2012-07-11 21:19:14 +0200
commitb83574ae1b8ada2bb9c2247492806473df920259 (patch)
tree30f9010da3cab12bda4921f079cfe86fcef2e7a4 /engine/classes/ElggSite.php
parent46bd104bd523c08ff2f6bc0342be9ae1251259e8 (diff)
parent4d42fd0263948eee4a7c7a26ceca0647c01cce32 (diff)
downloadelgg-b83574ae1b8ada2bb9c2247492806473df920259.tar.gz
elgg-b83574ae1b8ada2bb9c2247492806473df920259.tar.bz2
Merge tag '1.8.8' of git://github.com/Elgg/Elgg into lorea-preprod
Elgg 1.8.8 release Conflicts: js/lib/languages.js
Diffstat (limited to 'engine/classes/ElggSite.php')
-rw-r--r--engine/classes/ElggSite.php26
1 files changed, 18 insertions, 8 deletions
diff --git a/engine/classes/ElggSite.php b/engine/classes/ElggSite.php
index e793ab9c6..401939005 100644
--- a/engine/classes/ElggSite.php
+++ b/engine/classes/ElggSite.php
@@ -381,14 +381,24 @@ class ElggSite extends ElggEntity {
public function checkWalledGarden() {
global $CONFIG;
- if ($CONFIG->walled_garden && !elgg_is_logged_in()) {
- // hook into the index system call at the highest priority
- elgg_register_plugin_hook_handler('index', 'system', 'elgg_walled_garden_index', 1);
-
- if (!$this->isPublicPage()) {
- $_SESSION['last_forward_from'] = current_page_url();
- register_error(elgg_echo('loggedinrequired'));
- forward();
+ if ($CONFIG->walled_garden) {
+ if ($CONFIG->default_access == ACCESS_PUBLIC) {
+ $CONFIG->default_access = ACCESS_LOGGED_IN;
+ }
+ elgg_register_plugin_hook_handler(
+ 'access:collections:write',
+ 'user',
+ '_elgg_walled_garden_remove_public_access');
+
+ if (!elgg_is_logged_in()) {
+ // hook into the index system call at the highest priority
+ elgg_register_plugin_hook_handler('index', 'system', 'elgg_walled_garden_index', 1);
+
+ if (!$this->isPublicPage()) {
+ $_SESSION['last_forward_from'] = current_page_url();
+ register_error(elgg_echo('loggedinrequired'));
+ forward();
+ }
}
}
}