From 325a5b4af4f75322730ef1d2134d789581ed8378 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 14 Sep 2015 21:25:10 -0700 Subject: we need an owner for permissions_sql --- mod/thing.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/thing.php b/mod/thing.php index 03dc7db5b..280cc194d 100644 --- a/mod/thing.php +++ b/mod/thing.php @@ -234,9 +234,17 @@ function thing_init(&$a) { function thing_content(&$a) { + // @FIXME one problem with things is we can't share them unless we provide the channel in the url + // so we can definitively lookup the owner. + if(argc() == 2) { - $sql_extra = permissions_sql(); + $r = q("select obj_channel from obj where obj_type = %d and obj_obj = '%s' limit 1", + intval(TERM_OBJ_THING), + dbesc(argv(1)) + ); + if($r) + $sql_extra = permissions_sql($r[0]['obj_channel']); $r = q("select * from obj where obj_type = %d and obj_obj = '%s' $sql_extra limit 1", intval(TERM_OBJ_THING), -- cgit v1.2.3