这个接口文件:class\dao\userdata\simplepostnukeuserdataprovider.class.php中的authenticateUser( $username, $pass )不支持中文名,请问修改哪里让它可以支持中文用户名,谢谢
function authenticateUser( $username, $pass )
{
// Check if we find the user in the LifeType DB
$user = $this->getUserInfoFromUsername( $username );
if( $user ) {
return( $user->getPassword() == md5($pass));
}
// Check if the user is available in the PostNuke database...
else {
$query = "SELECT * FROM ".$this->_postnukedbprefix."users WHERE pn_uname = '".Db::qstr( $username )."' AND pn_pass = '".md5( $pass )."'";
$result = $this->_dbc->Execute( $query );
if( (!$result) || ($result == false) ) {
return false;
}
// let's add the user to the lt userbase
elseif ( $result->RecordCount() == 1 ) {
$result->Close();
$pnUserdata = $this->getUserInfoFromPostNukeUser( $username );
$user = new UserInfo( $pnUserdata["pn_uname"],
$pnUserdata["pn_pass"],
$pnUserdata["pn_email"],
"",
$pnUserdata["pn_name"],
0,
serialize(Array())
);
$user->setStatus( USER_STATUS_ACTIVE );
$newUserId = $this->addUser( $user );
if( !$newUserId ) {
return false;
}
//add Blog
$this->_PostNukeAddBlog($username, $newUserId);
return true;
}
else{
// TODO: shouldn't ever happen?
$result->Close();
}
// return false if user authentication failed on both databases
return false;
}
} // authenticateUser