connect perms

This commit is contained in:
zotlabs 2018-08-29 02:19:32 -07:00
parent 4ed37e3b33
commit ed4aa90338
7 changed files with 36 additions and 6 deletions

View file

@ -628,7 +628,10 @@ class Activity {
]
];
if($activitypub) {
$c = channelx_by_hash($p['xchan_hash']);
if($c) {
@ -655,6 +658,17 @@ class Activity {
}
}
}
else {
$ret['inbox'] = z_root() . '/nullbox';
$ret['outbox'] = z_root() . '/nullbox';
$ret['publicKey'] = [
'id' => $p['xchan_url'] . '/public_key_pem',
'owner' => $p['xchan_url'],
'publicKeyPem' => $p['xchan_pubkey']
];
}
$arr = [ 'xchan' => $p, 'encoded' => $ret, 'activitypub' => $activitypub ];
call_hooks('encode_person', $arr);

View file

@ -103,7 +103,7 @@ class Channel extends Controller {
$x = array_merge(['@context' => [
ACTIVITYSTREAMS_JSONLD_REV,
'https://w3id.org/security/v1'
]], Activity::encode_person($channel));
]], Activity::encode_person($channel,true));
json_return_and_die($x,'application/activity+json');

View file

@ -160,9 +160,9 @@ class Connedit extends \Zotlabs\Web\Controller {
// adjust permissions as desired.
$p = \Zotlabs\Access\Permissions::connect_perms(local_channel());
$my_perms = $p['perms'];
$my_perms = \Zotlabs\Acess\Permissions($p['perms']);
if($my_perms) {
set_abconfig($channel['channel_id'],$orig_record[0]['abook_xchan'],'system','my_perms',implode(',',$my_perms));
set_abconfig($channel['channel_id'],$orig_record[0]['abook_xchan'],'system','my_perms',$my_perms);
}
}

View file

@ -257,6 +257,7 @@ logger('gis: ' . print_r($gis,true));
$arr['item_thread_top'] = 1;
$arr['item_origin'] = 1;
$arr['item_wall'] = 1;
$arr['mid'] = item_message_id();
$arr['obj_type'] = ACTIVITY_OBJ_PHOTO;
$arr['verb'] = ACTIVITY_UPDATE;
@ -277,7 +278,7 @@ logger('gis: ' . print_r($gis,true));
'type' => ACTIVITY_OBJ_PHOTO,
'published' => datetime_convert('UTC','UTC',$photo['created'],ATOM_TIME),
'updated' => datetime_convert('UTC','UTC',$photo['edited'],ATOM_TIME),
'id' => z_root() . '/photo/' . $photo['resource_id'] . '-7',
'id' => $arr['mid'],
'url' => [ 'type' => 'Link', 'mediaType' => $photo['mimetype'], 'href' => z_root() . '/photo/' . $photo['resource_id'] . '-7' ],
'source' => [ 'content' => $arr['body'], 'mediaType' => 'text/bbcode' ],
'content' => bbcode($arr['body']),

View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Module;
use Zotlabs\Web\Controller;
class Nullbox extends Controller {
function init() {
http_status_exit(404,'Permission Denied');
}
}

View file

@ -1002,7 +1002,7 @@ function thread_author_menu($item, $mode = '') {
if($profile_link) {
$menu[] = [
'menu' => 'view_profile',
'title' => t('View Profile'),
'title' => t('Visit'),
'icon' => 'fw',
'action' => '',
'href' => $profile_link

View file

@ -4480,6 +4480,7 @@ function send_profile_photo_activity($channel,$photo,$profile) {
$arr['item_wall'] = 1;
$arr['obj_type'] = ACTIVITY_OBJ_PHOTO;
$arr['verb'] = ACTIVITY_UPDATE;
$arr['mid'] = item_message_id();
if(stripos($profile['gender'],t('female')) !== false)
$t = t('%1$s updated her %2$s');
@ -4499,7 +4500,7 @@ function send_profile_photo_activity($channel,$photo,$profile) {
'type' => ACTIVITY_OBJ_PHOTO,
'published' => datetime_convert('UTC','UTC',$photo['created'],ATOM_TIME),
'updated' => datetime_convert('UTC','UTC',$photo['edited'],ATOM_TIME),
'id' => z_root() . '/photo/profile/l/' . $channel['channel_id'],
'id' => $arr['mid'],
'url' => [ 'type' => 'Link', 'mediaType' => $photo['mimetype'], 'href' => z_root() . '/photo/profile/l/' . $channel['channel_id'] ],
'source' => [ 'content' => $arr['body'], 'mediaType' => 'text/bbcode' ],
'content' => bbcode($arr['body']),