Compare commits

..

No commits in common. "cf2302262663be120a530f2357c55e327ea548cd" and "dda86b167e912a6048a9b96f6f6153bc7f15463f" have entirely different histories.

4 changed files with 8 additions and 12 deletions

View file

@ -24,11 +24,7 @@ class Blacklists
function getByAuthorAndTarget(int $author, int $target): ?BlacklistItem
{
$fetch = $this->blacklists->where(["author" => $author, "target" => $target])->fetch();
if ($fetch)
return new BlacklistItem($fetch);
else
return null;
return new BlacklistItem($this->blacklists->where(["author" => $author, "target" => $target])->fetch());
}
function getCount(User $user): int

View file

@ -34,14 +34,14 @@ final class UserPresenter extends OpenVKPresenter
if ($this->user->identity)
if ($this->blacklists->isBanned($user, $this->user->identity)) {
if ($this->user->identity->isAdmin()) {
if (OPENVK_ROOT_CONF["openvk"]["preferences"]["security"]["blacklists"]["applyToAdmins"]) {
if ($this->user->identity->isAdmin()) {
if (OPENVK_ROOT_CONF["openvk"]["preferences"]["security"]["blacklists"]["applyToAdmins"]) {
$this->flashFail("err", tr("forbidden"), tr("user_blacklisted_you"));
}
} else {
$this->flashFail("err", tr("forbidden"), tr("user_blacklisted_you"));
}
} else {
$this->flashFail("err", tr("forbidden"), tr("user_blacklisted_you"));
}
}
if(!$user || $user->isDeleted()) {
if(!is_null($user) && $user->isDeactivated()) {

View file

@ -394,7 +394,7 @@
<div class="right_big_block">
<div class="page_info">
<div n:if="$isBlacklistedByThem AND $thisUser->isAdmin() AND $thisUser->getId() !== $user->getId()" class="user-alert">
<b>{_admin_privacy_warning}:</b>
<b>{admin_privacy_warning}:</b>
<br/>
{_user_blacklisted_you}
</div>

View file

@ -2,6 +2,6 @@ CREATE TABLE `blacklists` (
`index` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`author` BIGINT UNSIGNED NOT NULL,
`target` BIGINT UNSIGNED NOT NULL,
`created` BIGINT UNSIGNED NOT NULL,
`created` DATETIME NOT NULL,
PRIMARY KEY (`index`)
) ENGINE = InnoDB;