Disallow posting to restricted groups

This commit is contained in:
Michael 2024-08-24 14:07:59 +00:00
parent a3a8b6c9ec
commit dace658d5d
3 changed files with 29 additions and 15 deletions

View file

@ -259,6 +259,17 @@ class Contact
return DBA::update('contact', $fields, $condition, $old_fields);
}
/**
* @param integer $id Contact ID
* @param array $fields Array of selected fields, empty for all
* @return array|boolean Contact record if it exists, false otherwise
* @throws \Exception
*/
public static function getAccountById(int $id, array $fields = [])
{
return DBA::selectFirst('account-user-view', $fields, ['id' => $id]);
}
/**
* @param integer $id Contact ID
* @param array $fields Array of selected fields, empty for all
@ -2375,7 +2386,8 @@ class Contact
if ($default_avatar && Proxy::isLocalImage($avatar)) {
$fields = [
'avatar' => $avatar, 'avatar-date' => DateTimeFormat::utcNow(),
'avatar' => $avatar,
'avatar-date' => DateTimeFormat::utcNow(),
'photo' => $avatar,
'thumb' => self::getDefaultAvatar($contact, Proxy::SIZE_THUMB),
'micro' => self::getDefaultAvatar($contact, Proxy::SIZE_MICRO)