2022-05-19 14:59:32 +00:00
|
|
|
<?php
|
|
|
|
|
2022-11-20 14:11:54 +00:00
|
|
|
require 'router.php';
|
2022-05-19 14:59:32 +00:00
|
|
|
|
2022-11-20 14:11:54 +00:00
|
|
|
$authData = json_decode(file_get_contents('php://input'), true);
|
2022-05-19 14:59:32 +00:00
|
|
|
|
2022-09-03 16:56:40 +00:00
|
|
|
if (userExist($authData['username']) === true AND checkPassword($authData['username'], $authData['password']) === true) {
|
2022-11-07 18:40:40 +00:00
|
|
|
$quotaSize = (query('select', 'users', ['username' => $authData['username']], 'type')[0] === 'trusted') ? CONF['ht']['user_quota_trusted'] : CONF['ht']['user_quota_testing'];
|
2022-06-28 20:08:34 +00:00
|
|
|
echo '
|
|
|
|
{
|
|
|
|
"status": 1,
|
|
|
|
"username": "' . $authData['username'] . '",
|
2022-11-07 18:40:40 +00:00
|
|
|
"quota_size": ' . $quotaSize . ',
|
2022-06-28 20:08:34 +00:00
|
|
|
"permissions": {
|
|
|
|
"/": [
|
|
|
|
"*"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
';
|
2022-05-19 14:59:32 +00:00
|
|
|
http_response_code(200);
|
|
|
|
} else {
|
|
|
|
http_response_code(403);
|
|
|
|
}
|