示例#1
0
function check_bbpress($password, $user)
{
    // WordPress (and so bbPress) used simple md5 hashing some time ago
    if (strlen($user['passwordconvert']) <= 32) {
        return $user['passwordconvert'] == md5($password);
    } else {
        $hash = bbpress_crypt_private($password, $user['passwordconvert']);
        if ($hash[0] == '*') {
            $hash = crypt($password, $user['passwordconvert']);
        }
        return $hash === $user['passwordconvert'];
    }
}
示例#2
0
 function authenticate_bbpress($password)
 {
     if (bbpress_crypt_private($password, $this->user['passwordconvert'])) {
         return true;
     }
     return false;
 }