ecshop整合Discuz6.1后怎样可以不激活直接让用户登录?
现在整合完了可是ec的用户第一次到dz登录时候还需要激活,感觉和从新注册一样了,有什么办法避免激活么?...
现在整合完了 可是ec的用户第一次到dz登录时候还需要激活,感觉和从新注册一样了,有什么办法避免激活么?
展开
推荐于2016-05-21
展开全部
一、ecshop注册无法和discuz同步账号?
解决办法:在shop的注册代码里加了$user->login($username, $password);$ucdata = isset($user->ucdata)? $user->ucdata : '';。
二、怎样能让EC的用户直接在DZ里面登陆不需要激活?
api/uc.php里找到synlogin方法,在
if($member = DB::fetch($query)) {
dsetcookie('auth', authcode("$member[password]\t$member[uid]", 'ENCODE'), $cookietime);
}
后加入
else
{
$username = $get['username'];
$password = md5(time().rand(100000, 999999));
$email = $get['email'];
$ip = $_SERVER['REMOTE_ADDR'];
$time = time();
$userdata = array(
'uid' => $uid,
'username' => $username,
'password' => $password,
'email' => $email,
'adminid' => 0,
'groupid' => 10,
'regdate' => $time,
'credits' => 0,
'timeoffset' => 9999
);
DB::insert('common_member', $userdata);
$status_data = array(
'uid' => $uid,
'regip' => $ip,
'lastip' => $ip,
'lastvisit' => $time,
'lastactivity' => $time,
'lastpost' => 0,
'lastsendmail' => 0,
);
DB::insert('common_member_status', $status_data);
DB::insert('common_member_profile', array('uid' => $uid));
DB::insert('common_member_field_forum', array('uid' => $uid));
DB::insert('common_member_field_home', array('uid' => $uid));
$query = DB::query("SELECT uid, username, password FROM ".DB::table('common_member')." WHERE uid='$uid'");
if($member = DB::fetch($query))
{
dsetcookie('auth', authcode("$member[password]\t$member[uid]", 'ENCODE'), $cookietime);
}
}
三、在ecshop新注册的账号直接在同步登陆的dx系统里登出,ecshop无法同步登出?
在ecshop新注册的账号直接在同步登陆的dx系统里登出,ecshop无法同步登出(但重新登录的用户名可以做到登录登出的完美同步),仔细对比了cookie,,由于shop里(modules/intergrates /ucenter.php)清除cookie的方法写的是
setcookie("ECS[user_id]", '');
setcookie("ECS[password]", '');
没有指定cookie_path,改为
setcookie("ECS[user_id]", '', $time, $this->cookie_path);
setcookie("ECS[password]", '', $time, $this->cookie_path);
解决办法:在shop的注册代码里加了$user->login($username, $password);$ucdata = isset($user->ucdata)? $user->ucdata : '';。
二、怎样能让EC的用户直接在DZ里面登陆不需要激活?
api/uc.php里找到synlogin方法,在
if($member = DB::fetch($query)) {
dsetcookie('auth', authcode("$member[password]\t$member[uid]", 'ENCODE'), $cookietime);
}
后加入
else
{
$username = $get['username'];
$password = md5(time().rand(100000, 999999));
$email = $get['email'];
$ip = $_SERVER['REMOTE_ADDR'];
$time = time();
$userdata = array(
'uid' => $uid,
'username' => $username,
'password' => $password,
'email' => $email,
'adminid' => 0,
'groupid' => 10,
'regdate' => $time,
'credits' => 0,
'timeoffset' => 9999
);
DB::insert('common_member', $userdata);
$status_data = array(
'uid' => $uid,
'regip' => $ip,
'lastip' => $ip,
'lastvisit' => $time,
'lastactivity' => $time,
'lastpost' => 0,
'lastsendmail' => 0,
);
DB::insert('common_member_status', $status_data);
DB::insert('common_member_profile', array('uid' => $uid));
DB::insert('common_member_field_forum', array('uid' => $uid));
DB::insert('common_member_field_home', array('uid' => $uid));
$query = DB::query("SELECT uid, username, password FROM ".DB::table('common_member')." WHERE uid='$uid'");
if($member = DB::fetch($query))
{
dsetcookie('auth', authcode("$member[password]\t$member[uid]", 'ENCODE'), $cookietime);
}
}
三、在ecshop新注册的账号直接在同步登陆的dx系统里登出,ecshop无法同步登出?
在ecshop新注册的账号直接在同步登陆的dx系统里登出,ecshop无法同步登出(但重新登录的用户名可以做到登录登出的完美同步),仔细对比了cookie,,由于shop里(modules/intergrates /ucenter.php)清除cookie的方法写的是
setcookie("ECS[user_id]", '');
setcookie("ECS[password]", '');
没有指定cookie_path,改为
setcookie("ECS[user_id]", '', $time, $this->cookie_path);
setcookie("ECS[password]", '', $time, $this->cookie_path);
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询