From 39c88e7b82d8bd6483e668ef80cbbe08d3a45ac7 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 14 Jul 2012 08:39:12 -0400 Subject: different solution for letting people use flash uploader through walled garden --- start.php | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/start.php b/start.php index 13a9e2d85..6575c2daa 100644 --- a/start.php +++ b/start.php @@ -74,19 +74,14 @@ function tidypics_init() { // notifications register_notification_object('object', 'album', elgg_echo('tidypics:newalbum_subject')); - elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'tidypics_notify_message'); - // ajax handler for uploads when use_only_cookies is set - // using the all forward hook to work with walled gardens. - elgg_register_plugin_hook_handler('forward', 'all', 'tidypics_ajax_session_handler'); + // allow people in a walled garden to use flash uploader + elgg_register_plugin_hook_handler('public_pages', 'walled_garden', 'tidypics_walled_garden_override'); - /* - // Register for notifications + // flash session work around for uploads when use_only_cookies is set + elgg_register_plugin_hook_handler('forward', 'csrf', 'tidypics_ajax_session_handler'); - // slideshow plugin hook - register_plugin_hook('tp_slideshow', 'album', 'tidypics_slideshow'); -*/ // Register actions $base_dir = elgg_get_plugins_path() . 'tidypics/actions/photos'; elgg_register_action("photos/delete", "$base_dir/delete.php"); @@ -482,6 +477,16 @@ function tp_mostrecentimages($max = 8, $pagination = true) { return list_entities("object", "image", 0, $max, false, false, $pagination); } +/** + * Allows the flash uploader actions through walled garden since + * they come without the session cookie + */ +function tidypics_walled_garden_override($hook, $type, $pages) { + $pages[] = 'action/photos/image/ajax_upload'; + $pages[] = 'action/photos/image/ajax_upload_complete'; + return $pages; +} + /** * Work around for Flash/session issues * -- cgit v1.2.3