X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FACL.php;h=64e03d47190e752902d99351fbf191ba3ab789ac;hb=00756737b54e00dc5dc3c74ebc5c3e92a5dd97ff;hp=044f61aebce5da518f10e7e5e61d6d46702dc90a;hpb=f5a28e8bbf00accede6146e3fecd37611de75d39;p=friendica.git diff --git a/src/Core/ACL.php b/src/Core/ACL.php index 044f61aebc..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'));