function delete($u_arr) { if (empty($u_arr)) { return false; } require_once R_P . 'require/writelog.php'; global $admin_name, $timestamp, $onlineip; $udb = array(); $userService = $this->_getUserService(); foreach ($userService->getByUserIds($u_arr) as $rt) { $log = array('type' => 'deluser', 'username1' => $rt['username'], 'username2' => $admin_name, 'field1' => 0, 'field2' => $rt['groupid'], 'field3' => '', 'descrip' => 'deluser_descrip', 'timestamp' => $timestamp, 'ip' => $onlineip); writelog($log); $udb[] = $rt['uid']; } $this->delUserByIds($udb); require_once R_P . 'uc_client/uc_client.php'; uc_user_delete($u_arr); }
function delete($u_arr) { if (empty($u_arr)) { return false; } require_once R_P . 'uc_client/uc_client.php'; uc_user_delete($u_arr); require_once R_P . 'require/writelog.php'; global $admin_name, $timestamp, $onlineip; $udb = array(); $query = $this->db->query("SELECT m.uid,m.username,m.groupid FROM pw_members m LEFT JOIN pw_memberdata md ON md.uid=m.uid WHERE m.uid IN(" . pwImplode($u_arr) . ")"); while ($rt = $this->db->fetch_array($query)) { $log = array('type' => 'deluser', 'username1' => $rt['username'], 'username2' => $admin_name, 'field1' => 0, 'field2' => $rt['groupid'], 'field3' => '', 'descrip' => 'deluser_descrip', 'timestamp' => $timestamp, 'ip' => $onlineip); writelog($log); $udb[] = $rt['uid']; } $this->delUserByIds($udb); }
/** * 删除用户 * @param string {$uid:用户id;$username:用户名;$email:email} * @return array {-1:删除失败;>0:删除成功} */ public function delete() { $this->uid = isset($this->data['uid']) ? $this->data['uid'] : ''; $this->email = isset($this->data['email']) ? $this->data['email'] : ''; if($this->uid > 0 || is_array($this->uid)) { $where = to_sqls($this->uid, '', 'uid'); //ucenter部份 if ($this->config['ucuse']) { pc_base::load_config('uc_config'); require_once PHPCMS_PATH.'api/uc_client/client.php'; $s = $this->db->select($where, 'ucuserid'); if ($s) { $uc_data = array(); foreach ($s as $k=>$v) { $uc_data[$k] = $v['ucuserid']; } if (!empty($uc_data)) $r = uc_user_delete($uc_data); if (!$r) { exit('-1'); } } else { exit('-1'); } } /*插入消息队列*/ $noticedata['uids'] = $this->uid; messagequeue::add('member_delete', $noticedata); $this->db->delete($where); exit('1'); } elseif(!empty($this->username)) { $this->db->delete(array('username'=>$this->username)); exit('2'); } elseif(!empty($this->email)) { $this->db->delete(array('email'=>$this->email)); exit('3'); } else { exit('-1'); } }
public function uc_user_delete($uid) { $uid = explode(',', $uid); $ret = uc_user_delete($uid); return $ret; }
/** * 会员删除 * @author Vimhui Develop Team * @param * @return bool */ public function userDelete($uids) { return uc_user_delete($uids); }
foreach ($query as $comment) { $comments[] = $comment['cid']; } if ($comments) { deletecomments($comments); } else { $next = 0; $nextdeleteitem = 'allitem'; } } if ($deleteitem == 'allitem') { require_once libfile('function/delete'); $numdeleted = deletemember($uids); if ($isfounder && !empty($_GET['includeuc'])) { loaducenter(); uc_user_delete($uids); } if (!empty($_GET['uidarray'])) { cpmsg('members_delete_succeed', '', 'succeed', array('numdeleted' => $numdeleted)); } else { $allnum += $membernum < $delmemberlimit ? $membernum : $delmemberlimit; $nextlink = "action=members&operation=clean&confirmed=yes&submit=yes&includepost=yes" . (!empty($_GET['includeuc']) ? '&includeuc=yes' : '') . "&allnum={$allnum}&deletestart=" . ($deletestart + $delmemberlimit) . $urladd; cpmsg(cplang('members_delete_user_processing_next', array('deletestart' => $deletestart, 'nextdeletestart' => $deletestart + $delmemberlimit)), $nextlink, 'loadingform', array()); } } $nextlink = "action=members&operation=clean&confirmed=yes&submit=yes&includepost=yes" . (!empty($_GET['includeuc']) ? '&includeuc=yes' : '') . "¤t={$next}&pertask={$pertask}&lastprocess={$processed}&allnum={$allnum}&deletestart={$deletestart}" . $urladd; if (empty($_GET['uidarray'])) { $deladdmsg = cplang('members_delete_user_processing', array('deletestart' => $deletestart, 'nextdeletestart' => $deletestart + $delmemberlimit)) . '<br>'; } else { $deladdmsg = ''; }
if ($member['groupid'] == 8) { $members[$uid] = $member; } } $alluids = array_keys($members); if ($_GET['apply_all']) { $moderation[$_GET['apply_all']] = array_merge($alluids, $moderation[$_GET['apply_all']]); } if (!empty($members)) { $numdeleted = $numinvalidated = $numvalidated = 0; if (!empty($moderation['delete']) && is_array($moderation['delete'])) { $deluids = array_intersect($moderation['delete'], $alluids); $numdeleted = count($deluids); C::t('common_member')->delete_no_validate($deluids); loaducenter(); uc_user_delete($deluids); } else { $moderation['delete'] = array(); } if (!empty($moderation['validate']) && is_array($moderation['validate'])) { $validateuids = array_intersect($moderation['validate'], $alluids); C::t('common_member')->update($validateuids, array('adminid' => 0, 'groupid' => $_G['setting']['newusergroupid'])); $numvalidated = count($validateuids); C::t('common_member_validate')->delete($validateuids); } else { $moderation['validate'] = array(); } if (!empty($moderation['invalidate']) && is_array($moderation['invalidate'])) { $invalidateuids = array_intersect($moderation['invalidate'], $alluids); $numinvalidated = count($invalidateuids); foreach ($invalidateuids as $uid) {
if ($_G['gp_apply_all']) { $uids .= ',' . $member['uid']; $moderation[$_G[gp_apply_all]][] = $member['uid']; } } if (is_array($uidarray) && !empty($uidarray)) { $uids = implode(',', $uidarray); $numdeleted = $numinvalidated = $numvalidated = 0; if (!empty($moderation['delete']) && is_array($moderation['delete'])) { $deleteuids = '\'' . implode('\',\'', $moderation['delete']) . '\''; DB::query("DELETE FROM " . DB::table('common_member') . " WHERE uid IN ({$deleteuids}) AND uid IN ({$uids})"); $numdeleted = DB::affected_rows(); DB::query("DELETE FROM " . DB::table('common_member_field_forum') . " WHERE uid IN ({$deleteuids}) AND uid IN ({$uids})"); DB::query("DELETE FROM " . DB::table('common_member_validate') . " WHERE uid IN ({$deleteuids}) AND uid IN ({$uids})"); loaducenter(); uc_user_delete($moderation['delete']); } else { $moderation['delete'] = array(); } if (!empty($moderation['validate']) && is_array($moderation['validate'])) { $newgroupid = DB::result_first("SELECT groupid FROM " . DB::table('common_usergroup') . " WHERE creditshigher<=0 AND 0<creditslower LIMIT 1"); $validateuids = '\'' . implode('\',\'', $moderation['validate']) . '\''; DB::query("UPDATE " . DB::table('common_member') . " SET adminid='0', groupid='{$newgroupid}' WHERE uid IN ({$validateuids}) AND uid IN ({$uids})"); $numvalidated = DB::affected_rows(); DB::query("DELETE FROM " . DB::table('common_member_validate') . " WHERE uid IN ({$validateuids}) AND uid IN ({$uids})"); } else { $moderation['validate'] = array(); } if (!empty($moderation['invalidate']) && is_array($moderation['invalidate'])) { foreach ($moderation['invalidate'] as $uid) { $numinvalidated++;
/** * 用户接口,删除处理 * * @param array $params 参数数组 * 必须参数: $params['username'] - 用户名,$params['password'] - 密码,$params['email'] - 邮箱 * @access public * @return int */ function jieqi_udelete_iprocess(&$params) { global $jieqiLang; if (!isset($jieqiLang['system'])) { jieqi_loadlang('users', 'system'); } uc_user_delete($params['username']); if (defined('JIEQI_WAP_PAGE')) { jieqi_wapgourl($params['jumpurl']); } elseif ($_REQUEST['jumphide']) { header('Location: ' . $params['jumpurl']); } else { jieqi_jumppage($params['jumpurl'], LANG_DO_SUCCESS, $jieqiLang['system']['delete_user_success']); } return true; }
public function signupWithUC($username, $password, $email, $storeUserIndependent = 0, $options = array()) { $rt = 1; if (!$storeUserIndependent) { if (SYNC_WITH_UC) { $ucenterUserName = $username; if (defined('UCENTER_CHARSET') && UCENTER_CHARSET == 'utf-8') { $ucenterUserName = iconv('gbk', 'utf-8', $ucenterUserName); } include_once ABS_PATH . '/uc_client/client.php'; $rt = uc_user_register($ucenterUserName, $password, $email); } elseif (defined('SYNC_WITH_PHPWIND') && SYNC_WITH_PHPWIND) { define('AUTOSYSTEM', '1'); include ABS_PATH . '/pw_api.php'; include ABS_PATH . '/uc_client/uc_client.php'; $rt = uc_user_register($username, md5($password), $email); //把错误结果转换为ucenter的错误代码 switch ($rt) { default: break; case -2: $rt = -3; //用户名已被注册 break; case -3: $rt = -4; //邮箱非法 break; case -4: $rt = -6; //邮箱已经被注册 break; } } } if ($rt > 0) { $rt = $this->signup($username, $email, $password, $storeUserIndependent, $options); if ($rt) { setcookie('jsusername', escape($username), SYS_TIME + 2592000, '/', DOMAIN_ROOT); } // if ($rt < 1) { //cannot insert into auto_user table,so delete the record in uc_member if (SYNC_WITH_UC && !$storeUserIndependent) { include ABS_PATH . '/uc_client/client.php'; uc_user_delete($username); } } } return $rt; }
/** * * 删除uc会员 ... * @param int $memberId */ public function delUcUser($memberId) { if (empty($memberId)) { return 0; } $condition = ' AND m.member_id IN (' . $memberId . ')'; $delMemberInfo = $this->get_member_info($condition, 'm.member_name,m.type', '', 'member_id', 0); if (empty($delMemberInfo)) { return 0; } $check_Bind = new check_Bind(); include_once CUR_CONF_PATH . 'uc_client/client.php'; $ucId = array(); foreach ($delMemberInfo as $k => $v) { if (in_array($v['type'], array('m2o', 'uc'))) { $ucId[] = $check_Bind->check_uc($k, $v['type']); } } if ($ucId) { return uc_user_delete($ucId); //支持批量删除 } }
$dsql->ExecuteNoneQuery("DELETE FROM `#@__member_company` WHERE mid='{$id}' LIMIT 1"); $dsql->ExecuteNoneQuery("DELETE FROM `#@__member_person` WHERE mid='{$id}' LIMIT 1"); //删除用户相关数据 $dsql->ExecuteNoneQuery("DELETE FROM `#@__member_stow` WHERE mid='{$id}' "); $dsql->ExecuteNoneQuery("DELETE FROM `#@__member_flink` WHERE mid='{$id}' "); $dsql->ExecuteNoneQuery("DELETE FROM `#@__member_guestbook` WHERE mid='{$id}' "); $dsql->ExecuteNoneQuery("DELETE FROM `#@__member_operation` WHERE mid='{$id}' "); $dsql->ExecuteNoneQuery("DELETE FROM `#@__member_pms` WHERE toid='{$id}' Or fromid='{$id}' "); $dsql->ExecuteNoneQuery("DELETE FROM `#@__member_friends` WHERE mid='{$id}' Or fid='{$id}' "); $dsql->ExecuteNoneQuery("DELETE FROM `#@__member_vhistory` WHERE mid='{$id}' Or vid='{$id}' "); $dsql->ExecuteNoneQuery("DELETE FROM `#@__feedback` WHERE mid='{$id}' "); $dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET mid='0' WHERE mid='{$id}'"); #api{{ if (defined('UC_API') && @(include_once DEDEROOT . '/uc_client/client.php')) { $infofromuc = uc_get_user($row['userid']); uc_user_delete($infofromuc[0]); } #/aip}} } else { ShowMsg("无法删除此会员,如果这个会员是<b>[管理员]</b>,<br />必须先删除这个<b>[管理员]</b>才能删除此帐号!", $ENV_GOBACK_URL, 0, 5000); exit; } } ShowMsg("成功删除一个会员!", $ENV_GOBACK_URL); exit; } $randcode = mt_rand(10000, 99999); $safecode = substr(md5($cfg_cookie_encode . $randcode), 0, 24); $wintitle = "会员管理-删除会员"; $wecome_info = "<a href='" . $ENV_GOBACK_URL . "'>会员管理</a>::删除会员"; $win = new OxWindow();
/** * 删除用户 * @param type $uid 用户名 * @return int 1:成功 * 0:失败 */ public function user_delete($uid) { $modelid = M("Member")->where(array("userid" => $uid))->getField("modelid"); if (!$modelid) { return 0; } $Model_Member = F("Model_Member"); $tablename = ucwords($Model_Member[$modelid]['tablename']); if ($this->UCenter) { if (!uc_user_delete($uid)) { return 0; } } //删除本地用户数据开始 if (M("Member")->where(array("userid" => $uid))->delete()) { M($tablename)->where(array("userid" => $uid))->delete(); //删除connect M("Connect")->where(array("uid" => $uid))->delete(); return 1; } return 0; }
function onmemberdel() { if ($this->CON['mem_isucenter']) { require admin_ROOT . 'public/uc_client/client.php'; } $db_table = db_prefix . 'member'; $db_table2 = db_prefix . 'member_value'; $selectinfoid = $this->fun->accept('memberselectinfoid', 'P'); if (empty($selectinfoid)) { exit('false'); } $infoarray = explode(',', $selectinfoid); $count = count($infoarray) - 1; if ($count <= 0) { exit('false'); } for ($i = 0; $i < $count; $i++) { $db_where = "userid={$infoarray[$i]}"; if ($this->CON['mem_isucenter']) { $username = $this->get_member(null, $infoarray[$i], 'username'); $data = uc_get_user($username); if ($data) { $delid = uc_user_delete($data[0]); } } $this->db->query('DELETE FROM ' . $db_table . ' WHERE ' . $db_where); $this->db->query('DELETE FROM ' . $db_table2 . ' WHERE ' . $db_where); } $this->writelog($this->lng['membermain_del_log'], $this->lng['log_extra_ok'] . ' id=' . $selectinfoid); exit('true'); }
$dsql->ExecuteNoneQuery("Delete From `#@__member_space` where mid='{$id}' limit 1"); $dsql->ExecuteNoneQuery("Delete From `#@__member_company` where mid='{$id}' limit 1"); $dsql->ExecuteNoneQuery("Delete From `#@__member_person` where mid='{$id}' limit 1"); //删除用户相关数据 $dsql->ExecuteNoneQuery("Delete From `#@__member_stow` where mid='{$id}' "); $dsql->ExecuteNoneQuery("Delete From `#@__member_flink` where mid='{$id}' "); $dsql->ExecuteNoneQuery("Delete From `#@__member_guestbook` where mid='{$id}' "); $dsql->ExecuteNoneQuery("Delete From `#@__member_operation` where mid='{$id}' "); $dsql->ExecuteNoneQuery("Delete From `#@__member_pms` where toid='{$id}' Or fromid='{$id}' "); $dsql->ExecuteNoneQuery("Delete From `#@__member_friends` where mid='{$id}' Or fid='{$id}' "); $dsql->ExecuteNoneQuery("Delete From `#@__member_vhistory` where mid='{$id}' Or vid='{$id}' "); $dsql->ExecuteNoneQuery("Delete From `#@__feedback` where mid='{$id}' "); $dsql->ExecuteNoneQuery("update `#@__archives` set mid='0' where mid='{$id}'"); #api{{ if (defined('UC_API') && @(include_once DEDEROOT . '/uc_client/client.php')) { uc_user_delete($row['userid']); } #/aip}} } else { ShowMsg("无法删除此会员,如果这个会员是<b>[管理员]</b>,<br />必须先删除这个<b>[管理员]</b>才能删除此帐号!", $ENV_GOBACK_URL, 0, 5000); exit; } } ShowMsg("成功删除一个会员!", $ENV_GOBACK_URL); exit; } $randcode = mt_rand(10000, 99999); $safecode = substr(md5($cfg_cookie_encode . $randcode), 0, 24); $wintitle = "会员管理-删除会员"; $wecome_info = "<a href='" . $ENV_GOBACK_URL . "'>会员管理</a>::删除会员"; $win = new OxWindow();
static function user_delete($uid) { global $kekezu; db_factory::execute(sprintf("delete from %switkey_space where uid='%d' ", TABLEPRE, $uid)); db_factory::execute(sprintf("delete from %switkey_member where uid='%d' ", TABLEPRE, $uid)); db_factory::execute(sprintf("delete from %switkey_member_bank where uid='%d' ", TABLEPRE, $uid)); db_factory::execute(sprintf("delete from %switkey_member_ext where uid='%d' ", TABLEPRE, $uid)); db_factory::execute(sprintf("delete from %switkey_member_black where uid='%d' ", TABLEPRE, $uid)); db_factory::execute(sprintf("delete from %switkey_member_oauth where uid='%d' ", TABLEPRE, $uid)); db_factory::execute(sprintf("delete from %switkey_shop where uid='%d' ", TABLEPRE, $uid)); db_factory::execute(sprintf("delete from %switkey_service where uid='%d'", TABLEPRE, $uid)); db_factory::execute(sprintf("delete from %switkey_auth_email where uid='%d'", TABLEPRE, $uid)); db_factory::execute(sprintf("delete from %switkey_auth_mobile where uid='%d'", TABLEPRE, $uid)); db_factory::execute(sprintf("delete from %switkey_auth_bank where uid='%d'", TABLEPRE, $uid)); db_factory::execute(sprintf("delete from %switkey_auth_record where uid='%d'", TABLEPRE, $uid)); if ($kekezu->_sys_config['user_intergration'] == 1) { return $uid; } elseif ($kekezu->_sys_config['user_intergration'] == 2) { require_once S_ROOT . '/uc_client/client.php'; return uc_user_delete($uid); } }
function on_register() { global $_G; $_GET['username'] = $_GET['' . $this->setting['reginput']['username']]; $_GET['password'] = $_GET['' . $this->setting['reginput']['password']]; $_GET['password2'] = $_GET['' . $this->setting['reginput']['password2']]; $_GET['email'] = $_GET['' . $this->setting['reginput']['email']]; if ($_G['uid']) { $ucsynlogin = $this->setting['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : ''; $url_forward = dreferer(); if (strpos($url_forward, $this->setting['regname']) !== false) { $url_forward = 'forum.php'; } showmessage('login_succeed', $url_forward ? $url_forward : './', array('username' => $_G['member']['username'], 'usergroup' => $_G['group']['grouptitle'], 'uid' => $_G['uid']), array('extrajs' => $ucsynlogin)); } elseif (!$this->setting['regclosed'] && (!$this->setting['regstatus'] || !$this->setting['ucactivation'])) { if ($_GET['action'] == 'activation' || $_GET['activationauth']) { if (!$this->setting['ucactivation'] && !$this->setting['closedallowactivation']) { showmessage('register_disable_activation'); } } elseif (!$this->setting['regstatus']) { if ($this->setting['regconnect']) { dheader('location:connect.php?mod=login&op=init&referer=forum.php&statfrom=login_simple'); } showmessage(!$this->setting['regclosemessage'] ? 'register_disable' : str_replace(array("\r", "\n"), '', $this->setting['regclosemessage'])); } } $bbrules =& $this->setting['bbrules']; $bbrulesforce =& $this->setting['bbrulesforce']; $bbrulestxt =& $this->setting['bbrulestxt']; $welcomemsg =& $this->setting['welcomemsg']; $welcomemsgtitle =& $this->setting['welcomemsgtitle']; $welcomemsgtxt =& $this->setting['welcomemsgtxt']; $regname = $this->setting['regname']; if ($this->setting['regverify']) { if ($this->setting['areaverifywhite']) { $location = $whitearea = ''; $location = trim(convertip($_G['clientip'], "./")); if ($location) { $whitearea = preg_quote(trim($this->setting['areaverifywhite']), '/'); $whitearea = str_replace(array("\\*"), array('.*'), $whitearea); $whitearea = '.*' . $whitearea . '.*'; $whitearea = '/^(' . str_replace(array("\r\n", ' '), array('.*|.*', ''), $whitearea) . ')$/i'; if (@preg_match($whitearea, $location)) { $this->setting['regverify'] = 0; } } } if ($_G['cache']['ipctrl']['ipverifywhite']) { foreach (explode("\n", $_G['cache']['ipctrl']['ipverifywhite']) as $ctrlip) { if (preg_match("/^(" . preg_quote($ctrlip = trim($ctrlip), '/') . ")/", $_G['clientip'])) { $this->setting['regverify'] = 0; break; } } } } $invitestatus = false; if ($this->setting['regstatus'] == 2) { if ($this->setting['inviteconfig']['inviteareawhite']) { $location = $whitearea = ''; $location = trim(convertip($_G['clientip'], "./")); if ($location) { $whitearea = preg_quote(trim($this->setting['inviteconfig']['inviteareawhite']), '/'); $whitearea = str_replace(array("\\*"), array('.*'), $whitearea); $whitearea = '.*' . $whitearea . '.*'; $whitearea = '/^(' . str_replace(array("\r\n", ' '), array('.*|.*', ''), $whitearea) . ')$/i'; if (@preg_match($whitearea, $location)) { $invitestatus = true; } } } if ($this->setting['inviteconfig']['inviteipwhite']) { foreach (explode("\n", $this->setting['inviteconfig']['inviteipwhite']) as $ctrlip) { if (preg_match("/^(" . preg_quote($ctrlip = trim($ctrlip), '/') . ")/", $_G['clientip'])) { $invitestatus = true; break; } } } } $groupinfo = array(); if ($this->setting['regverify']) { $groupinfo['groupid'] = 8; } else { $groupinfo['groupid'] = $this->setting['newusergroupid']; } $seccodecheck = $this->setting['seccodestatus'] & 1; $secqaacheck = $this->setting['secqaa']['status'] & 1; $fromuid = !empty($_G['cookie']['promotion']) && $this->setting['creditspolicy']['promotion_register'] ? intval($_G['cookie']['promotion']) : 0; $username = isset($_GET['username']) ? $_GET['username'] : ''; $bbrulehash = $bbrules ? substr(md5(FORMHASH), 0, 8) : ''; $auth = $_GET['auth']; if (!$invitestatus) { $invite = getinvite(); } $sendurl = $this->setting['sendregisterurl'] ? true : false; if ($sendurl) { if (!empty($_GET['hash'])) { $_GET['hash'] = preg_replace("/[^\\[A-Za-z0-9_\\]%]/", '', $_GET['hash']); $hash = explode("\t", authcode($_GET['hash'], 'DECODE', $_G['config']['security']['authkey'])); if (is_array($hash) && isemail($hash[0]) && TIMESTAMP - $hash[1] < 259200) { $sendurl = false; } } } if (!submitcheck('regsubmit', 0, $seccodecheck, $secqaacheck)) { if ($_GET['action'] == 'activation') { $auth = explode("\t", authcode($auth, 'DECODE')); if (FORMHASH != $auth[1]) { showmessage('register_activation_invalid', 'member.php?mod=logging&action=login'); } $username = $auth[0]; $activationauth = authcode("{$auth['0']}\t" . FORMHASH, 'ENCODE'); $sendurl = false; } if (!$sendurl) { if ($fromuid) { $member = getuserbyuid($fromuid); if (!empty($member)) { $fromuser = dhtmlspecialchars($member['username']); } else { dsetcookie('promotion'); } } if ($_GET['action'] == 'activation') { $auth = dhtmlspecialchars($auth); } if ($seccodecheck) { $seccode = random(6, 1); } $username = dhtmlspecialchars($username); $htmls = $settings = array(); foreach ($_G['cache']['fields_register'] as $field) { $fieldid = $field['fieldid']; $html = profile_setting($fieldid, array(), false, false, true); if ($html) { $settings[$fieldid] = $_G['cache']['profilesetting'][$fieldid]; $htmls[$fieldid] = $html; } } $navtitle = $this->setting['reglinkname']; if ($this->extrafile && file_exists($this->extrafile)) { require_once $this->extrafile; } } $bbrulestxt = nl2br("\n{$bbrulestxt}\n\n"); $dreferer = dreferer(); include template($this->template); } else { $activationauth = array(); if (isset($_GET['activationauth']) && $_GET['activationauth']) { $activationauth = explode("\t", authcode($_GET['activationauth'], 'DECODE')); if ($activationauth[1] != FORMHASH) { showmessage('register_activation_invalid', 'member.php?mod=logging&action=login'); } $sendurl = false; } if (!$activationauth && ($sendurl || !$_G['setting']['forgeemail'])) { checkemail($_GET['email']); } if ($sendurl) { $hashstr = urlencode(authcode("{$_GET['email']}\t{$_G['timestamp']}", 'ENCODE', $_G['config']['security']['authkey'])); $registerurl = "{$_G[siteurl]}member.php?mod=" . $this->setting['regname'] . "&hash={$hashstr}&email={$_GET[email]}"; $email_register_message = lang('email', 'email_register_message', array('bbname' => $this->setting['bbname'], 'siteurl' => $_G['siteurl'], 'url' => $registerurl)); if (!sendmail("{$_GET['email']} <{$_GET['email']}>", lang('email', 'email_register_subject'), $email_register_message)) { runlog('sendmail', "{$_GET['email']} sendmail failed."); } showmessage('register_email_send_succeed', dreferer(), array('bbname' => $this->setting['bbname']), array('showdialog' => false, 'msgtype' => 3, 'closetime' => 10)); } $emailstatus = 0; if ($this->setting['sendregisterurl'] && !$sendurl) { $_GET['email'] = strtolower($hash[0]); $this->setting['regverify'] = $this->setting['regverify'] == 1 ? 0 : $this->setting['regverify']; if (!$this->setting['regverify']) { $groupinfo['groupid'] = $this->setting['newusergroupid']; } $emailstatus = 1; } if ($this->setting['regstatus'] == 2 && empty($invite) && !$invitestatus) { showmessage('not_open_registration_invite'); } if ($bbrules && $bbrulehash != $_POST['agreebbrule']) { showmessage('register_rules_agree'); } $activation = array(); if (isset($_GET['activationauth']) && $activationauth && is_array($activationauth)) { if ($activationauth[1] == FORMHASH && !($activation = uc_get_user($activationauth[0]))) { showmessage('register_activation_invalid', 'member.php?mod=logging&action=login'); } } if (!$activation) { $usernamelen = dstrlen($username); if ($usernamelen < 3) { showmessage('profile_username_tooshort'); } elseif ($usernamelen > 15) { showmessage('profile_username_toolong'); } if (uc_get_user(addslashes($username)) && !C::t('common_member')->fetch_uid_by_username($username) && !C::t('common_member_archive')->fetch_uid_by_username($username)) { if ($_G['inajax']) { showmessage('profile_username_duplicate'); } else { showmessage('register_activation_message', 'member.php?mod=logging&action=login', array('username' => $username)); } } if ($this->setting['pwlength']) { if (strlen($_GET['password']) < $this->setting['pwlength']) { showmessage('profile_password_tooshort', '', array('pwlength' => $this->setting['pwlength'])); } } if ($this->setting['strongpw']) { $strongpw_str = array(); if (in_array(1, $this->setting['strongpw']) && !preg_match("/\\d+/", $_GET['password'])) { $strongpw_str[] = lang('member/template', 'strongpw_1'); } if (in_array(2, $this->setting['strongpw']) && !preg_match("/[a-z]+/", $_GET['password'])) { $strongpw_str[] = lang('member/template', 'strongpw_2'); } if (in_array(3, $this->setting['strongpw']) && !preg_match("/[A-Z]+/", $_GET['password'])) { $strongpw_str[] = lang('member/template', 'strongpw_3'); } if (in_array(4, $this->setting['strongpw']) && !preg_match("/[^a-zA-z0-9]+/", $_GET['password'])) { $strongpw_str[] = lang('member/template', 'strongpw_4'); } if ($strongpw_str) { showmessage(lang('member/template', 'password_weak') . implode(',', $strongpw_str)); } } $email = strtolower(trim($_GET['email'])); if (empty($email) && $_G['setting']['forgeemail']) { $_GET['email'] = $email = strtolower(random(6)) . '@' . $_SERVER['HTTP_HOST']; } if (empty($this->setting['ignorepassword'])) { if ($_GET['password'] !== $_GET['password2']) { showmessage('profile_passwd_notmatch'); } if (!$_GET['password'] || $_GET['password'] != addslashes($_GET['password'])) { showmessage('profile_passwd_illegal'); } $password = $_GET['password']; } else { $password = md5(random(10)); } } $censorexp = '/^(' . str_replace(array('\\*', "\r\n", ' '), array('.*', '|', ''), preg_quote($this->setting['censoruser'] = trim($this->setting['censoruser']), '/')) . ')$/i'; if ($this->setting['censoruser'] && @preg_match($censorexp, $username)) { showmessage('profile_username_protect'); } if ($this->setting['regverify'] == 2 && !trim($_GET['regmessage'])) { showmessage('profile_required_info_invalid'); } if ($_G['cache']['ipctrl']['ipregctrl']) { foreach (explode("\n", $_G['cache']['ipctrl']['ipregctrl']) as $ctrlip) { if (preg_match("/^(" . preg_quote($ctrlip = trim($ctrlip), '/') . ")/", $_G['clientip'])) { $ctrlip = $ctrlip . '%'; $this->setting['regctrl'] = $this->setting['ipregctrltime']; break; } else { $ctrlip = $_G['clientip']; } } } else { $ctrlip = $_G['clientip']; } if ($this->setting['regctrl']) { if (C::t('common_regip')->count_by_ip_dateline($ctrlip, $_G['timestamp'] - $this->setting['regctrl'] * 3600)) { showmessage('register_ctrl', NULL, array('regctrl' => $this->setting['regctrl'])); } } $setregip = null; if ($this->setting['regfloodctrl']) { $regip = C::t('common_regip')->fetch_by_ip_dateline($_G['clientip'], $_G['timestamp'] - 86400); if ($regip) { if ($regip['count'] >= $this->setting['regfloodctrl']) { showmessage('register_flood_ctrl', NULL, array('regfloodctrl' => $this->setting['regfloodctrl'])); } else { $setregip = 1; } } else { $setregip = 2; } } $profile = $verifyarr = array(); foreach ($_G['cache']['fields_register'] as $field) { if (defined('IN_MOBILE')) { break; } $field_key = $field['fieldid']; $field_val = $_GET['' . $field_key]; if ($field['formtype'] == 'file' && !empty($_FILES[$field_key]) && $_FILES[$field_key]['error'] == 0) { $field_val = true; } if (!profile_check($field_key, $field_val)) { $showid = !in_array($field['fieldid'], array('birthyear', 'birthmonth')) ? $field['fieldid'] : 'birthday'; showmessage($field['title'] . lang('message', 'profile_illegal'), '', array(), array('showid' => 'chk_' . $showid, 'extrajs' => $field['title'] . lang('message', 'profile_illegal') . ($field['formtype'] == 'text' ? '<script type="text/javascript">' . '$(\'registerform\').' . $field['fieldid'] . '.className = \'px er\';' . '$(\'registerform\').' . $field['fieldid'] . '.onblur = function () { if(this.value != \'\') {this.className = \'px\';$(\'chk_' . $showid . '\').innerHTML = \'\';}}' . '</script>' : ''))); } if ($field['needverify']) { $verifyarr[$field_key] = $field_val; } else { $profile[$field_key] = $field_val; } } if (!$activation) { $uid = uc_user_register(addslashes($username), $password, $email, $questionid, $answer, $_G['clientip']); if ($uid <= 0) { if ($uid == -1) { showmessage('profile_username_illegal'); } elseif ($uid == -2) { showmessage('profile_username_protect'); } elseif ($uid == -3) { showmessage('profile_username_duplicate'); } elseif ($uid == -4) { showmessage('profile_email_illegal'); } elseif ($uid == -5) { showmessage('profile_email_domain_illegal'); } elseif ($uid == -6) { showmessage('profile_email_duplicate'); } else { showmessage('undefined_action'); } } } else { list($uid, $username, $email) = $activation; } $_G['username'] = $username; if (getuserbyuid($uid, 1)) { if (!$activation) { uc_user_delete($uid); } showmessage('profile_uid_duplicate', '', array('uid' => $uid)); } $password = md5(random(10)); $secques = $questionid > 0 ? random(8) : ''; if (isset($_POST['birthmonth']) && isset($_POST['birthday'])) { $profile['constellation'] = get_constellation($_POST['birthmonth'], $_POST['birthday']); } if (isset($_POST['birthyear'])) { $profile['zodiac'] = get_zodiac($_POST['birthyear']); } if ($_FILES) { $upload = new discuz_upload(); foreach ($_FILES as $key => $file) { $field_key = 'field_' . $key; if (!empty($_G['cache']['fields_register'][$field_key]) && $_G['cache']['fields_register'][$field_key]['formtype'] == 'file') { $upload->init($file, 'profile'); $attach = $upload->attach; if (!$upload->error()) { $upload->save(); if (!$upload->get_image_info($attach['target'])) { @unlink($attach['target']); continue; } $attach['attachment'] = dhtmlspecialchars(trim($attach['attachment'])); if ($_G['cache']['fields_register'][$field_key]['needverify']) { $verifyarr[$key] = $attach['attachment']; } else { $profile[$key] = $attach['attachment']; } } } } } if ($setregip !== null) { if ($setregip == 1) { C::t('common_regip')->update_count_by_ip($_G['clientip']); } else { C::t('common_regip')->insert(array('ip' => $_G['clientip'], 'count' => 1, 'dateline' => $_G['timestamp'])); } } if ($invite && $this->setting['inviteconfig']['invitegroupid']) { $groupinfo['groupid'] = $this->setting['inviteconfig']['invitegroupid']; } $init_arr = array('credits' => explode(',', $this->setting['initcredits']), 'profile' => $profile, 'emailstatus' => $emailstatus); C::t('common_member')->insert($uid, $username, $password, $email, $_G['clientip'], $groupinfo['groupid'], $init_arr); if ($emailstatus) { updatecreditbyaction('realemail', $uid); } if ($verifyarr) { $setverify = array('uid' => $uid, 'username' => $username, 'verifytype' => '0', 'field' => serialize($verifyarr), 'dateline' => TIMESTAMP); C::t('common_member_verify_info')->insert($setverify); C::t('common_member_verify')->insert(array('uid' => $uid)); } require_once libfile('cache/userstats', 'function'); build_cache_userstats(); if ($this->extrafile && file_exists($this->extrafile)) { require_once $this->extrafile; } if ($this->setting['regctrl'] || $this->setting['regfloodctrl']) { C::t('common_regip')->delete_by_dateline($_G['timestamp'] - ($this->setting['regctrl'] > 72 ? $this->setting['regctrl'] : 72) * 3600); if ($this->setting['regctrl']) { C::t('common_regip')->insert(array('ip' => $_G['clientip'], 'count' => -1, 'dateline' => $_G['timestamp'])); } } $regmessage = dhtmlspecialchars($_GET['regmessage']); if ($this->setting['regverify'] == 2) { C::t('common_member_validate')->insert(array('uid' => $uid, 'submitdate' => $_G['timestamp'], 'moddate' => 0, 'admin' => '', 'submittimes' => 1, 'status' => 0, 'message' => $regmessage, 'remark' => ''), false, true); manage_addnotify('verifyuser'); } setloginstatus(array('uid' => $uid, 'username' => $_G['username'], 'password' => $password, 'groupid' => $groupinfo['groupid']), 0); include_once libfile('function/stat'); updatestat('register'); if ($invite['id']) { $result = C::t('common_invite')->count_by_uid_fuid($invite['uid'], $uid); if (!$result) { C::t('common_invite')->update($invite['id'], array('fuid' => $uid, 'fusername' => $_G['username'], 'regdateline' => $_G['timestamp'], 'status' => 2)); updatestat('invite'); } else { $invite = array(); } } if ($invite['uid']) { if ($this->setting['inviteconfig']['inviteaddcredit']) { updatemembercount($uid, array($this->setting['inviteconfig']['inviterewardcredit'] => $this->setting['inviteconfig']['inviteaddcredit'])); } if ($this->setting['inviteconfig']['invitedaddcredit']) { updatemembercount($invite['uid'], array($this->setting['inviteconfig']['inviterewardcredit'] => $this->setting['inviteconfig']['invitedaddcredit'])); } require_once libfile('function/friend'); friend_make($invite['uid'], $invite['username'], false); notification_add($invite['uid'], 'friend', 'invite_friend', array('actor' => '<a href="home.php?mod=space&uid=' . $invite['uid'] . '" target="_blank">' . $invite['username'] . '</a>'), 1); space_merge($invite, 'field_home'); if (!empty($invite['privacy']['feed']['invite'])) { require_once libfile('function/feed'); $tite_data = array('username' => '<a href="home.php?mod=space&uid=' . $_G['uid'] . '">' . $_G['username'] . '</a>'); feed_add('friend', 'feed_invite', $tite_data, '', array(), '', array(), array(), '', '', '', 0, 0, '', $invite['uid'], $invite['username']); } if ($invite['appid']) { updatestat('appinvite'); } } if ($welcomemsg && !empty($welcomemsgtxt)) { $welcomemsgtitle = replacesitevar($welcomemsgtitle); $welcomemsgtxt = replacesitevar($welcomemsgtxt); if ($welcomemsg == 1) { $welcomemsgtxt = nl2br(str_replace(':', ':', $welcomemsgtxt)); notification_add($uid, 'system', $welcomemsgtxt, array('from_id' => 0, 'from_idtype' => 'welcomemsg'), 1); } elseif ($welcomemsg == 2) { sendmail_cron($email, $welcomemsgtitle, $welcomemsgtxt); } elseif ($welcomemsg == 3) { sendmail_cron($email, $welcomemsgtitle, $welcomemsgtxt); $welcomemsgtxt = nl2br(str_replace(':', ':', $welcomemsgtxt)); notification_add($uid, 'system', $welcomemsgtxt, array('from_id' => 0, 'from_idtype' => 'welcomemsg'), 1); } } if ($fromuid) { updatecreditbyaction('promotion_register', $fromuid); dsetcookie('promotion', ''); } dsetcookie('loginuser', ''); dsetcookie('activationauth', ''); dsetcookie('invite_auth', ''); $url_forward = dreferer(); $refreshtime = 3000; switch ($this->setting['regverify']) { case 1: $idstring = random(6); $authstr = $this->setting['regverify'] == 1 ? "{$_G['timestamp']}\t2\t{$idstring}" : ''; C::t('common_member_field_forum')->update($_G['uid'], array('authstr' => $authstr)); $verifyurl = "{$_G[siteurl]}member.php?mod=activate&uid={$_G[uid]}&id={$idstring}"; $email_verify_message = lang('email', 'email_verify_message', array('username' => $_G['member']['username'], 'bbname' => $this->setting['bbname'], 'siteurl' => $_G['siteurl'], 'url' => $verifyurl)); if (!sendmail("{$username} <{$email}>", lang('email', 'email_verify_subject'), $email_verify_message)) { runlog('sendmail', "{$email} sendmail failed."); } $message = 'register_email_verify'; $locationmessage = 'register_email_verify_location'; $refreshtime = 10000; break; case 2: $message = 'register_manual_verify'; $locationmessage = 'register_manual_verify_location'; break; default: $message = 'register_succeed'; $locationmessage = 'register_succeed_location'; break; } $param = array('bbname' => $this->setting['bbname'], 'username' => $_G['username'], 'usergroup' => $_G['group']['grouptitle'], 'uid' => $_G['uid']); if (strpos($url_forward, $this->setting['regname']) !== false || strpos($url_forward, 'buyinvitecode') !== false) { $url_forward = 'forum.php'; } $href = str_replace("'", "\\'", $url_forward); $extra = array('showid' => 'succeedmessage', 'extrajs' => '<script type="text/javascript">' . 'setTimeout("window.location.href =\'' . $href . '\';", ' . $refreshtime . ');' . '$(\'succeedmessage_href\').href = \'' . $href . '\';' . '$(\'main_message\').style.display = \'none\';' . '$(\'main_succeed\').style.display = \'\';' . '$(\'succeedlocation\').innerHTML = \'' . lang('message', $locationmessage) . '\';' . '</script>', 'striptags' => false); showmessage($message, $url_forward, $param, $extra); } }
while ($member = $db->fetch_array($query)) { if ($membernum < 2000 || !empty($uidarray)) { $extra .= '<input type="hidden" name="uidarray[]" value="' . $member['uid'] . '" />'; } $uids .= $comma . $member['uid']; $comma = ','; } if (empty($membernum) || empty($uids)) { cpmsg('members_no_find_deluser', '', 'error'); } if (!$confirmed) { cpmsg('members_delete_confirm', "{$BASESCRIPT}?action=members&operation=clean&submit=yes&confirmed=yes" . $urladd, 'form', $extra . '<br /><input type="checkbox" name="includepost" value="1" class="checkbox" />' . $lang['members_delete_post'] . ($isfounder ? ' <input type="checkbox" name="includeuc" value="1" class="checkbox" />' . $lang['members_delete_ucdata'] : '')); } else { if ($isfounder && !empty($includeuc)) { require_once DISCUZ_ROOT . './uc_client/client.php'; uc_user_delete($uidarray); } if (empty($includepost)) { $query = $db->query("DELETE FROM {$tablepre}members WHERE uid IN ({$uids})"); $numdeleted = $db->affected_rows(); $db->query("DELETE FROM {$tablepre}access WHERE uid IN ({$uids})", 'UNBUFFERED'); $db->query("DELETE FROM {$tablepre}memberfields WHERE uid IN ({$uids})", 'UNBUFFERED'); $db->query("DELETE FROM {$tablepre}favorites WHERE uid IN ({$uids})", 'UNBUFFERED'); $db->query("DELETE FROM {$tablepre}moderators WHERE uid IN ({$uids})", 'UNBUFFERED'); $db->query("DELETE FROM {$tablepre}validating WHERE uid IN ({$uids})", 'UNBUFFERED'); manyoulog('user', $uids, 'delete'); cpmsg('members_delete_succeed', '', 'succeed'); } else { $numdeleted = $numdeleted ? $numdeleted : count($uidarray); $pertask = 1000; $current = intval($current);
/** * [public function] * * Remove one or more users from the list of registered users * * @param array $users array of users to be deleted * @return int the number of users deleted * * @author Christopher Smith <*****@*****.**> * @author Matthias Grimm <*****@*****.**> */ function deleteUsers($users) { $count = 0; if (is_array($users) && count($users)) { foreach ($users as $user) { $uid = $this->get_uid($user); if ($uid && uc_user_delete($uid)) { $count++; } } } return $count; }
while ($comment = DB::fetch($query)) { $comments[] = $comment['cid']; } if ($comments) { deletecomments($comments); } else { $next = 0; $nextdeleteitem = 'allitem'; } } if ($deleteitem == 'allitem') { require_once libfile('function/delete'); $numdeleted = deletemember($uids); if ($isfounder && !empty($_G['gp_includeuc'])) { loaducenter(); uc_user_delete($_G['gp_uidarray']); } cpmsg('members_delete_succeed', '', 'succeed', array('numdeleted' => $numdeleted)); } if ($nextdeleteitem != $deleteitem) { $nextlink = "action=members&operation=clean&confirmed=yes&submit=yes&includepost=yes" . (!empty($_G['gp_includeuc']) ? '&includeuc=yes' : '') . "¤t={$next}&pertask={$pertask}&lastprocess={$processed}" . $urladd . "&deleteitem={$nextdeleteitem}"; cpmsg(cplang('members_delete_processing_next', array('item' => cplang('members_delete_' . $deleteitem), 'nextitem' => cplang('members_delete_' . $nextdeleteitem))), $nextlink, 'loadingform', array(), $extra); } else { $nextlink = "action=members&operation=clean&confirmed=yes&submit=yes&includepost=yes" . (!empty($_G['gp_includeuc']) ? '&includeuc=yes' : '') . "¤t={$next}&pertask={$pertask}&lastprocess={$processed}" . $urladd . "&deleteitem={$deleteitem}"; cpmsg(cplang('members_delete_processing', array('item' => cplang('members_delete_' . $deleteitem), 'current' => $current, 'next' => $next)), $nextlink, 'loadingform', array(), $extra); } } } } } elseif ($operation == 'newsletter') { if (!submitcheck('newslettersubmit', 1)) {
$sysmsg[] = '此用户帐号或回收站中还存在文件,请删除文件后再操作'; } if (!$error) { $uid = (int) gpc('uid', 'G', 0); $db->query_unbuffered("delete from {$tpf}folders where userid='{$uid}'"); $db->query_unbuffered("delete from {$tpf}users where userid='{$uid}'"); $db->query_unbuffered("update {$tpf}files set is_del=1 where userid='{$uid}'"); $db->query_unbuffered("delete from {$tpf}buddys where userid='{$uid}' or touserid='{$uid}'"); $db->query_unbuffered("delete from {$tpf}messages where userid='{$uid}' or touserid='{$uid}'"); if (display_plugin('api', 'open_uc_plugin', $settings['connect_uc'], 0)) { $username = @$db->result_first("select username from {$tpf}users where userid='{$uid}' limit 1"); if ($settings['connect_uc_type'] == 'phpwind') { $arr = uc_user_get($username, 1); uc_user_delete($arr['uid']); } else { $result = uc_user_delete($username); if (!$result) { $sysmsg[] = "UC:" . __('delete_user_error'); } } } $sysmsg[] = __('delete_user_success'); redirect(urr(ADMINCP, "item=users&menu=user&action=index"), $sysmsg); } else { redirect('back', $sysmsg); } break; case 'add_user': admin_no_power($task, 3, $pd_uid); if ($task == 'add_user') { form_auth(gpc('formhash', 'P', ''), formhash());
function delete() { foreach ($this->base->post["uid"] as $uid) { $userarr = $_ENV["user"]->get_user("uid", $uid); $username = $userarr["username"]; uc_user_delete($username); } }
function DoDelete() { $this->CheckAdminPrivs('memberedite'); $this->IDS = (array) ($this->IDS ? $this->IDS : $this->ID); foreach ($this->IDS as $key=>$val) { if(1 > ($this->IDS[$key] = (int) $val)) { unset($this->IDS[$key]); } } if (!$this->IDS) { $this->Messager("请先指定一个要删除的用户ID",null); } $query = $this->DatabaseHandler->Query("select * from `".TABLE_PREFIX."system_members` where `uid` in('".implode("','",$this->IDS)."')"); $member_ids = array(); $admin_list = array(); $member_ids_count = 0; while ($row = $query->GetRow()) { if(1==$row['uid'] || $row['role_type']!='normal') { $admin_list[$row['uid']] = $row['username']; continue; } if(true === UCENTER && $row['ucuid'] > 0) { include_once(UC_CLIENT_ROOT . './client.php'); uc_user_delete($row['ucuid']); } $member_ids[$row['uid']] = $row['uid']; } if(isset($member_ids[1])) unset($member_ids[1]); if (0 < ($member_ids_count = count($member_ids))) { $this->DatabaseHandler->Query("delete from `".TABLE_PREFIX."system_members` where `uid` in ('".implode("','",$member_ids)."')"); $this->DatabaseHandler->Query("delete from `".TABLE_PREFIX."system_memberfields` where `uid` in('".implode("','",$member_ids)."')"); $this->DatabaseHandler->Query("delete from `".TABLE_PREFIX."system_log` where `uid` in('".implode("','",$member_ids)."')"); foreach ($member_ids as $i => $uid) { $aliuid = meta('luid_'.$uid); meta('luid_'.$uid, null); meta('token_'.$aliuid, null); meta('ul.alipay.'.$aliuid, null); } } $msg = ''; $msg .= "成功删除<b>{$member_ids_count}</b>位会员"; if($admin_list) { $msg .= ",其中<b>".implode(' , ',$admin_list)."</b>是管理员或商家,不能直接删除"; } $this->Messager($msg); }
function pick_reg($info) { $member = $info; extract($info); global $_G; loaducenter(); require_once libfile('function/misc'); require_once libfile('function/profile'); include_once libfile('class/member'); $activation = array(); if (!$activation) { $usernamelen = dstrlen($username); if ($usernamelen < 3) { return milu_lang('too_short'); } elseif ($usernamelen > 15) { return milu_lang('too_long'); } $username = addslashes(trim(dstripslashes($username))); $email = trim($email); } if (!$activation) { $uid = uc_user_register($username, $password, $email, $questionid, $answer, $_G['clientip']); if ($uid <= 0) { if ($uid == -1) { return milu_lang('bad_word'); } elseif ($uid == -2) { return milu_lang('system_bad_word'); } elseif ($uid == -3) { return milu_lang('reged'); } elseif ($uid == -4) { return milu_lang('wrong_email'); } elseif ($uid == -5) { return milu_lang('bad_email'); } elseif ($uid == -6) { return milu_lang('email_reged'); } else { return milu_lang('unknow_error'); } } } else { list($uid, $username, $email) = $activation; } if (DB::result_first("SELECT uid FROM " . DB::table('common_member') . " WHERE uid='{$uid}'")) { if (!$activation) { uc_user_delete($uid); } return milu_lang('uid_reged'); } $init_arr = explode(',', $_G['setting']['initcredits']); $groupinfo['groupid'] = $_G['setting']['newusergroupid']; $password = md5(random(10)); $secques = $questionid > 0 ? random(8) : ''; //用户资料 $profile['constellation'] = get_constellation($birthmonth, $birthday); $profile['zodiac'] = get_zodiac($birthyear); $profile['gender'] = $gender == milu_lang('baomi') ? 0 : ($gender == milu_lang('man') ? 1 : 0); $profile_field_arr = array('birthyear', 'birthmonth', 'birthday', 'birthprovince', 'birthcity', 'birthdist', 'birthcommunity', 'resideprovince', 'residecity', 'residedist', 'residecommunity', 'residesuite', 'site', 'bio', 'interest', 'idcardtype', 'idcard', 'bloodtype', 'height', 'weight', 'qq', 'msn', 'taobao', 'yahoo', 'icq', 'alipay', 'lookingfor', 'position', 'occupation', 'education', 'company', 'graduateschool', 'revenue', 'telephone', 'mobile', 'constellation', 'realname', 'zodiac', 'affectivestatus'); foreach ($profile_field_arr as $k => $v) { $profile[$v] = ${$v}; } $lastactivity = rand($regdate, $regdate + 3600 * 24 * 2); if ($regipsql) { DB::query($regipsql); } $credits = 0; if (!empty($_G['setting']['creditsformula'])) { eval("\$credits = round(" . $_G['setting']['creditsformula'] . ");"); } $userdata = array('uid' => $uid, 'username' => $username, 'password' => $password, 'email' => $email, 'adminid' => 0, 'groupid' => $groupinfo['groupid'], 'regdate' => $regdate, 'credits' => $credits, 'timeoffset' => 9999); $status_data = array('uid' => $uid, 'regip' => $regip, 'lastip' => $lastip, 'lastvisit' => $lastvisit, 'lastactivity' => $lastactivity, 'lastpost' => $lastpost, 'lastsendmail' => 0); $profile['uid'] = $uid; $field_forum['uid'] = $uid; $field_forum['sightml'] = $sightmlm; $field_home['uid'] = $uid; DB::insert('common_member', paddslashes($userdata)); DB::insert('common_member_status', paddslashes($status_data)); DB::insert('common_member_profile', paddslashes($profile)); DB::insert('common_member_field_forum', paddslashes($field_forum)); DB::insert('common_member_field_home', paddslashes($field_home)); if ($verifyarr) { $setverify = array('uid' => $uid, 'username' => $username, 'verifytype' => '0', 'field' => daddslashes(serialize($verifyarr)), 'dateline' => $lastactivity); DB::insert('common_member_verify_info', $setverify); DB::insert('common_member_verify', array('uid' => $uid)); } $count_data = array('uid' => $uid, 'oltime' => $oltime ? $oltime : 0, 'extcredits1' => $extcredits1 ? $extcredits1 : $init_arr[1], 'extcredits2' => $extcredits2 ? $extcredits2 : $init_arr[2], 'extcredits3' => $extcredits3 ? $extcredits3 : $init_arr[3], 'extcredits4' => $extcredits4 ? $extcredits4 : $init_arr[4], 'extcredits5' => $extcredits5 ? $extcredits5 : $init_arr[5], 'extcredits6' => $extcredits6 ? $extcredits6 : $init_arr[6], 'extcredits7' => $extcredits7 ? $extcredits7 : $init_arr[7], 'extcredits8' => $extcredits8 ? $extcredits8 : $init_arr[8]); DB::insert('common_member_count', paddslashes($count_data)); DB::insert('common_setting', array('skey' => 'lastmember', 'svalue' => $username), false, true); manyoulog('user', $uid, 'add'); $totalmembers = DB::result_first("SELECT COUNT(*) FROM " . DB::table('common_member')); $userstats = array('totalmembers' => $totalmembers, 'newsetuser' => $username); checkusergroup($uid); //更新用户所在的用户组 save_syscache('userstats', $userstats); $re_arr['uid'] = $uid; return $re_arr; }
/** * 删除会员 */ public function delete() { $uidarr = isset($_POST['uid']) ? $_POST['uid'] : showmessage(L('illegal_parameters'), HTTP_REFERER); $new_arr = array(); foreach ($uidarr as $v) { $v = intval($v); $new_arr[] = $v; //删除头像 $dir = ps_getavatar($v, 1); ps_unlink($dir); } $where = to_sqls($new_arr, '', 'uid'); //ucenter部份 if ($this->config['ucuse']) { pc_base::load_config('uc_config'); include PHPCMS_PATH . 'api/uc_client/client.php'; $s = $this->db->select($where, 'ucuserid'); if ($s) { $uc_data = array(); foreach ($s as $k => $v) { $uc_data[$k] = $v['ucuserid']; } if (!empty($uc_data)) { $r = uc_user_delete($uc_data); } if (!$r) { showmessage(L('operation_failure'), HTTP_REFERER); } } else { showmessage(L('operation_failure'), HTTP_REFERER); } } if ($this->db->delete($where)) { /*插入消息队列*/ $noticedata = array('uids' => $new_arr); messagequeue::add('member_delete', $noticedata); showmessage(L('operation_success'), HTTP_REFERER); } else { showmessage(L('operation_failure'), HTTP_REFERER); } }
public function delete($uname) { return uc_user_delete($this->iconv($uname)); }
function delete_train_user($uid) { global $db; if (!is_array($uid)) { $uid = array($uid); } $sqlin = implode(",", $uid); if (preg_match("/^(\\d{1,10},)*(\\d{1,10})\$/", $sqlin)) { if (defined('UC_API')) { include_once QISHI_ROOT_PATH . 'uc_client/client.php'; foreach ($uid as $tuid) { $userinfo = get_user($tuid); $uc_user = uc_get_user($userinfo['username']); $uc_uid_arr[] = $uc_user[0]; } uc_user_delete($uc_uid_arr); } if (!$db->query("Delete from " . table('members') . " WHERE uid IN (" . $sqlin . ")")) { return false; } if (!$db->query("Delete from " . table('members_info') . " WHERE uid IN (" . $sqlin . ")")) { return false; } if (!$db->query("Delete from " . table('members_log') . " WHERE log_uid IN (" . $sqlin . ")")) { return false; } if (!$db->query("Delete from " . table('members_points') . " WHERE uid IN (" . $sqlin . ")")) { return false; } if (!$db->query("Delete from " . table('order') . " WHERE uid IN (" . $sqlin . ")")) { return false; } if (!$db->query("Delete from " . table('members_train_setmeal') . " WHERE uid IN (" . $sqlin . ")")) { return false; } return true; write_log("删除会员uid为" . $sqlin . "的培训机构会员", $_SESSION['admin_name'], 3); } return false; }
function on_register() { global $_G; $_G['gp_username'] = $_G['gp_' . $this->setting['reginput']['username']]; $_G['gp_password'] = $_G['gp_' . $this->setting['reginput']['password']]; $_G['gp_password2'] = $_G['gp_' . $this->setting['reginput']['password2']]; $_G['gp_email'] = $_G['gp_' . $this->setting['reginput']['email']]; if ($_G['uid']) { $ucsynlogin = $this->setting['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : ''; $url_forward = dreferer(); if (strpos($url_forward, $this->setting['regname']) !== false) { $url_forward = 'forum.php'; } showmessage('login_succeed', $url_forward ? $url_forward : './', array('username' => $_G['member']['username'], 'usergroup' => $_G['group']['grouptitle'], 'uid' => $_G['uid']), array('extrajs' => $ucsynlogin)); } elseif (!$this->setting['regclosed'] && (!$this->setting['regstatus'] || !$this->setting['ucactivation'])) { if ($_G['gp_action'] == 'activation' || $this->setting['gp_activationauth']) { if (!$this->setting['ucactivation'] && !$this->setting['closedallowactivation']) { showmessage('register_disable_activation'); } } elseif (!$this->setting['regstatus']) { showmessage(!$this->setting['regclosemessage'] ? 'register_disable' : str_replace(array("\r", "\n"), '', $this->setting['regclosemessage'])); } } $bbrules =& $this->setting['bbrules']; $bbrulesforce =& $this->setting['bbrulesforce']; $bbrulestxt =& $this->setting['bbrulestxt']; $welcomemsg =& $this->setting['welcomemsg']; $welcomemsgtitle =& $this->setting['welcomemsgtitle']; $welcomemsgtxt =& $this->setting['welcomemsgtxt']; $regname = $this->setting['regname']; if ($this->setting['regverify']) { if ($this->setting['areaverifywhite']) { $location = $whitearea = ''; $location = trim(convertip($_G['clientip'], "./")); if ($location) { $whitearea = preg_quote(trim($this->setting['areaverifywhite']), '/'); $whitearea = str_replace(array("\\*"), array('.*'), $whitearea); $whitearea = '.*' . $whitearea . '.*'; $whitearea = '/^(' . str_replace(array("\r\n", ' '), array('.*|.*', ''), $whitearea) . ')$/i'; if (@preg_match($whitearea, $location)) { $this->setting['regverify'] = 0; } } } if ($_G['cache']['ipctrl']['ipverifywhite']) { foreach (explode("\n", $_G['cache']['ipctrl']['ipverifywhite']) as $ctrlip) { if (preg_match("/^(" . preg_quote($ctrlip = trim($ctrlip), '/') . ")/", $_G['clientip'])) { $this->setting['regverify'] = 0; break; } } } } $invitestatus = false; if ($this->setting['regstatus'] == 2) { if ($this->setting['inviteconfig']['inviteareawhite']) { $location = $whitearea = ''; $location = trim(convertip($_G['clientip'], "./")); if ($location) { $whitearea = preg_quote(trim($this->setting['inviteconfig']['inviteareawhite']), '/'); $whitearea = str_replace(array("\\*"), array('.*'), $whitearea); $whitearea = '.*' . $whitearea . '.*'; $whitearea = '/^(' . str_replace(array("\r\n", ' '), array('.*|.*', ''), $whitearea) . ')$/i'; if (@preg_match($whitearea, $location)) { $invitestatus = true; } } } if ($this->setting['inviteconfig']['inviteipwhite']) { foreach (explode("\n", $this->setting['inviteconfig']['inviteipwhite']) as $ctrlip) { if (preg_match("/^(" . preg_quote($ctrlip = trim($ctrlip), '/') . ")/", $_G['clientip'])) { $invitestatus = true; break; } } } } $groupinfo = array(); if ($this->setting['regverify']) { $groupinfo['groupid'] = 8; } else { $groupinfo['groupid'] = $this->setting['newusergroupid']; } $seccodecheck = $this->setting['seccodestatus'] & 1; $secqaacheck = $this->setting['secqaa']['status'] & 1; $fromuid = !empty($_G['cookie']['promotion']) && $this->setting['creditspolicy']['promotion_register'] ? intval($_G['cookie']['promotion']) : 0; $username = isset($_G['gp_username']) ? $_G['gp_username'] : ''; $bbrulehash = $bbrules ? substr(md5(FORMHASH), 0, 8) : ''; $auth = $_G['gp_auth']; if (!$invitestatus) { $invite = getinvite(); } if (!submitcheck('regsubmit', 0, $seccodecheck, $secqaacheck)) { if ($_G['gp_action'] == 'activation') { $auth = explode("\t", authcode($auth, 'DECODE')); if (FORMHASH != $auth[1]) { showmessage('register_activation_invalid', 'member.php?mod=logging&action=login'); } $username = $auth[0]; $activationauth = authcode("{$auth['0']}\t" . FORMHASH, 'ENCODE'); } if ($fromuid) { $query = DB::query("SELECT username FROM " . DB::table('common_member') . " WHERE uid='{$fromuid}'"); if (DB::num_rows($query)) { $fromuser = dhtmlspecialchars(DB::result($query, 0)); } else { dsetcookie('promotion'); } } $bbrulestxt = nl2br("\n{$bbrulestxt}\n\n"); if ($_G['gp_action'] == 'activation') { $auth = dhtmlspecialchars($auth); } if ($seccodecheck) { $seccode = random(6, 1); } $username = dhtmlspecialchars($username); $htmls = $settings = array(); foreach ($_G['cache']['fields_register'] as $field) { $fieldid = $field['fieldid']; $html = profile_setting($fieldid, array(), false, false, true); if ($html) { $settings[$fieldid] = $_G['cache']['profilesetting'][$fieldid]; $htmls[$fieldid] = $html; } } $navtitle = $this->setting['reglinkname']; if ($this->extrafile && file_exists(libfile('member/' . $this->extrafile, 'module'))) { require_once libfile('member/' . $this->extrafile, 'module'); } $dreferer = dreferer(); include template($this->template); } else { if ($this->setting['regstatus'] == 2 && empty($invite) && !$invitestatus) { showmessage('not_open_registration_invite'); } if ($bbrules && $bbrulehash != $_POST['agreebbrule']) { showmessage('register_rules_agree'); } $activation = array(); if (isset($_G['gp_activationauth'])) { $activationauth = explode("\t", authcode($_G['gp_activationauth'], 'DECODE')); if ($activationauth[1] == FORMHASH && !($activation = daddslashes(uc_get_user($activationauth[0]), 1))) { showmessage('register_activation_invalid', 'member.php?mod=logging&action=login'); } } if (!$activation) { $usernamelen = dstrlen($username); if ($usernamelen < 3) { showmessage('profile_username_tooshort'); } elseif ($usernamelen > 15) { showmessage('profile_username_toolong'); } $username = addslashes(trim(dstripslashes($username))); if (uc_get_user($username) && !DB::result_first("SELECT uid FROM " . DB::table('common_member') . " WHERE username='******'")) { if ($_G['inajax']) { showmessage('profile_username_duplicate'); } else { showmessage('register_activation_message', 'member.php?mod=logging&action=login', array('username' => stripslashes($username))); } } $email = trim($_G['gp_email']); if (empty($this->setting['ignorepassword'])) { if ($_G['gp_password'] !== $_G['gp_password2']) { showmessage('profile_passwd_notmatch'); } if (!$_G['gp_password'] || $_G['gp_password'] != addslashes($_G['gp_password'])) { showmessage('profile_passwd_illegal'); } $password = $_G['gp_password']; } else { $password = md5(random(10)); } } $censorexp = '/^(' . str_replace(array('\\*', "\r\n", ' '), array('.*', '|', ''), preg_quote($this->setting['censoruser'] = trim($this->setting['censoruser']), '/')) . ')$/i'; if ($this->setting['censoruser'] && @preg_match($censorexp, $username)) { showmessage('profile_username_protect'); } if ($this->setting['regverify'] == 2 && !trim($_G['gp_regmessage'])) { showmessage('profile_required_info_invalid'); } if ($_G['cache']['ipctrl']['ipregctrl']) { foreach (explode("\n", $_G['cache']['ipctrl']['ipregctrl']) as $ctrlip) { if (preg_match("/^(" . preg_quote($ctrlip = trim($ctrlip), '/') . ")/", $_G['clientip'])) { $ctrlip = $ctrlip . '%'; $this->setting['regctrl'] = $this->setting['ipregctrltime']; break; } else { $ctrlip = $_G['clientip']; } } } else { $ctrlip = $_G['clientip']; } if ($this->setting['regctrl']) { $query = DB::query("SELECT ip FROM " . DB::table('common_regip') . " WHERE ip LIKE '{$ctrlip}' AND count='-1' AND dateline>{$_G['timestamp']}-'" . $this->setting['regctrl'] . "'*3600 LIMIT 1"); if (DB::num_rows($query)) { showmessage('register_ctrl', NULL, array('regctrl' => $this->setting['regctrl'])); } } $regipsql = ''; if ($this->setting['regfloodctrl']) { if ($regattempts = DB::result_first("SELECT count FROM " . DB::table('common_regip') . " WHERE ip='{$_G['clientip']}' AND count>'0' AND dateline>'{$_G['timestamp']}'-86400")) { if ($regattempts >= $this->setting['regfloodctrl']) { showmessage('register_flood_ctrl', NULL, array('regfloodctrl' => $this->setting['regfloodctrl'])); } else { $regipsql = "UPDATE " . DB::table('common_regip') . " SET count=count+1 WHERE ip='{$_G['clientip']}' AND count>'0'"; } } else { $regipsql = "INSERT INTO " . DB::table('common_regip') . " (ip, count, dateline)\r\n\t\t\t\t\t\tVALUES ('{$_G['clientip']}', '1', '{$_G['timestamp']}')"; } } $profile = $verifyarr = array(); foreach ($_G['cache']['fields_register'] as $field) { if (defined('IN_MOBILE')) { break; } $field_key = $field['fieldid']; $field_val = $_G['gp_' . $field_key]; if ($field['formtype'] == 'file' && !empty($_FILES[$field_key]) && $_FILES[$field_key]['error'] == 0) { $field_val = true; } if (!profile_check($field_key, $field_val)) { $showid = !in_array($field['fieldid'], array('birthyear', 'birthmonth')) ? $field['fieldid'] : 'birthday'; showmessage($field['title'] . lang('message', 'profile_illegal'), '', array(), array('showid' => 'chk_' . $showid, 'extrajs' => $field['title'] . lang('message', 'profile_illegal') . ($field['formtype'] == 'text' ? '<script type="text/javascript">' . '$(\'registerform\').' . $field['fieldid'] . '.className = \'px er\';' . '$(\'registerform\').' . $field['fieldid'] . '.onblur = function () { if(this.value != \'\') {this.className = \'px\';$(\'chk_' . $showid . '\').innerHTML = \'\';}}' . '</script>' : ''))); } if ($field['needverify']) { $verifyarr[$field_key] = $field_val; } else { $profile[$field_key] = $field_val; } } if (!$activation) { $uid = uc_user_register($username, $password, $email, $questionid, $answer, $_G['clientip']); if ($uid <= 0) { if ($uid == -1) { showmessage('profile_username_illegal'); } elseif ($uid == -2) { showmessage('profile_username_protect'); } elseif ($uid == -3) { showmessage('profile_username_duplicate'); } elseif ($uid == -4) { showmessage('profile_email_illegal'); } elseif ($uid == -5) { showmessage('profile_email_domain_illegal'); } elseif ($uid == -6) { showmessage('profile_email_duplicate'); } else { showmessage('undefined_action'); } } } else { list($uid, $username, $email) = $activation; } $_G['username'] = $username; if (DB::result_first("SELECT uid FROM " . DB::table('common_member') . " WHERE uid='{$uid}'")) { if (!$activation) { uc_user_delete($uid); } showmessage('profile_uid_duplicate', '', array('uid' => $uid)); } $password = md5(random(10)); $secques = $questionid > 0 ? random(8) : ''; if (isset($_POST['birthmonth']) && isset($_POST['birthday'])) { $profile['constellation'] = get_constellation($_POST['birthmonth'], $_POST['birthday']); } if (isset($_POST['birthyear'])) { $profile['zodiac'] = get_zodiac($_POST['birthyear']); } if ($_FILES) { require_once libfile('class/upload'); $upload = new discuz_upload(); foreach ($_FILES as $key => $file) { $field_key = 'field_' . $key; if (!empty($_G['cache']['fields_register'][$field_key]) && $_G['cache']['fields_register'][$field_key]['formtype'] == 'file') { $upload->init($file, 'profile'); $attach = $upload->attach; if (!$upload->error()) { $upload->save(); if (!$upload->get_image_info($attach['target'])) { @unlink($attach['target']); continue; } $attach['attachment'] = dhtmlspecialchars(trim($attach['attachment'])); if ($_G['cache']['fields_register'][$field_key]['needverify']) { $verifyarr[$key] = $attach['attachment']; } else { $profile[$key] = $attach['attachment']; } } } } } if ($regipsql) { DB::query($regipsql); } if ($invite && $this->setting['inviteconfig']['invitegroupid']) { $groupinfo['groupid'] = $this->setting['inviteconfig']['invitegroupid']; } $init_arr = explode(',', $this->setting['initcredits']); $userdata = array('uid' => $uid, 'username' => $username, 'password' => $password, 'email' => $email, 'adminid' => 0, 'groupid' => $groupinfo['groupid'], 'regdate' => TIMESTAMP, 'credits' => $init_arr[0], 'timeoffset' => 9999); $status_data = array('uid' => $uid, 'regip' => $_G['clientip'], 'lastip' => $_G['clientip'], 'lastvisit' => TIMESTAMP, 'lastactivity' => TIMESTAMP, 'lastpost' => 0, 'lastsendmail' => 0); $profile['uid'] = $uid; $field_forum['uid'] = $uid; $field_home['uid'] = $uid; if ($this->extrafile && file_exists(libfile('member/' . $this->extrafile, 'module'))) { require_once libfile('member/' . $this->extrafile, 'module'); } DB::insert('common_member', $userdata); DB::insert('common_member_status', $status_data); DB::insert('common_member_profile', $profile); DB::insert('common_member_field_forum', $field_forum); DB::insert('common_member_field_home', $field_home); if ($verifyarr) { $setverify = array('uid' => $uid, 'username' => $username, 'verifytype' => '0', 'field' => daddslashes(serialize($verifyarr)), 'dateline' => TIMESTAMP); DB::insert('common_member_verify_info', $setverify); DB::insert('common_member_verify', array('uid' => $uid)); } $count_data = array('uid' => $uid, 'extcredits1' => $init_arr[1], 'extcredits2' => $init_arr[2], 'extcredits3' => $init_arr[3], 'extcredits4' => $init_arr[4], 'extcredits5' => $init_arr[5], 'extcredits6' => $init_arr[6], 'extcredits7' => $init_arr[7], 'extcredits8' => $init_arr[8]); DB::insert('common_member_count', $count_data); DB::insert('common_setting', array('skey' => 'lastmember', 'svalue' => $username), false, true); manyoulog('user', $uid, 'add'); $totalmembers = DB::result_first("SELECT COUNT(*) FROM " . DB::table('common_member')); $userstats = array('totalmembers' => $totalmembers, 'newsetuser' => stripslashes($username)); save_syscache('userstats', $userstats); if ($this->setting['regctrl'] || $this->setting['regfloodctrl']) { DB::query("DELETE FROM " . DB::table('common_regip') . " WHERE dateline<='{$_G['timestamp']}'-" . ($this->setting['regctrl'] > 72 ? $this->setting['regctrl'] : 72) . "*3600", 'UNBUFFERED'); if ($this->setting['regctrl']) { DB::query("INSERT INTO " . DB::table('common_regip') . " (ip, count, dateline)\r\n\t\t\t\t\t\tVALUES ('{$_G['clientip']}', '-1', '{$_G['timestamp']}')"); } } $regmessage = dhtmlspecialchars($_G['gp_regmessage']); if ($this->setting['regverify'] == 2) { DB::query("REPLACE INTO " . DB::table('common_member_validate') . " (uid, submitdate, moddate, admin, submittimes, status, message, remark)\r\n\t\t\t\t\tVALUES ('{$uid}', '{$_G['timestamp']}', '0', '', '1', '0', '{$regmessage}', '')"); manage_addnotify('verifyuser'); } setloginstatus(array('uid' => $uid, 'username' => dstripslashes($_G['username']), 'password' => $password, 'groupid' => $groupinfo['groupid']), 0); include_once libfile('function/stat'); updatestat('register'); if ($invite['id']) { $result = DB::result_first("SELECT COUNT(*) FROM " . DB::table('common_invite') . " WHERE uid='{$invite['uid']}' AND fuid='{$uid}'"); if (!$result) { DB::update("common_invite", array('fuid' => $uid, 'fusername' => $_G['username'], 'regdateline' => $_G['timestamp'], 'status' => 2), array('id' => $invite['id'])); updatestat('invite'); } else { $invite = array(); } } if ($invite['uid']) { if ($this->setting['inviteconfig']['inviteaddcredit']) { updatemembercount($uid, array($this->setting['inviteconfig']['inviterewardcredit'] => $this->setting['inviteconfig']['inviteaddcredit'])); } if ($this->setting['inviteconfig']['invitedaddcredit']) { updatemembercount($invite['uid'], array($this->setting['inviteconfig']['inviterewardcredit'] => $this->setting['inviteconfig']['invitedaddcredit'])); } require_once libfile('function/friend'); friend_make($invite['uid'], $invite['username'], false); notification_add($invite['uid'], 'friend', 'invite_friend', array('actor' => '<a href="home.php?mod=space&uid=' . $invite['uid'] . '" target="_blank">' . $invite['username'] . '</a>'), 1); space_merge($invite, 'field_home'); if (!empty($invite['privacy']['feed']['invite'])) { require_once libfile('function/feed'); $tite_data = array('username' => '<a href="home.php?mod=space&uid=' . $_G['uid'] . '">' . $_G['username'] . '</a>'); feed_add('friend', 'feed_invite', $tite_data, '', array(), '', array(), array(), '', '', '', 0, 0, '', $invite['uid'], $invite['username']); } if ($invite['appid']) { updatestat('appinvite'); } } if ($welcomemsg && !empty($welcomemsgtxt)) { $welcomemsgtitle = addslashes(replacesitevar($welcomemsgtitle)); $welcomemsgtxt = addslashes(replacesitevar($welcomemsgtxt)); if ($welcomemsg == 1) { $welcomemsgtxt = nl2br(str_replace(':', ':', $welcomemsgtxt)); notification_add($uid, 'system', $welcomemsgtxt, array(), 1); } elseif ($welcomemsg == 2) { sendmail_cron($email, $welcomemsgtitle, $welcomemsgtxt); } elseif ($welcomemsg == 3) { sendmail_cron($email, $welcomemsgtitle, $welcomemsgtxt); $welcomemsgtxt = nl2br(str_replace(':', ':', $welcomemsgtxt)); notification_add($uid, 'system', $welcomemsgtxt, array(), 1); } } if ($fromuid) { updatecreditbyaction('promotion_register', $fromuid); dsetcookie('promotion', ''); } dsetcookie('loginuser', ''); dsetcookie('activationauth', ''); dsetcookie('invite_auth', ''); loadcache('setting', true); $_G['setting']['lastmember'] = stripslashes($username); $settingnew = $_G['setting']; $settingnew['pluginhooks'] = array(); save_syscache('setting', $settingnew); switch ($this->setting['regverify']) { case 1: $idstring = random(6); $authstr = $this->setting['regverify'] == 1 ? "{$_G['timestamp']}\t2\t{$idstring}" : ''; DB::query("UPDATE " . DB::table('common_member_field_forum') . " SET authstr='{$authstr}' WHERE uid='{$_G['uid']}'"); $verifyurl = "{$_G[siteurl]}member.php?mod=activate&uid={$_G[uid]}&id={$idstring}"; $email_verify_message = lang('email', 'email_verify_message', array('username' => $_G['member']['username'], 'bbname' => $this->setting['bbname'], 'siteurl' => $_G['siteurl'], 'url' => $verifyurl)); sendmail("{$username} <{$email}>", lang('email', 'email_verify_subject'), $email_verify_message); $message = 'register_email_verify'; $locationmessage = 'register_email_verify_location'; $url_forward = dreferer(); break; case 2: $message = 'register_manual_verify'; $locationmessage = 'register_manual_verify_location'; $url_forward = $_G['setting']['homestatus'] ? 'home.php?mod=space&do=home' : 'home.php?mod=spacecp'; break; default: $message = 'register_succeed'; $locationmessage = 'register_succeed_location'; $url_forward = dreferer(); break; } $param = array('bbname' => $this->setting['bbname'], 'username' => $_G['username'], 'usergroup' => $_G['group']['grouptitle'], 'uid' => $_G['uid']); if (strpos($url_forward, $this->setting['regname']) !== false || strpos($url_forward, 'buyinvitecode') !== false) { $url_forward = 'forum.php'; } $href = str_replace("'", "\\'", $url_forward); $extra = array('showid' => 'succeedmessage', 'extrajs' => '<script type="text/javascript">' . 'setTimeout("window.location.href =\'' . $href . '\';", 3000);' . '$(\'succeedmessage_href\').href = \'' . $href . '\';' . '$(\'main_message\').style.display = \'none\';' . '$(\'main_succeed\').style.display = \'\';' . '$(\'succeedlocation\').innerHTML = \'' . lang('message', $locationmessage) . '\';' . '</script>', 'striptags' => false); showmessage($message, $url_forward, $param, $extra); } }
} elseif ($uid == -4) { showmessage('profile_email_illegal'); } elseif ($uid == -5) { showmessage('profile_email_domain_illegal'); } elseif ($uid == -6) { showmessage('profile_email_duplicate'); } else { showmessage('undefined_action', NULL); } } } else { list($uid, $username, $email) = $activation; } if (DB::result_first("SELECT uid FROM " . DB::table('common_member') . " WHERE uid='{$uid}'")) { if (!$activation) { uc_user_delete($uid); } showmessage('profile_uid_duplicate', '', array('uid' => $uid)); } $password = md5(random(10)); if ($regipsql) { DB::query($regipsql); } if ($invite && $_G['setting']['inviteconfig']['invitegroupid']) { $groupinfo['groupid'] = $_G['setting']['inviteconfig']['invitegroupid']; } $init_arr = explode(',', $_G['setting']['initcredits']); $userdata = array('uid' => $uid, 'username' => $username, 'password' => $password, 'email' => $email, 'adminid' => 0, 'groupid' => $groupinfo['groupid'], 'regdate' => TIMESTAMP, 'credits' => $init_arr[0], 'timeoffset' => 9999); DB::insert('common_member', $userdata); $status_data = array('uid' => $uid, 'regip' => $_G['clientip'], 'lastip' => $_G['clientip'], 'lastvisit' => TIMESTAMP, 'lastactivity' => TIMESTAMP, 'lastpost' => 0, 'lastsendmail' => 0); DB::insert('common_member_status', $status_data);
function delete_user($user_id) { $user_data = get_userdata($user_id); list($uid, $user_name, $email) = uc_get_user($user_data->user_login); uc_user_delete($uid); }