aboutsummaryrefslogtreecommitdiffstats
path: root/mod/feed.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-09-20 17:04:22 -0700
committerfriendica <info@friendica.com>2012-09-20 17:04:22 -0700
commit6c92b5ab86d7f0fee775c2c485f5264ac2b206be (patch)
tree8d0782f0b2582e0b06fda370afcc435e5c4a6fad /mod/feed.php
parentc8957b36ea11a41604330c8f87c0fc0611ef18e6 (diff)
downloadvolse-hubzilla-6c92b5ab86d7f0fee775c2c485f5264ac2b206be.tar.gz
volse-hubzilla-6c92b5ab86d7f0fee775c2c485f5264ac2b206be.tar.bz2
volse-hubzilla-6c92b5ab86d7f0fee775c2c485f5264ac2b206be.zip
separate the public feed from everything else
Diffstat (limited to 'mod/feed.php')
-rw-r--r--mod/feed.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/mod/feed.php b/mod/feed.php
new file mode 100644
index 000000000..69d8fdb05
--- /dev/null
+++ b/mod/feed.php
@@ -0,0 +1,39 @@
+<?php
+
+
+require_once('include/items.php');
+
+function feed_init(&$a) {
+
+ $params = array();
+
+ $params['begin'] = ((x($_REQUEST,'date_begin')) ? $_REQUEST['date_begin'] : '0000-00-00 00:00:00');
+ $params['end'] = ((x($_REQUEST,'date_end')) ? $_REQUEST['date_end'] : '');
+ $params['type'] = ((stristr(argv(0),'json')) ? 'json' : 'xml');
+
+ $channel = '';
+ if(argc() > 1) {
+ $r = q("select * from entity where entity_address = '%s' limit 1",
+ dbesc(argv(1))
+ );
+ if(!($r && count($r)))
+ killme();
+
+ $channel = $r[0];
+
+ // check site and channel permissions
+
+ if(!($channel['entity_r_stream'] & PERMS_PUBLIC))
+ killme();
+
+ if((intval(get_config('system','block_public'))) && (! get_account_id()))
+ killme();
+
+ logger('mod_feed: public feed request from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $channel['entity_address']);
+ echo get_public_feed($channel,$params);
+ killme();
+ }
+
+}
+
+