123456789101112131415161718192021222324 |
- <?php
- require 'router.php';
- $authData = json_decode(file_get_contents('php://input'), true);
- if (userExist($authData['username']) === true AND checkPassword($authData['username'], $authData['password']) === true) {
- $quotaSize = (query('select', 'users', ['username' => $authData['username']], 'type')[0] === 'trusted') ? CONF['ht']['user_quota_trusted'] : CONF['ht']['user_quota_testing'];
- echo '
- {
- "status": 1,
- "username": "' . $authData['username'] . '",
- "quota_size": ' . $quotaSize . ',
- "permissions": {
- "/": [
- "*"
- ]
- }
- }
- ';
- http_response_code(200);
- } else {
- http_response_code(403);
- }
|