Przeglądaj źródła

Fix bug where test can be accepted/rejected more than once

Alan Lam 8 lat temu
rodzic
commit
3f5844f8f5
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      controllers/test.php

+ 4 - 0
controllers/test.php

@@ -238,6 +238,10 @@ else if(Core::$user->level >= User::LEVEL_ADMIN) {
 			$accept = http::value("accept");
 			$reject = http::value("reject");
 
+			if(($accept || $reject) && $test->status != Test::STATUS_PENDING_VERIFICATION) {
+				throw new Exception("This test is no longer pending verification.");
+			}
+
 			if(empty($test->verifier_id)) {
 				$test->verifier_id = Core::$user->id;
 				$test->dts_verified = Util::getDateTime();