Example #1
0
    case 'plugin':
        $script = 'plugin';
        break;
    default:
        $_G['gp_action'] = $script = 'home';
        $modtpl = 'modcp_home';
}
$script = empty($script) ? 'noperm' : $script;
$modtpl = empty($modtpl) ? !empty($script) ? 'modcp_' . $script : '' : $modtpl;
$modtpl = 'forum/' . $modtpl;
$op = isset($op) ? trim($op) : '';
if ($script != 'log') {
    include libfile('function/misc');
    $extra = implodearray(array('GET' => $_GET, 'POST' => $_POST), array('cppwd', 'formhash', 'submit', 'addsubmit'));
    $modcplog = array(TIMESTAMP, $_G['username'], $_G['adminid'], $_G['clientip'], $_G['gp_action'], $op, $_G['fid'], $extra);
    writelog('modcp', implode("\t", clearlogstring($modcplog)));
}
require DISCUZ_ROOT . './source/include/modcp/modcp_' . $script . '.php';
$reportnum = $modpostnum = $modthreadnum = $modforumnum = 0;
$modforumnum = count($modforums['list']);
if ($modforumnum) {
    $modnum = ($_G['group']['allowmodpost'] ? getcountofposts(DB::table('forum_post'), "invisible='-2' AND first='0' and fid IN({$modforums['fids']})") + DB::result_first("SELECT COUNT(*) FROM " . DB::table('forum_thread') . " WHERE fid IN({$modforums['fids']}) AND displayorder='-2'") : 0) + ($_G['group']['allowmoduser'] ? DB::result_first("SELECT COUNT(*) FROM " . DB::table('common_member_validate') . " WHERE status='0'") : 0);
}
switch ($_G['adminid']) {
    case 1:
        $access = '1,2,3,4,5,6,7';
        break;
    case 2:
        $access = '2,3,6,7';
        break;
    default:
Example #2
0
function clearlogstring($str)
{
    if (!empty($str)) {
        if (!is_array($str)) {
            $str = dhtmlspecialchars(trim($str));
            $str = str_replace(array("\t", "\r\n", "\n", "   ", "  "), ' ', $str);
        } else {
            foreach ($str as $key => $val) {
                $str[$key] = clearlogstring($val);
            }
        }
    }
    return $str;
}
Example #3
0
if (empty($_G['uid'])) {
    setcookie('_refer', $_SERVER['SCRIPT_NAME'] . '?action=' . $_GET['action'] . '&m=' . $GET['m']);
    showmessage('admin_login', $b_url);
}
/*
//常見id處理
foreach(array('itemid', 'nid', 'uid', 'catid', 'shopid', 'albumid', 'groupid', 'upid', 'displayorder', 'cmid') as $value) {
	//$_GET[$value] = $_POST[$value] = $_REQUEST[$value] = intval(!empty($_POST[$value])?$_POST[$value]:(!empty($_GET[$value])?$_GET[$value]:0));
}
*/
//載入語言包
include_once B_ROOT . './language/admin.lang.php';
$lang = array_merge($lang, $alang);
//記錄log
$extralog = implodearray(array('GET' => $_GET, 'POST' => $_POST), array('formhash', 'submit', 'action'));
writelog(substr($BASESCRIPT, 0, -4) . 'log', implode("\t", clearlogstring(array($_G['timestamp'], $_G['username'], $_G['clientip'], $_REQUEST['action'], $extralog))));
if (!in_array($_GET['m'], $models)) {
    $_GET['m'] = 'shop';
}
//讀入緩存
if (!in_array($_GET['m'], array('album', 'photo', 'brandlinks'))) {
    $cacheinfo = getmodelinfoall('modelname', $_GET['m']);
    $mname = $cacheinfo['models']['modelname'];
    $mid = $cacheinfo['models']['mid'];
    $categorylist = $_G['categorylist'];
} else {
    $mname = $_GET['m'];
}
//審核等級對應關係
$_SGLOBAL['shopgrade'] = array(3 => $lang['grade_3'], 1 => $lang['grade_1'], 2 => $lang['grade_2'], 0 => $lang['grade_0'], 5 => $lang['grade_5']);
if ($_GET['m'] != 'shop') {
 function writecplog()
 {
     global $_G;
     $extralog = implodearray(array('GET' => $_GET, 'POST' => $_POST), array('formhash', 'submit', 'addsubmit', 'admin_password', 'sid', 'action'));
     writelog('cplog', implode("\t", clearlogstring(array($_G['timestamp'], $_G['username'], $_G['adminid'], $_G['clientip'], getgpc('action'), $extralog))));
 }
Example #5
0
 $operation = !empty($operation) && is_string($operation) ? trim($operation) : '';
 $page = isset($page) ? intval(max(1, $page)) : 0;
 if (!empty($action) && !in_array($action, array('main', 'logs'))) {
     switch ($cpaccess) {
         case 1:
             $extralog = 'AUTHENTIFICATION(ERROR #' . intval($adminsession['errorcount']) . ')';
             break;
         case 3:
             $extralog = implodearray(array('GET' => $_GET, 'POST' => $_POST), array('formhash', 'submit', 'addsubmit', 'admin_password', 'sid', 'action'));
             break;
         default:
             $extralog = '';
     }
     $extralog = trim(str_replace(array('GET={};', 'POST={};'), '', $extralog));
     $extralog = $action == 'home' && isset($securyservice) || $action == 'insenz' && in_array($operation, array('register', 'binding')) ? '' : $extralog;
     writelog('cplog', implode("\t", clearlogstring(array($timestamp, $discuz_userss, $adminid, $onlineip, $action, $extralog))));
     unset($extralog);
 }
 $isfounder = $adminsession->isfounder = isfounder();
 if (empty($action) || isset($frames)) {
     $extra = cpurl('url');
     $extra = $extra && $action ? $extra : (!empty($runwizard) ? 'action=runwizard' : 'action=home');
     require_once DISCUZ_ROOT . './admin/main.inc.php';
 } elseif ($action == 'logout') {
     $adminsession->destroy();
     dheader("Location: {$indexname}");
 } else {
     checkacpaction($action, $operation);
     if (in_array($action, array('home', 'settings', 'members', 'profilefields', 'admingroups', 'usergroups', 'ranks', 'forums', 'threadtypes', 'threads', 'moderate', 'attach', 'smilies', 'recyclebin', 'prune', 'styles', 'plugins', 'tasks', 'magics', 'medals', 'google', 'qihoo', 'video', 'announce', 'faq', 'ec', 'tradelog', 'creditwizard', 'jswizard', 'project', 'counter', 'misc', 'adv', 'insenz', 'logs', 'tools', 'checktools', 'search', 'upgrade')) || $isfounder && in_array($action, array('runwizard', 'templates', 'db'))) {
         require_once DISCUZ_ROOT . './admin/' . $action . '.inc.php';
         $title = 'cplog_' . $action . ($operation ? '_' . $operation : '');