Skip to content
This repository was archived by the owner on Jan 1, 2021. It is now read-only.

Commit 1224b7a

Browse files
committed
Fixed users being able to vote on locked mappings.
1 parent ee46364 commit 1224b7a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

app/Mapping.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ public static function newMapping($values, $class)
7878

7979
public function vote($direction = 1)
8080
{
81+
if ($this->locked)
82+
{
83+
return;
84+
}
85+
8186
$ip = md5($_SERVER['REMOTE_ADDR']);
8287
if (Event::whereIn("type", [EventType::AddedMapping, EventType::ApproveMapping, EventType::DisapproveMapping])->where("mappings_id", "=", $this->id)->where("ip", "=", $ip)->whereBetween("date", array(Carbon::now()->addDays(-1), Carbon::now()))->first())
8388
{

0 commit comments

Comments
 (0)