]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #5022 not setting forward on ajax calls for walled garden
authorCash Costello <cash.costello@gmail.com>
Fri, 1 Feb 2013 12:22:03 +0000 (07:22 -0500)
committerCash Costello <cash.costello@gmail.com>
Fri, 1 Feb 2013 12:22:03 +0000 (07:22 -0500)
engine/classes/ElggSite.php

index 1fe49b85c726e97b2fdb01195f3ef5876dd2e328..1a34df195bdff12310376097b3e9d58dc271125a 100644 (file)
@@ -381,7 +381,9 @@ class ElggSite extends ElggEntity {
                                elgg_register_plugin_hook_handler('index', 'system', 'elgg_walled_garden_index', 1);
 
                                if (!$this->isPublicPage()) {
-                                       $_SESSION['last_forward_from'] = current_page_url();
+                                       if (!elgg_is_xhr()) {
+                                               $_SESSION['last_forward_from'] = current_page_url();
+                                       }
                                        register_error(elgg_echo('loggedinrequired'));
                                        forward();
                                }
@@ -443,8 +445,6 @@ class ElggSite extends ElggEntity {
                // include a hook for plugin authors to include public pages
                $plugins = elgg_trigger_plugin_hook('public_pages', 'walled_garden', NULL, array());
 
-               // lookup admin-specific public pages
-
                // allow public pages
                foreach (array_merge($defaults, $plugins) as $public) {
                        $pattern = "`^{$CONFIG->url}$public/*$`i";