wrapperr/api/get_config.php
aunefyren bdef6c017b Caching, admin page, username search, flexible results
- New design for platform
- Page change based on results
- Illustrations added
- Search by email and username
- Better security (sensitive files moved to folder with .htaccess)
- Admin page for setup (with password)
- Customizable functions
- Caching of results
- Pre-caching script for caching multiple users
2021-03-08 19:45:06 +01:00

24 lines
No EOL
795 B
PHP

<?php
$data = json_decode(file_get_contents("php://input"));
$config = json_decode(file_get_contents("../config/config.json"));
if(empty($data)) {
echo json_encode(array("error" => true, "message" => "No input provided."));
exit(0);
}
if(empty($config->password)) {
echo json_encode(array("error" => false, "message" => "No password set.", "password" => false, "data" => array()));
exit(0);
}
$password = htmlspecialchars($data->password);
if(password_verify($password, $config->password)) {
echo json_encode(array("error" => false, "message" => "Login successful.", "password" => true, "data" => $config));
exit(0);
} else {
echo json_encode(array("error" => true, "message" => "Password not accepted.", "password" => true, "data" => array()));
exit(0);
}
?>