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