X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FUser.php;h=bd7351f072513e456815dc552f9877bdcd8c32aa;hb=3f309805919671ce0ae22f82f5a751050a07dce4;hp=132e4f11a947d112ccc405e650faccc8804b8560;hpb=2f3f41ed9cdb4229d78bdf2f91b0617403a8dd62;p=friendica.git diff --git a/src/Model/User.php b/src/Model/User.php index 132e4f11a9..bd7351f072 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -1,6 +1,6 @@ $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 *