我在前一贴 https://discuz.dismall.com/thread-1190014-1-1.html 中发表过论坛免激活的代码,这一贴中是针对6.1版本的,应网友要求,现发布7.0版的免激活代码;
以下是操作步骤:
1、找到根目录下api/uc.php,查找“function synlogin($get, $post) ”,再找出-
- } else {
- _setcookie('cookietime', $cookietime, 31536000);
- _setcookie('loginuser', $username, $cookietime);
- _setcookie('activationauth', _authcode($username, 'ENCODE', $discuz_auth_key), $cookietime);
- }
复制代码 2、把上段这段else里的三个_setcookie全部注释掉,用以下代码替换
- $member = array();
- $member[uid] = $uid;
- $member[username] = $username;
- $member[email] = empty($get['email'])?'':$get['email'];
- $member[password] = md5(time().rand(100000, 999999));
- $member[secques] = '';
- $this->db->query("INSERT INTO {$this->tablepre}members (uid,username,email,password,groupid,regip,regdate,timeoffset) VALUES ('{$member[uid]}','{$member[username]}','{$member[email]}','{$member[password]}',10,'', '$timestamp',9999)");
- _setcookie('sid', '', -86400 * 365);
- _setcookie('cookietime', $cookietime, 31536000);
- _setcookie('auth', _authcode("$member[password]\t$member[secques]\t$member[uid]", 'ENCODE', $discuz_auth_key), $cookietime);
复制代码 3、注意是HOME登录之后,再到论坛就可以免激活; |