function run() { $db_md_ifopen = $this->getVar('db_md_ifopen'); if ($db_md_ifopen) { $winduid = $this->getVar('winduid'); require_once R_P . 'require/functions.php'; doMedalBehavior($winduid, 'continue_login'); } }
function run() { $winduid = $this->getVar('winduid'); $winddb = $this->getVar('winddb'); $db_md_ifopen = $this->getVar('db_md_ifopen'); if ($db_md_ifopen) { require_once R_P . 'require/functions.php'; doMedalBehavior($winduid, 'continue_thread_post'); doMedalBehavior($winduid, 'continue_post', $winddb['lastpost']); $medalservice = L::loadClass('medalservice', 'medal'); $medalservice->runAutoMedal($winddb, 'post', $winddb['postnum'], 1); } }
function synlogin($user) { global $timestamp, $uc_key; list($winduid, $windid, $windpwd) = explode("\t", $this->base->strcode($user, false)); header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'); $safecv = ''; $cktime = 31536000; $cktime != 0 && ($cktime += $timestamp); Cookie("winduser", StrCode($winduid . "\t" . PwdCode($windpwd) . "\t" . $safecv), $cktime); Cookie("ucuser", StrCode($winduid . "\t" . md5($uc_key . $windpwd)), $cktime); Cookie('lastvisit', '', 0); //鑾峰彇鍕嬬珷_start require_once R_P . 'require/functions.php'; doMedalBehavior($winduid, 'continue_login'); //鑾峰彇鍕嬬珷_end return ''; }
function run() { $db_md_ifopen = $this->getVar('db_md_ifopen'); $winduid = $this->getVar('winduid'); $winddb = $this->getVar('winddb'); $tpcarray = $this->getVar('tpcarray'); require_once R_P . 'require/functions.php'; doMedalBehavior($winduid, 'continue_post', $winddb['lastpost']); if ($db_md_ifopen) { $medalservice = L::loadClass('medalservice', 'medal'); $medalservice->runAutoMedal($winddb, 'post', $winddb['postnum'], 1); } if (!$tpcarray['replies']) { $userServer = L::loadClass('UserService', 'user'); $userServer->updateByIncrement($winduid, array(), array('shafa' => 1)); if ($db_md_ifopen) { $medalservice->runAutoMedal($winddb, 'shafa', $winddb['shafa'] + 1, 1); } } }
!defined('P_W') && exit('Forbidden'); S::gp(array('uid')); $db_logintype = 2; require_once R_P . 'require/checkpass.php'; $id = $db->get_value("SELECT id FROM pw_userbinding WHERE uid=" . S::sqlEscape($winduid)); $user = $db->get_one("SELECT s.password,m.uid,m.safecv FROM pw_userbinding s LEFT JOIN pw_members m ON s.uid=m.uid WHERE s.id=" . S::sqlEscape($id) . ' AND s.uid=' . S::sqlEscape($uid)); $logininfo = checkpass($user['uid'], $user['password'], $user['safecv'], 1); if (!is_array($logininfo)) { switch ($logininfo) { case 'login_forbid': case 'login_pwd_error': Showmsg('switchuser_error'); default: Showmsg($logininfo); } } list($winduid, $groupid, $windpwd, $showmsginfo) = $logininfo; $cktime = 7 * 24 * 3600; (int) $keepyear && ($cktime = 31536000); $cktime != 0 && ($cktime += $timestamp); Cookie("winduser", StrCode($winduid . "\t" . $windpwd . "\t" . $user['safecv']), $cktime); Cookie("ck_info", $db_ckpath . "\t" . $db_ckdomain); //Cookie("ucuser",'cc',$cktime); Cookie('lastvisit', '', 0); //鑾峰彇鍕嬬珷_start require_once R_P . 'require/functions.php'; doMedalBehavior($winduid, 'continue_login'); //鑾峰彇鍕嬬珷_end echo "ok\t{$showmsginfo}"; ajax_footer();
function weiboResetUserPassword($userId, $password, $repeatPassword) { global $db_ckpath, $db_ckdomain; if ('' == $password || '' == $repeatPassword) { Showmsg('创建密码不能为空'); } $rg_config = L::reg(); list($rg_regminpwd, $rg_regmaxpwd) = explode("\t", $rg_config['rg_pwdlen']); $register = L::loadClass('Register', 'user'); $register->checkPwd($password, $repeatPassword); $weiboLoginService = L::loadClass('WeiboLoginService', 'sns/weibotoplatform/service'); /* @var $weiboLoginService PW_WeiboLoginService */ $isSuccess = $weiboLoginService->resetLoginUserPassword($userId, $password); if (!$isSuccess) { return false; } $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $user = $userService->get($userId); Cookie("winduser", StrCode($userId . "\t" . PwdCode($user['password']) . "\t" . $user['safecv'])); Cookie("ck_info", $db_ckpath . "\t" . $db_ckdomain); Cookie('lastvisit', '', 0); //自动获取勋章_start require_once R_P . 'require/functions.php'; doMedalBehavior($userId, 'continue_login'); //自动获取勋章_end return true; }
function wap_login($username, $password, $safecv, $lgt = 0) { global $db, $timestamp, $onlineip, $db_ckpath, $db_ckdomain, $db_bbsurl, $db_ifsafecv; $men = $db->get_one("SELECT m.uid,m.password,m.safecv,m.groupid,m.yz,md.onlineip FROM pw_members m LEFT JOIN pw_memberdata md ON md.uid=m.uid WHERE m." . ($lgt ? 'uid' : 'username') . "=" . pwEscape($username)); if ($men) { $e_login = explode("|", $men['onlineip']); if ($e_login[0] != $onlineip . ' *' || $timestamp - $e_login[1] > 600 || $e_login[2] > 1) { $men_uid = $men['uid']; $men_pwd = $men['password']; $check_pwd = $password; if ($men['yz'] > 2) { wap_msg('login_jihuo'); return; } if (strlen($men_pwd) == 16) { $check_pwd = substr($password, 8, 16); } if ($men_pwd == $check_pwd && (!$db_ifsafecv || $men['safecv'] == $safecv)) { if (strlen($men_pwd) == 16) { $db->update("UPDATE pw_members SET password="******" WHERE uid=" . pwEscape($men_uid)); } $L_groupid = (int) $men['groupid']; Cookie("ck_info", $db_ckpath . "\t" . $db_ckdomain); } else { global $L_T; $L_T = $e_login[2]; $L_T ? $L_T-- : ($L_T = 5); $F_login = "******"; $db->update("UPDATE pw_memberdata SET onlineip=" . pwEscape($F_login) . " WHERE uid=" . pwEscape($men_uid)); wap_msg('login_pwd_error'); return; } } else { global $L_T; $L_T = 600 - ($timestamp - $e_login[1]); wap_msg('login_forbid'); return; } } else { global $errorname; $errorname = $username; wap_msg('user_not_exists'); return; } Cookie("winduser", StrCode($men_uid . "\t" . PwdCode($password) . "\t" . $safecv)); Cookie('lastvisit', '', 0); //自动获取勋章_start require_once R_P . 'require/functions.php'; doMedalBehavior($men_uid, 'continue_login'); //自动获取勋章_end wap_msg('wap_login', 'index.php'); }
function processLogin($userId, $user = null, $cktime = '31536000', $lgt = 0) { global $timestamp, $db_ckpath, $db_ckdomain, $db_autoban; if (!$user) { $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $user = $userService->get($userId, true, true); } $pwuser = $user['username']; $md5_pwpwd = $user['password']; $safecv = $user['safecv']; require_once R_P . 'require/checkpass.php'; $logininfo = checkpass($pwuser, $md5_pwpwd, $safecv, $lgt); if (!is_array($logininfo)) { Showmsg($logininfo); } list($winduid, , $windpwd, ) = $logininfo; /*update cache*/ $_cache = getDatastore(); $_cache->delete("UID_" . $winduid); $cktime != 0 && ($cktime += $timestamp); Cookie("winduser", StrCode($winduid . "\t" . $windpwd . "\t" . $safecv), $cktime); Cookie("ck_info", $db_ckpath . "\t" . $db_ckdomain); Cookie('lastvisit', '', 0); //将$lastvist清空以将刚注册的会员加入今日到访会员中 //自动获取勋章_start require_once R_P . 'require/functions.php'; doMedalBehavior($winduid, 'continue_login'); //自动获取勋章_end if ($db_autoban) { require_once R_P . 'require/autoban.php'; autoban($winduid); } return $logininfo; }
/** * 获取用户信息 */ function User_info() { global $db, $timestamp, $db_onlinetime, $winduid, $windpwd, $bday, $safecv, $db_ifonlinetime, $c_oltime, $onlineip, $db_ipcheck, $tdtime, $montime, $db_ifsafecv, $db_ifpwcache, $uc_server, $db_md_ifopen; PwNewDB(); $detail = getUserByUid($winduid); if (empty($detail) && $uc_server) { require_once R_P . 'require/ucuseradd.php'; } $loginout = 0; if ($db_ipcheck && strpos($detail['onlineip'], $onlineip) === false) { $iparray = explode('.', $onlineip); strpos($detail['onlineip'], $iparray[0] . '.' . $iparray[1]) === false && ($loginout = 1); } if (!$detail || PwdCode($detail['password']) != $windpwd || $db_ifsafecv && $safecv != $detail['safecv'] || $loginout || $detail['yz'] > 1) { $GLOBALS['groupid'] = 'guest'; require_once R_P . 'require/checkpass.php'; Loginout(); if ($detail['yz'] > 1) { $GLOBALS['jihuo_uid'] = $detail['uid']; Showmsg('login_jihuo'); } Showmsg('ip_change'); } else { list($detail['shortcut'], $detail['appshortcut']) = explode("\t", $detail['shortcut']); unset($detail['password']); $detail['honor'] = substrs($detail['honor'], 90); $distime = $timestamp - $detail['lastvisit']; if ($distime > $db_onlinetime || $distime > 3600) { /*--- element update ---start*/ if ($db_ifpwcache & 1 && SCR != 'post' && SCR != 'thread') { L::loadClass('elementupdate', '', false); $elementupdate = new ElementUpdate(); $elementupdate->userSortUpdate($detail); } /*--- element update ---end*/ if (!GetCookie('hideid')) { $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $updateMemberData = $updateByIncrementMemberData = array(); $updateMemberData['lastvisit'] = $timestamp; $updateMemberData['thisvisit'] = $timestamp; if ($db_ifonlinetime) { $c_oltime = intval($c_oltime); $c_oltime = $c_oltime <= 0 ? 0 : ($c_oltime > $db_onlinetime * 1.2 ? $db_onlinetime : $c_oltime); $updateByIncrementMemberData['onlinetime'] = $c_oltime; if ($detail['lastvisit'] > $montime) { $updateByIncrementMemberData['monoltime'] = $c_oltime; } else { $updateMemberData['monoltime'] = $c_oltime; } if ($c_oltime) { require_once R_P . 'require/functions.php'; updateDatanalyse($winduid, 'memberOnLine', $c_oltime); } $c_oltime = 0; } if (get_date($timestamp, 'Y-m-d') > get_date($detail['lastvisit'], 'Y-m-d')) { /*更新今日登录数*/ $stasticsService = L::loadClass('Statistics', 'datanalyse'); $stasticsService->login($winduid); /*连续登录天数*/ if ($db_md_ifopen) { require_once R_P . 'require/functions.php'; doMedalBehavior($winduid, 'continue_login'); } } $userService->update($winduid, array(), $updateMemberData); $updateByIncrementMemberData && $userService->updateByIncrement($winduid, array(), $updateByIncrementMemberData); $detail['lastvisit'] = $detail['thisvisit'] = $timestamp; } } } return $detail; }