if (in_array('avatar', $_GET['operations'])) { C::t('common_member')->update($uid, array('avatarstatus' => 0)); loaducenter(); uc_user_deleteavatar($uid); $cleartype[] = lang('forum/misc', 'avatar'); crime('recordaction', $uid, 'crime_avatar', lang('forum/misc', 'crime_reason', array('reason' => $reason))); } if (in_array('sightml', $_GET['operations'])) { C::t('common_member_field_forum')->update($uid, array('sightml' => ''), 'UNBUFFERED'); $cleartype[] = lang('forum/misc', 'signature'); crime('recordaction', $uid, 'crime_sightml', lang('forum/misc', 'crime_reason', array('reason' => $reason))); } if (in_array('customstatus', $_GET['operations'])) { C::t('common_member_field_forum')->update($uid, array('customstatus' => ''), 'UNBUFFERED'); $cleartype[] = lang('forum/misc', 'custom_title'); crime('recordaction', $uid, 'crime_customstatus', lang('forum/misc', 'crime_reason', array('reason' => $reason))); } if ($_G['group']['reasonpm'] == 2 || $_G['group']['reasonpm'] == 3 || !empty($_GET['sendreasonpm'])) { sendreasonpm(array('authorid' => $uid), 'reason_quickclear', array('cleartype' => implode(',', $cleartype), 'reason' => $reason, 'from_id' => 0, 'from_idtype' => 'quickclear')); } showmessage('quickclear_success', $_POST['redirect'], array(), array('showdialog' => 1, 'closetime' => true, 'msgtype' => 2, 'locationtime' => 1)); } } elseif ($_GET['action'] == 'getpostfeed') { $tid = intval($_GET['tid']); $pid = intval($_GET['pid']); $flag = intval($_GET['flag']); $feed = $thread = array(); if ($tid) { $thread = C::t('forum_thread')->fetch($tid); if ($flag) { $post = C::t('forum_post')->fetch($thread['posttableid'], $pid);
if (!submitcheck('modsubmit')) { $banid = $checkunban = $checkban = ''; foreach ($topiclist as $id) { $banid .= '<input type="hidden" name="topiclist[]" value="' . $id . '" />'; } $banstatus ? $checkunban = 'checked="checked"' : ($checkban = 'checked="checked"'); if ($modpostsnum == 1 || $authorcount == 1) { include_once libfile('function/member'); $crimenum = crime('getcount', $posts[0]['authorid'], 'crime_banpost'); $crimeauthor = $posts[0]['author']; } include template('forum/topicadmin_action'); } else { $banned = intval($_GET['banned']); $modaction = $banned ? 'BNP' : 'UBN'; $reason = checkreasonpm(); include_once libfile('function/member'); $pids = $comma = ''; foreach ($posts as $k => $post) { if ($banned) { C::t('forum_postcomment')->delete_by_rpid($post['pid']); C::t('forum_post')->increase_status_by_pid('tid:' . $_G['tid'], $post['pid'], 1, '|', true); crime('recordaction', $post['authorid'], 'crime_banpost', lang('forum/misc', 'crime_postreason', array('reason' => $reason, 'tid' => $_G['tid'], 'pid' => $post['pid']))); } else { C::t('forum_post')->increase_status_by_pid('tid:' . $_G['tid'], $post['pid'], 1, '^', true); } $pids .= $comma . $post['pid']; $comma = ','; } $resultarray = array('redirect' => "forum.php?mod=viewthread&tid={$_G['tid']}&page={$page}", 'reasonpm' => $sendreasonpm ? array('data' => $posts, 'var' => 'post', 'item' => 'reason_ban_post', 'notictype' => 'post') : array(), 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason), 'modtids' => 0, 'modlog' => $thread); }
include_once libfile('function/member'); if ($_GET['bannew'] == 'post') { $crimeaction = 'crime_banspeak'; $noticekey = 'member_ban_speak'; $from_idtype = 'banspeak'; } elseif ($_GET['bannew'] == 'visit') { $crimeaction = 'crime_banvisit'; $noticekey = 'member_ban_visit'; $from_idtype = 'banvisit'; } elseif ($_GET['bannew'] == 'status') { $crimeaction = 'crime_banstatus'; $noticekey = 'member_ban_status'; $from_idtype = 'banstatus'; } if ($crimeaction) { crime('recordaction', $member['uid'], $crimeaction, lang('forum/misc', 'crime_reason', array('reason' => $reason))); } if ($noticekey) { $notearr = array('user' => "<a href=\"home.php?mod=space&uid={$_G['uid']}\">{$_G['username']}</a>", 'day' => intval($_POST['banexpirynew']), 'reason' => $reason, 'from_id' => 0, 'from_idtype' => $from_idtype); notification_add($member['uid'], 'system', $noticekey, $notearr, 1); } if ($_G['adminid'] == 1 && !empty($_GET['clear']) && is_array($_GET['clear'])) { require_once libfile('function/delete'); $membercount = array(); if (in_array('post', $_GET['clear'])) { if ($member['uid']) { require_once libfile('function/post'); $tidsdelete = array(); loadcache('posttableids'); $posttables = empty($_G['cache']['posttableids']) ? array(0) : $_G['cache']['posttableids']; foreach ($posttables as $posttableid) {
private function _topicAdmin_band($fid, $tid, $pid, $act, $type, $params = array()) { extract($params); global $_G; // 在DISCUZ_ROOT/source/include/topicadmin/topicadmin_banpost.php基础上进行二次开发 if (!$_G['group']['allowbanpost']) { $this->_exitWithHtmlAlert('no_privilege_banpost'); } $topiclist = $_GET['topiclist']; $modpostsnum = count($topiclist); if (!($banpids = dimplode($topiclist))) { $this->_exitWithHtmlAlert('admin_banpost_invalid'); } elseif (!$_G['group']['allowbanpost'] || !$_G['tid']) { $this->_exitWithHtmlAlert('admin_nopermission'); } $posts = $authors = array(); $banstatus = 0; foreach (C::t('forum_post')->fetch_all('tid:' . $_G['tid'], $topiclist) as $post) { if ($post['tid'] != $_G['tid']) { continue; } $banstatus = $post['status'] & 1 || $banstatus; $authors[$post['authorid']] = 1; $posts[] = $post; } $authorcount = count(array_keys($authors)); if (!empty($_POST)) { $banned = intval($_GET['banned']); $modaction = $banned ? 'BNP' : 'UBN'; $reason = checkreasonpm(); include_once libfile('function/member'); $pids = $comma = ''; foreach ($posts as $k => $post) { if ($banned) { C::t('forum_postcomment')->delete_by_rpid($post['pid']); C::t('forum_post')->increase_status_by_pid('tid:' . $_G['tid'], $post['pid'], 1, '|', true); crime('recordaction', $post['authorid'], 'crime_banpost', lang('forum/misc', 'crime_postreason', array('reason' => $reason, 'tid' => $_G['tid'], 'pid' => $post['pid']))); } else { C::t('forum_post')->increase_status_by_pid('tid:' . $_G['tid'], $post['pid'], 1, '^', true); } $pids .= $comma . $post['pid']; $comma = ','; } $resultarray = array('redirect' => "forum.php?mod=viewthread&tid={$_G['tid']}&page={$page}", 'reasonpm' => $sendreasonpm ? array('data' => $posts, 'var' => 'post', 'item' => 'reason_ban_post', 'notictype' => 'post') : array(), 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason), 'modtids' => 0, 'modlog' => $thread); return $resultarray; } $banid = $checkunban = $checkban = ''; foreach ($topiclist as $id) { $banid .= '<input type="hidden" name="topiclist[]" value="' . $id . '" />'; } $banstatus ? $checkunban = 'checked="checked"' : ($checkban = 'checked="checked"'); if ($modpostsnum == 1 || $authorcount == 1) { include_once libfile('function/member'); $crimenum = crime('getcount', $posts[0]['authorid'], 'crime_banpost'); $crimeauthor = $posts[0]['author']; } $this->getController()->renderPartial('topicAdmin', array('formUrl' => WebUtils::createUrl_oldVersion('forum/topicadminview', array('fid' => $fid, 'tid' => $tid, 'pid' => $pid, 'act' => $act, 'type' => $type)), 'errorMsg' => $errorMsg, 'action' => $act, '_G' => $_G, 'banid' => $banid, 'checkunban' => $checkunban, 'checkban' => $checkban, 'modpostsnum' => $modpostsnum, 'crimenum' => $crimenum, 'crimeauthor' => $crimeauthor)); exit; }
if (isset($_G['cache']['medals'][$medalid]) && (!$medalexpiration || $medalexpiration > TIMESTAMP)) { $space['medals'][$key] = $_G['cache']['medals'][$medalid]; $space['medals'][$key]['medalid'] = $medalid; } else { unset($space['medals'][$key]); } } } $upgradecredit = $space['uid'] && $space['group']['type'] == 'member' && $space['group']['creditslower'] != 9999999 ? $space['group']['creditslower'] - $space['credits'] : false; $allowupdatedoing = $space['uid'] == $_G['uid'] && checkperm('allowdoing'); dsetcookie('home_diymode', 1); $navtitle = lang('space', 'sb_profile', array('who' => $space['username'])); $metakeywords = lang('space', 'sb_profile', array('who' => $space['username'])); $metadescription = lang('space', 'sb_profile', array('who' => $space['username'])); $showvideophoto = true; if ($space['videophotostatus'] > 0 && $_G['uid'] != $space['uid'] && !ckvideophoto($space, 1)) { $showvideophoto = false; } $clist = array(); if (in_array($_G['adminid'], array(1, 2, 3))) { include_once libfile('function/member'); $clist = crime('getactionlist', $space['uid']); } if (!$_G['privacy']) { if (!$_G['inajax']) { include_once template("home/space_profile"); } else { $_GET['do'] = 'card'; include_once template("home/space_card"); } }
$setarr['groupid'] = $groupidnew; C::t('common_member')->update($member['uid'], $setarr); if (DB::affected_rows()) { savebanlog($member['username'], $member['groupid'], $groupidnew, $banexpirynew, $reason); } C::t('common_member_field_forum')->update($member['uid'], array('groupterms' => serialize($member['groupterms']))); if ($_GET['bannew'] == 4) { $notearr = array('user' => "<a href=\"home.php?mod=space&uid={$_G['uid']}\">{$_G['username']}</a>", 'day' => $_GET['banexpirynew'], 'reason' => $reason, 'from_id' => 0, 'from_idtype' => 'banspeak'); notification_add($member['uid'], 'system', 'member_ban_speak', $notearr, 1); } if ($_GET['bannew'] == 5) { $notearr = array('user' => "<a href=\"home.php?mod=space&uid={$_G['uid']}\">{$_G['username']}</a>", 'day' => $_GET['banexpirynew'], 'reason' => $reason, 'from_id' => 0, 'from_idtype' => 'banvisit'); notification_add($member['uid'], 'system', 'member_ban_visit', $notearr, 1); } if ($_GET['bannew'] == 4 || $_GET['bannew'] == 5) { crime('recordaction', $member['uid'], $_GET['bannew'] == 4 ? 'crime_banspeak' : 'crime_banvisit', $reason); } acpmsg('modcp_member_ban_succeed', "{$cpscript}?mod=modcp&action={$_GET['action']}&op={$op}"); } } elseif ($op == 'ipban' && $_G['group']['allowbanip']) { require_once libfile('function/misc'); $iptoban = getgpc('ip') ? dhtmlspecialchars(explode('.', getgpc('ip'))) : array('', '', '', ''); $updatecheck = $addcheck = $deletecheck = $adderror = 0; if (submitcheck('ipbansubmit')) { $_GET['delete'] = isset($_GET['delete']) ? $_GET['delete'] : ''; if ($_GET['delete']) { $deletecheck = C::t('common_banned')->delete_by_id($_GET['delete'], $_G['adminid'], $_G['username']); } if ($_GET['ip1new'] != '' && $_GET['ip2new'] != '' && $_GET['ip3new'] != '' && $_GET['ip4new'] != '') { $addcheck = ipbanadd($_GET['ip1new'], $_GET['ip2new'], $_GET['ip3new'], $_GET['ip4new'], $_GET['validitynew'], $adderror); if (!$addcheck) {
C::t('forum_forum_threadtable')->delete_none_threads(); if (!empty($deleteredirect)) { deletethread($deleteredirect); } if (!empty($remarkclosed)) { C::t('forum_thread')->update($remarkclosed, array('closed' => 0)); } if ($_G['setting']['globalstick'] && $stickmodify) { require_once libfile('function/cache'); updatecache('globalstick'); } updateforumcount($_G['fid']); if ($_GET['crimerecord']) { include_once libfile('function/member'); foreach ($threadlist as $thread) { crime('recordaction', $thread['authorid'], 'crime_delpost', lang('forum/misc', 'crime_postreason', array('reason' => $reason, 'tid' => $thread['tid'], 'pid' => 0))); } } } elseif ($operation == 'close') { if (!$_G['group']['allowclosethread']) { showmessage('no_privilege_closethread'); } $expiration = checkexpiration($_GET['expirationclose'], $operation); $modaction = $expiration ? 'ECL' : 'CLS'; C::t('forum_thread')->update($tidsarr, array('closed' => 1, 'moderated' => 1), true); C::t('forum_threadmod')->update_by_tid_action($tidsarr, array('CLS', 'OPN', 'ECL', 'UCL', 'EOP', 'UEO'), array('status' => 0)); } elseif ($operation == 'open') { if (!$_G['group']['allowclosethread']) { showmessage('no_privilege_openthread'); } $expiration = checkexpiration($_GET['expirationopen'], $operation);
\t\t\t\t<th>{$lang['crime_operator']}: </th><td width="160"><input type="text" class="txt" name="operator" value="{$operator}" /></td> \t\t\t\t<th>{$lang['crime_action']}: </th><td><select name="crimeaction">{$crimeactionselect}</select></td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<th>{$lang['crime_user']}: </th><td><input type="text" class="txt" name="username" value="{$username}" /></td> \t\t\t\t<th>{$lang['startendtime']}: </th><td><input type="text" onclick="showcalendar(event, this)" style="width: 80px; margin-right: 5px;" value="{$starttime}" name="starttime" class="txt" /> -- <input type="text" onclick="showcalendar(event, this)" style="width: 80px; margin-left: 5px;" value="{$endtime}" name="endtime" class="txt" /></td> \t\t\t</tr> \t\t\t<tr> \t\t\t\t<th>{$lang['keywords']}: </th><td><input type="text" class="txt" name="keyword" value="{$keyword}" /></td> \t\t\t\t<th><input type="submit" name="crimesearch" value="{$lang['search']}" class="btn" /></th><td></td> \t\t\t</tr> \t\t</table> SEARCH; if (submitcheck('crimesearch', 1)) { include_once libfile('function/member'); list($count, $clist) = crime('search', $crimeaction, $username, $operator, $startime, $endtime, $keyword, $start, $lpp); showtablefooter(); showtableheader($lang[members_ban_crime_record], 'fixpadding', '', 5); if ($clist) { showtablerow('class="header"', array('class="td24"', 'class="td24"', 'class="td31"', '', 'class="td24"'), array($lang['crime_user'], $lang['crime_action'], $lang['crime_dateline'], $lang['crime_reason'], $lang['crime_operator'])); foreach ($clist as $crime) { showtablerow('', '', array('<a href="home.php?mod=space&uid=' . $crime['uid'] . '" target="_blank">' . $crime['username'] . '</a>', $lang[$crime['action']], date('Y-m-d H:i:s', $crime['dateline']), $crime['reason'], '<a href="home.php?mod=space&uid=' . $crime['operatorid'] . '" target="_blank">' . $crime['operator'] . '</a>')); } $multipage = multi($count, $lpp, $page, ADMINSCRIPT . "?action=logs&operation={$operation}&keyword=" . rawurlencode($_GET['keyword']) . "&starttime={$starttime}&endtime={$endtime}&username="******"&operator=" . rawurlencode($operator) . "&crimeaction={$crimeaction}&lpp={$lpp}&crimesearch=yes"); } else { showtablerow('', 'colspan=5', array($lang['none'])); } } } elseif ($operation == 'credit') { $operationlist = array('TRC', 'RTC', 'RAC', 'MRC', 'TFR', 'RCV', 'CEC', 'ECU', 'SAC', 'BAC', 'PRC', 'RSC', 'STC', 'BTC', 'AFD', 'UGP', 'RPC', 'ACC', 'RCT', 'RCA', 'RCB', 'CDC', 'RKC', 'BME', 'RPR', 'RPZ'); $rdata = array('task' => array('TRC'), 'thread' => array('RTC', 'RAC', 'STC', 'BTC', 'ACC', 'RCT', 'RCA', 'RCB'), 'member' => array('TFR', 'RCV', 'CEC', 'ECU', 'AFD', 'CDC', 'RKC', 'RPR', 'RPZ'), 'attach' => array('BAC', 'SAC'), 'magic' => array('MRC', 'BGC', 'RGC', 'AGC', 'BMC'), 'medal' => array('BME'), 'post' => array('PRC', 'RSC'), 'usergroup' => array('UGP'), 'report' => array('RPC'));