X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FUser.php;h=916844251e5c69710faa69890c52f826d0ef56f4;hb=60551e6277a4e3a0901481e2a23b3963db6a1c2c;hp=2b8516c255b0d1089a8a121000b2ac0a82c279d6;hpb=23a8245fb066d2b64ced49b50dd10f40ffabba1e;p=friendica.git diff --git a/src/Model/User.php b/src/Model/User.php index 2b8516c255..916844251e 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -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 *