From 95d7c27e5a65f6df5221842bb4427619ccec3327 Mon Sep 17 00:00:00 2001 From: nickw Date: Fri, 14 May 2010 14:30:37 +0000 Subject: Updating core code to allow public pages using new Walled Garden functionality. git-svn-id: http://code.elgg.org/elgg/trunk@6047 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/handlers/action_handler.php | 1 - engine/handlers/cron_handler.php | 1 - engine/handlers/pagehandler.php | 1 - engine/handlers/service_handler.php | 1 - engine/handlers/xml-rpc_handler.php | 1 - engine/lib/cron.php | 20 ++++++++++++++++++++ engine/lib/sites.php | 2 ++ 7 files changed, 22 insertions(+), 5 deletions(-) (limited to 'engine') diff --git a/engine/handlers/action_handler.php b/engine/handlers/action_handler.php index 52c1a2633..f99e1efdc 100644 --- a/engine/handlers/action_handler.php +++ b/engine/handlers/action_handler.php @@ -12,7 +12,6 @@ /** * Load Elgg framework */ -define('externalpage',true); require_once("../start.php"); $action = get_input("action"); action($action); \ No newline at end of file diff --git a/engine/handlers/cron_handler.php b/engine/handlers/cron_handler.php index 37a0335f6..a86cf7f4c 100644 --- a/engine/handlers/cron_handler.php +++ b/engine/handlers/cron_handler.php @@ -9,7 +9,6 @@ */ // Load Elgg engine -define('externalpage',true); require_once("../start.php"); global $CONFIG; diff --git a/engine/handlers/pagehandler.php b/engine/handlers/pagehandler.php index a0837caa1..24bef4d03 100644 --- a/engine/handlers/pagehandler.php +++ b/engine/handlers/pagehandler.php @@ -9,7 +9,6 @@ */ // Load Elgg engine -// define('externalpage',true); require_once("../start.php"); // Get input diff --git a/engine/handlers/service_handler.php b/engine/handlers/service_handler.php index 51ec2a689..4cc54a987 100644 --- a/engine/handlers/service_handler.php +++ b/engine/handlers/service_handler.php @@ -10,7 +10,6 @@ // Load Elgg engine -define('externalpage',true); require_once("../start.php"); // Get input diff --git a/engine/handlers/xml-rpc_handler.php b/engine/handlers/xml-rpc_handler.php index 26c1454bf..67d99a6ac 100644 --- a/engine/handlers/xml-rpc_handler.php +++ b/engine/handlers/xml-rpc_handler.php @@ -9,7 +9,6 @@ */ // Load Elgg engine -define('externalpage',true); require_once("../start.php"); global $CONFIG; diff --git a/engine/lib/cron.php b/engine/lib/cron.php index b4952e2ee..75897fb21 100644 --- a/engine/lib/cron.php +++ b/engine/lib/cron.php @@ -18,6 +18,9 @@ class CronException extends Exception {} function cron_init() { // Register a pagehandler for cron register_page_handler('cron','cron_page_handler'); + + // register a hook for Walled Garden public pages + register_plugin_hook('public_pages', 'walled_garden', 'cron_public_pages'); } /** @@ -53,5 +56,22 @@ function cron_page_handler($page) { } } +function cron_public_pages($hook, $type, $return_value, $params) { + global $CONFIG; + + $return_value[] = "{$CONFIG->url}pg/cron/minute"; + $return_value[] = "{$CONFIG->url}pg/cron/fiveminute"; + $return_value[] = "{$CONFIG->url}pg/cron/fifteenmin"; + $return_value[] = "{$CONFIG->url}pg/cron/halfhour"; + $return_value[] = "{$CONFIG->url}pg/cron/hourly"; + $return_value[] = "{$CONFIG->url}pg/cron/daily"; + $return_value[] = "{$CONFIG->url}pg/cron/weekly"; + $return_value[] = "{$CONFIG->url}pg/cron/monthly"; + $return_value[] = "{$CONFIG->url}pg/cron/yearly"; + $return_value[] = "{$CONFIG->url}pg/cron/reboot"; + + return $return_value; +} + // Register a startup event register_elgg_event_handler('init','system','cron_init'); \ No newline at end of file diff --git a/engine/lib/sites.php b/engine/lib/sites.php index fb9b66725..fb47dc012 100644 --- a/engine/lib/sites.php +++ b/engine/lib/sites.php @@ -279,6 +279,8 @@ class ElggSite extends ElggEntity { "{$CONFIG->url}action/user/requestnewpassword", "{$CONFIG->url}pg/resetpassword", "{$CONFIG->url}upgrade.php", + "{$CONFIG->url}xml-rpc.php", + "{$CONFIG->url}mt/mt-xmlrpc.cgi", ); // include a hook for plugin authors to include public pages -- cgit v1.2.3