;
//if($ip != $_ip) return FALSE;
//if($time - $_time > 86400) return FALSE;
// 检查密码是否被修改。
if($time - $_time > 1800) {
$user = user_read($_uid);
if(empty($user)) return 0;
if(md5($user['password']) != $_pwd) {
return 0;
}
}
return $_uid;
}
// 设置 token,防止 sid 过期后被删除
function user_token_set($uid) {
global $time, $conf;
if(empty($uid)) return;
$token = user_token_gen($uid);
setcookie('bbs_token', $token, $time + 8640000, $conf['cookie_path']);
}
function user_token_clear() {
global $time, $conf;
setcookie('bbs_token', '', $time - 8640000, $conf['cookie_path']);
}
function user_token_gen($uid) {
global $ip, $time, $conf;
$user = user_read($uid);
$pwd = md5($user['password']);
$tokenkey = md5(xn_key());
$token = xn_encrypt("$ip $time $uid $pwd", $tokenkey);
return $token;
}
// 前台登录验证
function user_login_check() {
global $user;
empty($user) AND http_location(url('user-login'));
}
// 获取用户来路
function user_http_referer() {
$referer = param('referer'); // 优先从参数获取 | GET is priority
empty($referer) AND $referer = array_value($_SERVER, 'HTTP_REFERER', '');
$referer = str_replace(array('\"', '"', '<', '>', ' ', '*', "\t", "\r", "\n"), '', $referer); // 干掉特殊字符 strip special chars
if(
!preg_match('#^(http|https)://[\w\-=/\.]+/[\w\-=.%\#?]*$#is', $referer)
|| strpos($referer, 'user-login.htm') !== FALSE
|| strpos($referer, 'user-logout.htm') !== FALSE
|| strpos($referer, 'user-create.htm') !== FALSE
|| strpos($referer, 'user-setpw.htm') !== FALSE
|| strpos($referer, 'user-resetpw_complete.htm') !== FALSE
) {
$referer = './';
}
return $referer;
}
function user_auth_check($token) {
global $time;
$auth = param(2);
$s = decrypt($auth);
empty($s) AND message(-1, lang('decrypt_failed'));
$arr = explode('-', $s);
count($arr) != 3 AND message(-1, lang('encrypt_failed'));
list($_ip, $_time, $_uid) = $arr;
$_user = user_read($_uid);
empty($_user) AND message(-1, lang('user_not_exists'));
$time - $_time > 3600 AND message(-1, lang('link_has_expired'));
return $_user;
}
?>;
//if($ip != $_ip) return FALSE;
//if($time - $_time > 86400) return FALSE;
// 检查密码是否被修改。
if($time - $_time > 1800) {
$user = user_read($_uid);
if(empty($user)) return 0;
if(md5($user['password']) != $_pwd) {
return 0;
}
}
return $_uid;
}
// 设置 token,防止 sid 过期后被删除
function user_token_set($uid) {
global $time, $conf;
if(empty($uid)) return;
$token = user_token_gen($uid);
setcookie('bbs_token', $token, $time + 8640000, $conf['cookie_path']);
}
function user_token_clear() {
global $time, $conf;
setcookie('bbs_token', '', $time - 8640000, $conf['cookie_path']);
}
function user_token_gen($uid) {
global $ip, $time, $conf;
$user = user_read($uid);
$pwd = md5($user['password']);
$tokenkey = md5(xn_key());
$token = xn_encrypt("$ip $time $uid $pwd", $tokenkey);
return $token;
}
// 前台登录验证
function user_login_check() {
global $user;
empty($user) AND http_location(url('user-login'));
}
// 获取用户来路
function user_http_referer() {
$referer = param('referer'); // 优先从参数获取 | GET is priority
empty($referer) AND $referer = array_value($_SERVER, 'HTTP_REFERER', '');
$referer = str_replace(array('\"', '"', '<', '>', ' ', '*', "\t", "\r", "\n"), '', $referer); // 干掉特殊字符 strip special chars
if(
!preg_match('#^(http|https)://[\w\-=/\.]+/[\w\-=.%\#?]*$#is', $referer)
|| strpos($referer, 'user-login.htm') !== FALSE
|| strpos($referer, 'user-logout.htm') !== FALSE
|| strpos($referer, 'user-create.htm') !== FALSE
|| strpos($referer, 'user-setpw.htm') !== FALSE
|| strpos($referer, 'user-resetpw_complete.htm') !== FALSE
) {
$referer = './';
}
return $referer;
}
function user_auth_check($token) {
global $time;
$auth = param(2);
$s = decrypt($auth);
empty($s) AND message(-1, lang('decrypt_failed'));
$arr = explode('-', $s);
count($arr) != 3 AND message(-1, lang('encrypt_failed'));
list($_ip, $_time, $_uid) = $arr;
$_user = user_read($_uid);
empty($_user) AND message(-1, lang('user_not_exists'));
$time - $_time > 3600 AND message(-1, lang('link_has_expired'));
return $_user;
}
?>
Error[2]: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time, File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 189
File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 189, ini_set(session.name , bbs_sid)
File: /www/wwwroot/xiuno/tmp/index.inc.php, Line: 12, sess_start()
File: /www/wwwroot/xiuno/index.php, Line: 52, include(/www/wwwroot/xiuno/tmp/index.inc.php)
Error[2]: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time, File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 191
File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 191, ini_set(session.use_cookies , On)
File: /www/wwwroot/xiuno/tmp/index.inc.php, Line: 12, sess_start()
File: /www/wwwroot/xiuno/index.php, Line: 52, include(/www/wwwroot/xiuno/tmp/index.inc.php)
Error[2]: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time, File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 192
File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 192, ini_set(session.use_only_cookies , On)
File: /www/wwwroot/xiuno/tmp/index.inc.php, Line: 12, sess_start()
File: /www/wwwroot/xiuno/index.php, Line: 52, include(/www/wwwroot/xiuno/tmp/index.inc.php)
Error[2]: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time, File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 193
File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 193, ini_set(session.cookie_domain , )
File: /www/wwwroot/xiuno/tmp/index.inc.php, Line: 12, sess_start()
File: /www/wwwroot/xiuno/index.php, Line: 52, include(/www/wwwroot/xiuno/tmp/index.inc.php)
Error[2]: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time, File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 194
File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 194, ini_set(session.cookie_path , )
File: /www/wwwroot/xiuno/tmp/index.inc.php, Line: 12, sess_start()
File: /www/wwwroot/xiuno/index.php, Line: 52, include(/www/wwwroot/xiuno/tmp/index.inc.php)
Error[2]: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time, File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 195
File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 195, ini_set(session.cookie_secure , Off)
File: /www/wwwroot/xiuno/tmp/index.inc.php, Line: 12, sess_start()
File: /www/wwwroot/xiuno/index.php, Line: 52, include(/www/wwwroot/xiuno/tmp/index.inc.php)
Error[2]: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time, File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 196
File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 196, ini_set(session.cookie_lifetime , 8640000)
File: /www/wwwroot/xiuno/tmp/index.inc.php, Line: 12, sess_start()
File: /www/wwwroot/xiuno/index.php, Line: 52, include(/www/wwwroot/xiuno/tmp/index.inc.php)
Error[2]: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time, File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 197
File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 197, ini_set(session.cookie_httponly , On)
File: /www/wwwroot/xiuno/tmp/index.inc.php, Line: 12, sess_start()
File: /www/wwwroot/xiuno/index.php, Line: 52, include(/www/wwwroot/xiuno/tmp/index.inc.php)
Error[2]: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time, File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 199
File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 199, ini_set(session.gc_maxlifetime , 3600)
File: /www/wwwroot/xiuno/tmp/index.inc.php, Line: 12, sess_start()
File: /www/wwwroot/xiuno/index.php, Line: 52, include(/www/wwwroot/xiuno/tmp/index.inc.php)
Error[2]: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time, File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 200
File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 200, ini_set(session.gc_probability , 1)
File: /www/wwwroot/xiuno/tmp/index.inc.php, Line: 12, sess_start()
File: /www/wwwroot/xiuno/index.php, Line: 52, include(/www/wwwroot/xiuno/tmp/index.inc.php)
Error[2]: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time, File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 201
File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 201, ini_set(session.gc_divisor , 500)
File: /www/wwwroot/xiuno/tmp/index.inc.php, Line: 12, sess_start()
File: /www/wwwroot/xiuno/index.php, Line: 52, include(/www/wwwroot/xiuno/tmp/index.inc.php)
Error[2]: session_set_save_handler(): Cannot change save handler when headers already sent, File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 203
File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 203, session_set_save_handler(sess_open , sess_close , sess_read , sess_write , sess_destroy , sess_gc)
File: /www/wwwroot/xiuno/tmp/index.inc.php, Line: 12, sess_start()
File: /www/wwwroot/xiuno/index.php, Line: 52, include(/www/wwwroot/xiuno/tmp/index.inc.php)
Error[2]: session_start(): Cannot start session when headers already sent, File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 210
File: /www/wwwroot/xiuno/tmp/model_session.func.php, Line: 210, session_start()
File: /www/wwwroot/xiuno/tmp/index.inc.php, Line: 12, sess_start()
File: /www/wwwroot/xiuno/index.php, Line: 52, include(/www/wwwroot/xiuno/tmp/index.inc.php)
Fatal error : Uncaught Error: Call to undefined function post_count() in /www/wwwroot/xiuno/tmp/model_runtime.func.php:12
Stack trace:
#0 /www/wwwroot/xiuno/tmp/index.inc.php(46): runtime_init()
#1 /www/wwwroot/xiuno/index.php(52): include('/www/wwwroot/xi...')
#2 {main}
thrown in /www/wwwroot/xiuno/tmp/model_runtime.func.php on line 12