fixed login error

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9422 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
devjin 2011-09-29 02:03:54 +00:00
parent 4c679ac041
commit 6b4ed81123

View file

@ -31,6 +31,7 @@
if(!$password) return new Object(-1,'null_password'); if(!$password) return new Object(-1,'null_password');
$output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false); $output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false);
if (!$output->toBool()) return $output;
$oModuleModel = &getModel('module'); $oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('member'); $config = $oModuleModel->getModuleConfig('member');
@ -48,11 +49,11 @@
} }
} }
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) { if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', ''); $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
$this->setRedirectUrl($returnUrl); $this->setRedirectUrl($returnUrl);
return; return;
} }
return $output; return $output;
} }
@ -1437,20 +1438,20 @@
// Create a member model object // Create a member model object
$oMemberModel = &getModel('member'); $oMemberModel = &getModel('member');
// check identifier // check identifier
$config = $oMemberModel->getMemberConfig(); $config = $oMemberModel->getMemberConfig();
if ($config->identifier == 'email_address'){ if ($config->identifier == 'email_address'){
// Get user_id information // Get user_id information
$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id); $this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
// Set an invalid user if no value returned // Set an invalid user if no value returned
if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return new Object(-1, 'invalid_email_address'); if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return new Object(-1, 'invalid_email_address');
}else{ }else{
// Get user_id information // Get user_id information
$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id); $this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
// Set an invalid user if no value returned // Set an invalid user if no value returned
if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return new Object(-1, 'invalid_user_id'); if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return new Object(-1, 'invalid_user_id');
} }
// Password Check // Password Check
if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password'); if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
// If denied == 'Y', notify // If denied == 'Y', notify