thinkphp整合SMF论坛COOKIE

thinkphp整合SMF论坛COOKIE,如果存在SMF论坛的COOKIE就写入thinkphp的SESSION的状态代码

//thinkphp 整合SMF论坛COOKIE
	$cookeie = unserialize($_COOKIE[SMFCookie842]);
        if ($cookeie[0]){
        	$userid =$cookeie[0];
			$getname=$this->smfbbs_select_userid($userid);
			// dump($getname);
		$username = $getname["0"][member_name];
        $shaf1 = $getname["0"][passwd] . $getname["0"][password_salt];
        $password1 = $cookeie[1];
        $password2 = sha1($shaf1);
        $rset = D("User")->queryUserByName($username);
        if ($rset) {
        	if ($rset['account_status'] == '0') {
        		echo "用户被锁定";
        		return false;
        	}
        	if ($password1 == $password2 && ($rset['account_status']=='1' || $rset['account_status']=='2')) { //login successfully

        		$_SESSION['userinfo'] = $rset;
                $_SESSION['cityos_user_id']  = $rset['cityos_user_id']; //cityos_user_id
                setcookie("wordpress_on",  "1",   time()+3600, "/", ".paopao8.com", 0);

        }
        }
		}
		//结束
© 版权声明
THE END
喜欢就支持以下吧
点赞0 分享