mirror of
https://github.com/aunefyren/wrapperr
synced 2025-01-05 22:48:42 +00:00
bdef6c017b
- 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
24 lines
No EOL
795 B
PHP
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);
|
|
}
|
|
?>
|