aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/ItemObject.php2
-rwxr-xr-xinclude/diaspora.php2
-rw-r--r--include/dir_fns.php8
-rw-r--r--include/features.php1
-rwxr-xr-xinclude/items.php2
-rw-r--r--include/permissions.php2
-rw-r--r--include/zot.php21
7 files changed, 29 insertions, 9 deletions
diff --git a/include/ItemObject.php b/include/ItemObject.php
index 6f1c76fa1..f6f7c0fba 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -79,7 +79,7 @@ class Item extends BaseObject {
$indent = '';
$osparkle = '';
$total_children = $this->count_descendants();
- $unseen_comments = (($item->real_uid) ? 0 : $this->count_unseen_descendants());
+ $unseen_comments = (($item['real_uid']) ? 0 : $this->count_unseen_descendants());
$conv = $this->get_conversation();
$observer = $conv->get_observer();
diff --git a/include/diaspora.php b/include/diaspora.php
index 09521b82b..b4f20528d 100755
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -1788,7 +1788,7 @@ function diaspora_like($importer,$xml,$msg) {
$contact = diaspora_get_contact_by_handle($importer['channel_id'],$msg['author']);
if(! $contact) {
- logger('diaspora_like: cannot find contact: ' . $msg['author']);
+ logger('diaspora_like: cannot find contact: ' . $msg['author'] . ' for channel ' . $importer['channel_name']);
return;
}
diff --git a/include/dir_fns.php b/include/dir_fns.php
index 8f27fb85d..0ba4f8712 100644
--- a/include/dir_fns.php
+++ b/include/dir_fns.php
@@ -38,7 +38,7 @@ function check_upstream_directory() {
*/
$directory = get_config('system','directory_server');
if ($directory) {
- $r = q("select * from site where site_url = '%s' and (site_flags & %d)>0 ",
+ $r = q("select * from site where site_url = '%s' and (site_flags & %d) > 0 ",
dbesc($directory),
intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY|DIRECTORY_MODE_STANDALONE)
);
@@ -86,14 +86,14 @@ function sync_directories($dirmode) {
$realm = get_directory_realm();
if($realm == DIRECTORY_REALM) {
- $r = q("select * from site where (site_flags & %d)>0 and site_url != '%s' and ( site_realm = '%s' or site_realm = '') ",
+ $r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s' and ( site_realm = '%s' or site_realm = '') ",
intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY),
dbesc(z_root()),
dbesc($realm)
);
}
else {
- $r = q("select * from site where (site_flags & %d)>0 and site_url != '%s' and site_realm like '%s' ",
+ $r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s' and site_realm like '%s' ",
intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY),
dbesc(z_root()),
dbesc(protect_sprintf('%' . $realm . '%'))
@@ -120,7 +120,7 @@ function sync_directories($dirmode) {
dbesc($r[0]['site_realm'])
);
- $r = q("select * from site where (site_flags & %d)>0 and site_url != '%s'",
+ $r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s'",
intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY),
dbesc(z_root())
);
diff --git a/include/features.php b/include/features.php
index 7530158ec..92d8598a5 100644
--- a/include/features.php
+++ b/include/features.php
@@ -48,6 +48,7 @@ function get_features() {
array('preview', t('Post Preview'), t('Allow previewing posts and comments before publishing them')),
array('channel_sources', t('Channel Sources'), t('Automatically import channel content from other channels or feeds')),
array('content_encrypt', t('Even More Encryption'), t('Allow optional encryption of content end-to-end with a shared secret key')),
+ array('adult_photo_flagging', t('Flag Adult Photos'), t('Provide photo edit option to hide adult photos from default album view')),
),
// Network Tools
diff --git a/include/items.php b/include/items.php
index 19de52e92..00edeabdd 100755
--- a/include/items.php
+++ b/include/items.php
@@ -4285,7 +4285,7 @@ function zot_feed($uid,$observer_xchan,$arr) {
$mindate = NULL_DATE;
$mindate = dbesc($mindate);
- logger('zot_feed: ' . $uid);
+ logger('zot_feed: requested for uid ' . $uid . ' from observer ' . $observer_xchan, LOGGER_DEBUG);
if(! perm_is_allowed($uid,$observer_xchan,'view_stream')) {
logger('zot_feed: permission denied.');
diff --git a/include/permissions.php b/include/permissions.php
index 0ad28b3f1..b078de4d5 100644
--- a/include/permissions.php
+++ b/include/permissions.php
@@ -257,7 +257,7 @@ function perm_is_allowed($uid,$observer_xchan,$permission) {
$channel_perm = $global_perms[$permission][0];
- $r = q("select %s, channel_hash from channel where channel_id = %d limit 1",
+ $r = q("select %s, channel_pageflags, channel_hash from channel where channel_id = %d limit 1",
dbesc($channel_perm),
intval($uid)
);
diff --git a/include/zot.php b/include/zot.php
index 3ffc9b43f..3b8584509 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -1256,8 +1256,14 @@ function zot_import($arr, $sender_url) {
function public_recips($msg) {
+
+ require_once('include/identity.php');
+
$check_mentions = false;
+ $include_sys = false;
+
if($msg['message']['type'] === 'activity') {
+ $include_sys = true;
$col = 'channel_w_stream';
$field = PERMS_W_STREAM;
if(array_key_exists('flags',$msg['message']) && in_array('thread_parent', $msg['message']['flags'])) {
@@ -1307,6 +1313,14 @@ function public_recips($msg) {
$r = array_merge($r,$x);
+ //logger('message: ' . print_r($msg['message'],true));
+
+ if($include_sys && array_key_exists('public_scope',$msg['message']) && $msg['message']['public_scope'] === 'public') {
+ $sys = get_sys_channel();
+ if($sys)
+ $r[] = array('hash' => $sys['channel_hash']);
+ }
+
// look for any public mentions on this site
// They will get filtered by tgroup_check() so we don't need to check permissions now
@@ -1337,7 +1351,7 @@ function public_recips($msg) {
function allowed_public_recips($msg) {
- logger('allowed_public_recips: ' . print_r($msg,true));
+ logger('allowed_public_recips: ' . print_r($msg,true),LOGGER_DATA);
$recips = public_recips($msg);
@@ -1414,8 +1428,13 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false,$reque
continue;
}
+
$channel = $r[0];
+ // allow public postings to the sys channel regardless of permissions
+ if(($channel['channel_pageflags'] & PAGE_SYSTEM) && (! $arr['item_private']))
+ $public = true;
+
$tag_delivery = tgroup_check($channel['channel_id'],$arr);
$perm = (($arr['mid'] == $arr['parent_mid']) ? 'send_stream' : 'post_comments');