mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 08:12:17 +09:00
#266 zbxe에서 비밀번호 체크시 memberModel::isValidPassword(hashes, plain)을 이용하면 md5, mysql password/old_password에 대한 검사를 할 수 있게 하여 마이그레이션 된 게시글/댓글의 비밀번호 검사도 가능하도록 변경
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3007 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
4624c74dbd
commit
d4c6825802
5 changed files with 64 additions and 73 deletions
|
|
@ -610,5 +610,27 @@
|
|||
if($output->data->count) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 입력된 plain text 비밀번호와 DB에 저장된 비밀번호와의 비교
|
||||
**/
|
||||
function isValidPassword($hashed_password, $password_text) {
|
||||
// 입력된 비밀번호가 없으면 무조건 falase
|
||||
if(!$password_text) return false;
|
||||
|
||||
// md5 해쉬된값가 맞으면 return true
|
||||
if($hashed_password == md5($password_text)) return true;
|
||||
|
||||
// mysql_pre4_hash_password함수의 값과 동일하면 return true
|
||||
if(mysql_pre4_hash_password($password_text) == $hashed_password) return true;
|
||||
|
||||
// 현재 DB에서 mysql DB를 이용시 직접 old_password를 이용하여 검사하고 맞으면 비밀번호를 변경
|
||||
if(substr(Context::getDBType(),0,5)=='mysql') {
|
||||
$oDB = &DB::getInstance();
|
||||
if($oDB->isValidOldPassword($password_text, $hashed_password)) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue