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 b416017
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 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
21 changes: 10 additions & 11 deletions public/request/user/reset-achievements.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,17 @@
$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');
exit;
}

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

redirect(back() . '?e=error');
echo "OK";

0 comments on commit b416017

Please sign in to comment.