summaryrefslogtreecommitdiff
path: root/plugins/Facebook/FBC_XDReceiver.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-10-24 19:59:46 -0400
committerEvan Prodromou <evan@status.net>2009-10-24 19:59:46 -0400
commit3c724ccd0df0d205a9567e435b6060300537f904 (patch)
tree4be361f0112444c5c8949a1e486efd1063030681 /plugins/Facebook/FBC_XDReceiver.php
parent967de946654e96793d11413a46067ac95b356a64 (diff)
parent6d6de3c1c7b359815aa0381b4cde3fcc8258cc80 (diff)
Merge branch '0.9.x' into location
Diffstat (limited to 'plugins/Facebook/FBC_XDReceiver.php')
-rw-r--r--plugins/Facebook/FBC_XDReceiver.php68
1 files changed, 68 insertions, 0 deletions
diff --git a/plugins/Facebook/FBC_XDReceiver.php b/plugins/Facebook/FBC_XDReceiver.php
new file mode 100644
index 000000000..2bc790d5a
--- /dev/null
+++ b/plugins/Facebook/FBC_XDReceiver.php
@@ -0,0 +1,68 @@
+<?php
+
+if (!defined('STATUSNET') && !defined('LACONICA')) {
+ exit(1);
+}
+
+/*
+ * Generates the cross domain communication channel file
+ * (xd_receiver.html). By generating it we can add some caching
+ * instructions.
+ *
+ * See: http://wiki.developers.facebook.com/index.php/Cross_Domain_Communication_Channel
+ */
+class FBC_XDReceiverAction extends Action
+{
+
+ /**
+ * Do we need to write to the database?
+ *
+ * @return boolean true
+ */
+
+ function isReadonly()
+ {
+ return true;
+ }
+
+ /**
+ * Handle a request
+ *
+ * @param array $args Arguments from $_REQUEST
+ *
+ * @return void
+ */
+
+ function handle($args)
+ {
+ // Parent handling, including cache check
+ parent::handle($args);
+ $this->showPage();
+ }
+
+ function showPage()
+ {
+ // cache the xd_receiver
+ header('Cache-Control: max-age=225065900');
+ header('Expires:');
+ header('Pragma:');
+
+ $this->startXML('html');
+
+ $language = $this->getLanguage();
+
+ $this->elementStart('html', array('xmlns' => 'http://www.w3.org/1999/xhtml',
+ 'xml:lang' => $language,
+ 'lang' => $language));
+ $this->elementStart('head');
+ $this->element('title', null, 'cross domain receiver page');
+ $this->script('http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.debug.js');
+ $this->elementEnd('head');
+ $this->elementStart('body');
+ $this->elementEnd('body');
+
+ $this->elementEnd('html');
+ }
+
+}
+