Skip to content

Commit

Permalink
Merge pull request #40 from helloxz/dev
Browse files Browse the repository at this point in the history
v0.9.13
  • Loading branch information
helloxz committed Feb 16, 2022
2 parents 60a535d + 6d886fb commit 17a3e20
Show file tree
Hide file tree
Showing 58 changed files with 104 additions and 17 deletions.
Empty file modified .htaccess 100644 → 100755
Empty file.
Empty file modified LICENSE 100644 → 100755
Empty file.
Empty file modified README.md 100644 → 100755
Empty file.
Empty file modified class/.htaccess 100644 → 100755
Empty file.
28 changes: 19 additions & 9 deletions class/Api.php 100644 → 100755
Expand Up @@ -18,11 +18,11 @@ public function __construct($db){
public function add_category($token,$name,$property = 0,$weight = 0,$description = ''){
$this->auth($token);
$data = [
'name' => $name,
'name' => htmlspecialchars($name,ENT_QUOTES),
'add_time' => time(),
'weight' => $weight,
'property' => $property,
'description' => $description
'description' => htmlspecialchars($description,ENT_QUOTES)
];
//插入分类目录
$this->db->insert("on_categorys",$data);
Expand Down Expand Up @@ -59,11 +59,11 @@ public function edit_category($token,$id,$name,$property = 0,$weight = 0,$descri
//更新数据库
else{
$data = [
'name' => $name,
'name' => htmlspecialchars($name,ENT_QUOTES),
'up_time' => time(),
'weight' => $weight,
'property' => $property,
'description' => $description
'description' => htmlspecialchars($description,ENT_QUOTES)
];
$re = $this->db->update('on_categorys',$data,[ 'id' => $id]);
//var_dump( $this->db->log() );
Expand Down Expand Up @@ -159,9 +159,9 @@ public function add_link($token,$fid,$title,$url,$description = '',$weight = 0,$
//合并数据
$data = [
'fid' => $fid,
'title' => $title,
'title' => htmlspecialchars($title,ENT_QUOTES),
'url' => $url,
'description' => $description,
'description' => htmlspecialchars($description,ENT_QUOTES),
'add_time' => time(),
'weight' => $weight,
'property' => $property
Expand Down Expand Up @@ -309,9 +309,9 @@ public function edit_link($token,$id,$fid,$title,$url,$description = '',$weight
//合并数据
$data = [
'fid' => $fid,
'title' => $title,
'title' => htmlspecialchars($title,ENT_QUOTES),
'url' => $url,
'description' => $description,
'description' => htmlspecialchars($description,ENT_QUOTES),
'up_time' => time(),
'weight' => $weight,
'property' => $property
Expand Down Expand Up @@ -548,6 +548,16 @@ protected function getIP() {
return $ip;
}

//
/**
* name:检查弱密码
*/
public function check_weak_password($token){
$this->auth($token);
//如果用户名、密码为初始密码,则提示修改
if ( ( USER == 'xiaoz' ) && ( PASSWORD == 'xiaoz.me' ) ) {
$this->err_msg(-1,'Weak password!');
}
}

}

Empty file modified class/Medoo.php 100644 → 100755
Empty file.
Empty file modified class/index.html 100644 → 100755
Empty file.
Empty file modified config.simple.php 100644 → 100755
Empty file.
Empty file modified controller/.htaccess 100644 → 100755
Empty file.
Empty file modified controller/admin.php 100644 → 100755
Empty file.
10 changes: 9 additions & 1 deletion controller/api.php 100644 → 100755
Expand Up @@ -14,7 +14,7 @@

//获取请求方法
$method = $_GET['method'];
//对方法进行判断
//对方法进行判断,对应URL路由:/index.php?c=api&method=xxx
switch ($method) {
case 'add_category':
add_category($api);
Expand Down Expand Up @@ -51,6 +51,8 @@
break;
case 'imp_link':
imp_link($api);
case 'check_weak_password':
check_weak_password($api);
break;
default:
# code...
Expand Down Expand Up @@ -211,4 +213,10 @@ function imp_link($api) {
$fid = intval($_POST['fid']);
$property = intval(@$_POST['property']);
$api->imp_link($token,$filename,$fid,$property);
}
//检查弱密码
function check_weak_password($api) {
//获取token
$token = $_POST['token'];
$api->check_weak_password($token);
}
Empty file modified controller/click.php 100644 → 100755
Empty file.
Empty file modified controller/index.html 100644 → 100755
Empty file.
Empty file modified controller/index.php 100644 → 100755
Empty file.
Empty file modified controller/login.php 100644 → 100755
Empty file.
Empty file modified data/index.html 100644 → 100755
Empty file.
8 changes: 7 additions & 1 deletion data/update.log 100644 → 100755
Expand Up @@ -22,4 +22,10 @@ CREATE INDEX on_options_key_IDX ON on_options ("key");
20210726
1. 修复后台QQ群2
2. 后台添加社区支持链接
3. 修复默认主题顶部遮挡问题
3. 修复默认主题顶部遮挡问题

20220211
1. 简化安装过程,无需再手动修改配置安装
2. 新增默认密码安全检测
3. 默认模板增加手机登录按钮
4. 修复一处XSS漏洞
Empty file modified db/onenav.simple.db3 100644 → 100755
Empty file.
Empty file modified favicon.ico 100644 → 100755
Empty file.
Empty file modified functions/.htaccess 100644 → 100755
Empty file.
Empty file modified functions/helper.php 100644 → 100755
Empty file.
13 changes: 12 additions & 1 deletion index.php 100644 → 100755
Expand Up @@ -12,7 +12,18 @@
//$version = @file_get_contents("./functions/version.txt");
//载入配置文件
if( !file_exists('./data/config.php') ) {
exit('<h3>配置文件不存在,请将站点目录下的config.simple.php复制为data/config.php</h3>');
echo "<p>正在准备安装,请稍等...</p>";
//复制配置文件
if ( copy('config.simple.php','data/config.php') ) {
echo "安装完毕,默认用户名:xiaoz,密码:xiaoz.me,5s后跳转到登录页面。";
//跳转到登录页面
header("Refresh:5;url=/index.php?c=login");
exit();
} else{
exit("<p>复制配置文件失败,请检查权限是否正常,或手动将站点目录下的config.simple.php复制为data/config.php</p>");
}

//exit('<h3>配置文件不存在,请将站点目录下的config.simple.php复制为data/config.php</h3>');
}
//检查数据库是否存在,不存在则复制数据库
if( !file_exists('./data/onenav.db3') ) {
Expand Down
Empty file modified static/layer/layer.js 100644 → 100755
Empty file.
Empty file modified static/layer/mobile/layer.js 100644 → 100755
Empty file.
Empty file modified static/layer/mobile/need/layer.css 100644 → 100755
Empty file.
Empty file modified static/layer/theme/default/icon-ext.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified static/layer/theme/default/icon.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified static/layer/theme/default/layer.css 100644 → 100755
Empty file.
Empty file modified static/layer/theme/default/loading-0.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified static/layer/theme/default/loading-1.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified static/layer/theme/default/loading-2.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified templates/admin/403.php 100644 → 100755
Empty file.
Empty file modified templates/admin/add_category.php 100644 → 100755
Empty file.
Empty file modified templates/admin/add_link.php 100644 → 100755
Empty file.
Empty file modified templates/admin/add_link_tpl.php 100644 → 100755
Empty file.
Empty file modified templates/admin/add_quick_tpl.php 100644 → 100755
Empty file.
Empty file modified templates/admin/category_list.php 100644 → 100755
Empty file.
Empty file modified templates/admin/edit_category.php 100644 → 100755
Empty file.
Empty file modified templates/admin/edit_link.php 100644 → 100755
Empty file.
Empty file modified templates/admin/ext_js.php 100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion templates/admin/footer.php 100644 → 100755
@@ -1,6 +1,6 @@
<div class="layui-footer">
<!-- 底部固定区域 -->
© Copyright 2021.Powered by <a href="https://github.com/helloxz/onenav" rel = "nofollow" target="_blank">OneNav</a>.
© Copyright 2022.Powered by <a href="https://github.com/helloxz/onenav" rel = "nofollow" target="_blank">OneNav</a>.
</div>
</div>
<script src = 'https://libs.xiaoz.top/jquery/2.2.4/jquery.min.js'></script>
Expand Down
Empty file modified templates/admin/header.php 100644 → 100755
Empty file.
Empty file modified templates/admin/imp_link.php 100644 → 100755
Empty file.
Empty file modified templates/admin/index.html 100644 → 100755
Empty file.
3 changes: 3 additions & 0 deletions templates/admin/index.php 100644 → 100755
Expand Up @@ -40,3 +40,6 @@
</div>

<?php include_once('footer.php'); ?>
<script>
check_weak_password();
</script>
Empty file modified templates/admin/left.php 100644 → 100755
Empty file.
Empty file modified templates/admin/link_list.php 100644 → 100755
Empty file.
4 changes: 4 additions & 0 deletions templates/admin/login.php 100644 → 100755
Expand Up @@ -44,6 +44,10 @@
<div class="layui-form-item">
<button class="layui-btn" lay-submit lay-filter="login" style = "width:100%;">登录</button>
</div>
<div class="layui-form-item layui-hide-sm layui-hide-md layui-hide-lg">
<button class="layui-btn" lay-submit lay-filter="mobile_login" style = "width:100%;">手机登录</button>
</div>
</form>
Expand Down
Empty file modified templates/admin/static/add_quick_tpl.css 100644 → 100755
Empty file.
Empty file modified templates/admin/static/bg.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 31 additions & 2 deletions templates/admin/static/embed.js 100644 → 100755
Expand Up @@ -191,7 +191,6 @@ layui.use(['element','table','layer','form','upload'], function(){
});

//登录
//添加链接
form.on('submit(login)', function(data){
$.post('/index.php?c=login&check=login',data.field,function(data,status){
//如果添加成功
Expand All @@ -205,6 +204,20 @@ layui.use(['element','table','layer','form','upload'], function(){
console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value}
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
});
//手机登录
form.on('submit(mobile_login)', function(data){
$.post('/index.php?c=login&check=login',data.field,function(data,status){
//如果登录成功
if(data.code == 0) {
window.location.href = '/';
}
else{
layer.msg(data.err_msg, {icon: 5});
}
});
console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value}
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
});

//添加分类目录
form.on('submit(add_category)', function(data){
Expand Down Expand Up @@ -400,4 +413,20 @@ function del_category(id){

layer.close(index);
});
}
}

//弱密码检查
function check_weak_password(){
$.get("/index.php?c=api&method=check_weak_password",function(data,status){
if (data.err_msg === 'Weak password!') {
layui.use('layer', function(){
var layer = layui.layer;

layer.open({
title:'风险提示!',
content: '系统检测到您使用的默认密码,请参考<a href = "https://dwz.ovh/ze1ts" target = "_blank" style = "color:#01AAED;">帮助文档</a>尽快修改!' //这里content是一个普通的String
});
});
}
});
}
Empty file modified templates/admin/static/style.css 100644 → 100755
Empty file.
18 changes: 17 additions & 1 deletion templates/default/index.php 100644 → 100755
Expand Up @@ -100,6 +100,22 @@
<div class="mdui-list-item-content category-name"><i class="fa fa-user-circle"></i> About</div>
</li>
</a>

<?php
if ( !is_login() ) {
?>
<a href="/index.php?c=login" title="手机登录" class="mdui-hidden-sm-up">
<li class="mdui-list-item mdui-ripple">
<div class="mdui-list-item-content category-name"><i class="fa fa-dashboard"></i> 登录</div>
</li>
</a>
<?php } else { ?>
<a href="/index.php?c=admin&page=logout" title="退出" class="mdui-hidden-sm-up">
<li class="mdui-list-item mdui-ripple">
<div class="mdui-list-item-content category-name"><i class="fa fa-dashboard"></i> 退出</div>
</li>
</a>
<?php } ?>
</ul>
</div>
<!--左侧抽屉导航END-->
Expand Down Expand Up @@ -179,7 +195,7 @@
<!--正文内容部分END-->
<!-- footer部分 -->
<footer>
© 2021 Powered by <a target = "_blank" href="https://github.com/helloxz/onenav" title = "简约导航/书签管理器" rel = "nofollow">OneNav</a>.The author is <a href="https://www.xiaoz.me/" target="_blank" title = "小z博客">xiaoz.me</a>
© 2022 Powered by <a target = "_blank" href="https://github.com/helloxz/onenav" title = "简约导航/书签管理器" rel = "nofollow">OneNav</a>.The author is <a href="https://www.xiaoz.me/" target="_blank" title = "小z博客">xiaoz.me</a>
</footer>
<!-- footerend -->
</body>
Expand Down
Empty file modified templates/default/static/embed.js 100644 → 100755
Empty file.
Empty file modified templates/default/static/holmes.js 100644 → 100755
Empty file.
Empty file modified templates/default/static/style.css 100644 → 100755
Empty file.
Empty file modified templates/index.html 100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion version.txt 100644 → 100755
@@ -1 +1 @@
v0.9.12-20210726
v0.9.13-20220214

0 comments on commit 17a3e20

Please sign in to comment.