aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Display.php38
1 files changed, 13 insertions, 25 deletions
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php
index 4732045f5..68da3e247 100644
--- a/Zotlabs/Module/Display.php
+++ b/Zotlabs/Module/Display.php
@@ -17,20 +17,18 @@ class Display extends \Zotlabs\Web\Controller {
if($load)
$_SESSION['loadtime'] = datetime_convert();
-
if(observer_prohibited()) {
notice( t('Public access denied.') . EOL);
return;
}
-
if(argc() > 1 && argv(1) !== 'load')
$item_hash = argv(1);
if($_REQUEST['mid'])
$item_hash = $_REQUEST['mid'];
- if(! $item_hash) {
+ if(! $item_hash) {
\App::$error = 404;
notice( t('Item not found.') . EOL);
return;
@@ -38,21 +36,18 @@ class Display extends \Zotlabs\Web\Controller {
$observer_is_owner = false;
$updateable = false;
-
if(local_channel() && (! $update)) {
$channel = \App::get_channel();
-
-
+
$channel_acl = array(
'allow_cid' => $channel['channel_allow_cid'],
'allow_gid' => $channel['channel_allow_gid'],
'deny_cid' => $channel['channel_deny_cid'],
'deny_gid' => $channel['channel_deny_gid']
);
-
-
+
$x = array(
'is_owner' => true,
'allow_location' => ((intval(get_pconfig($channel['channel_id'],'system','use_browser_location'))) ? '1' : ''),
@@ -136,7 +131,6 @@ class Display extends \Zotlabs\Web\Controller {
$simple_update .= " and item_thread_top = 0 and author_xchan = '" . protect_sprintf(get_observer_hash()) . "' ";
if((! $update) && (! $load)) {
-
$static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 1);
@@ -182,20 +176,20 @@ class Display extends \Zotlabs\Web\Controller {
]);
}
-
+
$observer_hash = get_observer_hash();
$item_normal = item_normal();
$item_normal_update = item_normal_update();
-
+
$sql_extra = public_permissions_sql($observer_hash);
if(($update && $load) || ($checkjs->disabled())) {
-
+
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']),intval(\App::$pager['start']));
-
+
if($load || ($checkjs->disabled())) {
$r = null;
-
+
require_once('include/channel.php');
$sys = get_sys_channel();
$sysid = $sys['channel_id'];
@@ -211,16 +205,14 @@ class Display extends \Zotlabs\Web\Controller {
);
if($r) {
$updateable = true;
-
}
-
}
if($r === null) {
-
+
// in case somebody turned off public access to sys channel content using permissions
// make that content unsearchable by ensuring the owner uid can't match
-
+
if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))
$sysid = 0;
@@ -248,7 +240,6 @@ class Display extends \Zotlabs\Web\Controller {
$sysid = $sys['channel_id'];
if(local_channel()) {
-
$r = q("SELECT item.parent AS item_id from item
WHERE uid = %d
and parent_mid = '%s'
@@ -291,10 +282,8 @@ class Display extends \Zotlabs\Web\Controller {
}
if($r) {
-
$parents_str = ids_to_querystr($r,'item_id');
if($parents_str) {
-
$items = q("SELECT item.*, item.id AS item_id
FROM item
WHERE parent in ( %s ) $item_normal ",
@@ -305,7 +294,8 @@ class Display extends \Zotlabs\Web\Controller {
$items = fetch_post_tags($items,true);
$items = conv_sort($items,'created');
}
- } else {
+ }
+ else {
$items = array();
}
@@ -327,7 +317,6 @@ class Display extends \Zotlabs\Web\Controller {
$o .= '<div id="content-complete"></div>';
-
if((($update && $load) || $checkjs->disabled()) && (! $items)) {
$r = q("SELECT id, item_deleted FROM item WHERE mid = '%s' LIMIT 1",
@@ -350,6 +339,5 @@ class Display extends \Zotlabs\Web\Controller {
return $o;
}
-
-
+
}