<?php

$verify = $request['verify'];
if (empty($verify))
{
    message("ERR:verify不能为空,认证失败",$core->url, 3);
}
$strKey = $inte->CONFIG['code'];
$username = $request['userName'];
$strSysDatetime = $request['strSysDatetime'];
$jsName = $request['jsName'];

$time = substr($strSysDatetime,0,10).' '.substr($strSysDatetime,10);

if(abs(strtotime($time) - time())>600){
    message("ERR:超时,认证失败",$core->url, 3);
}

$verify = str_replace(array(' ','+','-','/','='),'',$verify);

$mtxt = MD5($username . $strKey . $strSysDatetime . $jsName);
$mtxt = str_replace(array(' ','+','-','/','='),'',$mtxt);
if(strtolower($verify)==strtolower($mtxt)){
    $inte->login($username);
    message($P8LANG['login_success'], $core->url, 3);
}else{
    message( "ERR:认证失败",$core->url, 3);
}
