From d00860430f3d90e75a464cee03d3ff79c34715eb Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 25 May 2023 08:03:10 +0000 Subject: owa fixes for where keyId = acct:xxx@yyy.zz --- Zotlabs/Module/Owa.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Owa.php b/Zotlabs/Module/Owa.php index 02997d3f1..920a92240 100644 --- a/Zotlabs/Module/Owa.php +++ b/Zotlabs/Module/Owa.php @@ -32,7 +32,7 @@ class Owa extends Controller { $keyId = $sigblock['keyId']; if ($keyId) { $r = q("SELECT * FROM hubloc LEFT JOIN xchan ON hubloc_hash = xchan_hash - WHERE ( hubloc_addr = '%s' OR hubloc_id_url = '%s' ) AND hubloc_deleted = 0 AND xchan_pubkey != '' ORDER BY hubloc_id DESC", + WHERE (hubloc_addr = '%s' OR hubloc_id_url = '%s') AND hubloc_deleted = 0 AND xchan_pubkey != '' ORDER BY hubloc_id DESC", dbesc(str_replace('acct:', '', $keyId)), dbesc($keyId) ); @@ -40,11 +40,13 @@ class Owa extends Controller { $found = discover_by_webbie($keyId); if ($found) { $r = q("SELECT * FROM hubloc LEFT JOIN xchan ON hubloc_hash = xchan_hash - WHERE hubloc_id_url = '%s' AND hubloc_deleted = 0 AND xchan_pubkey != '' ORDER BY hubloc_id DESC ", + WHERE (hubloc_addr = '%s' OR hubloc_id_url = '%s') AND hubloc_deleted = 0 AND xchan_pubkey != '' ORDER BY hubloc_id DESC ", + dbesc(str_replace('acct:', '', $keyId)), dbesc($keyId) ); } } + if ($r) { foreach ($r as $hubloc) { $verified = HTTPSig::verify(file_get_contents('php://input'), $hubloc['xchan_pubkey']); @@ -73,7 +75,8 @@ class Owa extends Controller { if ($found) { $r = q("SELECT * FROM hubloc LEFT JOIN xchan ON hubloc_hash = xchan_hash - WHERE hubloc_id_url = '%s' AND hubloc_deleted = 0 ORDER BY hubloc_id DESC LIMIT 1", + WHERE (hubloc_addr = '%s' OR hubloc_id_url = '%s') AND hubloc_deleted = 0 ORDER BY hubloc_id DESC LIMIT 1", + dbesc(str_replace('acct:', '', $keyId)), dbesc($keyId) ); -- cgit v1.2.3 From 02089f15c46248937389d63dcef31a44b21644f2 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 26 May 2023 08:19:34 +0000 Subject: work around hubloc confusion in mod rmagic --- Zotlabs/Module/Rmagic.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Rmagic.php b/Zotlabs/Module/Rmagic.php index 2950dca5e..90cf8b854 100644 --- a/Zotlabs/Module/Rmagic.php +++ b/Zotlabs/Module/Rmagic.php @@ -12,13 +12,13 @@ class Rmagic extends \Zotlabs\Web\Controller { $me = get_my_address(); if($me) { - $r = q("select hubloc_url, hubloc_network from hubloc where hubloc_addr = '%s' and hubloc_deleted = 0", + $r = q("select hubloc_url, hubloc_network from hubloc where hubloc_addr = '%s' and hubloc_deleted = 0 order by hubloc_id desc", dbesc($me) ); if(! $r) { $w = discover_by_webbie($me); if($w) { - $r = q("select hubloc_url, hubloc_network from hubloc where hubloc_addr = '%s' and hubloc_deleted = 0", + $r = q("select hubloc_url, hubloc_network from hubloc where hubloc_addr = '%s' and hubloc_deleted = 0 order by hubloc_id desc", dbesc($me) ); } @@ -57,13 +57,13 @@ class Rmagic extends \Zotlabs\Web\Controller { $r = null; if($address) { - $r = q("select hubloc_url, hubloc_network from hubloc where hubloc_addr = '%s' and hubloc_deleted = 0", + $r = q("select hubloc_url, hubloc_network from hubloc where hubloc_addr = '%s' and hubloc_deleted = 0 order by hubloc_id desc", dbesc($address) ); if(! $r) { $w = discover_by_webbie($address); if($w) { - $r = q("select hubloc_url, hubloc_network from hubloc where hubloc_addr = '%s' and hubloc_deleted = 0", + $r = q("select hubloc_url, hubloc_network from hubloc where hubloc_addr = '%s' and hubloc_deleted = 0 order by hubloc_id desc", dbesc($address) ); } -- cgit v1.2.3 From 904401617a4f4ea866668bcedd6a1f52c60d9ee0 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 26 May 2023 10:17:53 +0000 Subject: mod magic make a get request instead of post and remove digest header --- Zotlabs/Module/Magic.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Magic.php b/Zotlabs/Module/Magic.php index 6d997c662..8259f7d39 100644 --- a/Zotlabs/Module/Magic.php +++ b/Zotlabs/Module/Magic.php @@ -105,13 +105,13 @@ class Magic extends Controller { $headers['Accept'] = 'application/x-zot+json' ; $headers['Content-Type'] = 'application/x-zot+json' ; $headers['X-Open-Web-Auth'] = random_string(); - $headers['Digest'] = HTTPSig::generate_digest_header($data); $headers['Host'] = $parsed['host']; - $headers['(request-target)'] = 'post ' . '/owa'; + $headers['(request-target)'] = 'get ' . '/owa'; $headers = HTTPSig::create_sig($headers,$channel['channel_prvkey'], channel_url($channel),true,'sha512'); $redirects = 0; - $x = z_post_url($owapath,$data,$redirects,[ 'headers' => $headers ]); + $x = z_fetch_url($owapath, false, $redirects, ['headers' => $headers]); + logger('owa fetch returned: ' . print_r($x,true),LOGGER_DATA); if ($x['success']) { $j = json_decode($x['body'],true); -- cgit v1.2.3 From 6a27afa6acdcc1d54bb109353c518051a37d9189 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 30 May 2023 08:59:29 +0000 Subject: improved unseen forums notification --- Zotlabs/Module/Sse_bs.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Sse_bs.php b/Zotlabs/Module/Sse_bs.php index 052870cc9..970c482a9 100644 --- a/Zotlabs/Module/Sse_bs.php +++ b/Zotlabs/Module/Sse_bs.php @@ -586,29 +586,23 @@ class Sse_bs extends Controller { $p_str = ids_to_querystr($p, 'parent'); $p_sql = (($p_str) ? "OR parent IN ( $p_str )" : ''); - $r = q("select mid from item + $r = q("select count(*) as total from item where uid = %d and ( owner_xchan = '%s' OR author_xchan = '%s' $p_sql ) and item_unseen = 1 $sql_extra $item_normal", intval(self::$uid), dbesc($forums[$x]['xchan_hash']), dbesc($forums[$x]['xchan_hash']) ); - if($r) { - $mids = flatten_array_recursive($r); - $b64mids = []; - - foreach($mids as $mid) - $b64mids[] = gen_link_id($mid); + if($r[0]['total']) { $forums[$x]['notify_link'] = z_root() . '/network/?f=&pf=1&unseen=1&cid=' . $forums[$x]['abook_id']; $forums[$x]['name'] = $forums[$x]['xchan_name']; $forums[$x]['addr'] = $forums[$x]['xchan_addr'] ?? $forums[$x]['xchan_url']; $forums[$x]['url'] = $forums[$x]['xchan_url']; $forums[$x]['photo'] = $forums[$x]['xchan_photo_s']; - $forums[$x]['unseen'] = count($b64mids); + $forums[$x]['unseen'] = $r[0]['total']; $forums[$x]['private_forum'] = ((isset($forums[$x]['private_forum']) && $forums[$x]['private_forum']) ? 'lock' : ''); $forums[$x]['message'] = ((isset($forums[$x]['private_forum']) && $forums[$x]['private_forum']) ? t('Private forum') : t('Public forum')); - $forums[$x]['mids'] = json_encode($b64mids); unset($forums[$x]['abook_id']); unset($forums[$x]['xchan_hash']); @@ -616,7 +610,7 @@ class Sse_bs extends Controller { unset($forums[$x]['xchan_url']); unset($forums[$x]['xchan_photo_s']); - $i = $i + count($mids); + $i = $i + $r[0]['total']; } else { -- cgit v1.2.3 From 423fdc0a9618e322636a5291ed92df00115fafb0 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 1 Jun 2023 08:15:33 +0000 Subject: owa: workaround for friendica when using nginx until this will be fixed at their side and check prrofile uid for features instead of local channel --- Zotlabs/Module/Chat.php | 2 +- Zotlabs/Module/Owa.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Chat.php b/Zotlabs/Module/Chat.php index efe098739..fc74016ab 100644 --- a/Zotlabs/Module/Chat.php +++ b/Zotlabs/Module/Chat.php @@ -212,7 +212,7 @@ class Chat extends Controller { '$online' => t('I am online'), '$bookmark_link' => $bookmark_link, '$bookmark' => t('Bookmark this room'), - '$feature_encrypt' => ((feature_enabled(local_channel(),'content_encrypt')) ? true : false), + '$feature_encrypt' => ((feature_enabled(App::$profile['profile_uid'], 'content_encrypt')) ? true : false), '$cipher' => $cipher, '$linkurl' => t('Please enter a link URL:'), '$encrypt' => t('Encrypt text'), diff --git a/Zotlabs/Module/Owa.php b/Zotlabs/Module/Owa.php index 920a92240..4de4d32d6 100644 --- a/Zotlabs/Module/Owa.php +++ b/Zotlabs/Module/Owa.php @@ -49,6 +49,10 @@ class Owa extends Controller { if ($r) { foreach ($r as $hubloc) { + // fix friendica accept header for nginx + if (str_starts_with($keyId, 'acct:') && $_SERVER['HTTP_ACCEPT'] === 'application/x-zot+json') + $_SERVER['HTTP_ACCEPT'] = 'application/x-dfrn+json, application/x-zot+json'; + $verified = HTTPSig::verify(file_get_contents('php://input'), $hubloc['xchan_pubkey']); if ($verified && $verified['header_signed'] && $verified['header_valid'] && ($verified['content_valid'] || (! $verified['content_signed']))) { logger('OWA header: ' . print_r($verified,true),LOGGER_DATA); -- cgit v1.2.3 From 48a33f08e2042b0bb809f43f9bec9d7739af3c28 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 2 Jun 2023 11:33:44 +0000 Subject: ocap initial checkin --- Zotlabs/Module/Item.php | 51 +++++++++++++++++++++++++++++++------ Zotlabs/Module/Lockview.php | 41 +++++++++++++++++++++-------- Zotlabs/Module/Photo.php | 19 +++++++++----- Zotlabs/Module/Settings/Privacy.php | 5 ++++ Zotlabs/Module/Wall_attach.php | 22 ++++++++-------- Zotlabs/Module/Wall_upload.php | 1 - 6 files changed, 101 insertions(+), 38 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index a5f66d72e..b564396c9 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -218,6 +218,22 @@ class Item extends Controller { ); } + $bear = Activity::token_from_request(); + if ($bear) { + logger('bear: ' . $bear, LOGGER_DEBUG); + if (!$i) { + $t = q("select * from iconfig where cat = 'ocap' and k = 'relay' and v = '%s'", + dbesc($bear) + ); + if ($t) { + $i = q("select id as item_id from item where uuid = '%s' and id = %d $item_normal limit 1", + dbesc($item_id), + intval($t[0]['iid']) + ); + } + } + } + if (!$i) { http_status_exit(403, 'Forbidden'); } @@ -286,7 +302,9 @@ class Item extends Controller { if ((!local_channel()) && (!remote_channel()) && (!x($_REQUEST, 'anonname'))) return; - $uid = local_channel(); + $uid = local_channel(); + $token = ''; + $channel = null; $observer = null; $datarray = []; @@ -809,7 +827,6 @@ class Item extends Controller { require_once('include/text.php'); - // BBCODE alert: the following functions assume bbcode input // and will require alternatives for alternative content-types (text/html, text/markdown, text/plain, etc.) // we may need virtual or template classes to implement the possible alternatives @@ -845,6 +862,21 @@ class Item extends Controller { $private = 2; } + if ($private && get_pconfig($profile_uid, 'system', 'ocap_enabled')) { + // for edited posts, re-use any existing OCAP token (if found). + // Otherwise generate a new one. + + if ($iconfig) { + foreach ($iconfig as $cfg) { + if ($cfg['cat'] === 'ocap' && $cfg['k'] === 'relay') { + $token = $cfg['v']; + } + } + } + if (!$token) { + $token = new_token(); + } + } /** * @@ -866,9 +898,9 @@ class Item extends Controller { */ if (!$preview) { - fix_attached_photo_permissions($profile_uid, $owner_xchan['xchan_hash'], ((strpos($body, '[/crypt]')) ? $_POST['media_str'] : $body), $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny); - fix_attached_photo_permissions($profile_uid, $owner_xchan['xchan_hash'], ((strpos($summary, '[/crypt]')) ? $_POST['media_str'] : $summary), $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny); - fix_attached_file_permissions($channel, $observer['xchan_hash'], ((strpos($body, '[/crypt]')) ? $_POST['media_str'] : $body), $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny); + fix_attached_permissions($profile_uid, ((strpos($body, '[/crypt]')) ? $_POST['media_str'] : $body), $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny, $token); + //fix_attached_photo_permissions($profile_uid, $owner_xchan['xchan_hash'], ((strpos($body, '[/crypt]')) ? $_POST['media_str'] : $body), $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny, $token); + //fix_attached_file_permissions($channel, $observer['xchan_hash'], ((strpos($body, '[/crypt]')) ? $_POST['media_str'] : $body), $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny, $token); } $attachments = ''; @@ -951,14 +983,12 @@ class Item extends Controller { } } - $item_unseen = ((local_channel() != $profile_uid) ? 1 : 0); $item_wall = ((isset($_REQUEST['type']) && ($_REQUEST['type'] === 'wall' || $_REQUEST['type'] === 'wall-comment')) ? 1 : 0); $item_origin = (($origin) ? 1 : 0); $item_consensus = (($consensus) ? 1 : 0); $item_nocomment = (($nocomment) ? 1 : 0); - // determine if this is a wall post if ($parent) { @@ -1107,8 +1137,13 @@ class Item extends Controller { if (!empty_acl($datarray)) $datarray['public_policy'] = ''; - if ($iconfig) + if ($iconfig) { $datarray['iconfig'] = $iconfig; + } + + if ($token) { + IConfig::set($datarray, 'ocap', 'relay', $token); + } // preview mode - prepare the body for display and send it via json diff --git a/Zotlabs/Module/Lockview.php b/Zotlabs/Module/Lockview.php index bac3a7eb9..0c8e23f8c 100644 --- a/Zotlabs/Module/Lockview.php +++ b/Zotlabs/Module/Lockview.php @@ -15,6 +15,7 @@ class Lockview extends Controller { $atoken_xchans = []; $access_list = []; $guest_access_list = []; + $ocap_access_list = []; if (local_channel()) { $at = q("select * from atoken where atoken_uid = %d", @@ -166,6 +167,24 @@ class Lockview extends Controller { } } } + $ocap_tokens = []; + foreach ($allowed_users as $allowed_user) { + $allowed_user = trim($allowed_user, '\''); + if (str_starts_with($allowed_user, 'token:')) { + $ocap_tokens[] = str_replace('token:', '', $allowed_user); + } + } + + if ($ocap_tokens) { + stringify_array_elms($ocap_tokens, true); + $ocap_mids = dbq("select id, mid from item where id in (select iid from iconfig where cat = 'ocap' and k = 'relay' and v in (" . implode(', ', $ocap_tokens) . "))"); + + foreach ($ocap_mids as $ocap) { + $ocap_access_list[] = '' . t('Item') . ' ' . $ocap['id'] . ''; + } + + } + } $profile_groups = []; @@ -205,9 +224,6 @@ class Lockview extends Controller { } if ($atokens && $allowed_xchans && $url) { - - $guest_access_list = []; - $allowed_xchans = array_unique($allowed_xchans); foreach ($atokens as $atoken) { if (in_array($atoken['xchan_hash'], $allowed_xchans)) { @@ -216,22 +232,25 @@ class Lockview extends Controller { } } - $access_list_header = ''; + $access_list_header = ''; + $guest_access_list_header = ''; + $ocap_access_list_header = ''; + $divider = ''; + $str = ''; + if ($access_list) { - $access_list_header = ''; + $str .= $access_list_header . implode($access_list); } - $guest_access_list_header = ''; if ($guest_access_list) { - $guest_access_list_header = ''; + $str .= $divider . $guest_access_list_header . implode($guest_access_list); } - $divider = ''; - if ($access_list && $guest_access_list) { - $divider = ''; + if ($ocap_access_list) { + $str .= $divider . $ocap_access_list_header . implode($ocap_access_list); } - echo $access_list_header . implode($access_list) . $divider . $guest_access_list_header . implode($guest_access_list); + echo $str; killme(); } diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index fa87d96e5..cb83d78d3 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -46,7 +46,7 @@ class Photo extends \Zotlabs\Web\Controller { dbesc(argv(1)) ); if ($r) { - $allowed = attach_can_view($r[0]['uid'],$observer_xchan,argv(1)/*,$bear*/); + $allowed = attach_can_view($r[0]['uid'], $observer_xchan, argv(1), $bear); } if (! $allowed) { http_status_exit(404,'Permission denied.'); @@ -154,6 +154,11 @@ class Photo extends \Zotlabs\Web\Controller { } else { + $bear = Activity::token_from_request(); + if ($bear) { + logger('bear: ' . $bear, LOGGER_DEBUG); + } + /** * Other photos */ @@ -223,7 +228,7 @@ class Photo extends \Zotlabs\Web\Controller { } if($allowed === (-1)) - $allowed = attach_can_view($r[0]['uid'],$observer_xchan,$photo); + $allowed = attach_can_view($r[0]['uid'], $observer_xchan, $photo, $bear); $channel = channelx_by_n($r[0]['uid']); @@ -262,13 +267,13 @@ class Photo extends \Zotlabs\Web\Controller { http_status_exit(404,'not found'); } - if(! $data) - killme(); + if(! $data) + killme(); - $etag = '"' . md5($data . $modified) . '"'; + $etag = '"' . md5($data . $modified) . '"'; - if($modified == 0) - $modified = time(); + if($modified == 0) + $modified = time(); header_remove('Pragma'); if((isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] === $etag) || (!isset($_SERVER['HTTP_IF_NONE_MATCH']) && isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $_SERVER['HTTP_IF_MODIFIED_SINCE'] === gmdate("D, d M Y H:i:s", $modified) . " GMT")) { diff --git a/Zotlabs/Module/Settings/Privacy.php b/Zotlabs/Module/Settings/Privacy.php index 65d5b538e..911c03aa5 100644 --- a/Zotlabs/Module/Settings/Privacy.php +++ b/Zotlabs/Module/Settings/Privacy.php @@ -25,6 +25,9 @@ class Privacy { $permit_all_mentions = (((x($_POST, 'permit_all_mentions')) && (intval($_POST['permit_all_mentions']) == 1)) ? 1 : 0); set_pconfig(local_channel(), 'system', 'permit_all_mentions', $permit_all_mentions); + $ocap_enabled = (((x($_POST, 'ocap_enabled')) && (intval($_POST['ocap_enabled']) == 1)) ? 1 : 0); + set_pconfig(local_channel(), 'system', 'ocap_enabled', $ocap_enabled); + $role = get_pconfig(local_channel(), 'system', 'permissions_role'); if ($role === 'custom') { @@ -103,6 +106,7 @@ class Privacy { $index_opt_out = get_pconfig(local_channel(), 'system', 'index_opt_out'); $group_actor = get_pconfig(local_channel(), 'system', 'group_actor'); $permit_all_mentions = get_pconfig(local_channel(), 'system', 'permit_all_mentions'); + $ocap_enabled = get_pconfig(local_channel(), 'system', 'ocap_enabled'); $permissions_role = get_pconfig(local_channel(), 'system', 'permissions_role', 'custom'); $permission_limits = ($permissions_role === 'custom'); @@ -125,6 +129,7 @@ class Privacy { '$index_opt_out' => ['index_opt_out', t('Opt-out of search engine indexing'), $index_opt_out, '', [t('No'), t('Yes')]], '$group_actor' => ['group_actor', t('Group actor'), $group_actor, t('Allow this channel to act as a forum'), [t('No'), t('Yes')]], '$permit_all_mentions' => ['permit_all_mentions', t('Accept all messages which mention you'), $permit_all_mentions, t('This setting bypasses normal permissions'), [t('No'), t('Yes')]], + '$ocap_enabled' => ['ocap_enabled', t('Enable OCAP access'), $ocap_enabled, t('Allow limited posts access to linked private media'), [t('No'), t('Yes')]], ]); return $o; diff --git a/Zotlabs/Module/Wall_attach.php b/Zotlabs/Module/Wall_attach.php index 2c0eeec77..80892f0f3 100644 --- a/Zotlabs/Module/Wall_attach.php +++ b/Zotlabs/Module/Wall_attach.php @@ -18,10 +18,10 @@ class Wall_attach extends \Zotlabs\Web\Controller { function post() { - + $using_api = false; - $result = []; + $result = []; if($_REQUEST['api_source'] && array_key_exists('media',$_FILES)) { $using_api = true; @@ -69,7 +69,7 @@ class Wall_attach extends \Zotlabs\Web\Controller { ]; } } - else { + else { if(! array_key_exists('userfile',$_FILES)) { $_FILES['userfile'] = [ 'name' => $_FILES['files']['name'], @@ -82,18 +82,18 @@ class Wall_attach extends \Zotlabs\Web\Controller { } $observer = \App::get_observer(); - - + + $def_album = get_pconfig($channel['channel_id'],'system','photo_path'); $def_attach = get_pconfig($channel['channel_id'],'system','attach_path'); - - $r = attach_store($channel,(($observer) ? $observer['xchan_hash'] : ''),'', array('source' => 'editor', 'visible' => 0, 'album' => $def_album, 'directory' => $def_attach, 'allow_cid' => '<' . $channel['channel_hash'] . '>')); + + $r = attach_store($channel,(($observer) ? $observer['xchan_hash'] : ''),'', array('source' => 'editor', 'visible' => 0, 'album' => $def_album, 'directory' => $def_attach, 'flags' => 1, 'allow_cid' => '<' . $channel['channel_hash'] . '>')); if(! $r['success']) { notice( $r['message'] . EOL); killme(); } - + if(intval($r['data']['is_photo'])) { $s = "\n\n" . $r['body'] . "\n\n"; } @@ -130,7 +130,7 @@ class Wall_attach extends \Zotlabs\Web\Controller { logger('unable to read svg data file: ' . 'store/' . $channel['channel_address'] . '/' . $r['data']['os_path']); } } - + $s .= "\n\n" . '[attachment]' . $r['data']['hash'] . ',' . $r['data']['revision'] . '[/attachment]' . "\n"; } @@ -144,8 +144,8 @@ class Wall_attach extends \Zotlabs\Web\Controller { $result['message'] = $s; json_return_and_die($result); - + } - + } diff --git a/Zotlabs/Module/Wall_upload.php b/Zotlabs/Module/Wall_upload.php index 3e979588c..4a6eee8f9 100644 --- a/Zotlabs/Module/Wall_upload.php +++ b/Zotlabs/Module/Wall_upload.php @@ -12,7 +12,6 @@ class Wall_upload extends \Zotlabs\Web\Controller { function post() { - $using_api = ((x($_FILES,'media')) ? true : false); if($using_api) { -- cgit v1.2.3 From 0ee03a565f58f3e66d7b7f40163c188cc7d5496f Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 2 Jun 2023 12:02:50 +0000 Subject: remove custom acl from rpost --- Zotlabs/Module/Rpost.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Rpost.php b/Zotlabs/Module/Rpost.php index 7b84339b1..f0194fdfd 100644 --- a/Zotlabs/Module/Rpost.php +++ b/Zotlabs/Module/Rpost.php @@ -169,16 +169,8 @@ class Rpost extends \Zotlabs\Web\Controller { $channel = \App::get_channel(); - if(isset($_REQUEST['acl']) && $_REQUEST['acl']) { - $acl = new \Zotlabs\Access\AccessList([]); - $acl->set($_REQUEST['acl']); - $channel_acl = $acl->get(); - } - else { - $acl = new \Zotlabs\Access\AccessList($channel); - $channel_acl = $acl->get(); - } - + $acl = new \Zotlabs\Access\AccessList($channel); + $channel_acl = $acl->get(); if(isset($_REQUEST['url']) && $_REQUEST['url']) { $x = z_fetch_url(z_root() . '/linkinfo?f=&url=' . urlencode($_REQUEST['url'])); -- cgit v1.2.3 From 64d7585282ea42e771f06527abb3e65b03e4e9ad Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 2 Jun 2023 15:29:24 +0000 Subject: adjust text --- Zotlabs/Module/Settings/Privacy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Settings/Privacy.php b/Zotlabs/Module/Settings/Privacy.php index 911c03aa5..d38d7d383 100644 --- a/Zotlabs/Module/Settings/Privacy.php +++ b/Zotlabs/Module/Settings/Privacy.php @@ -129,7 +129,7 @@ class Privacy { '$index_opt_out' => ['index_opt_out', t('Opt-out of search engine indexing'), $index_opt_out, '', [t('No'), t('Yes')]], '$group_actor' => ['group_actor', t('Group actor'), $group_actor, t('Allow this channel to act as a forum'), [t('No'), t('Yes')]], '$permit_all_mentions' => ['permit_all_mentions', t('Accept all messages which mention you'), $permit_all_mentions, t('This setting bypasses normal permissions'), [t('No'), t('Yes')]], - '$ocap_enabled' => ['ocap_enabled', t('Enable OCAP access'), $ocap_enabled, t('Allow limited posts access to linked private media'), [t('No'), t('Yes')]], + '$ocap_enabled' => ['ocap_enabled', t('Enable OCAP access'), $ocap_enabled, t('Grant access to linked private media in access limited posts'), [t('No'), t('Yes')]], ]); return $o; -- cgit v1.2.3 From 1bfbd57ee41352bcbd630eb25fb625dbb87598b5 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 2 Jun 2023 15:34:06 +0000 Subject: more adjust text --- Zotlabs/Module/Settings/Privacy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Settings/Privacy.php b/Zotlabs/Module/Settings/Privacy.php index d38d7d383..1d0840af4 100644 --- a/Zotlabs/Module/Settings/Privacy.php +++ b/Zotlabs/Module/Settings/Privacy.php @@ -129,7 +129,7 @@ class Privacy { '$index_opt_out' => ['index_opt_out', t('Opt-out of search engine indexing'), $index_opt_out, '', [t('No'), t('Yes')]], '$group_actor' => ['group_actor', t('Group actor'), $group_actor, t('Allow this channel to act as a forum'), [t('No'), t('Yes')]], '$permit_all_mentions' => ['permit_all_mentions', t('Accept all messages which mention you'), $permit_all_mentions, t('This setting bypasses normal permissions'), [t('No'), t('Yes')]], - '$ocap_enabled' => ['ocap_enabled', t('Enable OCAP access'), $ocap_enabled, t('Grant access to linked private media in access limited posts'), [t('No'), t('Yes')]], + '$ocap_enabled' => ['ocap_enabled', t('Enable OCAP access'), $ocap_enabled, t('Grant limited posts access to linked private media'), [t('No'), t('Yes')]], ]); return $o; -- cgit v1.2.3 From 87689df062f09adf104ff996b7bc942ba508a2b4 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 2 Jun 2023 15:59:26 +0000 Subject: even more adjust text --- Zotlabs/Module/Settings/Privacy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Settings/Privacy.php b/Zotlabs/Module/Settings/Privacy.php index 1d0840af4..24249a865 100644 --- a/Zotlabs/Module/Settings/Privacy.php +++ b/Zotlabs/Module/Settings/Privacy.php @@ -129,7 +129,7 @@ class Privacy { '$index_opt_out' => ['index_opt_out', t('Opt-out of search engine indexing'), $index_opt_out, '', [t('No'), t('Yes')]], '$group_actor' => ['group_actor', t('Group actor'), $group_actor, t('Allow this channel to act as a forum'), [t('No'), t('Yes')]], '$permit_all_mentions' => ['permit_all_mentions', t('Accept all messages which mention you'), $permit_all_mentions, t('This setting bypasses normal permissions'), [t('No'), t('Yes')]], - '$ocap_enabled' => ['ocap_enabled', t('Enable OCAP access'), $ocap_enabled, t('Grant limited posts access to linked private media'), [t('No'), t('Yes')]], + '$ocap_enabled' => ['ocap_enabled', t('Enable OCAP access'), $ocap_enabled, t('Grant limited posts the right to access linked private media'), [t('No'), t('Yes')]], ]); return $o; -- cgit v1.2.3 From 489ba72d5c447a89ad5c5b8c212dd8e049879a7f Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 19 Jun 2023 19:47:01 +0000 Subject: fix issues in mod oep --- Zotlabs/Module/Oep.php | 52 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 17 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Oep.php b/Zotlabs/Module/Oep.php index bf17e6436..37a46a23e 100644 --- a/Zotlabs/Module/Oep.php +++ b/Zotlabs/Module/Oep.php @@ -28,7 +28,6 @@ class Oep extends \Zotlabs\Web\Controller { $format = $_REQUEST['format'] ?? ''; if($format && $format !== 'json') http_status_exit(501, 'Not implemented'); - if(fnmatch('*/photos/*/album/*',$url)) $arr = $this->oep_album_reply($_REQUEST); elseif(fnmatch('*/photos/*/image/*',$url)) @@ -95,12 +94,12 @@ class Oep extends \Zotlabs\Web\Controller { $c = channelx_by_n($p[0]['uid']); - if(! ($c && $res)) return; - if(! perm_is_allowed($c[0]['channel_id'],get_observer_hash(),'view_stream')) + if(! perm_is_allowed($c['channel_id'], get_observer_hash(), 'view_stream')) { return; + } $sql_extra = item_permissions_sql($c['channel_id']); @@ -336,32 +335,51 @@ class Oep extends \Zotlabs\Web\Controller { $maxwidth = ((isset($args['maxwidth'])) ? $args['maxwidth'] : 0); $maxheight = ((isset($args['maxheight'])) ? $args['maxheight'] : 0); - if(preg_match('#//(.*?)/(.*?)/(.*?)/(.*?)mid\=(.*?)(&|$)#',$url,$matches)) { - $chn = $matches[3]; - $res = $matches[5]; + $parsed = parse_url($url); + if (empty($parsed['path'])) { + return; } - if(! ($chn && $res)) + $nick = basename($parsed['path']); + if (!$nick) { return; + } - $c = q("select * from channel where channel_address = '%s' limit 1", - dbesc($chn) - ); + if (empty($parsed['query'])) { + return; + } - if(! $c) + parse_str($parsed['query'], $query); + + if (empty($query['mid'])) { return; + } - if(! perm_is_allowed($c[0]['channel_id'],get_observer_hash(),'view_stream')) + $mid = unpack_link_id($query['mid']); + if (!$mid) { return; + } - $sql_extra = item_permissions_sql($c[0]['channel_id']); + $c = channelx_by_nick($nick); + if(! $c) { + return; + } - $p = q("select * from item where mid = '%s' and uid = %d $sql_extra limit 1", - dbesc($res), - intval($c[0]['channel_id']) + if(! perm_is_allowed($c['channel_id'], get_observer_hash(), 'view_stream')) { + return; + } + + $sql_extra = item_permissions_sql($c['channel_id']); + $item_normal = item_normal(); + + $p = q("select * from item where mid = '%s' and uid = %d $sql_extra $item_normal limit 1", + dbesc($mid), + intval($c['channel_id']) ); - if(! $p) + + if(! $p) { return; + } xchan_query($p,true); $p = fetch_post_tags($p,true); -- cgit v1.2.3 From cd26ead043f9cb92ca4d59e587480520cb51f117 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 23 Jun 2023 09:13:51 +0000 Subject: implement optional moderation of unsolicited comments, minor css fixes and some more work on ocap --- Zotlabs/Module/Attach.php | 2 +- Zotlabs/Module/Channel.php | 8 ++------ Zotlabs/Module/Hq.php | 6 +++--- Zotlabs/Module/Moderate.php | 24 ++++++++++++++++++------ Zotlabs/Module/Network.php | 2 ++ Zotlabs/Module/Settings/Privacy.php | 5 +++++ 6 files changed, 31 insertions(+), 16 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Attach.php b/Zotlabs/Module/Attach.php index 5f5779b51..710f965ef 100644 --- a/Zotlabs/Module/Attach.php +++ b/Zotlabs/Module/Attach.php @@ -95,7 +95,7 @@ class Attach extends Controller { killme(); } - $r = attach_by_hash(argv(1), get_observer_hash(), ((argc() > 2) ? intval(argv(2)) : 0)); + $r = attach_by_hash(argv(1), get_observer_hash(), ((argc() > 2) ? intval(argv(2)) : 0), $token); if (!$r['success']) { notice($r['message'] . EOL); diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 748d990cb..036663681 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -284,13 +284,9 @@ class Channel extends Controller { * Get permissions SQL - if $remote_contact is true, our remote user has been pre-verified and we already have fetched his/her groups */ - $item_normal = " and item.item_hidden = 0 and item.item_type = 0 and item.item_deleted = 0 - and item.item_unpublished = 0 and item.item_pending_remove = 0 - and item.item_blocked = 0 "; - if (!$is_owner) - $item_normal .= "and item.item_delayed = 0 "; + $item_normal = item_normal(); $item_normal_update = item_normal_update(); - $sql_extra = item_permissions_sql(App::$profile['profile_uid']); + $sql_extra = item_permissions_sql(App::$profile['profile_uid']); if (feature_enabled(App::$profile['profile_uid'], 'channel_list_mode') && (!$mid)) $page_mode = 'list'; diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php index 77d56e9a2..efa13b832 100644 --- a/Zotlabs/Module/Hq.php +++ b/Zotlabs/Module/Hq.php @@ -17,8 +17,6 @@ class Hq extends \Zotlabs\Web\Controller { function init() { if(! local_channel()) return; - - App::$profile_uid = local_channel(); } function get($update = 0, $load = false) { @@ -27,6 +25,8 @@ class Hq extends \Zotlabs\Web\Controller { return; } + App::$profile_uid = local_channel(); + $item_hash = ''; if(argc() > 1 && argv(1) !== 'load') { @@ -69,7 +69,7 @@ class Hq extends \Zotlabs\Web\Controller { //if the item is to be moderated redirect to /moderate if($target_item['item_blocked'] == ITEM_MODERATED) { - goaway(z_root() . '/moderate/' . $target_item['id']); + // goaway(z_root() . '/moderate/' . $target_item['id']); } $simple_update = ''; diff --git a/Zotlabs/Module/Moderate.php b/Zotlabs/Module/Moderate.php index b66b052a6..b895b4a8c 100644 --- a/Zotlabs/Module/Moderate.php +++ b/Zotlabs/Module/Moderate.php @@ -17,7 +17,7 @@ class Moderate extends \Zotlabs\Web\Controller { } \App::set_pager_itemspage(30); - $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start'])); + $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start'])); //show all items if(argc() == 1) { @@ -40,8 +40,13 @@ class Moderate extends \Zotlabs\Web\Controller { if(argc() > 2) { $post_id = intval(argv(1)); - if(! $post_id) + if(! $post_id) { + if (is_ajax()) { + killme(); + } + goaway(z_root() . '/moderate'); + } $action = argv(2); @@ -61,18 +66,20 @@ class Moderate extends \Zotlabs\Web\Controller { ); $item['item_blocked'] = 0; - item_update_parent_commented($item); - notice( t('Comment approved') . EOL); } elseif($action === 'drop') { + // TODO: not implemented + // let the sender know we received their comment but we don't permit spam here. + // Activity::send_rejection_activity(App::get_channel(), $item['author_xchan'], $item); + drop_item($post_id,false); notice( t('Comment deleted') . EOL); - } + } // refetch the item after changes have been made - + $r = q("select * from item where id = %d", intval($post_id) ); @@ -84,6 +91,11 @@ class Moderate extends \Zotlabs\Web\Controller { if($action === 'approve') { \Zotlabs\Daemon\Master::Summon(array('Notifier', 'comment-new', $post_id)); } + + if (is_ajax()) { + killme(); + } + goaway(z_root() . '/moderate'); } } diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 00fed55c2..dcc209d1d 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -43,6 +43,8 @@ class Network extends \Zotlabs\Web\Controller { return login(false); } + App::$profile_uid = local_channel(); + $o = ''; $arr = array('query' => App::$query_string); diff --git a/Zotlabs/Module/Settings/Privacy.php b/Zotlabs/Module/Settings/Privacy.php index 24249a865..588ece1f1 100644 --- a/Zotlabs/Module/Settings/Privacy.php +++ b/Zotlabs/Module/Settings/Privacy.php @@ -25,6 +25,9 @@ class Privacy { $permit_all_mentions = (((x($_POST, 'permit_all_mentions')) && (intval($_POST['permit_all_mentions']) == 1)) ? 1 : 0); set_pconfig(local_channel(), 'system', 'permit_all_mentions', $permit_all_mentions); + $moderate_unsolicited_comments = (((x($_POST, 'moderate_unsolicited_comments')) && (intval($_POST['moderate_unsolicited_comments']) == 1)) ? 1 : 0); + set_pconfig(local_channel(), 'system', 'moderate_unsolicited_comments', $moderate_unsolicited_comments); + $ocap_enabled = (((x($_POST, 'ocap_enabled')) && (intval($_POST['ocap_enabled']) == 1)) ? 1 : 0); set_pconfig(local_channel(), 'system', 'ocap_enabled', $ocap_enabled); @@ -106,6 +109,7 @@ class Privacy { $index_opt_out = get_pconfig(local_channel(), 'system', 'index_opt_out'); $group_actor = get_pconfig(local_channel(), 'system', 'group_actor'); $permit_all_mentions = get_pconfig(local_channel(), 'system', 'permit_all_mentions'); + $moderate_unsolicited_comments = get_pconfig(local_channel(), 'system', 'moderate_unsolicited_comments'); $ocap_enabled = get_pconfig(local_channel(), 'system', 'ocap_enabled'); $permissions_role = get_pconfig(local_channel(), 'system', 'permissions_role', 'custom'); @@ -129,6 +133,7 @@ class Privacy { '$index_opt_out' => ['index_opt_out', t('Opt-out of search engine indexing'), $index_opt_out, '', [t('No'), t('Yes')]], '$group_actor' => ['group_actor', t('Group actor'), $group_actor, t('Allow this channel to act as a forum'), [t('No'), t('Yes')]], '$permit_all_mentions' => ['permit_all_mentions', t('Accept all messages which mention you'), $permit_all_mentions, t('This setting bypasses normal permissions'), [t('No'), t('Yes')]], + '$moderate_unsolicited_comments' => ['moderate_unsolicited_comments', t('Moderate unsolicited comments'), $moderate_unsolicited_comments, t('Otherwise they will be silently dropped'), [t('No'), t('Yes')]], '$ocap_enabled' => ['ocap_enabled', t('Enable OCAP access'), $ocap_enabled, t('Grant limited posts the right to access linked private media'), [t('No'), t('Yes')]], ]); -- cgit v1.2.3 From 12b2137a044ff6fd48239e207e5ad9350ceaf5e5 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 23 Jun 2023 12:35:41 +0000 Subject: fix relaying and syncing in Activity::drop(), change wording for moderation request notices and redirect moderation request for reactions to mod moderate --- Zotlabs/Module/Hq.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php index efa13b832..260d0c41b 100644 --- a/Zotlabs/Module/Hq.php +++ b/Zotlabs/Module/Hq.php @@ -67,9 +67,10 @@ class Hq extends \Zotlabs\Web\Controller { } } - //if the item is to be moderated redirect to /moderate - if($target_item['item_blocked'] == ITEM_MODERATED) { - // goaway(z_root() . '/moderate/' . $target_item['id']); + // if the item is to be moderated redirect to /moderate + // comments can be moderated inline + if(intval($target_item['item_blocked']) === ITEM_MODERATED && in_array($target_item['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_ATTEND, ACTIVITY_ATTENDMAYBE, ACTIVITY_ATTENDNO])) { + goaway(z_root() . '/moderate/' . $target_item['id']); } $simple_update = ''; -- cgit v1.2.3 From 750641ef196d9e113b0e80da9734f70400b55652 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 27 Jun 2023 14:53:23 +0000 Subject: implement inline moderation of reactions --- Zotlabs/Module/Hq.php | 6 ------ Zotlabs/Module/Moderate.php | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php index 260d0c41b..05b48f119 100644 --- a/Zotlabs/Module/Hq.php +++ b/Zotlabs/Module/Hq.php @@ -67,12 +67,6 @@ class Hq extends \Zotlabs\Web\Controller { } } - // if the item is to be moderated redirect to /moderate - // comments can be moderated inline - if(intval($target_item['item_blocked']) === ITEM_MODERATED && in_array($target_item['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_ATTEND, ACTIVITY_ATTENDMAYBE, ACTIVITY_ATTENDNO])) { - goaway(z_root() . '/moderate/' . $target_item['id']); - } - $simple_update = ''; if($update && $_SESSION['loadtime']) $simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) "; diff --git a/Zotlabs/Module/Moderate.php b/Zotlabs/Module/Moderate.php index b895b4a8c..ed2a1e4f9 100644 --- a/Zotlabs/Module/Moderate.php +++ b/Zotlabs/Module/Moderate.php @@ -67,7 +67,7 @@ class Moderate extends \Zotlabs\Web\Controller { $item['item_blocked'] = 0; item_update_parent_commented($item); - notice( t('Comment approved') . EOL); + notice( t('Item approved') . EOL); } elseif($action === 'drop') { // TODO: not implemented @@ -75,7 +75,7 @@ class Moderate extends \Zotlabs\Web\Controller { // Activity::send_rejection_activity(App::get_channel(), $item['author_xchan'], $item); drop_item($post_id,false); - notice( t('Comment deleted') . EOL); + notice( t('Item deleted') . EOL); } // refetch the item after changes have been made -- cgit v1.2.3 From 8f7383f5c24bf1bdb4967ec11764554dd881050a Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 28 Jun 2023 12:05:55 +0000 Subject: text --- Zotlabs/Module/Settings/Privacy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Settings/Privacy.php b/Zotlabs/Module/Settings/Privacy.php index 588ece1f1..316b1306e 100644 --- a/Zotlabs/Module/Settings/Privacy.php +++ b/Zotlabs/Module/Settings/Privacy.php @@ -133,7 +133,7 @@ class Privacy { '$index_opt_out' => ['index_opt_out', t('Opt-out of search engine indexing'), $index_opt_out, '', [t('No'), t('Yes')]], '$group_actor' => ['group_actor', t('Group actor'), $group_actor, t('Allow this channel to act as a forum'), [t('No'), t('Yes')]], '$permit_all_mentions' => ['permit_all_mentions', t('Accept all messages which mention you'), $permit_all_mentions, t('This setting bypasses normal permissions'), [t('No'), t('Yes')]], - '$moderate_unsolicited_comments' => ['moderate_unsolicited_comments', t('Moderate unsolicited comments'), $moderate_unsolicited_comments, t('Otherwise they will be silently dropped'), [t('No'), t('Yes')]], + '$moderate_unsolicited_comments' => ['moderate_unsolicited_comments', t('Accept unsolicited comments for moderation'), $moderate_unsolicited_comments, t('Otherwise they will be silently dropped'), [t('No'), t('Yes')]], '$ocap_enabled' => ['ocap_enabled', t('Enable OCAP access'), $ocap_enabled, t('Grant limited posts the right to access linked private media'), [t('No'), t('Yes')]], ]); -- cgit v1.2.3 From e57211fbd10079a860c8d6b7c5f71efb297134bb Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 4 Jul 2023 09:07:39 +0000 Subject: also filter deleted hublocs --- Zotlabs/Module/Dirsearch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Dirsearch.php b/Zotlabs/Module/Dirsearch.php index 7efac6345..a5c3f41c0 100644 --- a/Zotlabs/Module/Dirsearch.php +++ b/Zotlabs/Module/Dirsearch.php @@ -273,7 +273,7 @@ class Dirsearch extends Controller { xprof.xprof_hometown as hometown, xprof.xprof_keywords as keywords from xchan left join xprof on xchan_hash = xprof_hash left join hubloc on (hubloc_id_url = xchan_url and hubloc_hash = xchan_hash) - where hubloc_primary = 1 and hubloc_updated > %s - INTERVAL %s and ( $logic $sql_extra ) $hub_query $keywords_query and xchan_network = 'zot6' and xchan_system = 0 and xchan_hidden = 0 and xchan_orphan = 0 and xchan_deleted = 0 + where hubloc_primary = 1 and hubloc_updated > %s - INTERVAL %s and ( $logic $sql_extra ) $hub_query $keywords_query and xchan_network = 'zot6' and xchan_system = 0 and xchan_hidden = 0 and xchan_orphan = 0 and xchan_deleted = 0 and hubloc_deleted = 0 $safesql $order $qlimit", db_utcnow(), db_quoteinterval('30 DAY') -- cgit v1.2.3