Maison  >  Article  >  développement back-end  >  discuz免激活同步登入代码修改方法(discuz同步登录)_PHP教程

discuz免激活同步登入代码修改方法(discuz同步登录)_PHP教程

WBOY
WBOYoriginal
2016-07-13 17:18:261276parcourir

复制代码 代码如下:

//打开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);
        }
    }
}

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/621671.htmlTechArticle复制代码 代码如下: //打开discuz/api/uc.php //synlogin方法(180行)处,往下找到 if(($member = getuserbyuid($uid, 1))) { dsetcookie('auth', authcode("$member[pas...
Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn