浏览代码

Add debug option in SFTPGo authenticator

Miraty 2 年之前
父节点
当前提交
9f7c93e66d
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      sftpgo-auth.php

+ 6 - 0
sftpgo-auth.php

@@ -1,8 +1,12 @@
 <?php
 
+const DEBUG = false;
+!DEBUG or ob_start();
+
 require 'router.php';
 
 function deny() {
+	!DEBUG or file_put_contents(ROOT_PATH . '/db/debug.txt', ob_get_contents());
 	http_response_code(403);
 	exit();
 }
@@ -38,4 +42,6 @@ echo '
 	}
 }
 ';
+
+!DEBUG or file_put_contents(ROOT_PATH . '/db/debug.txt', ob_get_contents());
 http_response_code(200);