sftpgo-auth.php 457 B

1234567891011121314151617181920212223
  1. <?php
  2. require "router.php";
  3. $authData = json_decode(file_get_contents("php://input"), true);
  4. if (userExist($authData['username']) === true AND checkPassword($authData['username'], $authData['password']) === true) {
  5. echo '
  6. {
  7. "status": 1,
  8. "username": "' . $authData['username'] . '",
  9. "quota_size": ' . CONF['ht']['user_quota'] . ',
  10. "permissions": {
  11. "/": [
  12. "*"
  13. ]
  14. }
  15. }
  16. ';
  17. http_response_code(200);
  18. } else {
  19. http_response_code(403);
  20. }