working microcrud for ipbans

This commit is contained in:
Shish
2019-11-27 21:06:14 +00:00
parent 1edc4a37bf
commit a9993b47a8
5 changed files with 46 additions and 37 deletions

View File

@@ -242,5 +242,12 @@ class User
public function check_auth_token(): bool
{
return (isset($_POST["auth_token"]) && $_POST["auth_token"] == $this->get_auth_token());
}
public function ensure_authed(): void
{
if(!$this->check_auth_token()) {
die("Invalid auth token");
}
}
}