Skip to content

Commit

Permalink
Fix progress reset response
Browse files Browse the repository at this point in the history
Revert request responses to be strings, not header redirects.
  • Loading branch information
luchaos committed Aug 9, 2022
1 parent e8307aa commit 7e71cdd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion public/controlpanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ function ResetProgressForSelection() {

function onResetComplete(data) {
if (data.substr(0, 2) !== 'OK') {
alert(data);
//showStatusFailure('Error: ' + data);
$('#loadingiconreset').attr('src', '<?= asset('Images/tick.png') ?>').delay(750).fadeTo('slow', 0.0);
return;
Expand Down
7 changes: 2 additions & 5 deletions public/request/user/reset-achievements.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@
$achID = requestInputPost('a', null, 'integer');

if (!authenticateFromCookie($user, $permissions, $userDetails)) {
redirect(back() . '?e=error');
exit;
}

if (!empty($achID) && resetSingleAchievement($user, $achID)) {
redirect(back() . '?reset=ok');
echo "OK";
exit;
}

if (!empty($gameID) && resetAchievements($user, $gameID) > 0) {
redirect(back() . '?reset=ok');
echo "OK";
exit;
}

redirect(back() . '?e=error');

0 comments on commit 7e71cdd

Please sign in to comment.