X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FACL.php;h=0da636699e690d71116d823688cf0e6f2984e1ae;hb=5b13de8e7f9380f5fc2e9fad609d381660c1a6cb;hp=4df15dc536906a31e6a8c64b245140830c910854;hpb=abe6ecf820b729c6943b272be255dc10abafde4e;p=friendica.git diff --git a/src/Core/ACL.php b/src/Core/ACL.php index 4df15dc536..0da636699e 100644 --- a/src/Core/ACL.php +++ b/src/Core/ACL.php @@ -83,6 +83,27 @@ class ACL return $o; } + /** + * Returns a minimal ACL block for self-only permissions + * + * @param int $localUserId + * @param string $explanation + * @return string + * @throws \Friendica\Network\HTTPException\InternalServerErrorException + */ + public static function getSelfOnlyHTML(int $localUserId, string $explanation) + { + $selfPublicContactId = Contact::getPublicIdByUserId($localUserId); + + $tpl = Renderer::getMarkupTemplate('acl/self_only.tpl'); + $o = Renderer::replaceMacros($tpl, [ + '$selfPublicContactId' => $selfPublicContactId, + '$explanation' => $explanation, + ]); + + return $o; + } + /** * Return the default permission of the provided user array * @@ -123,6 +144,7 @@ class ACL 'archive' => false, 'deleted' => false, 'pending' => false, + 'network' => Protocol::FEDERATED, 'rel' => [Contact::FOLLOWER, Contact::FRIEND] ], $condition), $params @@ -135,7 +157,7 @@ class ACL $acl_forums = Contact::selectToArray($fields, ['uid' => $user_id, 'self' => false, 'blocked' => false, 'archive' => false, 'deleted' => false, - 'pending' => false, 'contact-type' => Contact::TYPE_COMMUNITY], $params + 'network' => Protocol::FEDERATED, 'pending' => false, 'contact-type' => Contact::TYPE_COMMUNITY], $params ); $acl_contacts = array_merge($acl_forums, $acl_contacts);