Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Comment Protection bug?
Here on this forum, blocking a user doesn't seem to stick for me. I can block someone, but eventually they become unblocked.
Is blocking just for a session, or a short period, or is it supposed to be permanent?
0
This discussion has been closed.
Comments
function RemoveUserBlock($UserID) { $s = $this->Context->ObjectFactory->NewContextObject($this->Context, 'SqlBuilder'); $s->SetMainTable('UserBlock', 'b'); $s->AddFieldNameValue('BlockingUserID', $this->Context->Session->UserID); $s->AddFieldNameValue('BlockedUserID', $UserID); // Don't stress over errors (ie. duplicate entries) since this is indexed and duplicates cannot be inserted $this->Context->Database->Delete($s, $this->Name, 'RemoveUserBlock', 'An error occurred while removing the user block.', 0); }
should probably (untested) be
function RemoveUserBlock($UserID) { $s = $this->Context->ObjectFactory->NewContextObject($this->Context, 'SqlBuilder'); $s->SetMainTable('UserBlock', 'b'); $s->AddWhere('b', 'BlockingUserID', '', $this->Context->Session->UserID, '='); $s->AddWhere('b', 'BlockedUserID', '', $UserID, '='); $this->Context->Database->Delete($s, $this->Name, 'RemoveUserBlock', 'An error occurred while removing the user block.', 0); }