fix: ?login can return loginpage
parent
29840c8b26
commit
4073323d7c
34
common.php
34
common.php
|
@ -190,22 +190,24 @@ function main($path)
|
||||||
} else {
|
} else {
|
||||||
$adminloginpage = getConfig('adminloginpage');
|
$adminloginpage = getConfig('adminloginpage');
|
||||||
}
|
}
|
||||||
if (isset($_GET['login'])&&$_GET['login']==$adminloginpage) {
|
if (isset($_GET['login'])) {
|
||||||
/*if (isset($_GET['preview'])) {
|
if ($_GET['login']===$adminloginpage) {
|
||||||
$url = $_SERVER['PHP_SELF'] . '?preview';
|
/*if (isset($_GET['preview'])) {
|
||||||
} else {
|
$url = $_SERVER['PHP_SELF'] . '?preview';
|
||||||
$url = path_format($_SERVER['PHP_SELF'] . '/');
|
} else {
|
||||||
}*/
|
$url = path_format($_SERVER['PHP_SELF'] . '/');
|
||||||
if (isset($_POST['password1'])) {
|
}*/
|
||||||
$compareresult = compareadminsha1($_POST['password1'], $_POST['timestamp'], getConfig('admin'));
|
if (isset($_POST['password1'])) {
|
||||||
if ($compareresult=='') {
|
$compareresult = compareadminsha1($_POST['password1'], $_POST['timestamp'], getConfig('admin'));
|
||||||
$timestamp = time()+7*24*60*60;
|
if ($compareresult=='') {
|
||||||
$randnum = rand(10, 99999);
|
$timestamp = time()+7*24*60*60;
|
||||||
$admincookie = adminpass2cookie('admin', getConfig('admin'), $timestamp, $randnum);
|
$randnum = rand(10, 99999);
|
||||||
$adminlocalstorage = adminpass2storage('admin', getConfig('admin'), $timestamp, $randnum);
|
$admincookie = adminpass2cookie('admin', getConfig('admin'), $timestamp, $randnum);
|
||||||
return adminform('admin', $admincookie, $adminlocalstorage);
|
$adminlocalstorage = adminpass2storage('admin', getConfig('admin'), $timestamp, $randnum);
|
||||||
} else return adminform($compareresult);
|
return adminform('admin', $admincookie, $adminlocalstorage);
|
||||||
} else return adminform();
|
} else return adminform($compareresult);
|
||||||
|
} else return adminform();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ( isset($_COOKIE['admin'])&&compareadminmd5('admin', getConfig('admin'), $_COOKIE['admin']) ) {
|
if ( isset($_COOKIE['admin'])&&compareadminmd5('admin', getConfig('admin'), $_COOKIE['admin']) ) {
|
||||||
$_SERVER['admin']=1;
|
$_SERVER['admin']=1;
|
||||||
|
|
Loading…
Reference in New Issue