From 9e08285c003de4fcb2dad9bd6917c326961ed524 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 14 Feb 2009 23:03:09 +0000 Subject: Say hello to the new Flash based uploader, courtesy of Eric Zelermyer. This requires a little trickery to proxy the session id and user agent through the ActionScript code so that we can assume the same session in the uploader. It's also using its own path to add photos since we'll want to have a slightly different protocol for dealing with responses (as opposed to JSON or HTML). A work in progress for sure, but it's already better than what we had before.?\024 --- core/hooks/init_gallery.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core/hooks') diff --git a/core/hooks/init_gallery.php b/core/hooks/init_gallery.php index 27a4d8a4..89f97ef9 100644 --- a/core/hooks/init_gallery.php +++ b/core/hooks/init_gallery.php @@ -21,3 +21,14 @@ Event::add("system.ready", array("I18n", "instance")); Event::add("system.post_routing", array("theme", "load_themes")); Event::add("system.ready", array("module", "load_modules")); Event::add("system.post_routing", array("url", "parse_url")); + +// Override the cookie if we have a session id in the URL. +// @todo This should probably be an event callback +$input = Input::instance(); +if ($g3sid = $input->post("g3sid", $input->get("g3sid"))) { + $_COOKIE["g3sid"] = $g3sid; +} + +if ($user_agent = $input->post("user_agent", $input->get("user_agent"))) { + Kohana::$user_agent = $user_agent; +} -- cgit v1.2.3