]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/User.php
Merge pull request #12547 from MrPetovan/bug/12545-plink-zindex
[friendica.git] / src / Model / User.php
index 2b8516c255b0d1089a8a121000b2ac0a82c279d6..916844251e5c69710faa69890c52f826d0ef56f4 100644 (file)
@@ -158,6 +158,7 @@ class User
                $system['publish'] = false;
                $system['net-publish'] = false;
                $system['hide-friends'] = true;
+               $system['hidewall'] = true;
                $system['prv_keywords'] = '';
                $system['pub_keywords'] = '';
                $system['address'] = '';
@@ -829,6 +830,22 @@ class User
                return DBA::update('user', $fields, ['uid' => $uid]);
        }
 
+       /**
+        * Returns if the given uid is valid and in the admin list
+        *
+        * @param int $uid
+        *
+        * @return bool
+        * @throws Exception
+        */
+       public static function isSiteAdmin(int $uid): bool
+       {
+               return DBA::exists('user', [
+                       'uid'   => $uid,
+                       'email' => self::getAdminEmailList()
+               ]);
+       }
+
        /**
         * Checks if a nickname is in the list of the forbidden nicknames
         *