diff options
author | zotlabs <mike@macgirvin.com> | 2018-09-05 21:02:06 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-09-05 21:02:06 -0700 |
commit | c5bc4fe24519079664b8f63a5e9082f0a7ffc945 (patch) | |
tree | 9039d12215106b92b21f42977abbcdb44b529f65 /Zotlabs/Module | |
parent | bc4a92b702618aa83991ea65eb24d653cfc6601a (diff) | |
parent | ea381d918021a33a73df40de95fd0c57f0edc5c2 (diff) | |
download | volse-hubzilla-c5bc4fe24519079664b8f63a5e9082f0a7ffc945.tar.gz volse-hubzilla-c5bc4fe24519079664b8f63a5e9082f0a7ffc945.tar.bz2 volse-hubzilla-c5bc4fe24519079664b8f63a5e9082f0a7ffc945.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Admin.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Filestorage.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Item.php | 12 |
3 files changed, 9 insertions, 7 deletions
diff --git a/Zotlabs/Module/Admin.php b/Zotlabs/Module/Admin.php index 2df8dc25d..6edced9b5 100644 --- a/Zotlabs/Module/Admin.php +++ b/Zotlabs/Module/Admin.php @@ -109,7 +109,7 @@ class Admin extends \Zotlabs\Web\Controller { // available channels, primary and clones $channels = array(); - $r = q("SELECT COUNT(*) AS total, COUNT(CASE WHEN channel_primary = 1 THEN 1 ELSE NULL END) AS main, COUNT(CASE WHEN channel_primary = 0 THEN 1 ELSE NULL END) AS clones FROM channel WHERE channel_removed = 0"); + $r = q("SELECT COUNT(*) AS total, COUNT(CASE WHEN channel_primary = 1 THEN 1 ELSE NULL END) AS main, COUNT(CASE WHEN channel_primary = 0 THEN 1 ELSE NULL END) AS clones FROM channel WHERE channel_removed = 0 and channel_system = 0"); if ($r) { $channels['total'] = array('label' => t('Channels'), 'val' => $r[0]['total']); $channels['main'] = array('label' => t('Primary'), 'val' => $r[0]['main']); diff --git a/Zotlabs/Module/Filestorage.php b/Zotlabs/Module/Filestorage.php index cd9ab601d..23bd63f95 100644 --- a/Zotlabs/Module/Filestorage.php +++ b/Zotlabs/Module/Filestorage.php @@ -128,7 +128,7 @@ class Filestorage extends \Zotlabs\Web\Controller { } } - if(json_return) + if($json_return) json_return_and_die([ 'success' => true ]); goaway(dirname($url)); diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 640b4fa5c..a24d6da9c 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -29,7 +29,7 @@ use \Zotlabs\Lib as Zlib; class Item extends \Zotlabs\Web\Controller { function post() { - + // This will change. Figure out who the observer is and whether or not // they have permission to post here. Else ignore the post. @@ -237,10 +237,12 @@ class Item extends \Zotlabs\Web\Controller { if($parent) { logger('mod_item: item_post parent=' . $parent); $can_comment = false; - if((array_key_exists('owner',$parent_item)) && intval($parent_item['owner']['abook_self'])) - $can_comment = perm_is_allowed($profile_uid,$observer['xchan_hash'],'post_comments'); - else - $can_comment = can_comment_on_post($observer['xchan_hash'],$parent_item); + + $can_comment = can_comment_on_post($observer['xchan_hash'],$parent_item); + if (!$can_comment) { + if((array_key_exists('owner',$parent_item)) && intval($parent_item['owner']['abook_self'])==1 ) + $can_comment = perm_is_allowed($profile_uid,$observer['xchan_hash'],'post_comments'); + } if(! $can_comment) { notice( t('Permission denied.') . EOL) ; |