]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/ACL.php
Merge pull request #10095 from annando/parseurl-photos
[friendica.git] / src / Core / ACL.php
index 4df15dc536906a31e6a8c64b245140830c910854..0da636699e690d71116d823688cf0e6f2984e1ae 100644 (file)
@@ -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);