diff options
author | zotlabs <mike@macgirvin.com> | 2017-09-19 13:09:19 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-09-19 13:09:19 -0700 |
commit | 51e40add661219c26c73f4b8d6da1f691e0b9b6d (patch) | |
tree | 6ce7fcce4ead9110c67eecd08be652b07350ccb5 | |
parent | 8123a62302330cc8629d0c8ecb68d3d3be07a005 (diff) | |
parent | 4500faf463e7fd6fcf9948666421c941a1292df9 (diff) | |
download | volse-hubzilla-51e40add661219c26c73f4b8d6da1f691e0b9b6d.tar.gz volse-hubzilla-51e40add661219c26c73f4b8d6da1f691e0b9b6d.tar.bz2 volse-hubzilla-51e40add661219c26c73f4b8d6da1f691e0b9b6d.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
-rw-r--r-- | CHANGELOG | 8 | ||||
-rw-r--r-- | Zotlabs/Daemon/Notifier.php | 10 | ||||
-rw-r--r-- | Zotlabs/Lib/ActivityStreams.php | 11 | ||||
-rw-r--r-- | Zotlabs/Lib/NativeWiki.php | 18 | ||||
-rw-r--r-- | Zotlabs/Lib/NativeWikiPage.php | 9 | ||||
-rw-r--r-- | Zotlabs/Module/Acl.php | 11 | ||||
-rw-r--r-- | Zotlabs/Module/Photos.php | 6 | ||||
-rw-r--r-- | Zotlabs/Module/Wiki.php | 8 | ||||
-rw-r--r-- | include/feedutils.php | 7 | ||||
-rwxr-xr-x | include/items.php | 3 | ||||
-rw-r--r-- | view/tpl/wiki_page_list.tpl | 22 |
11 files changed, 90 insertions, 23 deletions
@@ -1,3 +1,11 @@ +Hubzilla 2.6.3 (2017-09-18) + - Fix anonymous comments/likes on photos - this is not yet implemented + - Fix favicon not displayed on certain pages + - Fix hubzilla logo icon for favicon and email notifications + - Fix an issue with displaying selected theme in settings/display + - [SECURITY] Restrict the input characters we accept in token verification strings to hex digits + - Remove hubzilla.nl from fallback directory servers + Hubzilla 2.6.2 (2017-08-31) - Fix webfinger returns invalid XML (github issue #851) diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 0e8c99572..54d609ad1 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -59,6 +59,8 @@ require_once('include/bbcode.php'); * * ZOT * permission_create abook_id + * permission_accept abook_id + * permission_reject abook_id * permission_update abook_id * refresh_all channel_id * purge_all channel_id @@ -159,7 +161,7 @@ class Notifier { $packet_type = 'keychange'; $normal_mode = false; } - elseif($cmd == 'permission_update' || $cmd == 'permission_create') { + elseif($cmd == 'permission_update' || $cmd == 'permission_reject' || $cmd == 'permission_accept' || $cmd == 'permission_create') { // Get the (single) recipient $r = q("select * from abook left join xchan on abook_xchan = xchan_hash where abook_id = %d and abook_self = 0", intval($item_id) @@ -171,8 +173,12 @@ class Notifier { if($channel) { $perm_update = array('sender' => $channel, 'recipient' => $r[0], 'success' => false, 'deliveries' => ''); - if($cmd == 'permission_create') + if($cmd === 'permission_create') call_hooks('permissions_create',$perm_update); + elseif($cmd === 'permission_accept') + call_hooks('permissions_accept',$perm_update); + elseif($cmd === 'permission_reject') + call_hooks('permissions_reject',$perm_update); else call_hooks('permissions_update',$perm_update); diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php index 2846ea476..d9735881a 100644 --- a/Zotlabs/Lib/ActivityStreams.php +++ b/Zotlabs/Lib/ActivityStreams.php @@ -17,6 +17,7 @@ class ActivityStreams { public $ldsig = null; public $sigok = false; public $recips = null; + public $raw_recips = null; function __construct($string) { @@ -53,13 +54,21 @@ class ActivityStreams { return $this->valid; } + function set_recips($arr) { + $this->saved_recips = $arr; + } + function collect_recips($base = '',$namespace = 'https://www.w3.org/ns/activitystreams') { $x = []; $fields = [ 'to','cc','bto','bcc','audience']; foreach($fields as $f) { $y = $this->get_compound_property($f,$base,$namespace); - if($y) + if($y) { $x = array_merge($x,$y); + if(! is_array($this->raw_recips)) + $this->raw_recips = []; + $this->raw_recips[$f] = $x; + } } // not yet ready for prime time // $x = $this->expand($x,$base,$namespace); diff --git a/Zotlabs/Lib/NativeWiki.php b/Zotlabs/Lib/NativeWiki.php index 390b83958..7642dbb3e 100644 --- a/Zotlabs/Lib/NativeWiki.php +++ b/Zotlabs/Lib/NativeWiki.php @@ -135,6 +135,18 @@ class NativeWiki { $item_id = $update['item_id']; + // update acl for any existing wiki pages + + q("update item set allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s', item_private = %d where resource_type = 'nwikipage' and resource_id = '%s'", + dbesc($item['allow_cid']), + dbesc($item['allow_gid']), + dbesc($item['deny_cid']), + dbesc($item['deny_gid']), + dbesc($item['item_private']), + dbesc($arr['resource_id']) + ); + + if($update['item_id']) { info( t('Wiki updated successfully')); if($update_title) { @@ -160,6 +172,12 @@ class NativeWiki { dbesc($resource_id) ); if($r) { + $q = q("select * from item where resource_type = 'nwikipage' and resource_id = '%s'", + dbesc($r[0]['resource_type']) + ); + if($q) { + $r = array_merge($r,$q); + } xchan_query($r); $sync_item = fetch_post_tags($r); build_sync_packet($uid,array('wiki' => array(encode_item($sync_item[0],true)))); diff --git a/Zotlabs/Lib/NativeWikiPage.php b/Zotlabs/Lib/NativeWikiPage.php index 4b637781e..209a5ef3c 100644 --- a/Zotlabs/Lib/NativeWikiPage.php +++ b/Zotlabs/Lib/NativeWikiPage.php @@ -21,7 +21,7 @@ class NativeWikiPage { $sql_extra = item_permissions_sql($channel_id,$observer_hash); $r = q("select * from item where resource_type = 'nwikipage' and resource_id = '%s' and uid = %d and item_deleted = 0 - $sql_extra order by created asc", + $sql_extra order by title asc", dbesc($resource_id), intval($channel_id) ); @@ -74,6 +74,7 @@ class NativeWikiPage { $arr['uid'] = $channel_id; $arr['author_xchan'] = $observer_hash; $arr['mimetype'] = $mimetype; + $arr['title'] = $name; $arr['resource_type'] = 'nwikipage'; $arr['resource_id'] = $resource_id; $arr['allow_cid'] = $w['wiki']['allow_cid']; @@ -139,8 +140,14 @@ class NativeWikiPage { if($ic) { foreach($ic as $c) { set_iconfig($c['item_id'],'nwikipage','pagetitle',$pageNewName); + $ids[] = $c['item_id']; } + $str_ids = implode(',', $ids); + q("update item set title = '%s' where id in ($str_ids)", + dbesc($pageNewName) + ); + $page = [ 'rawName' => $pageNewName, 'htmlName' => escape_tags($pageNewName), diff --git a/Zotlabs/Module/Acl.php b/Zotlabs/Module/Acl.php index 9b2be0fea..769b36ce4 100644 --- a/Zotlabs/Module/Acl.php +++ b/Zotlabs/Module/Acl.php @@ -21,7 +21,7 @@ class Acl extends \Zotlabs\Web\Controller { function init() { - // logger('mod_acl: ' . print_r($_REQUEST,true)); + logger('mod_acl: ' . print_r($_REQUEST,true)); $start = (x($_REQUEST,'start') ? $_REQUEST['start'] : 0); $count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 500); @@ -307,7 +307,7 @@ class Acl extends \Zotlabs\Web\Controller { $contacts[] = array( "photo" => $g['photo'], "name" => $g['name'], - "nick" => $g['address'], + "nick" => $g['address'] ); } } @@ -330,7 +330,12 @@ class Acl extends \Zotlabs\Web\Controller { continue; $g['hash'] = urlencode($g['hash']); - + + if(! $g['nick']) { + $t = explode(' ',strtolower($g['name'])); + $g['nick'] = $t[0] . '@'; + } + if(in_array($g['hash'],$permitted) && $type == 'c' && (! $noforums)) { $contacts[] = array( "type" => "c", diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index bb7079a6a..f86801fcc 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -1041,7 +1041,7 @@ class Photos extends \Zotlabs\Web\Controller { $likebuttons = ''; - if($can_post || $can_comment) { + if($observer && ($can_post || $can_comment)) { $likebuttons = [ 'id' => $link_item['id'], 'likethis' => t("I like this \x28toggle\x29"), @@ -1053,7 +1053,7 @@ class Photos extends \Zotlabs\Web\Controller { $comments = ''; if(! count($r)) { - if($can_post || $can_comment) { + if($observer && ($can_post || $can_comment)) { $commentbox = replace_macros($cmnt_tpl,array( '$return_path' => '', '$mode' => 'photos', @@ -1172,7 +1172,7 @@ class Photos extends \Zotlabs\Web\Controller { } - if($can_post || $can_comment) { + if($observer && ($can_post || $can_comment)) { $commentbox = replace_macros($cmnt_tpl,array( '$return_path' => '', '$jsreload' => $return_url, diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index 6055b0b38..2668229ee 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -140,11 +140,16 @@ class Wiki extends \Zotlabs\Web\Controller { $zip = new \ZipArchive; $r = $zip->open($zip_filepath, \ZipArchive::CREATE); if($r === true) { - $i = q("select * from item where resource_type = 'nwikipage' and resource_id = '%s'", + $pages = []; + $i = q("select * from item where resource_type = 'nwikipage' and resource_id = '%s' order by revision desc", dbesc($resource_id) ); + if($i) { foreach($i as $iv) { + if(in_array($iv['mid'],$pages)) + continue; + if($iv['mimetype'] === 'text/plain') { $content = html_entity_decode($iv['body'],ENT_COMPAT,'UTF-8'); } @@ -156,6 +161,7 @@ class Wiki extends \Zotlabs\Web\Controller { } $fname = get_iconfig($iv['id'],'nwikipage','pagetitle') . Zlib\NativeWikiPage::get_file_ext($iv); $zip->addFromString($fname,$content); + $pages[] = $iv['mid']; } diff --git a/include/feedutils.php b/include/feedutils.php index 145d4361c..112e10155 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -811,6 +811,7 @@ function feed_get_reshare(&$res,$item) { } $attach = $share['links']; + if($attach) { foreach($attach as $att) { if($att['rel'] === 'alternate') { @@ -845,6 +846,10 @@ function feed_get_reshare(&$res,$item) { } } + if((! $body) && ($share['alternate'])) { + $body = $share['alternate']; + } + $res['body'] = "[share author='" . urlencode($share['author']) . "' profile='" . $share['profile'] . "' avatar='" . $share['avatar'] . @@ -1706,7 +1711,7 @@ function compat_photos_list($s) { $found = preg_match_all('/\[[zi]mg(.*?)\](.*?)\[/ism',$s,$matches,PREG_SET_ORDER); if($found) { - foreach($matches as $match) { + foreach($matches as $match) { $ret[] = [ 'href' => $match[2], 'length' => 0, diff --git a/include/items.php b/include/items.php index f286015fe..daf41aa4b 100755 --- a/include/items.php +++ b/include/items.php @@ -2498,6 +2498,9 @@ function tag_deliver($uid, $item_id) { $pattern = '/@\!?\[zrl\=([^\]]*?)\]((?:.(?!\[zrl\=))*?)\+\[\/zrl\]/'; + // statusnet style group tags + $pattern2 = '/^|[^@]\!\[zrl\=([^\]]*?)\]((?:.(?!\[zrl\=))*?)\+\[\/zrl\]/'; + if(preg_match_all($pattern,$body,$matches,PREG_SET_ORDER)) { $max_forums = get_config('system','max_tagged_forums'); if(! $max_forums) diff --git a/view/tpl/wiki_page_list.tpl b/view/tpl/wiki_page_list.tpl index bf5f6697d..a7e6ebdaf 100644 --- a/view/tpl/wiki_page_list.tpl +++ b/view/tpl/wiki_page_list.tpl @@ -3,6 +3,16 @@ {{/if}} <h3>{{$header}}</h3> <ul class="nav nav-pills flex-column"> + {{if $pages}} + {{foreach $pages as $page}} + <li class="nav-item nav-item-hack" id="{{$page.link_id}}"> + {{if $page.resource_id && $candel}} + <i class="nav-link widget-nav-pills-icons fa fa-trash-o drop-icons" onclick="wiki_delete_page('{{$page.title}}', '{{$page.title}}', '{{$page.resource_id}}', '{{$page.link_id}}')"></i> + {{/if}} + <a class="nav-link" href="/wiki/{{$channel_address}}/{{$wikiname}}/{{$page.url}}">{{$page.title}}</a> + </li> + {{/foreach}} + {{/if}} {{if $canadd}} <li class="nav-item"><a class="nav-link" href="#" onclick="wiki_show_new_page_form(); return false;"><i class="fa fa-plus-circle"></i> {{$addnew}}</a></li> {{/if}} @@ -11,7 +21,7 @@ <form id="new-page-form" action="wiki/{{$channel_address}}/create/page" method="post" > <input type="hidden" name="resource_id" value="{{$resource_id}}"> {{if $typelock}} - <input type="hidden" name="mimetype" value="{{$lockedtype}}"> + <input id="id_mimetype" type="hidden" name="mimetype" value="{{$lockedtype}}"> {{else}} {{$mimetype}} {{/if}} @@ -20,16 +30,6 @@ </form> </div> {{/if}} - {{if $pages}} - {{foreach $pages as $page}} - <li class="nav-item nav-item-hack" id="{{$page.link_id}}"> - {{if $page.resource_id && $candel}} - <i class="nav-link widget-nav-pills-icons fa fa-trash-o drop-icons" onclick="wiki_delete_page('{{$page.title}}', '{{$page.title}}', '{{$page.resource_id}}', '{{$page.link_id}}')"></i> - {{/if}} - <a class="nav-link" href="/wiki/{{$channel_address}}/{{$wikiname}}/{{$page.url}}">{{$page.title}}</a> - </li> - {{/foreach}} - {{/if}} </ul> {{if ! $refresh}} </div> |