Skip to content

Commit

Permalink
Test case
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui committed Aug 15, 2024
1 parent ff81eb3 commit 2e1b142
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions inc/Do.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,11 @@ public static function ChangeWhitelist()
throw new Exception("You don't have enough permissions to edit this user");
}

// whitelist must be a value between 0 and 3
if ($_POST["newwhitelist"] < 0 || $_POST["newwhitelist"] > 3) {
throw new Exception("Invalid whitelist value");
}

$GLOBALS['db']->execute('UPDATE users SET whitelist = ? WHERE id = ?', [$_POST['newwhitelist'], $_POST["id"]]);

// log this whitelist change to the users rap notes
Expand Down

0 comments on commit 2e1b142

Please sign in to comment.