소스 검색

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);