summaryrefslogtreecommitdiff
path: root/core/hooks
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-02-14 23:03:09 +0000
committerBharat Mediratta <bharat@menalto.com>2009-02-14 23:03:09 +0000
commit9e08285c003de4fcb2dad9bd6917c326961ed524 (patch)
treeb21fbf99ba081f44a4f1888765d1e7707c4602df /core/hooks
parentb7e75a191cfc4de4ceb56f7fc6d44938e347e352 (diff)
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
Diffstat (limited to 'core/hooks')
-rw-r--r--core/hooks/init_gallery.php11
1 files changed, 11 insertions, 0 deletions
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;
+}