aboutsummaryrefslogtreecommitdiff
path: root/engine/classes
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2012-07-01 22:28:56 -0400
committerCash Costello <cash.costello@gmail.com>2012-07-01 22:28:56 -0400
commitbcd5b0e59e4ea7191475e30397578859315cf2bb (patch)
treed2de2dfbf1454d43c27fe82fefa70b3209bd3206 /engine/classes
parentc593ca648683688fe89ab6f7ebc39e1c8471af18 (diff)
downloadelgg-bcd5b0e59e4ea7191475e30397578859315cf2bb.tar.gz
elgg-bcd5b0e59e4ea7191475e30397578859315cf2bb.tar.bz2
Fixes #3955 removes public access from walled gardens - maintains groups functionality
Diffstat (limited to 'engine/classes')
-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();
+ }
}
}
}