系统的原意是限制注册,但是已经注册过的用户名却也无法登录了,管理员也无法在前台登录!
如果在登录时检查,那么就会有admin这样的用户名无法登录会员中心!怀疑是程序BUG!后来又仔细分析了程序,发现不是先前修改的那一段程序的问题,而是一个思路问题。
在include/memberlogin.class.php文件中,找到以下代码,删除。
1
if
($cfg_mb_notallow !=
''
)
2
{
3
$nas = explode(
','
,$cfg_mb_notallow);
4
if
(in_array($uid,$nas))
5
{
6
return
$msgtitle.
'为系统禁止的标识!'
;
7
}
8
}
9
复制代码
再找到以下代码:1
if
($ckhas)
2
{
3
$row = $dsql->GetOne(
"Select * From `dede_member` where userid like '$uid' "
);
4
if
(is_array($row))
return
$msgtitle.
"已经存在!"
;
5
}
6
复制代码
改为:01
if
($ckhas)
02
{
03
if
($cfg_mb_notallow !=
''
)
04
{
05
$nas = explode(
','
,$cfg_mb_notallow);
06
if
(in_array($uid,$nas))
07
{
08
return
$msgtitle.
'为系统禁止的标识!'
;
09
}
10
}
11
$row = $dsql->GetOne(
"Select * From `dede_member` where userid like '$uid' "
);
12
if
(is_array($row))
return
$msgtitle.
"已经存在!"
;
13
}
14
复制代码
修改后admin登录出现提示:管理员帐号不能从前台登录,这是正确的提示,这样就解决了修改了限制注册的信息后,以前注册的用户不能登录的问题!