some issues with mod_display on very first anonymous page visit (prior to any browser cookies being set)

This commit is contained in:
zotlabs 2017-08-30 18:55:56 -07:00
parent be097bf415
commit f436ec6f21
5 changed files with 15 additions and 13 deletions

View file

@ -324,8 +324,11 @@ class Acl extends \Zotlabs\Web\Controller {
$r = array();
if($r) {
foreach($r as $g){
foreach($r as $g) {
if(($g['network'] === 'rss') && ($type != 'a'))
continue;
$g['hash'] = urlencode($g['hash']);
if(in_array($g['hash'],$permitted) && $type == 'c' && (! $noforums)) {

View file

@ -76,7 +76,6 @@ class Display extends \Zotlabs\Web\Controller {
$o = '<div id="jot-popup">';
$o .= status_editor($a,$x);
$o .= '</div>';
}
// This page can be viewed by anybody so the query could be complicated
@ -181,6 +180,7 @@ class Display extends \Zotlabs\Web\Controller {
'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string),
'title' => 'oembed'
]);
}
$observer_hash = get_observer_hash();
@ -190,7 +190,6 @@ class Display extends \Zotlabs\Web\Controller {
if(($update && $load) || ($checkjs->disabled())) {
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']),intval(\App::$pager['start']));
if($load || ($checkjs->disabled())) {
@ -224,7 +223,6 @@ class Display extends \Zotlabs\Web\Controller {
if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))
$sysid = 0;
$r = q("SELECT item.id as item_id from item
WHERE mid = '%s'
AND (((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = ''
@ -237,7 +235,6 @@ class Display extends \Zotlabs\Web\Controller {
dbesc($target_item['parent_mid']),
intval($sysid)
);
}
}
}
@ -250,6 +247,7 @@ 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'
@ -269,12 +267,12 @@ class Display extends \Zotlabs\Web\Controller {
// make that content unsearchable by ensuring the owner_xchan can't match
if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))
$sysid = 0;
$r = q("SELECT item.parent AS item_id from item
WHERE parent_mid = '%s'
AND (((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = ''
AND item.deny_gid = '' AND item_private = 0 )
and owner_xchan in ( " . stream_perms_xchans(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " ))
and uid in ( " . stream_perms_api_uids(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " ))
OR uid = %d )
$sql_extra )
$item_normal
@ -292,7 +290,7 @@ class Display extends \Zotlabs\Web\Controller {
}
if($r) {
$parents_str = ids_to_querystr($r,'item_id');
if($parents_str) {
@ -310,7 +308,6 @@ class Display extends \Zotlabs\Web\Controller {
$items = array();
}
if ($checkjs->disabled()) {
$o .= conversation($items, 'display', $update, 'traditional');
if ($items[0]['title'])

View file

@ -21,9 +21,9 @@ class CheckJS {
$page = urlencode(\App::$query_string);
if($test) {
self::$jsdisabled = 1;
$this->jsdisabled = 1;
if(array_key_exists('jsdisabled',$_COOKIE))
self::$jsdisabled = $_COOKIE['jsdisabled'];
$this->jsdisabled = $_COOKIE['jsdisabled'];
if(! array_key_exists('jsdisabled',$_COOKIE)) {
\App::$page['htmlhead'] .= "\r\n" . '<script>document.cookie="jsdisabled=0; path=/"; var jsMatch = /\&jsdisabled=0/; if (!jsMatch.exec(location.href)) { location.href = "' . z_root() . '/nojs/0?f=&redir=' . $page . '" ; }</script>' . "\r\n";
@ -41,7 +41,7 @@ class CheckJS {
}
function disabled() {
return self::$jsdisabled;
return $this->jsdisabled;
}

View file

@ -3,3 +3,4 @@
<div id="conversation-end"></div>
<div id="page-spinner"></div>

View file

@ -1,8 +1,9 @@
<div id="threads-begin"></div>
{{if $photo_item}}
{{$photo_item}}
{{/if}}
{{foreach $threads as $thread_item}}
{{include file="{{$thread_item.template}}" item=$thread_item}}
{{/foreach}}
<div id="threads-end"></div>
<div id="conversation-end"></div>