$newuser = new cls_userinfo(); $newuser->useradd($mainarr['mname'], $mainarr['password'], $mainarr['email'], $mchid); $mid = $newuser->info['mid']; $c_upload->closure(1, $mid, 'members'); $mid || message('memregisterfail', M_REFERER); if ($autocheck == 2) { $confirmid = random(6); $confirmstr = "{$timestamp}\t2\t{$confirmid}"; $subarr['confirmstr'] = $confirmstr; } foreach (array('main', 'sub', 'custom') as $var) { foreach (${$var . 'arr'} as $k => $v) { $newuser->updatefield($k, $v, $var); } } $newuser->autoinit(); $newuser->updatedb(); unset($newuser); cms_spread(empty($_REQUEST['uid']) ? '' : stripslashes($_REQUEST['uid']), 1); if ($autocheck == 1) { msetcookie('userauth', authcode("{$md5_password}\t{$mid}", 'ENCODE')); if ($enable_pptout && !empty($pptout_file) && !empty($pptout_url)) { $action = 'login'; $username = $mname; include M_ROOT . './include/pptout/' . $pptout_file . '.php'; header('location:' . $url); exit; } } elseif ($autocheck == 2) { mailto($email, 'member_active_subject', 'member_active_content', array('mid' => $mid, 'mname' => $mname, 'url' => "{$cms_abs}tools/memactive.php?action=emailactive&mid={$mid}&id={$confirmid}")); }
if ($v['available'] && !$v['issystem'] && !$v['isfunc'] && !$v['isadmin'] && in_array($k, $additems)) { $actuser->updatefield($k, @$minfos[$k], $v['tbl']); if ($arr = multi_val_arr(@$minfos[$k], $v)) { foreach ($arr as $x => $y) { $actuser->updatefield($k . '_' . $x, $y, $v['tbl']); } } } } $actuser->updatefield('mchid', $mchid, 'main'); //在更新会员资料之前一定要将原模型表中的记录删除,插入新模型表中的记录。 $db->query("DELETE FROM {$tblprefix}members_{$omchid} WHERE mid='{$minfos['mid']}'"); $db->query("INSERT INTO {$tblprefix}members_{$mchid} SET mid='{$minfos['mid']}'"); $actuser->gtidbymchid(); //检查因模型改变是否有不生效会员组 $actuser->autoinit(); $actuser->updatedb(); $db->query("UPDATE {$tblprefix}mtrans SET contentarr='',remark='',reply='',checked='1' WHERE trid='{$trid}'"); $actuser->init(); } } } unset($actuser); } adminlog(lang('memchaaltadm'), lang('memchaalliadope')); amessage('memchaaltopefin', "?entry=mtrans&action=mtransedit&page={$page}{$filterstr}"); } } elseif ($action == 'mtrandetail' && $trid) { if (!($minfos = $db->fetch_one("SELECT * FROM {$tblprefix}mtrans WHERE trid='{$trid}'"))) { amessage('choosealtrec'); }