更新 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

@ -1,24 +1,24 @@
<?php <?php
include("../include/common.php"); include("../include/common.php");
if(isset($_POST['user']) && isset($_POST['pass'])){ if(isset($_POST['user']) && isset($_POST['pass'])) {
$user=daddslashes($_POST['user']); $user = daddslashes($_POST['user']);
$pass=daddslashes($_POST['pass']); $pass = md5('lylme' . daddslashes($_POST['pass']));
if($user==$conf['admin_user'] && $pass==$conf['admin_pwd']) { if($user == $conf['admin_user'] && $pass == $conf['admin_pwd']) {
$session=md5($user.$pass); $session = md5($user . $pass);
$token=authcode("{$user}\t{$session}", 'ENCODE', SYS_KEY); $token = authcode("{$user}\t{$session}", 'ENCODE', SYS_KEY);
setcookie("admin_token", $token, time() + 604800); setcookie("admin_token", $token, time() + 604800);
@header('Content-Type: text/html; charset=UTF-8'); @header('Content-Type: text/html; charset=UTF-8');
exit("<script language='javascript'>alert('登陆管理中心成功!');window.location.href='./';</script>"); exit("<script language='javascript'>alert('登陆管理中心成功!');window.location.href='./';</script>");
}elseif ($pass != $conf['admin_pwd']) { } elseif ($pass != $conf['admin_pwd']) {
@header('Content-Type: text/html; charset=UTF-8'); @header('Content-Type: text/html; charset=UTF-8');
exit("<script language='javascript'>alert('用户名或密码不正确!');history.go(-1);</script>"); exit("<script language='javascript'>alert('用户名或密码不正确!');history.go(-1);</script>");
} }
}elseif(isset($_GET['logout'])){ } elseif(isset($_GET['logout'])) {
setcookie("admin_token", "", time() - 604800); setcookie("admin_token", "", time() - 604800);
@header('Content-Type: text/html; charset=UTF-8'); @header('Content-Type: text/html; charset=UTF-8');
exit("<script language='javascript'>alert('您已成功注销本次登陆!');window.location.href='./login.php';</script>"); exit("<script language='javascript'>alert('您已成功注销本次登陆!');window.location.href='./login.php';</script>");
}elseif(isset($islogin)==1){ } elseif(isset($islogin) == 1) {
exit("<script language='javascript'>alert('您已登陆!');window.location.href='./';</script>"); exit("<script language='javascript'>alert('您已登陆!');window.location.href='./';</script>");
} }
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
@ -76,9 +76,10 @@ if(isset($_POST['user']) && isset($_POST['pass'])){
<body> <body>
<?php <?php
if(!empty($background = background())){ if(!empty($background = background())) {
$background = str_replace('./','../',$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="row lyear-wrapper">
<div class="lyear-login"> <div class="lyear-login">
@ -103,7 +104,7 @@ if(!empty($background = background())){
</form> </form>
<hr> <hr>
<footer class="col-sm-12 text-center"> <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> </footer>
</div> </div>
</div> </div>

View File

@ -1,57 +1,44 @@
<?php <?php
$title = '账号安全'; $title = '账号安全';
include './head.php'; include './head.php';
$set=isset($_GET['set'])?$_GET['set']:null; $set = isset($_GET['set']) ? $_GET['set'] : null;
if($set=='save'){ if($set == 'save') {
$user=$_POST['new-usernameuser']; $user = $_POST['new-usernameuser'];
$oldpwd=$_POST['oldpwd']; $oldpwd = $_POST['oldpwd'];
$newpwd=$_POST['newpwd']; $newpwd = $_POST['newpwd'];
$repwd=$_POST['confirmpwd']; $repwd = $_POST['confirmpwd'];
if($oldpwd==$conf['admin_pwd']) if(md5('lylme' . $oldpwd) == $conf['admin_pwd']) {
{ if(empty($newpwd)) {//未修改密码
if(empty($newpwd)){//未修改密码 if(empty($user)) {
if(empty($user)) echo '<script>alert("未做出更改");history.go(-1);</script>';
{ } else {
echo '<script>alert("未做出更改");history.go(-1);</script>';//只修改用户名 //只修改用户名
} saveSetting('admin_user', $user);
else echo '<script>alert("用户名修改成功!\n新用户名' . $user . '\n请牢记将重新登录");window.location.href="./";</script>';
{ }
saveSetting('admin_user',$user); } elseif(!empty($newpwd)) {//修改密码
echo '<script>alert("用户名修改成功!\n新用户名'.$user.'\n请牢记将重新登录");window.location.href="./";</script>'; if ($newpwd == $repwd && empty($user)) {
} $admin_pwd = md5('lylme' . $newpwd);
} saveSetting('admin_pwd', $admin_pwd);
else if(!empty($newpwd)) echo '<script>alert("密码修改成功!\n新密码' . $newpwd . '\n请牢记将重新登录");window.location.href="./";</script>';
{//修改密码 } elseif($newpwd == $repwd) {
if ($newpwd==$repwd && empty($user)) $admin_pwd = md5('lylme' . $newpwd);
{ saveSetting('admin_user', $user);
saveSetting('admin_pwd',$newpwd); saveSetting('admin_pwd', $admin_pwd);
echo '<script>alert("密码修改成功!\n新密码'.$newpwd.'\n请牢记将重新登录");window.location.href="./";</script>'; echo '<script>alert("修改成功!\n新用户名' . $user . '\n新密码' . $newpwd . '\n请牢记将重新登录");window.location.href="./";</script>';
} }
else if($newpwd==$repwd)
{ } else {
saveSetting('admin_user',$user); echo '<script>alert("两次新密码不一致!");history.go(-1);</script>';
saveSetting('admin_pwd',$newpwd);
echo '<script>alert("修改成功!\n新用户名'.$user.'\n新密码'.$newpwd.'\n请牢记将重新登录");window.location.href="./";</script>';
} }
} } else {
else echo '<script>alert("当前密码错误!");history.go(-1);</script>';
{ }
echo '<script>alert("两次新密码不一致!");history.go(-1);</script>';
}
} } else {
?>
else{
echo '<script>alert("当前密码错误!");history.go(-1);</script>';
}
}
else{
?>
<!--页面主要内容--> <!--页面主要内容-->
<main class="lyear-layout-content"> <main class="lyear-layout-content">

View File

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

View File

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

3
include/site.php Normal file
View File

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

View File

@ -1,52 +1,52 @@
<?php <?php
$file = SYSTEM_ROOT."/log.txt";
if(!file_exists($file)){
touch($file);
}
else{
$fp=fopen($file,'r+');
$content='';
if (flock($fp,LOCK_EX)){
while (($buffer=fgets($fp,1024))!=false){
$content=$content.$buffer;
}
$tjdate=unserialize($content);
//设置记录键值
$tjtotal = 'total';
$tjmonth = date('Ym');
$tjtoday = date('Ymd');
$tjyesterday = date('Ymd',strtotime("-1 day"));
$tongji = array();
if(strpos($_SERVER['REQUEST_URI'],'admin')==false){
$tongji[$tjtotal] = $tjdate[$tjtotal] + 1; $linksrows = $DB->num_rows($DB->query("SELECT * FROM `lylme_links`")); //链接数量
// 本月访问量增加 $groupsrows = $DB->num_rows($DB->query("SELECT * FROM `lylme_groups`")); //分类数量
$tongji[$tjmonth] = $tjdate[$tjmonth] + 1; $file = SYSTEM_ROOT . "/log.txt";
// 今日访问增加 if(!file_exists($file)) {
$tongji[$tjtoday] = $tjdate[$tjtoday] + 1; touch($file);
//保持昨天访问 } else {
$tongji[$tjyesterday] = $tjdate[$tjyesterday]; $fp = fopen($file, 'r+');
ftruncate($fp,0); // 将文件截断到给定的长度 $content = '';
rewind($fp); // 倒回文件指针的位置 if (flock($fp, LOCK_EX)) {
fwrite($fp, serialize($tongji)); while (($buffer = fgets($fp, 1024)) != false) {
} $content = $content . $buffer;
else{ }
$tongji[$tjtotal] = $tjdate[$tjtotal] ; $tjdate = unserialize($content);
// 本月访问量增加 //设置记录键值
$tongji[$tjmonth] = $tjdate[$tjmonth]; $tjtotal = 'total';
// 今日访问增加 $tjmonth = date('Ym');
$tongji[$tjtoday] = $tjdate[$tjtoday]; $tjtoday = date('Ymd');
//保持昨天访问 $tjyesterday = date('Ymd', strtotime("-1 day"));
$tongji[$tjyesterday] = $tjdate[$tjyesterday]; $tongji = array();
} if(strpos($_SERVER['REQUEST_URI'], 'admin') == false) {
flock($fp,LOCK_UN);
fclose($fp); $tongji[$tjtotal] = $tjdate[$tjtotal] + 1;
//输出数据 // 本月访问量增加
$tjtotal = $tongji[$tjtotal]; $tongji[$tjmonth] = $tjdate[$tjmonth] + 1;
$tjmonth = $tongji[$tjmonth]; // 今日访问增加
$tjtoday = $tongji[$tjtoday]; $tongji[$tjtoday] = $tjdate[$tjtoday] + 1;
$tjyesterday = $tongji[$tjyesterday]?$tongji[$tjyesterday]:0; //保持昨天访问
//访总问 {$tjtotal} 本月 {$tjmonth} 昨日 {$tjyesterday} 今日 {$tjtoday} $tongji[$tjyesterday] = $tjdate[$tjyesterday];
ftruncate($fp, 0); // 将文件截断到给定的长度
rewind($fp); // 倒回文件指针的位置
fwrite($fp, serialize($tongji));
} else {
$tongji[$tjtotal] = $tjdate[$tjtotal] ;
// 本月访问量增加
$tongji[$tjmonth] = $tjdate[$tjmonth];
// 今日访问增加
$tongji[$tjtoday] = $tjdate[$tjtoday];
//保持昨天访问
$tongji[$tjyesterday] = $tjdate[$tjyesterday];
}
flock($fp, LOCK_UN);
fclose($fp);
//输出数据
$tjtotal = $tongji[$tjtotal];
$tjmonth = $tongji[$tjmonth];
$tjtoday = $tongji[$tjtoday];
$tjyesterday = $tongji[$tjyesterday] ? $tongji[$tjyesterday] : 0;
//访总问 {$tjtotal} 本月 {$tjmonth} 昨日 {$tjyesterday} 今日 {$tjtoday}
}
} }
}
?>

View File

@ -1,74 +1,91 @@
<?php <?php
if(empty(constant("VERSION")))return 0;
function get_vernum($version){ if(empty(constant("VERSION"))) {
$vn = explode('.',str_replace('v','',$version)); return 0;
$vernum = $vn[0].sprintf("%02d",$vn[1]).sprintf("%02d",$vn[2]); }
return $vernum; function get_vernum($version)
{
$vn = explode('.', str_replace('v', '', $version));
$vernum = $vn[0] . sprintf("%02d", $vn[1]) . sprintf("%02d", $vn[2]);
return $vernum;
} }
$sqlvn = get_vernum($conf['version']); //数据库版本 $sqlvn = get_vernum($conf['version']); //数据库版本
$filevn = get_vernum(constant("VERSION")); // 文件版本 $filevn = get_vernum(constant("VERSION")); // 文件版本
if($sqlvn < $filevn){ if($sqlvn < $filevn) {
//文件版本大于数据库版本执行更新 //文件版本大于数据库版本执行更新
$sql= ''; $sql = '';
if($sqlvn < 10101) { if($sqlvn < 10101) {
$version = 'v1.1.1'; $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) { if($sqlvn < 10103) {
$version = 'v1.1.3'; $version = 'v1.1.3';
@unlink(ROOT.'include/head.php'); @unlink(ROOT . 'include/head.php');
@unlink(ROOT.'include/home.php'); @unlink(ROOT . 'include/home.php');
@unlink(ROOT.'include/apply.php'); @unlink(ROOT . 'include/apply.php');
@unlink(ROOT.'include/footer.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) { if($sqlvn < 10104) {
$version = 'v1.1.4'; $version = 'v1.1.4';
} }
if($sqlvn < 10105) { if($sqlvn < 10105) {
$version = 'v1.1.5'; $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) { if($sqlvn < 10106) {
$version = 'v1.1.6'; $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) { if($sqlvn < 10109) {
$version = 'v1.1.9'; $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) { if($sqlvn < 10200) {
$version = 'v1.2.0'; $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) { if($sqlvn < 10205) {
$version = 'v1.2.5'; $version = 'v1.2.5';
} }
if($sqlvn < 10300) { if($sqlvn < 10300) {
$version = 'v1.3.0'; $version = 'v1.3.0';
} }
if($sqlvn < 10304) { if($sqlvn < 10304) {
$version = 'v1.3.4'; $version = 'v1.3.4';
} }
if($sqlvn < 10500) { if($sqlvn < 10500) {
$version = 'v1.5.0'; $version = 'v1.5.0';
} }
if($sqlvn < 10501) { if($sqlvn < 10501) {
$version = 'v1.5.1'; $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) { if($sqlvn < 10600) {
$version = 'v1.6.0'; $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) { if($sqlvn < 10700) {
$version = 'v1.7.0'; $version = 'v1.7.0';
} }
$sql=explode(';',$sql); if($sqlvn < 10800) {
for ($i=0;$i<count($sql);$i++) { $version = 'v1.8.0';
if (trim($sql[$i])=='')continue; $sql = $sql . file_get_contents(ROOT . 'install/data/update8.sql');
if($DB->query($sql[$i])) { if (!isset($conf['md5pass'])) {
} //MD5加密密码
} $admin_pwd = md5('lylme' . $conf['admin_pwd']);
saveSetting('version',$version); $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($DB->query($sql[$i])) {
}
}
saveSetting('version', $version);
} }

View File

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

View File

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

View File

@ -34,21 +34,23 @@ and (max-width:320px){.form-wrapper{padding-top:10%;border-radius:2px;margin:50p
<body> <body>
<?php <?php
if(!empty($background = background())){ if(!empty($background = background())) {
$background = str_replace('./','../',$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="form-wrapper">
<div class="nav"> <div class="nav">
<?php <?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> </div>
<?php <?php
session_start(); //设置session session_start(); //设置session
if($_SESSION['pass'] != 1){?> if(isset($_SESSION['pass']) != 1) {?>
<p>请输入密码登录</p> <p>请输入密码登录</p>
<form name="form" action="../include/go.php" method="POST"> <form name="form" action="../include/go.php" method="POST">
<div class="form"> <div class="form">
@ -60,15 +62,15 @@ if(!empty($background = background())){
<input type="submit" class="button" title="登录" value="登录"> <input type="submit" class="button" title="登录" value="登录">
</div> </div>
</div> </div>
</form><?php }else{ ?> </form><?php } else { ?>
<form name="form" action="../include/go.php" method="POST"> <form name="form" action="../include/go.php" method="POST">
<div class="form"> <div class="form">
<div class="button-panel"> <div class="button-panel">
<p> 欢迎回来,您已登录!<br><br>用户组: <p> 欢迎回来,您已登录!<br><br>用户组:
<?php foreach($_SESSION['list'] as $list){ <?php foreach($_SESSION['list'] as $list) {
echo(' ['.$list.'] '); echo(' [' . $list . '] ');
} }
?></p> ?></p>
<div class="form-item"> <div class="form-item">
<input type="hidden" autocomplete="new-password" name="exit" required="required" value="exit" > <input type="hidden" autocomplete="new-password" name="exit" required="required" value="exit" >
</div> </div>
@ -78,9 +80,11 @@ if(!empty($background = background())){
</form> </form>
<?php <?php
} }
}else{echo '<h2>当前站点未启用链接加密</h2>';} } else {
?> echo '<h2>当前站点未启用链接加密</h2>';
}
?>
<a href="../" class="home">返回首页</a> <a href="../" class="home">返回首页</a>
</div> </div>
</div> </div>