Loading Controllers/api/v2/moderation/jury.php +6 −6 Original line number Original line Diff line number Diff line Loading @@ -19,7 +19,7 @@ class jury implements Interfaces\Api $juryType = $pages[0] ?? 'appeal'; $juryType = $pages[0] ?? 'appeal'; if ($juryType !== 'appeal' && !Core\Session::isAdmin()) { if ($juryType !== 'appeal' && !Core\Session::isAdmin()) { //exit; exit; } } $juryManager = Di::_()->get('Moderation\Jury\Manager'); $juryManager = Di::_()->get('Moderation\Jury\Manager'); Loading @@ -39,7 +39,7 @@ class jury implements Interfaces\Api public function post($pages) public function post($pages) { { $juryType = $pages[0] ?? null; $juryType = $pages[0] ?? null; $entityGuid = $pages[1] ?? null; $urn = $pages[1] ?? null; $uphold = $_POST['uphold'] ?? null; $uphold = $_POST['uphold'] ?? null; if (!$juryType) { if (!$juryType) { Loading @@ -49,10 +49,10 @@ class jury implements Interfaces\Api ]); ]); } } if (!$entityGuid) { if (!$urn) { return Factory::response([ return Factory::response([ 'status' => 'error', 'status' => 'error', 'message' => 'You must supply the entity guid in the URI like /:juryType/:entityGuid', 'message' => 'You must supply the entity urn in the URI like /:juryType/:urn', ]); ]); } } Loading @@ -63,7 +63,7 @@ class jury implements Interfaces\Api ]); ]); } } if (!Core\Session::getLoggedInUser()->getPhoneNumberHash() && false) { if (!Core\Session::getLoggedInUser()->getPhoneNumberHash()) { return Factory::response([ return Factory::response([ 'status' => 'error', 'status' => 'error', 'message' => 'juror must be in the rewards program', 'message' => 'juror must be in the rewards program', Loading @@ -72,7 +72,7 @@ class jury implements Interfaces\Api $juryManager = Di::_()->get('Moderation\Jury\Manager'); $juryManager = Di::_()->get('Moderation\Jury\Manager'); $moderationManager = Di::_()->get('Moderation\Manager'); $moderationManager = Di::_()->get('Moderation\Manager'); $report = $moderationManager->getReport($entityGuid); $report = $moderationManager->getReport($urn); $decision = new Decision(); $decision = new Decision(); $decision $decision Loading Controllers/api/v2/moderation/report.php +4 −0 Original line number Original line Diff line number Diff line Loading @@ -69,6 +69,10 @@ class report implements Interfaces\Api ->setReporterGuid($user->getGuid()) ->setReporterGuid($user->getGuid()) ->setTimestamp(round(microtime(true) * 1000)); ->setTimestamp(round(microtime(true) * 1000)); if ($user->getPhoneNumberHash()) { $userReport->setReporterHash($user->getPhoneNumberHash()); } if (!$manager->add($userReport)) { if (!$manager->add($userReport)) { return Factory::response([ return Factory::response([ 'status' => 'error', 'status' => 'error', Loading Core/Entities/Delegates/EntityGuidResolverDelegate.php +1 −1 Original line number Original line Diff line number Diff line Loading @@ -34,7 +34,7 @@ class EntityGuidResolverDelegate implements ResolverDelegate */ */ public function shouldResolve(Urn $urn) public function shouldResolve(Urn $urn) { { return $urn->getNid() === 'entity' || $urn->getNid() === 'activity'; return $urn->getNid() === 'entity' || $urn->getNid() === 'activity' || $urn->getNid() === 'user'; } } /** /** Loading Core/Reports/Appeals/Repository.php +2 −2 Original line number Original line Diff line number Diff line Loading @@ -79,12 +79,12 @@ class Repository } } break; break; case 'approved': case 'approved': if ($report->getState() != 'appeal_jury_decided' && $report->isUpheld() === false) { if ($report->getState() !== 'appeal_jury_decided' || $report->isUpheld() === false) { $skip = true; $skip = true; } } break; break; case 'rejected': case 'rejected': if ($report->getState() != 'appeal_jury_decided' && $report->isUpheld() === true) { if ($report->getState() !== 'appeal_jury_decided' || $report->isUpheld() === true) { $skip = true; $skip = true; } } break; break; Loading Core/Reports/Manager.php +2 −2 Original line number Original line Diff line number Diff line Loading @@ -40,9 +40,9 @@ class Manager return $this->repository->getList($opts); return $this->repository->getList($opts); } } public function getReport($entity_guid) public function getReport($urn) { { return $this->repository->get($entity_guid); return $this->repository->get($urn); } } /** /** Loading Loading
Controllers/api/v2/moderation/jury.php +6 −6 Original line number Original line Diff line number Diff line Loading @@ -19,7 +19,7 @@ class jury implements Interfaces\Api $juryType = $pages[0] ?? 'appeal'; $juryType = $pages[0] ?? 'appeal'; if ($juryType !== 'appeal' && !Core\Session::isAdmin()) { if ($juryType !== 'appeal' && !Core\Session::isAdmin()) { //exit; exit; } } $juryManager = Di::_()->get('Moderation\Jury\Manager'); $juryManager = Di::_()->get('Moderation\Jury\Manager'); Loading @@ -39,7 +39,7 @@ class jury implements Interfaces\Api public function post($pages) public function post($pages) { { $juryType = $pages[0] ?? null; $juryType = $pages[0] ?? null; $entityGuid = $pages[1] ?? null; $urn = $pages[1] ?? null; $uphold = $_POST['uphold'] ?? null; $uphold = $_POST['uphold'] ?? null; if (!$juryType) { if (!$juryType) { Loading @@ -49,10 +49,10 @@ class jury implements Interfaces\Api ]); ]); } } if (!$entityGuid) { if (!$urn) { return Factory::response([ return Factory::response([ 'status' => 'error', 'status' => 'error', 'message' => 'You must supply the entity guid in the URI like /:juryType/:entityGuid', 'message' => 'You must supply the entity urn in the URI like /:juryType/:urn', ]); ]); } } Loading @@ -63,7 +63,7 @@ class jury implements Interfaces\Api ]); ]); } } if (!Core\Session::getLoggedInUser()->getPhoneNumberHash() && false) { if (!Core\Session::getLoggedInUser()->getPhoneNumberHash()) { return Factory::response([ return Factory::response([ 'status' => 'error', 'status' => 'error', 'message' => 'juror must be in the rewards program', 'message' => 'juror must be in the rewards program', Loading @@ -72,7 +72,7 @@ class jury implements Interfaces\Api $juryManager = Di::_()->get('Moderation\Jury\Manager'); $juryManager = Di::_()->get('Moderation\Jury\Manager'); $moderationManager = Di::_()->get('Moderation\Manager'); $moderationManager = Di::_()->get('Moderation\Manager'); $report = $moderationManager->getReport($entityGuid); $report = $moderationManager->getReport($urn); $decision = new Decision(); $decision = new Decision(); $decision $decision Loading
Controllers/api/v2/moderation/report.php +4 −0 Original line number Original line Diff line number Diff line Loading @@ -69,6 +69,10 @@ class report implements Interfaces\Api ->setReporterGuid($user->getGuid()) ->setReporterGuid($user->getGuid()) ->setTimestamp(round(microtime(true) * 1000)); ->setTimestamp(round(microtime(true) * 1000)); if ($user->getPhoneNumberHash()) { $userReport->setReporterHash($user->getPhoneNumberHash()); } if (!$manager->add($userReport)) { if (!$manager->add($userReport)) { return Factory::response([ return Factory::response([ 'status' => 'error', 'status' => 'error', Loading
Core/Entities/Delegates/EntityGuidResolverDelegate.php +1 −1 Original line number Original line Diff line number Diff line Loading @@ -34,7 +34,7 @@ class EntityGuidResolverDelegate implements ResolverDelegate */ */ public function shouldResolve(Urn $urn) public function shouldResolve(Urn $urn) { { return $urn->getNid() === 'entity' || $urn->getNid() === 'activity'; return $urn->getNid() === 'entity' || $urn->getNid() === 'activity' || $urn->getNid() === 'user'; } } /** /** Loading
Core/Reports/Appeals/Repository.php +2 −2 Original line number Original line Diff line number Diff line Loading @@ -79,12 +79,12 @@ class Repository } } break; break; case 'approved': case 'approved': if ($report->getState() != 'appeal_jury_decided' && $report->isUpheld() === false) { if ($report->getState() !== 'appeal_jury_decided' || $report->isUpheld() === false) { $skip = true; $skip = true; } } break; break; case 'rejected': case 'rejected': if ($report->getState() != 'appeal_jury_decided' && $report->isUpheld() === true) { if ($report->getState() !== 'appeal_jury_decided' || $report->isUpheld() === true) { $skip = true; $skip = true; } } break; break; Loading
Core/Reports/Manager.php +2 −2 Original line number Original line Diff line number Diff line Loading @@ -40,9 +40,9 @@ class Manager return $this->repository->getList($opts); return $this->repository->getList($opts); } } public function getReport($entity_guid) public function getReport($urn) { { return $this->repository->get($entity_guid); return $this->repository->get($urn); } } /** /** Loading