public static function submitcheck($var, $allowget = 0) { if (empty($GLOBALS[$var])) { return FALSE; } else { global $_SERVER, $seclevel, $seccode, $seccodedata, $seccodeverify, $secanswer, $_NCACHE, $_DCOOKIE, $timestamp, $discuz_uid; if ($allowget || $_SERVER['REQUEST_METHOD'] == 'POST' && $GLOBALS['formhash'] == GlobalCore::formhash() && empty($_SERVER['HTTP_X_FLASH_VERSION']) && (empty($_SERVER['HTTP_REFERER']) || preg_replace("/https?:\\/\\/([^\\:\\/]+).*/i", "\\1", $_SERVER['HTTP_REFERER']) == preg_replace("/([^\\:]+).*/", "\\1", $_SERVER['HTTP_HOST']))) { return TRUE; } else { GlobalCore::showmessage('submit_invalid'); } } }
} $_DSESSION['dateformat'] = empty($_DSESSION['dateformat']) ? $_CHOBITS['settings']['dateformat'] : $_DSESSION['dateformat']; $_DSESSION['timeformat'] = empty($_DSESSION['timeformat']) ? $_CHOBITS['settings']['timeformat'] : ($_DSESSION['timeformat'] == 1 ? 'h:i A' : 'H:i'); $_DSESSION['timeoffset'] = isset($_DSESSION['timeoffset']) && $_DSESSION['timeoffset'] != 9999 ? $_DSESSION['timeoffset'] : $_CHOBITS['settings']['timeoffset']; $membertablefields = ''; @extract($_DSESSION); $lastvisit = empty($lastvisit) ? $timestamp - 86400 : $lastvisit; $timenow = array('time' => gmdate("{$dateformat} {$timeformat}", $timestamp + 3600 * $timeoffset), 'offset' => $timeoffset >= 0 ? $timeoffset == 0 ? '' : '+' . $timeoffset : $timeoffset); if (PHP_VERSION > '5.1') { @date_default_timezone_set('Etc/GMT' . ($timeoffset > 0 ? '-' : '+') . abs($timeoffset)); } if (empty($nw_uid) || empty($nw_user)) { $show_cloud = 0; $nw_user = $nw_nick = ''; $nw_uid = $adminid = 0; $groupid = empty($groupid) || $groupid != 6 ? 7 : 6; } else { $nw_userss = $nw_user; $nw_user = addslashes($nw_user); $nw_nick = addslashes($nw_nick); } if ($errorreport == 2 || $errorreport == 1 && $adminid > 0) { error_reporting(E_ERROR | E_WARNING | E_PARSE); } define('FORMHASH', GlobalCore::formhash()); $rsshead = $navtitle = $navigation = ''; $_DSESSION['groupid'] = $groupid = empty($ipbanned) ? empty($groupid) ? 7 : intval($groupid) : 6; if (empty($_DCOOKIE['sid']) || $sid != $_DCOOKIE['sid']) { GlobalCore::chobits_setcookie('sid', $sid, 604800); } }