mirror of
https://github.com/openvk/openvk
synced 2024-12-23 17:12:01 +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) {
|
if($_FILES["ava"]["error"] === UPLOAD_ERR_OK) {
|
||||||
$photo = new Photo;
|
$photo = new Photo;
|
||||||
try {
|
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->setOwner($this->user->id);
|
||||||
$photo->setDescription("Profile image");
|
$photo->setDescription("Profile image");
|
||||||
$photo->setFile($_FILES["ava"]);
|
$photo->setFile($_FILES["ava"]);
|
||||||
$photo->setCreated(time());
|
$photo->setCreated(time());
|
||||||
|
$photo->setAnonymous($anon);
|
||||||
$photo->save();
|
$photo->save();
|
||||||
|
|
||||||
(new Albums)->getClubAvatarAlbum($club)->addPhoto($photo);
|
(new Albums)->getClubAvatarAlbum($club)->addPhoto($photo);
|
||||||
|
|
Loading…
Reference in a new issue