Groups: If the administrator is hidden, create his posts anonymously

This commit is contained in:
Maxim Leshchenko 2021-11-17 09:43:55 +02:00
parent 2ee7a141c5
commit c83947ab09
No known key found for this signature in database
GPG key ID: BB9C44A8733FBEEE

View file

@ -188,7 +188,16 @@ final class WallPresenter extends OpenVKPresenter
if(false) if(false)
$this->flashFail("err", "Не удалось опубликовать пост", "Пост слишком большой."); $this->flashFail("err", "Не удалось опубликовать пост", "Пост слишком большой.");
$anon = OPENVK_ROOT_CONF["openvk"]["preferences"]["wall"]["anonymousPosting"]["enable"] && $this->postParam("anon") === "on"; $anon = OPENVK_ROOT_CONF["openvk"]["preferences"]["wall"]["anonymousPosting"]["enable"];
if($wallOwner instanceof Club && $this->postParam("as_group") === "on" && $this->postParam("force_sign") !== "on" && $anon) {
$manager = $wallOwner->getManager($this->user->identity);
if($manager)
$anon = $manager->isHidden();
elseif($this->user->identity->getId() === $wallOwner->getOwner()->getId())
$anon = $wallOwner->isOwnerHidden();
} else {
$anon = $anon && $this->postParam("anon") === "on";
}
$flags = 0; $flags = 0;
if($this->postParam("as_group") === "on") if($this->postParam("as_group") === "on")