mirror of
https://github.com/tznb1/TwoNav.git
synced 2025-08-10 08:51:49 +00:00
v2.0.35-20230816
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
TwoNav 是一款开源免费的书签(导航)管理程序,界面简洁,安装简单,使用方便。TwoNav可帮助你将浏览器书签集中式管理,解决跨设备、跨平台、跨浏览器之间同步和访问困难问题,做到一处部署,随处访问。
|
||||
TwoNav 是一款开源的书签(导航)管理程序,界面简洁,安装简单,使用方便,基础功能免费。TwoNav可帮助你将浏览器书签集中式管理,解决跨设备、跨平台、跨浏览器之间同步和访问困难问题,做到一处部署,随处访问。
|
||||
|
||||
- **演示站**: [http://two.lm21.top](http://two.lm21.top)
|
||||
- **仅供体验,定期清理数据** 账号密码`admin`
|
||||
|
||||
@@ -165,6 +165,14 @@ if(!empty($_GET['type'])){
|
||||
update_db("user_login_info", ["user" => $_POST['new_user_name']], ["user" => $USER['User']]);
|
||||
update_db("user_log", ["user" => $_POST['new_user_name']], ["user" => $USER['User']]);
|
||||
update_db("global_user", ["User" => $_POST['new_user_name']], ["ID" => $_POST['ID']],[1,'操作成功']);
|
||||
}elseif($_GET['type'] == 'del_otp'){
|
||||
$user_data = get_db('global_user','*',['ID'=>$_POST['ID']]);
|
||||
$LoginConfig = unserialize($user_data['LoginConfig']);
|
||||
if(empty($LoginConfig['totp_key'])){
|
||||
msgA(['code'=>-1,'msg'=>'当前账号未开启OTP双重验证']);
|
||||
}
|
||||
$LoginConfig['totp_key'] = '';
|
||||
update_db("global_user", ["LoginConfig" => $LoginConfig], ["ID" => $_POST['ID']],[1,'操作成功']);
|
||||
}
|
||||
|
||||
msgA(['code'=>-1,'msg'=>'请求类型错误']);
|
||||
@@ -267,6 +275,7 @@ function echo_Atool(){
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="set_pwd">改密码</a>
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="set_root">设站长</a>
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="set_user_name">改账号</a>
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="del_otp" title="移除OTP登录验证">删OTP</a>
|
||||
</div>
|
||||
</script>
|
||||
<script src="../static/Layui/v2.8.10/layui.js"></script>
|
||||
@@ -280,7 +289,7 @@ function echo_Atool(){
|
||||
var table = layui.table;
|
||||
var cols = [[
|
||||
{field:'ID',title:'ID',width:60,sort:true}
|
||||
,{title:'操作',toolbar:'#tablebar',width:175}
|
||||
,{title:'操作',toolbar:'#tablebar',width:220}
|
||||
,{field:'User',title:'账号',minWidth:120,templet:function(d){
|
||||
return '<a style="color:#3c78d8" title="打开用户主页" target="_blank" href="../?u='+d.User+'">'+d.User+'</a>'
|
||||
}}
|
||||
@@ -359,6 +368,14 @@ function echo_Atool(){
|
||||
}
|
||||
});
|
||||
});
|
||||
}else if(obj.event == 'del_otp'){
|
||||
$.post('./ATool.php?type=del_otp',{ID:data.ID},function(data,status){
|
||||
if(data.code == 1) {
|
||||
layer.msg(data.msg, {icon: 1});
|
||||
}else{
|
||||
layer.msg(data.msg, {icon: 5});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
$('.set').click(function () {
|
||||
|
||||
@@ -352,6 +352,25 @@ function write_user_info(){
|
||||
delete_db('global_user',["ID" => $uids]);
|
||||
msg(1,'删除成功');
|
||||
break;
|
||||
//删除OTP验证
|
||||
case "Del_OTP":
|
||||
$uids = json_decode($_POST['ID']);
|
||||
$USER_S = select_db('global_user',['LoginConfig','ID','User'],['ID'=>$uids]);
|
||||
$fail = 0;
|
||||
foreach($USER_S as $USER){
|
||||
$LoginConfig = unserialize($USER['LoginConfig']);
|
||||
if(empty($LoginConfig['totp_key'])){
|
||||
$fail ++;
|
||||
continue;
|
||||
}
|
||||
$LoginConfig['totp_key'] = '';
|
||||
update_db("global_user", ["LoginConfig" => $LoginConfig], ["ID" => $USER['ID']]);
|
||||
}
|
||||
if($fail > 0){
|
||||
msg(1,'操作完毕,有'.$fail.'个账号未开启OTP双重验证');
|
||||
}
|
||||
msg(1,'操作成功');
|
||||
break;
|
||||
//设用户组
|
||||
case "set_UserGroup":
|
||||
if(empty($_POST['UserGroup'])){
|
||||
|
||||
@@ -129,7 +129,6 @@ function get_links($fid) {
|
||||
$where['ORDER']['lid'] = 'ASC';
|
||||
if(!is_login){
|
||||
$where['property'] = 0;
|
||||
|
||||
}
|
||||
//书签分享>私有可见
|
||||
if(isset($share['pv']) && $share['pv'] == 1){
|
||||
|
||||
@@ -713,10 +713,10 @@ function send_email($config){
|
||||
$mail->SMTPSecure = $config['secure'];
|
||||
$mail->Port = intval($config['port']);
|
||||
|
||||
if(preg_match('/(.+)<(.+)>/', $config['sender'], $match)){
|
||||
if(preg_match('/(.+)<(.+@.+)>$/', $config['sender'], $match)){
|
||||
$mail->setFrom($match[2],$match[1]);
|
||||
}else{
|
||||
$mail->setFrom($config['sender']);
|
||||
$mail->setFrom($config['user'],empty($config['sender'])?'TwoNav':$config['sender']);
|
||||
}
|
||||
|
||||
$mail->addAddress($config['addressee']); //收件人
|
||||
|
||||
@@ -1 +1 @@
|
||||
v2.0.34-20230809
|
||||
v2.0.35-20230816
|
||||
@@ -3,6 +3,12 @@ if($global_config['article'] != 1 || !check_purview('article',1)){
|
||||
require(DIR.'/templates/admin/page/404.php');
|
||||
exit;
|
||||
}
|
||||
if(!is_file(DIR.'/static/wangEditor/wangEditor.css') || !is_file(DIR.'/static/wangEditor/wangEditor.js')){
|
||||
$content = '由于缺少静态资源,当前无法加载编辑器!<br />如果您是站长,请在系统设置页面点击确定保存,系统将自动下载相关资源!<br />如果您是用户,请联系站长处理或耐心等候!';
|
||||
require DIR.'/templates/admin/page/404.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
$article_id = Get('id');
|
||||
$mode = empty($article_id) ? 'add' : 'edit' ;
|
||||
|
||||
|
||||
@@ -56,9 +56,9 @@ $title='系统设置';require(dirname(__DIR__).'/header.php');
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">发送人</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="sender" lay-verify="required" lay-reqtext="发送人邮箱不能为空" placeholder='' autocomplete="off" class="layui-input">
|
||||
<input type="text" name="sender" lay-verify="required" lay-reqtext="发送人名称不能为空" placeholder='' autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">例如: TwoNav书签<test@qq.com></div>
|
||||
<div class="layui-form-mid layui-word-aux">例如: TwoNav</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
||||
@@ -35,6 +35,7 @@ $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 layui-btn-danger" lay-event="Del_OTP" title="移除OTP双重验证">移除OTP验证</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>
|
||||
@@ -163,6 +164,16 @@ layui.use(['table','layer','form'], function () {
|
||||
}else if(event == 'set_UserGroup'){
|
||||
IDs = tableIds;
|
||||
index = layer.open({type: 1,scrollbar: false,shadeClose: true,title: '修改用户组',area : ['100%', '100%'],content: $('.set_UserGroup')});
|
||||
}else if(event == 'Del_OTP'){
|
||||
layer.alert("以下账号将被移除OTP双重验证,确定继续吗?<br />"+table_Users,{icon:3,title:'确认操作',anim: 2,closeBtn: 0,btn: ['确定','取消']},function () {
|
||||
$.post(get_api('write_user_info','Del_OTP'),{ID:tableIds},function(data,status){
|
||||
if(data.code == 1){
|
||||
layer.msg(data.msg,{icon: 1})
|
||||
} else{
|
||||
layer.msg(data.msg,{icon: 5});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
//行工具
|
||||
|
||||
@@ -2,6 +2,21 @@
|
||||
<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.35-20230816</h4>
|
||||
<ul>
|
||||
<li>[新增] Atool工具箱增加关闭OTP双重验证选项(删OTP),用于解决站长丢失OTP令牌造成无法登录</li>
|
||||
<li>[新增] 用户管理支持关闭OTP双重验证选项,用于站长帮助用户关闭OTP双重验证</li>
|
||||
<li>[优化] 邮件配置发送人只填发送人名称未按要求格式填写邮箱时由系统自动完成拼接</li>
|
||||
<li>[优化] 文章管理特定情况造成缺少资源时提醒用户如何解决</li>
|
||||
<li>[模板] 新增爱导航V1主页模板,轻量化设计简洁不卡顿/支持缓存/自适应/站内搜索,适合书签多的用户使用</li>
|
||||
<li>[模板] WebStack-Hugo主页模板新增:夜间背景图/炫彩横幅</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">
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn" xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta charset="utf-8">
|
||||
<title><?php echo $link['title']; ?> - <?php echo $site['title']; ?></title>
|
||||
<meta name="keywords" content="<?php echo $link['keywords']; ?>" />
|
||||
<meta name="description" content="<?php echo $link['description']; ?>" />
|
||||
<meta name="keywords" content="<?php echo $link['keywords']; ?>">
|
||||
<meta name="description" content="<?php echo $link['description']; ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="<?php echo $libs?>/bootstrap4/css/bootstrap.min.css" type="" media=""/>
|
||||
<meta http-equiv = "X-UA-Compatible" content = "IE=edge" >
|
||||
<link rel="stylesheet" href="<?php echo $libs?>/bootstrap4/css/bootstrap.min.css" crossorigin="anonymous">
|
||||
<link rel="shortcut icon" href="<?php echo $favicon;?>">
|
||||
<!--<script src="<?php echo $libs?>/jquery/jquery-2.2.4.min.js"></script>-->
|
||||
<!--<script src="<?php echo $libs?>/bootstrap4/js/bootstrap.min.js"></script>-->
|
||||
<script src="<?php echo $libs?>/jquery/jquery-2.2.4.min.js"></script>
|
||||
<script src="<?php echo $libs?>/bootstrap4/js/bootstrap.min.js" crossorigin="anonymous"></script>
|
||||
<style>
|
||||
.a_d img{
|
||||
max-width:100%;
|
||||
|
||||
Reference in New Issue
Block a user