Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
huangxuan258
whatsns内容付费问答系统
提交
6f48c94d
whatsns内容付费问答系统
项目概览
huangxuan258
/
whatsns内容付费问答系统
2021-04-29 05:05:01同步失败
通知
3
Star
2
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
whatsns内容付费问答系统
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6f48c94d
编写于
5月 12, 2020
作者:
huangxuan258
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复开启游客禁止访问后手机找回密码页面不能访问跳登录页面问题
上级
d6d44f47
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
18 deletion
+18
-18
system/core/Controller.php
system/core/Controller.php
+18
-18
未找到文件。
system/core/Controller.php
浏览文件 @
6f48c94d
...
...
@@ -98,7 +98,7 @@ class CI_Controller {
$this
->
isinstall
();
$this
->
init_cache
();
//$this->checkurl ();
//
$this->checkurl ();
$this
->
init_user
();
$this
->
banned
();
...
...
@@ -132,19 +132,18 @@ class CI_Controller {
// 获取访问页面的后缀,可能是html,php或者别的后缀
$_fix
=
$p
[
'extension'
];
//如果网页带参数,提取参数前的后缀
if
(
strstr
(
$_fix
,
'?'
))
{
$_fix
=
substr
(
$_fix
,
0
,
strrpos
(
$_fix
,
'?'
)
);
//
如果网页带参数,提取参数前的后缀
if
(
strstr
(
$_fix
,
'?'
))
{
$_fix
=
substr
(
$_fix
,
0
,
strrpos
(
$_fix
,
'?'
)
);
}
if
(
strstr
(
$url
,
'index.php?'
)
||
$this
->
uri
->
rsegments
[
1
]
==
'rss'
||
$this
->
uri
->
rsegments
[
1
]
==
'user'
||
$this
->
uri
->
rsegments
[
1
]
==
'appstore'
||
$this
->
uri
->
rsegments
[
1
]
==
'custom'
||
$this
->
uri
->
rsegments
[
1
]
==
'pay'
||
$this
->
uri
->
rsegments
[
1
]
==
'ebank'
||
$this
->
uri
->
rsegments
[
1
]
==
'api_user'
||
strstr
(
$this
->
uri
->
rsegments
[
1
],
'app_'
)){
}
else
{
// 判断是否是首页
if
(
strstr
(
$url
,
'index.php?'
)
||
$this
->
uri
->
rsegments
[
1
]
==
'rss'
||
$this
->
uri
->
rsegments
[
1
]
==
'user'
||
$this
->
uri
->
rsegments
[
1
]
==
'appstore'
||
$this
->
uri
->
rsegments
[
1
]
==
'custom'
||
$this
->
uri
->
rsegments
[
1
]
==
'pay'
||
$this
->
uri
->
rsegments
[
1
]
==
'ebank'
||
$this
->
uri
->
rsegments
[
1
]
==
'api_user'
||
strstr
(
$this
->
uri
->
rsegments
[
1
],
'app_'
))
{
}
else
{
// 判断是否是首页
if
(
strstr
(
$regular
,
'index/index'
))
{
// 如果是首页只允许后缀是 php或者后台配置的后缀
if
(
$_fix
&&
$_fix
!=
trim
(
$setting
[
'seo_suffix'
],
'.'
))
{
//同时后缀也不等于默认的php
//
同时后缀也不等于默认的php
if
(
$_fix
!=
'php'
)
{
show_404
();
}
...
...
@@ -152,25 +151,23 @@ class CI_Controller {
}
else
{
// 判断如果不是后台seo设置得网页后缀或者不是分类栏目地址就返回404
if
(
strstr
(
$regular
,
'seo/index'
)
||
strstr
(
$regular
,
'ask/index'
)
||
strstr
(
$regular
,
'category/view'
)
||
strstr
(
$regular
,
'topic/catlist'
))
{
// 去掉文章栏目和问题栏目的url尾巴
// 栏目白名单 ,如果有后缀就返回404,和后台配置相同除外
// 栏目白名单 ,如果有后缀就返回404,和后台配置相同除外
if
(
$_fix
&&
$_fix
!=
trim
(
$setting
[
'seo_suffix'
],
'.'
))
{
show_404
();
}
}
else
{
if
(
strstr
(
$regular
,
'/index'
)){
//排除首页分享
}
else
{
if
(
strstr
(
$regular
,
'/index'
))
{
//
排除首页分享
}
else
{
// 非栏目页面判断网址后缀是否是后台配置默认的网址后缀
if
(
$_fix
!=
trim
(
$setting
[
'seo_suffix'
],
'.'
))
{
show_404
();
}
}
}
}
}
}
// 检查是否已经安装
function
isinstall
()
{
...
...
@@ -216,7 +213,7 @@ class CI_Controller {
if
(
$this
->
setting
[
'needlogin'
]
==
1
)
{
$method
=
$this
->
uri
->
segments
[
2
];
if
(
$this
->
uri
->
segments
[
1
]
!=
'account'
&&
$this
->
uri
->
segments
[
1
]
!=
'plugin_weixin'
&&
$this
->
uri
->
segments
[
1
]
!=
'pccaiji_question'
&&
$this
->
uri
->
segments
[
1
]
!=
'pccaiji_catgory'
&&
$this
->
uri
->
segments
[
1
]
!=
'api_user'
&&
$method
!=
'code'
&&
$method
!=
'login'
&&
$method
!=
'register'
&&
$method
!=
'getpass'
&&
$method
!=
'resetpass'
&&
$method
!=
'checkemail'
&&
$method
!=
'getsmscode'
)
{
if
(
$this
->
uri
->
segments
[
1
]
!=
'account'
&&
$this
->
uri
->
segments
[
1
]
!=
'plugin_weixin'
&&
$this
->
uri
->
segments
[
1
]
!=
'pccaiji_question'
&&
$this
->
uri
->
segments
[
1
]
!=
'pccaiji_catgory'
&&
$this
->
uri
->
segments
[
1
]
!=
'api_user'
&&
$method
!=
'code'
&&
$method
!=
'login'
&&
$method
!=
'register'
&&
$method
!=
'ajaxsendpwdmail'
&&
$method
!=
'getsmscode'
&&
$method
!=
'getpwdsmscode'
&&
$method
!=
'getphonepass'
&&
$method
!=
'getpass'
&&
$method
!=
'resetpass'
&&
$method
!=
'checkemail'
&&
$method
!=
'getsmscode'
)
{
$url
=
url
(
'user/login'
);
header
(
"Location:
$url
"
);
...
...
@@ -239,7 +236,7 @@ class CI_Controller {
$user
[
'avatar'
]
=
get_avatar_dir
(
$user
[
'uid'
]
);
$user
=
$this
->
user
=
array_merge
(
$user
,
$this
->
usergroup
[
$user
[
'groupid'
]]
);
if
(
$user
[
'uid'
])
{
if
(
$user
[
'uid'
])
{
// 如果用户登录,且携带邀请被邀请注册的邀请码,则自动成为被邀请人
// frominvatecode
if
(
!
isset
(
$user
[
'frominvatecode'
]
))
{
...
...
@@ -654,6 +651,9 @@ class CI_Controller {
* $ishtml=1 表示是跳转到静态网页
*/
function
message
(
$message
,
$url
=
''
)
{
if
(
trim
(
$url
)
==
'index'
||
trim
(
$url
)
==
'index/index'
){
$url
=
''
;
}
$seotitle
=
'操作提示'
;
if
(
''
==
$url
)
{
$redirect
=
isset
(
$_SERVER
[
'HTTP_REFERER'
]
)
?
$_SERVER
[
'HTTP_REFERER'
]
:
base_url
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录