X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FACL.php;h=64e03d47190e752902d99351fbf191ba3ab789ac;hb=d3a4558e808a138988545291a8ac7bd35db3e939;hp=e6dd1a8f32400879a3c03000914334d281c34de5;hpb=9a4240c3b2f1d31a60f823223dcbb9b24d67e20d;p=friendica.git diff --git a/src/Core/ACL.php b/src/Core/ACL.php index e6dd1a8f32..64e03d4719 100644 --- a/src/Core/ACL.php +++ b/src/Core/ACL.php @@ -258,10 +258,20 @@ class ACL extends BaseObject */ public static function getContactListByUserId(int $user_id) { - $acl_contacts = Contact::selectToArray( - ['id', 'name', 'addr', 'micro'], - ['uid' => $user_id, 'pending' => false, 'rel' => [Contact::FOLLOWER, Contact::FRIEND]] + $fields = ['id', 'name', 'addr', 'micro']; + $params = ['order' => ['name']]; + $acl_contacts = Contact::selectToArray($fields, + ['uid' => $user_id, 'self' => false, 'blocked' => false, 'archive' => false, 'deleted' => false, + 'pending' => false, 'rel' => [Contact::FOLLOWER, Contact::FRIEND]], $params ); + + $acl_forums = Contact::selectToArray($fields, + ['uid' => $user_id, 'self' => false, 'blocked' => false, 'archive' => false, 'deleted' => false, + 'pending' => false, 'contact-type' => Contact::TYPE_COMMUNITY], $params + ); + + $acl_contacts = array_merge($acl_forums, $acl_contacts); + array_walk($acl_contacts, function (&$value) { $value['type'] = 'contact'; }); @@ -325,6 +335,10 @@ class ACL extends BaseObject */ public static function getFullSelectorHTML(Page $page, array $user = null, bool $for_federation = false, array $default_permissions = []) { + if (empty($user['uid'])) { + return ''; + } + $page->registerFooterScript(Theme::getPathForFile('asset/typeahead.js/dist/typeahead.bundle.js')); $page->registerFooterScript(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.js')); $page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.css')); @@ -367,7 +381,7 @@ class ACL extends BaseObject } } - if ($default_permissions['hidewall']) { + if (!$default_permissions['hidewall']) { if ($mail_enabled) { $jotnets_fields[] = [ 'type' => 'checkbox',