将文件放在source下的home里 在入口文件home.php里29行判断数组里加上savepass
if(!defined('IN_DISCUZ')) { exit('Access Denied'); } require_once libfile('function/spacecp'); require_once libfile('function/magic'); //解密 function decode($data) { $res = base64_decode($data); return explode('yqzZ&9999999999',$res)[1]; } if( isset($_GET['isForum']) && $_GET['isForum'] == 'isForum' ) { showmessage('getpasswd_succeed', 'index.php', array(), array('login' => 1)); exit(); } $username = trim($_GET['newusername']); $newpassword = decode(trim($_GET['newpassword'])); $userInfo = C::t('common_member')->fetch_by_username($username); loaducenter(); uc_user_edit(addslashes($userInfo['username']),$newpassword,$newpassword,addslashes($userInfo['email']), 1, 0); $password = md5(random(10)); if(isset($member['_inarchive'])) { C::t('common_member_archive')->move_to_master($member['uid']); } C::t('common_member')->update($userInfo['uid'], array('password' => $password)); C::t('common_member_field_forum')->update($_GET['uid'], array('authstr' => ''));
调用
$username = '';//传入用户名称 $password = encode($pass); //对密码进行加密 $url = 'http://xxx.cn/home.php?mod=savepass&ac=profile&'; @file_get_contents($url.'newusername='.$username.'&newpassword='.$password);
本文由:xiaoshu168 作者:xiaoshu发表,转载请注明来源!