宝马娱乐在线112222 > 网络应用 > discuz免激活同步登入代码修改方法

原标题:discuz免激活同步登入代码修改方法

浏览次数:178 时间:2019-10-01

如果论坛不唯一邮箱太多,又不能挨个修改,只能通过程序解决,防止修改的密码的时候报错。具体修改如下:

discuz免激活同步登入代码修改方法

 无需激活直接同步登入discuz,测试版本:discuz! x3,理论也支持2.5,大家测试再用吧

 代码如下:

//打开discuz/api/uc.php

//synlogin方法(180行)处,往下找到

if(($member = getuserbyuid($uid, 1))) {

    dsetcookie('auth', authcode("$member[password]t$member[uid]", 'ENCODE'), $cookietime);

}

 

 

//改为

if(($member = getuserbyuid($uid, 1))) {

    dsetcookie('auth', authcode("$member[password]t$member[uid]", 'ENCODE'), $cookietime);

} else {

    if(!function_exists('uc_get_user')) {

        loaducenter();

    }

    $user = uc_get_user($uid, 1);

    if($user) {

        $time = time();

        DB::query("REPLACE INTO ".DB::table('common_member')." SET `uid`='{$user[0]}' , `username`='{$user[1]}' , `password`='".md5(random(10))."' , `email`='{$user[2]}' , `adminid`='0' , `groupid`='10' , `regdate`='{$time}' , `emailstatus`='0' , `credits`='0' , `timeoffset`='9999'");

        DB::query("REPLACE INTO ".DB::table('common_member_status')." SET `uid`='{$user[0]}' , `regip`='{$_G['clientip']}' , `lastip`='{$_G['clientip']}' , `lastvisit`='{$time}' , `lastactivity`='' , `lastpost`='0' , `lastsendmail`='0'");

        DB::query("REPLACE INTO ".DB::table('common_member_count')." SET `uid`='{$user[0]}' , `extcredits1`='0' , `extcredits2`='0' , `extcredits3`='0' , `extcredits4`='0' , `extcredits5`='0' , `extcredits6`='0' , `extcredits7`='0' , `extcredits8`='0'");

        DB::query("REPLACE INTO ".DB::table('common_member_profile')." SET `uid`='{$user[0]}'");

        DB::query("REPLACE INTO ".DB::table('common_member_field_forum')." SET `uid`='{$user[0]}'");

        DB::query("REPLACE INTO ".DB::table('common_member_field_home')." SET `uid`='{$user[0]}'");

        DB::query("UPDATE ".DB::table('common_stat')." SET `register`=`register`+1 WHERE `daytime` = '".date('Ymd', $time)."'");

        if(($member = getuserbyuid($uid, 1))) {

            dsetcookie('auth', authcode("$member[password]t$member[uid]", 'ENCODE'), $cookietime);

        }

    }

}

 

 

http://www.bkjia.com/PHPjc/1238609.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1238609.htmlTechArticlediscuz免激活同步登入代码修改方法 无需激活直接同步登入discuz,测试版本:discuz! x3,理论也支持2.5,大家测试再用吧 代码如下: //打开discuz/a...

找到:


$ucresult = uc_user_edit($discuz_user, $oldpassword, $newpassword, $emailnew, 0, $questionidnew, $answernew);

在上面增加


if($emailnew==$member[email]){$emailnew="";$emailnew1=$member[email];}else{$emailnew1=$emailnew;}

本文由宝马娱乐在线112222发布于网络应用,转载请注明出处:discuz免激活同步登入代码修改方法

关键词:

上一篇:ThinkPHP控制器里javascript代码不能执行的解决方法

下一篇:没有了