浏览代码

Set user's quota_files in SFTPGo

Miraty 3 年之前
父节点
当前提交
18364c1ff6
共有 2 个文件被更改,包括 14 次插入1 次删除
  1. 2 0
      config.ini
  2. 12 1
      sftpgo-auth.php

+ 2 - 0
config.ini

@@ -52,3 +52,5 @@ public_sftp_port = 2022
 ; Will be used in configuration files
 ; Will be used in configuration files
 https_port = 42443
 https_port = 42443
 internal_onion_http_port = 9080
 internal_onion_http_port = 9080
+
+user_quota = 20971520

+ 12 - 1
sftpgo-auth.php

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