function setSafecv($question, $customquest, $answer) { global $db_ifsafecv; if ($db_ifsafecv) { require_once R_P . 'require/checkpass.php'; $this->data['safecv'] = questcode($question, $customquest, $answer); } }
S::gp(array('groupid', 'groups', 'username', 'password', 'check_pwd', 'email', 'publicmail', 'receivemail', 'regdate', 'yz', 'userip', 'facetype', 'proicon', 'delupload', 'postnum', 'rvrc', 'money', 'deposit', 'ddeposit', 'credit', 'currency', 'onlinetime', 'site', 'location', 'oicq', 'icq', 'msn', 'aliww', 'yahoo', 'honor', 'gender', 'year', 'month', 'day', 'signature', 'introduce', 'banpm', 'question', 'customquest', 'answer', 'creditdb'), 'P'); $basename .= "&action=edit&uid={$uid}"; $upmembers = $uc_edit = array(); $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $oldinfo = $userService->get($uid); if ($password != '') { $password != $check_pwd && adminmsg('password_confirm'); $upmembers['password'] = md5($password); $uc_edit['password'] = md5($password); } if ($email && $email != $oldinfo['email']) { $uc_edit['email'] = $email; } if ($question != '-2') { $upmembers['safecv'] = questcode($question, $customquest, $answer); } $newgroups = $groups ? ',' . implode(',', $groups) . ',' : ''; $newgroups = str_replace(',' . $groupid . ',', ',', $newgroups); if (($oldinfo['groupid'] == '3' || strpos($oldinfo['groups'], ',3,') !== false) && !If_manager) { adminmsg('manager_right'); } elseif ($oldinfo['groupid'] != '3' && ($groupid == '3' || strpos($newgroups, ',3,') !== false) && !If_manager) { adminmsg('manager_right'); } if (ifadmin($oldinfo['username']) && $groupid != '5' && strpos($newgroups, ',5,') === false) { if (strpos($oldinfo['groups'], ',5,') !== false) { adminmsg('setuser_forumadmin'); } else { $newgroups .= $newgroups ? '5,' : ',5,'; } } elseif (!ifadmin($oldinfo['username']) && ($groupid == '5' || strpos($newgroups, ',5,') !== false)) {
//job sign initJob($winduid, "doUpdatedata"); refreshto("profile.php?action=modify&info_type={$info_type}", 'operate_success', 2, true); } elseif ($_POST['step'] == '3') { PostCheck(); !$_G['userbinding'] && Showmsg('undefined_action'); InitGP(array('username', 'password', 'question', 'customquest', 'answer')); require_once R_P . 'require/checkpass.php'; if (empty($username) || empty($password)) { Showmsg('login_empty'); } if ($username == $windid) { Showmsg('userbinding_same'); } $password = md5($password); $safecv = $db_ifsafecv ? questcode($question, $customquest, $answer) : ''; $db_logintype = 1; $logininfo = checkpass($username, $password, $safecv, 0); if (!is_array($logininfo)) { Showmsg($logininfo); } list($uid) = $logininfo; $arr = array(); $query = $db->query("SELECT id,uid FROM pw_userbinding WHERE uid IN(" . pwImplode(array($winduid, $uid)) . ")"); while ($rt = $db->fetch_array($query)) { $arr[$rt['uid']] = $rt; } if (empty($arr)) { $db->update("INSERT INTO pw_userbinding SET " . pwSqlSingle(array('uid' => $winduid, 'password' => $userdb['password']))); $id = $db->insert_id(); $db->update("INSERT INTO pw_userbinding SET " . pwSqlSingle(array('id' => $id, 'uid' => $uid, 'password' => $password)));
$L_T = 1200 - ($timestamp - pwFilemtime($bbsrecordfile)); $L_left = 15 - $F_count; if ($F_count > 15 && $L_T > 0) { $db_adminrecord = 0; Cookie('AdminUser', '', 0); adminmsg('login_fail'); } if (empty($manager)) { include PrintEot('unloginleft'); adminmsg('sql_config'); } $CK = array(); $admin_name = ''; if ($_POST['admin_pwd'] && $_POST['admin_name']) { $admin_name = stripcslashes($_POST['admin_name']); $safecv = $db_ifsafecv ? questcode($_POST['question'], $_POST['customquest'], $_POST['answer']) : ''; $CK = array($timestamp, $_POST['admin_name'], md5(PwdCode(md5($_POST['admin_pwd'])) . $timestamp), $safecv); Cookie('AdminUser', StrCode(implode("\t", $CK))); } else { $AdminUser = GetCookie('AdminUser'); if ($AdminUser) { $CK = explode("\t", StrCode($AdminUser, 'DECODE')); $admin_name = stripcslashes($CK[1]); } } if (!empty($CK)) { require_once Pcv(R_P . "require/db_{$database}.php"); $db = new DB($dbhost, $dbuser, $dbpw, $dbname, $PW, $charset, $pconnect); $rightset = checkpass($CK); } else { $db = null;
list($authStep, $remainTime, $waitTime, $mobile) = $authService->getStatus('findpwd'); $authStep_1 = $authStep_2 = 'none'; ${'authStep_' . $authStep} = ''; $verifyUsername = $authStep == 1 ? '' : getCookie('findpwd_verifyUsername'); } require_once PrintEot('sendpwd'); footer(); } else { PostCheck(0, $db_gdcheck & 16); S::gp(array('type', 'pwuser', 'email', 'authmobile', 'question', 'customquest', 'answer')); $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $userarray = $userService->getByUserName($pwuser); if ($db_ifsafecv) { require_once R_P . 'require/checkpass.php'; $safecv = questcode($question, $customquest, $answer); if ($userarray['safecv'] != $safecv) { Showmsg('safecv_error', 1); } } if ($userarray) { if ($type == 1) { //手机取回 S::gp(array('authverify', 'new_pwd', 'pwdreapt')); $authService = L::loadClass('Authentication', 'user'); if (!$authService->checkverify($authmobile, $userarray['uid'], $authverify)) { Showmsg('手机验证码填写错误', 1); } if (!$new_pwd || $new_pwd != $pwdreapt) { Showmsg('password_confirm', 1); } else {
InitGP(array('step')); if (2 == $step) { $loginq = 0; //验证问题去除,自动通过 $db_gdcheck = 0; //验证码去除,自动通过 PostCheck(0, $db_gdcheck & 2, $loginq, 0); //from login.php require_once R_P . 'require/checkpass.php'; InitGP(array('pwuser', 'pwpwd', 'question', 'customquest', 'answer', 'cktime', 'hideid', 'jumpurl', 'lgt', 'keepyear'), 'P'); InitGP(array('isfollow')); if (!$pwuser || !$pwpwd) { Showmsg('login_empty'); } $loginUser = array('username' => $pwuser, 'password' => md5($pwpwd)); $loginUser['safecv'] = $db_ifsafecv ? questcode($question, $customquest, $answer) : ''; list($winduid, $groupid, $windpwd, $showmsginfo) = processLogin(null, $loginUser, $cktime, $lgt); require_once file_exists(D_P . "data/groupdb/group_{$groupid}.php") ? Pcv(D_P . "data/groupdb/group_{$groupid}.php") : D_P . "data/groupdb/group_1.php"; $_G['allowhide'] && $hideid ? Cookie('hideid', "1", $cktime) : Loginipwrite($winduid); if (GetCookie('o_invite') && $db_modes['o']['ifopen'] == 1) { list($o_u, $hash, $app) = explode("\t", GetCookie('o_invite')); if (is_numeric($o_u) && strlen($hash) == 18) { require_once R_P . 'require/o_invite.php'; } } if (empty($jumpurl) || false !== strpos($jumpurl, $regurl)) { $jumpurl = isset($sessionInfo['sessiondata']['httpReferer']) ? $sessionInfo['sessiondata']['httpReferer'] : $db_bfn; } //passport if ($db_pptifopen && $db_ppttype == 'server' && ($db_ppturls || $forward)) { $tmp = $jumpurl;
} if ($_POST['propublicemail'] != getstatus($userdb['userstatus'], PW_USERSTATUS_PUBLICMAIL)) { $userService->setUserStatus($winduid, PW_USERSTATUS_PUBLICMAIL, (int) $_POST['propublicemail']); } } else { $proemail = $userdb['email']; } if ($proemail && !preg_match('/^[-a-zA-Z0-9_\\.]+\\@([0-9A-Za-z][0-9A-Za-z-]+\\.)+[A-Za-z]{2,5}$/', $proemail)) { Showmsg('illegal_email'); } //密码修改问题 if ($db_ifsafecv && $question != '-2') { $safecv = ''; if ($db_ifsafecv) { require_once R_P . 'require/checkpass.php'; $safecv = questcode($question, $_POST['customquest'], $_POST['answer']); } $upmembers['safecv'] = $safecv; } $pwSQL = array_merge($upmembers, array('email' => $proemail)); //update memdata if ($upmemdata) { $userService->update($winduid, array(), $upmemdata); } //update meminfo if ($upmeminfo) { updateThreadTrade($upmeminfo, $winduid); } unset($upmemdata, $upmeminfo); $result = $userService->update($winduid, $pwSQL); // defend start