PHPCMS V9版的会员登陆验证方法, 从程序里提取出来的。
$phpcms_auth = param::get_cookie('auth');
if($phpcms_auth) {
$auth_key = md5(pc_base::load_config('system', 'auth_key').$_SERVER['HTTP_USER_AGENT']);
list($userid, $password) = explode("\t", sys_auth($phpcms_auth, 'DECODE', $auth_key));
if($userid >0) {
} else {$phpcms_auth = param::get_cookie('auth');
if($phpcms_auth) {
$auth_key = md5(pc_base::load_config('system', 'auth_key').$_SERVER['HTTP_USER_AGENT']);
list($userid, $password) = explode("\t", sys_auth($phpcms_auth, 'DECODE', $auth_key));
if($userid >0) {
exit(trim_script($_GET['callback']).'('.json_encode(array('status'=>-1)).')');
}
} else {
exit(trim_script($_GET['callback']).'('.json_encode(array('status'=>-1)).')');
}
用户的ID从这里获取到
list($userid, $password) = explode("\t", sys_auth($phpcms_auth, 'DECODE', $auth_key));
$userid > 0, 表明会员已经成功登陆系统。