diff --git a/Web/Models/Entities/Club.php b/Web/Models/Entities/Club.php
index 15c458a9..0ace9224 100644
--- a/Web/Models/Entities/Club.php
+++ b/Web/Models/Entities/Club.php
@@ -389,6 +389,11 @@ class Club extends RowModel
return (object) $res;
}
+ function isAnonCommentsAllowed(): bool
+ {
+ return (bool) $this->getRecord()->allow_anon_comments;
+ }
+
use Traits\TBackDrops;
use Traits\TSubscribable;
}
diff --git a/Web/Models/Entities/User.php b/Web/Models/Entities/User.php
index 348631e4..9a4a465c 100644
--- a/Web/Models/Entities/User.php
+++ b/Web/Models/Entities/User.php
@@ -1126,6 +1126,11 @@ class User extends RowModel
return $res;
}
+
+ function isAnonCommentsAllowed(): bool
+ {
+ return (bool) $this->getRecord()->allow_anon_comments;
+ }
use Traits\TBackDrops;
use Traits\TSubscribable;
diff --git a/Web/Presenters/CommentPresenter.php b/Web/Presenters/CommentPresenter.php
index 8c6f6a85..6baa1043 100644
--- a/Web/Presenters/CommentPresenter.php
+++ b/Web/Presenters/CommentPresenter.php
@@ -51,7 +51,7 @@ final class CommentPresenter extends OpenVKPresenter
if($_FILES["_vid_attachment"] && OPENVK_ROOT_CONF['openvk']['preferences']['videos']['disableUploading'])
$this->flashFail("err", tr("error"), "Video uploads are disabled by the system administrator.");
- $anon = OPENVK_ROOT_CONF["openvk"]["preferences"]["wall"]["anonymousPosting"]["enable"] && $this->postParam("anon") === "on";
+ $anon = OPENVK_ROOT_CONF["openvk"]["preferences"]["wall"]["anonymousPosting"]["enable"] && $this->postParam("anon") === "on" && $entity->getWallOwner()->isAnonCommentsAllowed();
$flags = 0;
if($this->postParam("as_group") === "on" && !is_null($club) && $club->canBeModifiedBy($this->user->identity))
diff --git a/Web/Presenters/GroupPresenter.php b/Web/Presenters/GroupPresenter.php
index 4f671df3..65db1d85 100644
--- a/Web/Presenters/GroupPresenter.php
+++ b/Web/Presenters/GroupPresenter.php
@@ -208,6 +208,7 @@ final class GroupPresenter extends OpenVKPresenter
$club->setEveryone_Can_Create_Topics(empty($this->postParam("everyone_can_create_topics")) ? 0 : 1);
$club->setDisplay_Topics_Above_Wall(empty($this->postParam("display_topics_above_wall")) ? 0 : 1);
$club->setHide_From_Global_Feed(empty($this->postParam("hide_from_global_feed")) ? 0 : 1);
+ $club->setAllow_Anon_Comments(empty($this->postParam("allow_anon_comments")) ? 0 : 1);
$website = $this->postParam("website") ?? "";
if(empty($website))
diff --git a/Web/Presenters/UserPresenter.php b/Web/Presenters/UserPresenter.php
index 9cfa3654..590a456c 100644
--- a/Web/Presenters/UserPresenter.php
+++ b/Web/Presenters/UserPresenter.php
@@ -418,6 +418,8 @@ final class UserPresenter extends OpenVKPresenter
if(!$user->setShortCode(empty($this->postParam("sc")) ? NULL : $this->postParam("sc")))
$this->flashFail("err", tr("error"), tr("error_shorturl_incorrect"));
+
+ $user->setAllow_Anon_Comments(empty($this->postParam("allow_anon_comments")) ? 0 : 1);
} else if($_GET['act'] === "privacy") {
$settings = [
"page.read",
diff --git a/Web/Presenters/templates/Group/Edit.xml b/Web/Presenters/templates/Group/Edit.xml
index 22f0b490..28231d13 100644
--- a/Web/Presenters/templates/Group/Edit.xml
+++ b/Web/Presenters/templates/Group/Edit.xml
@@ -101,7 +101,14 @@
{_group_dont_display_administrators_list}
-
+