$system_log_obj->create_keke_witkey_system_log(); $status = '重置成功'; } else { $status = '重置失败'; } echo json_encode(array('status' => $status)); die; } if ($is_submit == 1) { if (!$edituid) { $regClass = new keke_register_class(); $result = $regClass->check_email(trim($fds['email'])); if ($result !== true) { kekezu::admin_show_msg('操作提示', "index.php?do=user&view=add", 3, $result, 'warning'); } $reg_uid = $reg_obj->user_register($fds['username'], $fds['password'], $fds['email'], null, false, $fds['password']); unset($fds[repassword]); $arrAddUserInfo = array(); $fds['truename'] and $arrAddUserInfo['truename'] = $fds['truename']; $fds['phone'] and $arrAddUserInfo['phone'] = $fds['phone']; $fds['indus_id'] and $arrAddUserInfo['indus_id'] = $fds['indus_id']; $fds['indus_pid'] and $arrAddUserInfo['indus_pid'] = $fds['indus_pid']; $fds['birthday'] and $arrAddUserInfo['birthday'] = $fds['birthday']; !empty($arrAddUserInfo) and db_factory::updatetable(TABLEPRE . 'witkey_space', $arrAddUserInfo, array('uid' => $reg_uid)); is_null($fds['group_id']) or db_factory::execute(sprintf("update %switkey_space set group_id={$fds['group_id']} where uid={$reg_uid}", TABLEPRE)); kekezu::admin_system_log($_lang['add_member'] . $fds['username']); kekezu::admin_show_msg($_lang['operate_notice'], "index.php?do=user&view=add", 3, $_lang['user_creat_success'], 'success'); } else { $uinfo = kekezu::get_user_info($edituid); if ($fds['password']) { $slt = db_factory::get_count(sprintf("select rand_code from %switkey_member where uid = '%d'", TABLEPRE, $edituid));
$tips['errors']['email'] = '该email非法或已经被注册'; kekezu::show_msg($tips, NULL, NULL, NULL, 'error'); } if (strtoupper(CHARSET) == 'GBK') { $account = kekezu::utftogbk($account); } $strNameCheck = keke_user_class::check_username($account); if ($strNameCheck != 1) { $tips['errors']['account'] = $strNameCheck; kekezu::show_msg($tips, NULL, NULL, NULL, 'error'); } $strCodeCheck = kekezu::check_secode($code); if ($strCodeCheck != 1) { $tips['errors']['code'] = $strCodeCheck; kekezu::show_msg($tips, NULL, NULL, NULL, 'error'); } if (intval($agree) == 0) { $tips['errors']['agree'] = '请先同意注册协议'; kekezu::show_msg($tips, NULL, NULL, NULL, 'error'); } //增加$user_type, $intRegUid = $objReg->user_register(kekezu::escape($account), $password, $email, $code, 1, $password, $reg_user_type, $reg_user_type_xf); $arrUserInfo = keke_user_class::get_user_info($intRegUid); $objReg->register_login($arrUserInfo); } if (isset($check_username) && !empty($check_username)) { $res = keke_user_class::check_username($check_username); echo $res; die; } $_SESSION['spread'] = 'index.php?do=register';
$objLogin->save_user_info($loginUserInfo, 1); } elseif ($_SESSION[$type . '_oauthInfo'] && !$arrBindInfo && !$formhash && !$to_bind) { $password = kekezu::randomkeys(6); $account = kekezu::escape($arrOauthInfo['nickname']); $is_nameExist = 1; while ($is_nameExist) { $hasUser = db_factory::get_one("select * from " . TABLEPRE . "witkey_space where username='******'"); if ($hasUser) { $is_nameExist = 1; $code = kekezu::randomkeys(6); $account = $account . $code; } else { $is_nameExist = 0; } } $intRegUid = $objReg->user_register($account, $password, $email, $code, false, $password, 1); $arrUserInfo = keke_user_class::get_user_info($intRegUid); UserCenter::bindingAccount($arrUserInfo['uid'], $arrUserInfo['username'], $arrOauthInfo); $_SESSION['uid'] = $arrUserInfo['uid']; $_SESSION['username'] = $arrUserInfo['username']; $_SESSION['last_login_time'] = $arrUserInfo['last_login_time']; setcookie($type . 'uid', 1, time() + 3600 * 24); } $arrApiNames = keke_glob_class::get_open_api(); if (isset($formhash)) { if ($email) { if (keke_user_class::user_checkemail($email) != 1) { $tips['errors']['email'] = '该email非法或已经被注册'; kekezu::show_msg($tips, NULL, NULL, NULL, 'error'); } }