From 494ee8c0978e63888d7035213d116c05088bdf24 Mon Sep 17 00:00:00 2001 From: xiaoz Date: Wed, 7 Apr 2021 14:56:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0403=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .htaccess | 3 ++- controller/click.php | 13 ++++++++++--- data/.htaccess | 2 -- templates/admin/403.php | 28 ++++++++++++++++++++++++++++ templates/default/index.php | 2 +- version.txt | 2 +- 6 files changed, 42 insertions(+), 8 deletions(-) delete mode 100644 data/.htaccess create mode 100644 templates/admin/403.php diff --git a/.htaccess b/.htaccess index 938af1c..39f777c 100644 --- a/.htaccess +++ b/.htaccess @@ -1,4 +1,5 @@ RewriteEngine On RewriteRule '^click\/(.*)$' /index.php?c=click&id=$1 [L] RewriteRule '^api\/(.*)?(.*)$' /index.php?c=api&method=$1&$2 [L] -RewriteRule login /index.php?c=login [NC,L] \ No newline at end of file +RewriteRule login /index.php?c=login [NC,L] +RewriteRule .*.(db3|rar|gz|json)$ - [F] \ No newline at end of file diff --git a/controller/click.php b/controller/click.php index ccf656b..2809e42 100644 --- a/controller/click.php +++ b/controller/click.php @@ -7,7 +7,9 @@ $id = intval($_GET['id']); //如果链接为空 if(empty($id)) { - exit('无效ID!'); + $msg = '

无效ID!

'; + require('templates/admin/403.php'); + exit(); } //查询链接信息 @@ -17,7 +19,9 @@ $link = $db->get('on_links',['id','fid','url','property','click'],[ //如果查询失败 if( !$link ){ - exit('无效ID!'); + $msg = '

无效ID!

'; + require('templates/admin/403.php'); + exit(); } //查询该ID的父及ID信息 @@ -61,5 +65,8 @@ elseif( is_login() ) { } //其它情况则没有权限 else{ - exit('无权限!'); + $msg = '

很抱歉,该页面是私有的,您无权限访问此页面。

+

如果您是管理员,请尝试登录OneNav后台并重新访问。

'; + require('templates/admin/403.php'); + exit(); } \ No newline at end of file diff --git a/data/.htaccess b/data/.htaccess deleted file mode 100644 index baa56e5..0000000 --- a/data/.htaccess +++ /dev/null @@ -1,2 +0,0 @@ -order allow,deny -deny from all \ No newline at end of file diff --git a/templates/admin/403.php b/templates/admin/403.php new file mode 100644 index 0000000..e9b46b4 --- /dev/null +++ b/templates/admin/403.php @@ -0,0 +1,28 @@ + + + + + 403 error + + + + + + + +
+
+
+
+

403 error

+
+
+ +
+
+ +
+
+
+ + diff --git a/templates/default/index.php b/templates/default/index.php index 7f01028..e93cfe3 100644 --- a/templates/default/index.php +++ b/templates/default/index.php @@ -66,7 +66,7 @@ -
+
diff --git a/version.txt b/version.txt index 204253b..a18e2bc 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v0.9.10-20210406 \ No newline at end of file +v0.9.10-20210407 \ No newline at end of file