Compare commits

...

2 Commits

Author SHA1 Message Date
MI15\Win ccae67f236 v2.0.15-20230422 2023-04-22 20:37:34 +08:00
MI15\Win 87566c39f3 v2.0.14-20230420 2023-04-20 21:03:34 +08:00
20 changed files with 226 additions and 68 deletions
+1
View File
@@ -73,6 +73,7 @@ if(empty($c) || $c == 'index'){
}elseif(in_array($c,['admin','click','api','ico','verify'])){
require "./system/{$c}.php";
}elseif(in_array($c,['apply','guestbook'])){
if($global_config['Maintenance'] != 0){Amsg(-1,'网站正在进行维护,请稍后再试!');}
require "./system/expand/{$c}.php";
}else{
Amsg(-1,'接口错误'.$c);
+1 -1
View File
@@ -23,6 +23,6 @@ function Amsg($code,$msg){
msg($code,$msg);
}else{
header("content-Type: text/html; charset=utf-8");
exit('<title>错误</title><font color="red">错误代码:'.$code.'<br />错误信息:'.$msg.'</font>');
exit('<title>错误</title><font color="red">代码:'.$code.'<br />信息:'.$msg.'</font>');
}
}
+23
View File
@@ -0,0 +1,23 @@
<?php if(!defined('DIR')){header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");exit;}
//弥补主题配置目录名相同造成的窜数据的bug
//复制主题配置,并重新标记t类型
// 'theme_home','theme_login','theme_transit','theme_register';
$datas = select_db('user_config','*',['t'=>'theme']);
foreach ($datas as $data) {
$name = $data['k'];
unset($data['id']);
if($name == 'default'){
$data['t'] = 'theme_transit';
insert_db('user_config',$data);
}
if($name == 'WebStack-Hugo'){
$data['t'] = 'theme_transit';
insert_db('user_config',$data);
}
$data['t'] = 'theme_home';
insert_db('user_config',$data);
}
insert_db('updatadb_logs',['file_name'=>$file_name,'update_time'=>time(),'status'=>'TRUE','extra'=>'']);
delete_db('user_config',['t'=>'theme']);
+2 -1
View File
@@ -42,7 +42,8 @@ CREATE TABLE IF NOT EXISTS `updatadb_logs` (
UNIQUE KEY `file_name` (`file_name`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
INSERT INTO "updatadb_logs" ("id", "file_name", "update_time", "status", "extra") VALUES ('1', '20230417.php', '1681719049', 'TRUE', '');
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20230417.php', '1681719049', 'TRUE', '');
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20230420.php', '1681977368', 'TRUE', '');
-- 创建用户表
DROP TABLE IF EXISTS `global_user`;
+22 -4
View File
@@ -1,4 +1,5 @@
<?php if(!defined('DIR')||$global_config['RegOption']=='0'){header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");exit;}
if($global_config['Maintenance'] != 0){Amsg(-1,'网站正在进行维护,请稍后再试!');}
//注册入口
$global_templates = unserialize(get_db("global_config",'v', ["k" => "s_templates"]));
//如果是Get请求则载入登录模板
@@ -14,7 +15,7 @@ if($_SERVER['REQUEST_METHOD'] === 'GET'){
$global_templates['register'] = 'default';
update_db("global_config", ["v" => $global_templates], ["k"=>"s_templates"]);
}
$copyright = empty($global_config['copyright'])?'<a target="_blank" href="https://gitee.com/tznb/twonav">Copyright © TwoNav</a>':$global_config['copyright'];
$copyright = empty($global_config['copyright'])?'<a target="_blank" href="https://gitee.com/tznb/TwoNav">Copyright © TwoNav</a>':$global_config['copyright'];
$ICP = empty($global_config['ICP'])?'':'<a target="_blank" href="https://beian.miit.gov.cn">'.$global_config['ICP'].'</a>';
$reg_tips = get_db('global_config','v',['k'=>'reg_tips']);
require $t_path;
@@ -55,17 +56,18 @@ if(!preg_match('/^[A-Za-z0-9]{4,13}$/', $user)){
msg(-1,'邮箱长度超限');
}elseif(strlen($pass)!=32){
msg(-1,'POST提交的密码异常≠32!');
}elseif(preg_match("/(class|controller|data|favicon|initial|static|templates|index|root|admin|cache|upload)/i",$user) ) {
msg(-1,'禁止注册保留用户名!');
}elseif(preg_match("/^(system|data|static|templates|index|root|admin)$/i",$user) ) {
msg(-1,'改用户名已被系统保留!');
}elseif(!empty(get_db('global_user','ID',['User'=>$user ]))){
msg(-1,'该账号已被注册!');
}elseif(!empty(get_db('global_user','ID',['Email'=>$Email ]))){
msg(-1,'该邮箱已被使用!');
}elseif(!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/i",$Email)){
msg(-1,'邮箱错误!');
}elseif(username_retain_verify($user)){
msg(-1,'该账号已被站长保留!');
}
//插入用户表和创建初始数据库
$RegTime = time();
$PassMD5 = Get_MD5_Password($pass,$RegTime);
@@ -182,6 +184,22 @@ $category_id = intval(max_db('user_categorys','cid',['uid'=>$USER_DB['ID']])) +1
insert_db("user_config", ["uid"=>$USER_DB['ID'],"k"=>"category_id","v"=>$category_id,"t"=>"max_id","d"=>'分类ID']);
insert_db("user_config", ["uid"=>$USER_DB['ID'],"k"=>"pwd_group_id","v"=>1,"t"=>"max_id","d"=>'加密组ID']);
//账号保留
function username_retain_verify($username){
$list = get_db("global_config", "v", ["k" => "username_retain"]);
if(empty($list)){
return false;
}
$patterns = explode("\n", $list);
foreach($patterns as $pattern){
if (preg_match($pattern, $username)) {
return true;
}
}
return false;
}
//返回注册成功
msg(1,'注册成功');
+23
View File
@@ -0,0 +1,23 @@
<?php if(!defined('DIR')){header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");exit;}
//弥补主题配置目录名相同造成的窜数据的bug
//复制主题配置,并重新标记t类型
// 'theme_home','theme_login','theme_transit','theme_register';
$datas = select_db('user_config','*',['t'=>'theme']);
foreach ($datas as $data) {
$name = $data['k'];
unset($data['id']);
if($name == 'default'){
$data['t'] = 'theme_transit';
insert_db('user_config',$data);
}
if($name == 'WebStack-Hugo'){
$data['t'] = 'theme_transit';
insert_db('user_config',$data);
}
$data['t'] = 'theme_home';
insert_db('user_config',$data);
}
insert_db('updatadb_logs',['file_name'=>$file_name,'update_time'=>time(),'status'=>'TRUE','extra'=>'']);
delete_db('user_config',['t'=>'theme']);
+2 -1
View File
@@ -35,7 +35,8 @@ CREATE TABLE IF NOT EXISTS "updatadb_logs" (
"extra" TEXT(512) NOT NULL DEFAULT "",
CONSTRAINT "file_name" UNIQUE ("file_name" ASC)
);
INSERT INTO "updatadb_logs" ("id", "file_name", "update_time", "status", "extra") VALUES ('1', '20230417.php', '1681719049', 'TRUE', '');
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20230417.php', '1681719049', 'TRUE', '');
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20230420.php', '1681977368', 'TRUE', '');
-- 创建用户表
CREATE TABLE IF NOT EXISTS "global_user" (
+5 -32
View File
@@ -1,4 +1,4 @@
<?php if(!defined('DIR')){header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");exit;}
<?php if(!defined('DIR')){header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");exit;}AccessControl();
//获取请求参数
$page = trim($_GET['page']);
@@ -53,32 +53,8 @@ if ($page == 'home') {
array_push($day_data[0]['data'],get_db('user_count','v',['uid'=>UID,'k'=>$date,'t'=>'index_Ymd'])??0);
array_push($day_data[1]['data'],get_db('user_count','v',['uid'=>UID,'k'=>$date,'t'=>'click_Ymd'])??0);
}
//var_dump(json_encode($day),$day_data);
}
//调试
if( $page == 'test' ) {
$dirs = get_dir_list(DIR.'/templates/home');
//var_dump($dirs);
foreach ($dirs as $dir) {
$path = DIR.'/templates/home/'.$dir; //目录完整路径
//没有信息文件则跳过
if(!is_file($path.'/info.json') ) {continue;}
//读取主题信息
$themes[$dir]['info'] = json_decode(@file_get_contents($path.'/info.json'),true);
//是否支持配置
$themes[$dir]['info']['config'] = is_file($path.'/config.php') ? '1':'0';
//预览图优先顺序:png>jpg>info>default
if(is_file($dirs.'/screenshot.png')){
$themes[$dir]['info']['screenshot'] = "./templates/home/".$dir."/screenshot.png";
}elseif(is_file($dirs.'/screenshot.jpg')){
$themes[$dir]['info']['screenshot'] = "./templates/home/".$dir."/screenshot.jpg";
}elseif(empty($themes[$dir]['info']['screenshot'])){
$themes[$dir]['info']['screenshot'] = "./templates/admin/static/42ed3ef2c4a50f6d.png";
}
//var_dump($themes);
}
}
//载入主题配置
if($page == 'config_home'){
$theme = $_GET['theme'];
@@ -92,7 +68,10 @@ if($page == 'config_home'){
$theme_config = empty($theme_config['config']) ? []:$theme_config['config'];
//读取用户主题配置
$theme_config_db = get_db('user_config','v',['t'=>'theme','k'=>$theme,'uid'=>UID]);
if(!in_array($_GET['fn'],['home','login','register','transit'])){
msg(-1,"参数错误");
}
$theme_config_db = get_db('user_config','v',['t'=>'theme_'.$_GET['fn'],'k'=>$theme,'uid'=>UID]);
$theme_config_db = unserialize($theme_config_db);
//如果不为空则合并数据
@@ -103,7 +82,6 @@ if($page == 'config_home'){
if(empty($theme_config)){
exit("<h3>获取主题配置失败</h3>");
}
//var_dump($theme_config);
require $config_path;
exit;
}
@@ -129,7 +107,6 @@ if( $page == 'theme_home' || $page == 'theme_login' || $page == 'theme_transit'
}elseif(empty($themes[$dir]['info']['screenshot'])){
$themes[$dir]['info']['screenshot'] = "./templates/admin/static/42ed3ef2c4a50f6d.png";
}
//var_dump($themes);
}
//获取当前主题
@@ -191,7 +168,6 @@ if( $page == 'theme_home' || $page == 'theme_login' || $page == 'theme_transit'
define('referrer',$data['referrer']);
}
}
//var_dump($themes);exit;
}
@@ -230,7 +206,6 @@ if ($page == 'menu') {
array_push($menu,$extend);
}
//如果是管理员则追加菜单
if($USER_DB['UserGroup'] == 'root'){
array_push($menu,
@@ -251,7 +226,6 @@ if ($page == 'menu') {
exit(json_encode($init));
}
//不带参数是载入框架
if(empty($page)){
$site = unserialize(get_db('user_config','v',['uid'=>UID,'k'=>'s_site']));
@@ -271,7 +245,6 @@ if(!empty($page)){
}
}
//加载静态库
function load_static($type){
if($type == 'css'){
+14 -2
View File
@@ -2,7 +2,7 @@
//允许跨域访问
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: Access-Control-Allow-Private-Network,Content-Type, AccessToken, X-CSRF-Token, Authorization, Token,X-Token,X-Cid");
AccessControl();
//鉴权验证 Cookie验证通过,验证二级密码,Cookie验证失败时尝试验证token
//获取请求方法
@@ -1231,10 +1231,22 @@ function write_theme(){
if(empty($_POST)){
msg(-1,"POST请求数据不能为空!");
}
write_user_config($_GET['t'],$_POST,'theme','主题配置');
//20230420,修复同名窜数据的问题!由于保存主题不提交模板类型,只能从来路中提取
parse_str(parse_url($_SERVER['HTTP_REFERER'])['query'],$GET);
if(empty($GET['fn']) && empty($_GET['template_type']) ){
msg(-1,"获取模板类型错误");
}
$fn = empty($GET['fn']) ? $_GET['template_type'] : $GET['fn'];
if(!in_array($fn,['home','login','register','transit'])){
msg(-1,"参数错误");
}
//0420 END
write_user_config($_GET['t'],$_POST,'theme_' . $fn,'主题配置');
msg(1,"保存成功!");
}
}
//读登录信息
function read_login_info(){
$page = empty(intval($_REQUEST['page'])) ? 1 : intval($_REQUEST['page']);
+18 -2
View File
@@ -42,9 +42,9 @@ function other_upsys(){
if($_POST['i'] == 2){
if(!is_subscribe('bool')){
msg(-1,'未检测到有效授权,
<a href="https://gitee.com/tznb/OneNav/wikis/%E8%AE%A2%E9%98%85%E6%9C%8D%E5%8A%A1%E6%8C%87%E5%BC%95" target="_blank" style="color: #01AAED;">购买授权</a>
<a href="https://gitee.com/tznb/TwoNav/wikis/pages?sort_id=7968669&doc_id=3767990" target="_blank" style="color: #01AAED;">购买授权</a>
<a href="https://gitee.com/tznb/TwoNav/releases" target="_blank" style="color: #01AAED;">手动更新</a>');
<a href="https://gitee.com/tznb/TwoNav/wikis/pages?sort_id=8013447&doc_id=3767990" target="_blank" style="color: #01AAED;">手动更新</a>');
}
//设置执行最长时间,0为无限制。单位秒!
set_time_limit(5*60);
@@ -634,6 +634,22 @@ function other_root(){
msg(1,'已释放 '.byteFormat($size).' 缓存');
}elseif($_GET['type'] == 'import_data'){
require DIR .'/system/UseFew/root_import_data.php';
}elseif($_GET['type'] == 'read_username_retain'){
$data = get_db("global_config", "v", ["k" => "username_retain"]);
msgA(['code'=>1,'msg'=>'获取成功','data'=>$data]);
}elseif($_GET['type'] == 'write_username_retain'){
//遍历检测语法
$patterns = explode("\n",$_POST['username_retain']);
foreach($patterns as $pattern){
if (@preg_match($pattern, '') === false) {
msg(-1,'正则表达式语法错误,请检查');
}
}
if(!is_subscribe('bool')){
msg(-1,'未检测到有效授权');
}
write_global_config('username_retain',$_POST['username_retain'],'账号保留');
msg(1,'保存成功');
}
}
+3 -3
View File
@@ -1,4 +1,4 @@
<?php if(!defined('DIR')){Not_Found();}
<?php if(!defined('DIR')){Not_Found();}AccessControl();
//负责过渡页/跳转/隐私保护/密码访问
$id = intval($_GET['id']);
@@ -18,7 +18,7 @@ if(empty($link)){Not_Found();}
$site = unserialize(get_db('user_config','v',['uid'=>UID,'k'=>'s_site']));
$site['Title'] = $site['title'].(empty($site['subtitle'])?'':' - '.$site['subtitle']);
//免费用户请保留版权,谢谢!
$copyright = empty($global_config['copyright'])?'<a target="_blank" href="https://gitee.com/tznb/twonav">Copyright © TwoNav</a>':$global_config['copyright'];
$copyright = empty($global_config['copyright'])?'<a target="_blank" href="https://gitee.com/tznb/TwoNav">Copyright © TwoNav</a>':$global_config['copyright'];
$ICP = empty($global_config['ICP'])?'':'<a target="_blank" href="https://beian.miit.gov.cn">'.$global_config['ICP'].'</a>';
$favicon = ( !empty($site['site_icon_file'])) ? $site['site_icon'] : './favicon.ico';
@@ -113,7 +113,7 @@ update_db("user_links", ["click[+]"=>1],['uid'=>UID,'lid'=>$id]);
//读取用户主题配置
$theme_config_db = unserialize(get_db('user_config','v',['t'=>'theme','k'=>$s_templates['transit'],'uid'=>UID]));
$theme_config_db = unserialize(get_db('user_config','v',['t'=>'theme_transit','k'=>$s_templates['transit'],'uid'=>UID]));
//读取默认主题配置
$theme_info = json_decode(@file_get_contents($dir_path.'/info.json'),true);
+7 -6
View File
@@ -1,4 +1,4 @@
<?php if(!defined('DIR')){header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");exit;}
<?php if(!defined('DIR')){header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");exit;}AccessControl();
//主页入口
define('is_login',is_login());
@@ -12,7 +12,7 @@ if(!is_login && ($global_config['Privacy'] == 1 || !check_purview('Common_home',
$site = unserialize(get_db('user_config','v',['uid'=>UID,'k'=>'s_site']));
$site['Title'] = $site['title'].(empty($site['subtitle'])?'':' - '.$site['subtitle']);
//免费用户请保留版权,谢谢!
$copyright = empty($global_config['copyright'])?'<a target="_blank" href="https://gitee.com/tznb/twonav">Copyright © TwoNav</a>':$global_config['copyright'];
$copyright = empty($global_config['copyright'])?'<a target="_blank" href="https://gitee.com/tznb/TwoNav">Copyright © TwoNav</a>':$global_config['copyright'];
$ICP = empty($global_config['ICP'])?'':'<a target="_blank" href="https://beian.miit.gov.cn">'.$global_config['ICP'].'</a>';
$favicon = ( !empty($site['site_icon_file'])) ? $site['site_icon'] : './favicon.ico';
//读取默认模板信息
@@ -43,7 +43,7 @@ $support_category_svg = $theme_info['support']['category_svg']??0; //0.不支持
//主题配置(默认)
$theme_config = empty($theme_info['config']) ? []:$theme_info['config'];
//主题配置(用户)
$theme_config_db = get_db('user_config','v',['t'=>'theme','k'=>$theme,'uid'=>UID]);
$theme_config_db = get_db('user_config','v',['t'=>'theme_home','k'=>$theme,'uid'=>UID]);
$theme_config_db = unserialize($theme_config_db);
//合并配置数据
$theme_config = empty($theme_config_db) ? $theme_config : array_merge ($theme_config,$theme_config_db);
@@ -132,10 +132,11 @@ function get_links($fid) {
$where['LIMIT'] = $site['new_link'];
}
$where['ORDER']['lid'] = 'DESC';
//输出上限&不在子页面&例外主题
}elseif($site['max_link'] > 0 && empty(Get('oc')) && !$site['ex_theme']){
//输出上限&不在子页面&例外主题&书签分享
}elseif($site['max_link'] > 0 && empty(Get('oc')) && !$site['ex_theme'] && empty($_GET['share'])){
$count = count_db('user_links',$where);
$where['LIMIT'] = $site['max_link'];
$max_link = true;
}
$links = select_db('user_links',['lid(id)','fid','property','title','url(real_url)','url_standby','description','icon','click','pid'],$where);
foreach ($links as $key => $link) {
@@ -172,7 +173,7 @@ function get_links($fid) {
//获取图标链接
$links[$key]['ico'] = $lock ? $GLOBALS['libs'].'/Other/lock.svg' : geticourl($site['link_icon'],$link);
}
if($site['max_link'] > 0 && $count > $site['max_link'] && empty(Get('oc')) && !$site['ex_theme']){
if($max_link && $count > $site['max_link']){
$oc_url = "./index.php?u={$u}&oc={$fid}" . (empty($_GET['theme']) ? '':"&theme={$_GET['theme']}");
array_push($links,['id'=>0,'title'=>'查看全部','url'=>$oc_url,'real_url'=>$oc_url,'description'=>'该分类共有'.$count.'条数据','ico'=>'./favicon.ico']);
}
+1 -1
View File
@@ -5,7 +5,7 @@ require "./system/templates.php";
if($_SERVER['REQUEST_METHOD'] === 'GET'){
require DIR ."/system/templates.php";
$t_path = DIR ."/templates/login/{$s_templates['login']}/index.php"; //模板路径
$copyright = empty($global_config['copyright'])?'<a target="_blank" href="https://gitee.com/tznb/twonav">Copyright © TwoNav</a>':$global_config['copyright'];
$copyright = empty($global_config['copyright'])?'<a target="_blank" href="https://gitee.com/tznb/TwoNav">Copyright © TwoNav</a>':$global_config['copyright'];
$ICP = empty($global_config['ICP'])?'':'<a target="_blank" href="https://beian.miit.gov.cn">'.$global_config['ICP'].'</a>';
//检查是否存在,不存在则使用默认
if(!is_file($t_path)){
+5 -7
View File
@@ -155,8 +155,7 @@ function get_db($table,$columns,$where,$rp = []){
//写全局配置(存在则更新,不存在则创建)
function write_global_config($key,$value,$d){
$re = get_db('global_config','k',['k'=>$key]);
if(empty($re)){
if(!has_db('global_config',['k'=>$key])){
insert_db("global_config", ["k" => $key,"v" => $value,"d" => $d]);
}else{
update_db("global_config", ["v" => $value],['k'=>$key]);
@@ -165,17 +164,16 @@ function write_global_config($key,$value,$d){
//写用户配置(存在则更新,不存在则创建)
function write_user_config($key,$value,$t,$d){
$re = get_db('user_config','k',['uid'=>UID,'k'=>$key]);
if(empty($re)){
if(!has_db('user_config',['uid'=>UID,'k'=>$key,'t'=>$t])){
insert_db("user_config", ['uid'=>UID,"k"=>$key,"v"=>$value,"t"=>$t,"d"=>$d]);
}else{
update_db("user_config", ["v"=>$value],['uid'=>UID,'k'=>$key]);
update_db("user_config", ["v"=>$value],['uid'=>UID,'k'=>$key,'t'=>$t]);
}
}
//写用户统计
function write_user_count($key,$t){
$re = get_db('user_count','k',['uid'=>UID,'t'=>$t,'k'=>$key]);
if(empty($re)){
if(!has_db('user_count',['uid'=>UID,'t'=>$t,'k'=>$key])){
insert_db("user_count", ['uid'=>UID,"k"=>$key,"v"=>1,'t'=>$t]);
}else{
update_db("user_count", ["v[+]"=>1],['uid'=>UID,'t'=>$t,'k'=>$key]);
+1 -1
View File
@@ -1 +1 @@
v2.0.13-20230418
v2.0.15-20230422
@@ -113,7 +113,7 @@ $title='留言管理';require dirname(__DIR__).'/header.php';
<?php foreach ( $data as $value ) { ?>
<div class="layui-colla-item">
<h2 class="layui-colla-title"><?php echo $value['id'] .'.&nbsp;[&nbsp;'. $value['type'] .'&nbsp;]&nbsp;[&nbsp;'. $value['title'].'&nbsp;]'; ?>&emsp;
<a style="cursor:pointer;" rel = "nofollow" onclick = "del('<?php echo $value['file'] ?>')">删除</a>
<a class="click" style="cursor:pointer;" rel = "nofollow" onclick = "del('<?php echo $value['file'] ?>')">删除</a> &emsp;
</h2>
<div class="layui-colla-content <?php if( $value['id'] <= $show ){echo 'layui-show';} ?>">
<p><?php echo '提交时间: '. $value['time'] .'<br />终端地址: '. $value['ip'] .'<br />联系方式: '. $value['contact'] .'<br /> <br />'. str_replace("\n","<br />",str_replace(" ","&nbsp;",$value['content'])) ; ?></p>
@@ -134,6 +134,11 @@ layui.use(['layer','element'], function(){
var layer = layui.layer;
});
$('.click').click(function (event) {
event.preventDefault();
return false;
});
function del(name) {
$.post('',{'type':'del','name':name},function(data,status){
if(data.code == 1) {
@@ -154,6 +159,7 @@ function set(key){
}
});
}
</script>
</body>
</html>
@@ -22,7 +22,7 @@
<div class="layui-container">
<div class="layui-col-lg10 ">
<form class="layui-form">
<fieldset class="layui-elem-field layui-field-title " style="margin-top: 30px;"><legend><a href="https://gitee.com/tznb/OneNav" target="_blank" rel="nofollow">TwoNav</a> 极简留言板</legend></fieldset>
<fieldset class="layui-elem-field layui-field-title " style="margin-top: 30px;"><legend><a href="https://gitee.com/tznb/TwoNav" target="_blank" rel="nofollow">TwoNav</a> 极简留言板</legend></fieldset>
<div class="layui-form-item">
<label class="layui-form-label">反馈类型</label>
<div class="layui-input-inline">
@@ -59,7 +59,7 @@
</div>
</form>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
<legend>Powered by <a href="https://gitee.com/tznb/OneNav" target="_blank" rel="nofollow">lm21</a></legend>
<legend>Powered by <a href="https://gitee.com/tznb/TwoNav" target="_blank" rel="nofollow">lm21</a></legend>
<!--非订阅用户请勿去除版权,谢谢-->
</fieldset>
</div>
+68 -3
View File
@@ -35,8 +35,9 @@ $user_groups = select_db('user_group',['id','code','name'],'');
<script type="text/html" id="user_tool">
<div class="layui-btn-group">
<button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="Del">删除</button>
<button class="layui-btn layui-btn-sm " lay-event="register" <?php echo $global_config['RegOption'] == 0? 'style = "display:none;"':'' ?> >注册账号</button>
<button class="layui-btn layui-btn-sm " lay-event="set_UserGroup" >设用户组</button>
<button class="layui-btn layui-btn-sm" lay-event="register" <?php echo $global_config['RegOption'] == 0? 'style = "display:none;"':'' ?> >注册账号</button>
<button class="layui-btn layui-btn-sm" lay-event="set_UserGroup">设用户组</button>
<button class="layui-btn layui-btn-sm" lay-event="username_retain">账号保留</button>
</div>
</script>
<!-- 操作列 -->
@@ -122,6 +123,17 @@ layui.use(['table','layer','form'], function () {
if (event == 'register') {
window.open('./index.php?c=<?php echo $global_config['Register'];?>');
return;
}else if(event == 'username_retain'){
index = layer.open({type: 1,scrollbar: false,shadeClose: true,title: '账号保留',area : ['100%', '100%'],content: $('.username_retain')});
$.post(get_api('other_root','read_username_retain'),function(data,status){
if(data.code == 1) {
form.val('username_retain', {"username_retain": data.data});
}else{
layer.msg(data.msg, {icon: 5});
}
});
return;
}
var checkStatus = table.checkStatus(obj.config.id);
@@ -206,6 +218,20 @@ layui.use(['table','layer','form'], function () {
});
return false;
});
//保存账号保留
form.on('submit(save_username_retain)', function (data) {
$.post(get_api('other_root','write_username_retain'),data.field,function(data,status){
if(data.code == 1) {
layer.msg(data.msg, {icon: 1});
}else{
layer.msg(data.msg, {icon: 5});
}
});
return false;
});
});
</script>
<ul class="set_UserGroup" style = "margin-top:18px;display:none;padding-right: 10px;" >
@@ -225,8 +251,47 @@ layui.use(['table','layer','form'], function () {
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="save_UserGroup" id ='save_UserGroup'>保存</button>
<button class="layui-btn layui-btn-warm" type="button" id="close" >关闭</button>
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="save_UserGroup" id ='save_UserGroup'>保存</button>
</div>
</div>
</form>
</ul>
<ul class="username_retain" style="margin-left: 10px;padding-right: 10px;margin-top:18px;display:none;" >
<form class="layui-form layuimini-form layui-form-pane" lay-filter="username_retain">
<div class="layui-form-item layui-form-text">
<label class="layui-form-label required">账号保留 - 正则表达式匹配</label>
<div class="layui-input-block">
<textarea name="username_retain" class="layui-textarea"></textarea>
</div>
</div>
<pre class="layui-code" >
使用举例:
/^(root|data)$/ 匹配用户等于root或data 区分大小写!
/^(root|data)$/i 匹配用户等于root或data 不区分大小写!
/root|data/ 匹配用户含有root或data 区分大小写!
/root|data/i 匹配用户含有root或data 不区分大小写!
/^admin.+/ 匹配admin开头的任意用账号,但不匹配admin
/^admin.*/ 同上,但匹配admin本身
支持多行,一行一条规则!
举例中的表达式解释:
^ 匹配开头位置
$ 匹配结尾位置
| 或者
. 匹配换行符以外的任何字符
+ 匹配前一个字符一次或多次
* 匹配前一个字符零次或多次
更多语法请自行百度
:错误的规则可能会造成程序异常,如需帮助请联系技术支持QQ:271152681或技术交流群695720839
</pre>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-warm" type="button" id="close" >关闭</button>
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="save_username_retain" id ='save_username_retain'>保存</button>
</div>
</div>
</form>
-1
View File
@@ -51,7 +51,6 @@ $HTTP_HOST = preg_replace('/:\d+$/','',$_SERVER['HTTP_HOST']); //去除端口号
<button class="layui-btn" lay-submit lay-filter="get_subscribe">查询授权</button>
</div>
<fieldset class="layui-elem-field layui-field-title" style="margin-top:30px;"><legend>授权用户专享</legend></fieldset>
<blockquote class="layui-elem-quote layui-text">
<li>1. 可使用一键更新功能</li>
+21
View File
@@ -2,6 +2,27 @@
<body>
<div class="layuimini-container">
<div class="layuimini-main" style=" margin-left: 20px;">
<li class="layui-timeline-item">
<i class="layui-icon layui-timeline-axis"></i>
<div class="layui-timeline-content layui-text">
<h4 class="layui-timeline-title">v2.0.15-20230422</h4>
<ul>
<li>修复默认版权链接错误的问题</li>
<li>修复维护模式未起作用</li>
<li>网站管理>用户管理>新增账号保留,方便公开注册的站长保留一些账号</li>
</ul>
</div>
</li>
<li class="layui-timeline-item">
<i class="layui-icon layui-timeline-axis"></i>
<div class="layui-timeline-content layui-text">
<h4 class="layui-timeline-title">v2.0.14-20230420</h4>
<ul>
<li>修复书签分享和输出上限冲突的问题</li>
<li>[数据库更新]修复不同类型的模板目录名相同时存在窜数据的问题</li>
</ul>
</div>
</li>
<li class="layui-timeline-item">
<i class="layui-icon layui-timeline-axis"></i>
<div class="layui-timeline-content layui-text">