function changeFactcheckers($uid, $pid, $add, $remove) { mysql_query('START TRANSACTION'); addFactcheckers($uid, $pid, $add); removeFactcheckers($uid, $pid, $remove); mysql_query('COMMIT'); }
addPuzzleToTestQueue($uid, $pid); } else { $_SESSION['failedToAdd'] = TRUE; } header("Location: " . URL . "/testsolving.php"); exit(0); } if (isset($_POST['SelfAddFactchecker'])) { // User wishes to opt in to factchecking duty. grantFactcheckPowers($uid); header("Location: " . URL . "/factcheck.php"); exit(0); } if (isset($_POST['FactcheckPuzzle'])) { $pid = $_POST['pid']; addFactcheckers($uid, $pid, array($uid)); header("Location: " . URL . "/factcheck.php"); exit(0); } if (isset($_POST['TestAdminPuzzle'])) { $pid = $_POST['pid']; if (!addToTestAdminQueue($uid, $pid)) { $_SESSION['failedToAdd'] = TRUE; } header("Location: " . URL . "/testadmin.php"); exit(0); } if (isset($_POST['getTestId'])) { $pid = $_POST['pid']; if (!validPuzzleId($pid)) { utilsError("Invalid puzzle ID.");