ShopEx与Discuz论坛(Ucenter)整合以及限制UID登录

Share on:

最近碰到一个客户,需求是以限制UID限制Ucenter用户登录shopex系统,我也研究了下ShopEx与Discuz论坛(Ucenter)整合,发现确实强大无比。

我按照官网的ShopEx与Discuz论坛(Ucenter)整合说明整合了两个系统。

实现以限制UID限制Ucenter用户登录shopex系统方法如下

core\shop\controller\ctl.passport.php找到约554行

if ((is_array($uinfo)&&intval($uinfo[0])>0)||$info = $memberObj->verifyLogin($_POST['login'],$_POST['passwd'],$message)){

替换成

if ((is_array($uinfo)&&intval($uinfo[0])>2&&$uinfo[0]<5)||$info = $memberObj->verifyLogin($_POST['login'],$_POST['passwd'],$message)){

intval($uinfo[0])>2&&$uinfo[0]<5) 的意思是 UID>2且<5才能登录系统

前提是Ucenter用户均未登录过shopex系统,因为登录过后shopex系统会插入Ucenter用户的用户信息,导致限制不准确。

 

闽ICP备12003472号-7