mirror of
https://github.com/openvk/openvk
synced 2024-12-23 00:51:03 +03:00
Groups: Publish group avatars uploaded by hidden administrator as anonymous
This commit is contained in:
parent
08c4d961f1
commit
33836d8a2e
1 changed files with 7 additions and 0 deletions
|
@ -219,10 +219,17 @@ final class GroupPresenter extends OpenVKPresenter
|
|||
if($_FILES["ava"]["error"] === UPLOAD_ERR_OK) {
|
||||
$photo = new Photo;
|
||||
try {
|
||||
$anon = OPENVK_ROOT_CONF["openvk"]["preferences"]["wall"]["anonymousPosting"]["enable"];
|
||||
if($anon && $this->user->id === $club->getOwner()->getId())
|
||||
$anon = $club->isOwnerHidden();
|
||||
else if($anon)
|
||||
$anon = $club->getManager($this->user->identity)->isHidden();
|
||||
|
||||
$photo->setOwner($this->user->id);
|
||||
$photo->setDescription("Profile image");
|
||||
$photo->setFile($_FILES["ava"]);
|
||||
$photo->setCreated(time());
|
||||
$photo->setAnonymous($anon);
|
||||
$photo->save();
|
||||
|
||||
(new Albums)->getClubAvatarAlbum($club)->addPhoto($photo);
|
||||
|
|
Loading…
Reference in a new issue