mirror of
https://github.com/openvk/openvk
synced 2024-11-15 11:39:13 +03:00
Config
This commit is contained in:
parent
aaad80f4f8
commit
ae0258c78b
4 changed files with 20 additions and 5 deletions
|
@ -439,7 +439,7 @@ class User extends RowModel
|
||||||
else if($user->getId() === $this->getId())
|
else if($user->getId() === $this->getId())
|
||||||
return true;
|
return true;
|
||||||
else if ((new Blacklists)->isBanned($this, $user)) {
|
else if ((new Blacklists)->isBanned($this, $user)) {
|
||||||
if ($user->isAdmin())
|
if ($user->isAdmin() && !OPENVK_ROOT_CONF["openvk"]["preferences"]["security"]["blacklists"]["applyToAdmins"])
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -140,6 +140,11 @@ final class PhotosPresenter extends OpenVKPresenter
|
||||||
if($album->getPrettyId() !== $owner . "_" . $id || $album->isDeleted())
|
if($album->getPrettyId() !== $owner . "_" . $id || $album->isDeleted())
|
||||||
$this->notFound();
|
$this->notFound();
|
||||||
|
|
||||||
|
if ((new Blacklists)->isBanned($album->getOwner(), $this->user->identity)) {
|
||||||
|
if (!$this->user->identity->isAdmin() OR $this->user->identity->isAdmin() AND OPENVK_ROOT_CONF["openvk"]["preferences"]["security"]["blacklists"]["applyToAdmins"])
|
||||||
|
$this->flashFail("err", tr("forbidden"), "Пользователь внёс Вас в чёрный список.");
|
||||||
|
}
|
||||||
|
|
||||||
if($owner > 0 /* bc we currently don't have perms for clubs */) {
|
if($owner > 0 /* bc we currently don't have perms for clubs */) {
|
||||||
$ownerObject = (new Users)->get($owner);
|
$ownerObject = (new Users)->get($owner);
|
||||||
if(!$ownerObject->getPrivacyPermission('photos.read', $this->user->identity ?? NULL)) {
|
if(!$ownerObject->getPrivacyPermission('photos.read', $this->user->identity ?? NULL)) {
|
||||||
|
@ -166,8 +171,10 @@ final class PhotosPresenter extends OpenVKPresenter
|
||||||
$photo = $this->photos->getByOwnerAndVID($ownerId, $photoId);
|
$photo = $this->photos->getByOwnerAndVID($ownerId, $photoId);
|
||||||
if(!$photo || $photo->isDeleted()) $this->notFound();
|
if(!$photo || $photo->isDeleted()) $this->notFound();
|
||||||
|
|
||||||
if ((new Blacklists)->isBanned($photo->getOwner(), $this->user->identity))
|
if ((new Blacklists)->isBanned($photo->getOwner(), $this->user->identity)) {
|
||||||
|
if (!$this->user->identity->isAdmin() OR $this->user->identity->isAdmin() AND OPENVK_ROOT_CONF["openvk"]["preferences"]["security"]["blacklists"]["applyToAdmins"])
|
||||||
$this->flashFail("err", tr("forbidden"), "Пользователь внёс Вас в чёрный список.");
|
$this->flashFail("err", tr("forbidden"), "Пользователь внёс Вас в чёрный список.");
|
||||||
|
}
|
||||||
|
|
||||||
if(!is_null($this->queryParam("from"))) {
|
if(!is_null($this->queryParam("from"))) {
|
||||||
if(preg_match("%^album([0-9]++)$%", $this->queryParam("from"), $matches) === 1) {
|
if(preg_match("%^album([0-9]++)$%", $this->queryParam("from"), $matches) === 1) {
|
||||||
|
|
|
@ -32,8 +32,14 @@ final class UserPresenter extends OpenVKPresenter
|
||||||
$user = $this->users->get($id);
|
$user = $this->users->get($id);
|
||||||
|
|
||||||
if ($this->user->identity)
|
if ($this->user->identity)
|
||||||
if ($this->blacklists->isBanned($user, $this->user->identity) && !$this->user->identity->isAdmin())
|
if ($this->blacklists->isBanned($user, $this->user->identity)) {
|
||||||
|
if ($this->user->identity->isAdmin()) {
|
||||||
|
if (OPENVK_ROOT_CONF["openvk"]["preferences"]["security"]["blacklists"]["applyToAdmins"])
|
||||||
$this->flashFail("err", tr("forbidden"), "Пользователь внёс Вас в чёрный список.");
|
$this->flashFail("err", tr("forbidden"), "Пользователь внёс Вас в чёрный список.");
|
||||||
|
} else {
|
||||||
|
$this->flashFail("err", tr("forbidden"), "Пользователь внёс Вас в чёрный список.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!$user || $user->isDeleted()) {
|
if(!$user || $user->isDeleted()) {
|
||||||
if($user->isDeactivated()) {
|
if($user->isDeactivated()) {
|
||||||
|
|
|
@ -33,6 +33,8 @@ openvk:
|
||||||
maxViolations: 50
|
maxViolations: 50
|
||||||
maxViolationsAge: 120
|
maxViolationsAge: 120
|
||||||
autoban: true
|
autoban: true
|
||||||
|
blacklists:
|
||||||
|
applyToAdmins: true
|
||||||
registration:
|
registration:
|
||||||
enable: true
|
enable: true
|
||||||
reason: "" # reason for disabling registration
|
reason: "" # reason for disabling registration
|
||||||
|
|
Loading…
Reference in a new issue