servnest/sftpgo-auth.php
2022-06-28 22:08:34 +02:00

23 lines
416 B
PHP

<?php
require "common/init.php";
$authData = json_decode(file_get_contents("php://input"), true);
if (checkPassword($authData['username'], $authData['password']) === true) {
echo '
{
"status": 1,
"username": "' . $authData['username'] . '",
"quota_size": ' . CONF['ht']['user_quota'] . ',
"permissions": {
"/": [
"*"
]
}
}
';
http_response_code(200);
} else {
http_response_code(403);
}