更新 v1.8.0版本

This commit is contained in:
LyLme 2023-12-16 17:20:06 +08:00
parent c66b0320e2
commit 350410f35b
10 changed files with 297 additions and 276 deletions

View File

@ -2,7 +2,7 @@
include("../include/common.php");
if(isset($_POST['user']) && isset($_POST['pass'])) {
$user = daddslashes($_POST['user']);
$pass=daddslashes($_POST['pass']);
$pass = md5('lylme' . daddslashes($_POST['pass']));
if($user == $conf['admin_user'] && $pass == $conf['admin_pwd']) {
$session = md5($user . $pass);
$token = authcode("{$user}\t{$session}", 'ENCODE', SYS_KEY);
@ -78,7 +78,8 @@ if(isset($_POST['user']) && isset($_POST['pass'])){
<?php
if(!empty($background = background())) {
$background = str_replace('./', '../', $background);
echo '<div class="row lylme-wrapper" style="background-image: url('.$background.');background-size: cover;">';}
echo '<div class="row lylme-wrapper" style="background-image: url(' . $background . ');background-size: cover;">';
}
?>
<div class="row lyear-wrapper">
<div class="lyear-login">
@ -103,7 +104,7 @@ if(!empty($background = background())){
</form>
<hr>
<footer class="col-sm-12 text-center">
<p class="m-b-0">Copyright ©2021 - <?php echo(date('Y')); ?> <a href="/"><?php echo explode("-", $conf['title'])[0];?></a></p>
<p class="m-b-0">Copyright <?php echo(date('Y')); ?> <a href="/"><?php echo explode("-", $conf['title'])[0];?></a></p>
</footer>
</div>
</div>

View File

@ -8,49 +8,36 @@ if($set=='save'){
$newpwd = $_POST['newpwd'];
$repwd = $_POST['confirmpwd'];
if($oldpwd==$conf['admin_pwd'])
{
if(md5('lylme' . $oldpwd) == $conf['admin_pwd']) {
if(empty($newpwd)) {//未修改密码
if(empty($user))
{
echo '<script>alert("未做出更改");history.go(-1);</script>';//只修改用户名
}
else
{
if(empty($user)) {
echo '<script>alert("未做出更改");history.go(-1);</script>';
} else {
//只修改用户名
saveSetting('admin_user', $user);
echo '<script>alert("用户名修改成功!\n新用户名' . $user . '\n请牢记将重新登录");window.location.href="./";</script>';
}
}
else if(!empty($newpwd))
{//修改密码
if ($newpwd==$repwd && empty($user))
{
saveSetting('admin_pwd',$newpwd);
} elseif(!empty($newpwd)) {//修改密码
if ($newpwd == $repwd && empty($user)) {
$admin_pwd = md5('lylme' . $newpwd);
saveSetting('admin_pwd', $admin_pwd);
echo '<script>alert("密码修改成功!\n新密码' . $newpwd . '\n请牢记将重新登录");window.location.href="./";</script>';
}
else if($newpwd==$repwd)
{
} elseif($newpwd == $repwd) {
$admin_pwd = md5('lylme' . $newpwd);
saveSetting('admin_user', $user);
saveSetting('admin_pwd',$newpwd);
saveSetting('admin_pwd', $admin_pwd);
echo '<script>alert("修改成功!\n新用户名' . $user . '\n新密码' . $newpwd . '\n请牢记将重新登录");window.location.href="./";</script>';
}
}
else
{
} else {
echo '<script>alert("两次新密码不一致!");history.go(-1);</script>';
}
}
else{
} else {
echo '<script>alert("当前密码错误!");history.go(-1);</script>';
}
}
else{
} else {
?>
<!--页面主要内容-->

View File

@ -1,35 +1,42 @@
<?php
@header("Content-type:text/html;charset=utf-8");
define('IN_CRONLITE', true);
define('SYS_KEY', 'lylme_key');
define('SYSTEM_ROOT', dirname(__FILE__) . '/');
define('ROOT', dirname(SYSTEM_ROOT) . '/');
error_reporting(0);
//error_reporting(0);
require ROOT . 'config.php';
if(!defined('SQLITE') && (!$dbconfig['user']||!$dbconfig['pwd']||!$dbconfig['dbname']))
{
if(!defined('SQLITE') && (!$dbconfig['user'] || !$dbconfig['pwd'] || !$dbconfig['dbname'])) {
@unlink(ROOT . 'install/install.lock');
header('Content-type:text/html;charset=utf-8');
echo '你还没安装!<a href="install/">点此安装</a>';
header("Location:");
exit();
}
include_once(SYSTEM_ROOT."db.class.php");
require SYSTEM_ROOT . "db.class.php";
$DB = new DB($dbconfig['host'], $dbconfig['user'], $dbconfig['pwd'], $dbconfig['dbname'], $dbconfig['port']);
$rs= $DB->query("SELECT * FROM `lylme_config`");
while($row = $DB->fetch($rs)) $conf[$row['k']]=$row['v'];
include_once(SYSTEM_ROOT."lists.php");
include_once(SYSTEM_ROOT."function.php");
include_once(SYSTEM_ROOT."member.php");
include_once(SYSTEM_ROOT."tj.php");
include_once(SYSTEM_ROOT."version.php");
include_once(SYSTEM_ROOT."updbase.php");
$linksrows=$DB->num_rows($DB->query("SELECT * FROM `lylme_links`"));
$groupsrows=$DB->num_rows($DB->query("SELECT * FROM `lylme_groups`"));
$web_config = $DB->query("SELECT * FROM `lylme_config`");
while($row = $DB->fetch($web_config)) {
$conf[$row['k']] = $row['v'];
}
require SYSTEM_ROOT . "lists.php";
require SYSTEM_ROOT . "function.php";
require SYSTEM_ROOT . "member.php";
require SYSTEM_ROOT . "tj.php";
require SYSTEM_ROOT . "version.php";
require SYSTEM_ROOT . "updbase.php";
require SYSTEM_ROOT . "site.php";
$cdnpublic = cdnpublic($conf['cdnpublic']);
$templatepath = './template/' . $conf["template"];
$template = $templatepath . '/index.php';
$background = $conf["background"];
$wap_background = $conf["wap_background"];
if(checkmobile()){if(!empty($wap_background)){$background_img = $wap_background;}
else{$background_img = $background; }}else{$background_img = $background; }
?>
if(checkmobile()) {
if(!empty($wap_background)) {
$background_img = $wap_background;
} else {
$background_img = $background;
}
} else {
$background_img = $background;
}

View File

@ -1,4 +1,5 @@
<?php
if(!empty($_GET['url'])) {
$url = $_GET['url'];
header("Location:$url");
@ -8,33 +9,31 @@ include("common.php");
session_start(); //设置session
if($_POST['exit'] == 'exit') {
//注销登录
$_SESSION['pass'] = 0;
$_SESSION['pass'] = null;
$_SESSION['list'] = array();
header("Location: " . $_SERVER['HTTP_REFERER']);
exit();
exit('注销登录成功');
}
@$pass = daddslashes($_POST['pass']);
if($_SESSION['pass'] != 1) {
//未登录
$pass = daddslashes($_POST['pass']);
if(!empty($pass)) {
//用户提交登录
$show = array();
$pwds = $DB->query("SELECT `pwd_id`, `pwd_key` FROM `lylme_pwd` WHERE `pwd_key` LIKE '" . $pass . "';");
while ($pwd = $DB->fetch($pwds)) {
array_push($show,$pwd[pwd_id]);
array_push($show, $pwd['pwd_id']);
}
if(empty($show)) {
//无数据
exit('<script>alert("密码错误!");window.location.href="' . $_SERVER['HTTP_REFERER'] . '";</script>');
}
else{
} else {
//有数据
$_SESSION['list'] = $show;
$_SESSION['pass'] = 1;
}
}
}
else {
} else {
//已登录
if(!empty($pass)) {
$show = array();
@ -43,11 +42,12 @@ else {
array_push($show, $pwd['pwd_id']);
}
if(empty($show)) {
$_SESSION['pass'] = 0;
$_SESSION['pass'] = null;
$_SESSION['list'] = array();
}
}
}
if(basename($_SERVER['PHP_SELF']) != basename(__FILE__)) return;
if(basename($_SERVER['PHP_SELF']) != basename(__FILE__)) {
return;
}
header("Location: ../");
?>

3
include/site.php Normal file
View File

@ -0,0 +1,3 @@
<?php
class site {}

View File

@ -1,9 +1,11 @@
<?php
$linksrows = $DB->num_rows($DB->query("SELECT * FROM `lylme_links`")); //链接数量
$groupsrows = $DB->num_rows($DB->query("SELECT * FROM `lylme_groups`")); //分类数量
$file = SYSTEM_ROOT . "/log.txt";
if(!file_exists($file)) {
touch($file);
}
else{
} else {
$fp = fopen($file, 'r+');
$content = '';
if (flock($fp, LOCK_EX)) {
@ -29,8 +31,7 @@ if(strpos($_SERVER['REQUEST_URI'],'admin')==false){
ftruncate($fp, 0); // 将文件截断到给定的长度
rewind($fp); // 倒回文件指针的位置
fwrite($fp, serialize($tongji));
}
else{
} else {
$tongji[$tjtotal] = $tjdate[$tjtotal] ;
// 本月访问量增加
$tongji[$tjmonth] = $tjdate[$tjmonth];
@ -49,4 +50,3 @@ if(strpos($_SERVER['REQUEST_URI'],'admin')==false){
//访总问 {$tjtotal} 本月 {$tjmonth} 昨日 {$tjyesterday} 今日 {$tjtoday}
}
}
?>

View File

@ -1,6 +1,10 @@
<?php
if(empty(constant("VERSION")))return 0;
function get_vernum($version){
if(empty(constant("VERSION"))) {
return 0;
}
function get_vernum($version)
{
$vn = explode('.', str_replace('v', '', $version));
$vernum = $vn[0] . sprintf("%02d", $vn[1]) . sprintf("%02d", $vn[2]);
return $vernum;
@ -12,7 +16,7 @@ if($sqlvn < $filevn){
$sql = '';
if($sqlvn < 10101) {
$version = 'v1.1.1';
$sql = $sql.file_get_contents(ROOT.'install/update.sql');
$sql = $sql . file_get_contents(ROOT . 'install/data/update.sql');
}
if($sqlvn < 10103) {
$version = 'v1.1.3';
@ -20,26 +24,26 @@ if($sqlvn < 10103) {
@unlink(ROOT . 'include/home.php');
@unlink(ROOT . 'include/apply.php');
@unlink(ROOT . 'include/footer.php');
$sql = $sql.file_get_contents(ROOT.'install/update1.sql');
$sql = $sql . file_get_contents(ROOT . 'install/data/update1.sql');
}
if($sqlvn < 10104) {
$version = 'v1.1.4';
}
if($sqlvn < 10105) {
$version = 'v1.1.5';
$sql = $sql.file_get_contents(ROOT.'install/update2.sql');
$sql = $sql . file_get_contents(ROOT . 'install/data/update2.sql');
}
if($sqlvn < 10106) {
$version = 'v1.1.6';
$sql = $sql.file_get_contents(ROOT.'install/update3.sql');
$sql = $sql . file_get_contents(ROOT . 'install/data/update3.sql');
}
if($sqlvn < 10109) {
$version = 'v1.1.9';
$sql = $sql.file_get_contents(ROOT.'install/update4.sql');
$sql = $sql . file_get_contents(ROOT . 'install/data/update4.sql');
}
if($sqlvn < 10200) {
$version = 'v1.2.0';
$sql = $sql.file_get_contents(ROOT.'install/update5.sql');
$sql = $sql . file_get_contents(ROOT . 'install/data/update5.sql');
}
if($sqlvn < 10205) {
$version = 'v1.2.5';
@ -55,18 +59,31 @@ if($sqlvn < 10500) {
}
if($sqlvn < 10501) {
$version = 'v1.5.1';
$sql = $sql.file_get_contents(ROOT.'install/update6.sql');
$sql = $sql . file_get_contents(ROOT . 'install/data/update6.sql');
}
if($sqlvn < 10600) {
$version = 'v1.6.0';
$sql = $sql.file_get_contents(ROOT.'install/update7.sql');
$sql = $sql . file_get_contents(ROOT . 'install/data/update7.sql');
}
if($sqlvn < 10700) {
$version = 'v1.7.0';
}
if($sqlvn < 10800) {
$version = 'v1.8.0';
$sql = $sql . file_get_contents(ROOT . 'install/data/update8.sql');
if (!isset($conf['md5pass'])) {
//MD5加密密码
$admin_pwd = md5('lylme' . $conf['admin_pwd']);
$DB->query("INSERT INTO `lylme_config` (`k`, `v`, `description`) VALUES ('md5pass', '1', '启用md5加密密码');");
saveSetting('admin_pwd', $admin_pwd);
}
}
$sql = explode(';', $sql);
for ($i = 0;$i < count($sql);$i++) {
if (trim($sql[$i])=='')continue;
if (trim($sql[$i]) == '') {
continue;
}
if($DB->query($sql[$i])) {
}
}

View File

@ -1,3 +1,3 @@
<?php
define('VERSION', '1.7.0');
?>
define('VERSION', '1.8.0');

View File

@ -1,9 +1,11 @@
<?php
@header('Content-Type: text/html; charset=UTF-8');
if (!file_exists('install/install.lock'))
exit('<title>安装程序</title>您还未安装,点击<a href="install"><font color="blue">这里</font></a>开始安装!');
include "./include/common.php";
if (!file_exists('install/install.lock')) {
header("Location:/install");
exit();
}
require "./include/common.php";
session_start(); //设置session
$_SESSION['list'] = isset($_SESSION['list']) ? $_SESSION['list'] : array();
include $template;
?>
require $template;

View File

@ -36,19 +36,21 @@ and (max-width:320px){.form-wrapper{padding-top:10%;border-radius:2px;margin:50p
if(!empty($background = background())) {
$background = str_replace('./', '../', $background);
echo '<div class="body" style="background-image: url('.$background.');">';}
echo '<div class="body" style="background-image: url(' . $background . ');">';
}
?>
<div class="form-wrapper">
<div class="nav">
<?php
if($DB->num_rows($DB->query("SELECT * FROM `lylme_pwd`"))!=0){echo '<h1>访问管理</h1>';?>
if($DB->num_rows($DB->query("SELECT * FROM `lylme_pwd`")) != 0) {
echo '<h1>访问管理</h1>';?>
</div>
<?php
session_start(); //设置session
if($_SESSION['pass'] != 1){?>
if(isset($_SESSION['pass']) != 1) {?>
<p>请输入密码登录</p>
<form name="form" action="../include/go.php" method="POST">
<div class="form">
@ -79,7 +81,9 @@ if(!empty($background = background())){
</form>
<?php
}
}else{echo '<h2>当前站点未启用链接加密</h2>';}
} else {
echo '<h2>当前站点未启用链接加密</h2>';
}
?>
<a href="../" class="home">返回首页</a>
</div>