我们正在开发一个管理用户的软件,我需要使用 Kohana 3 和 Auth Module 构建一个应用程序。我的应用程序将只允许登录。用户登录时,我不需要在密码中添加盐。我该怎么做?谢谢你。
编辑:
我知道,它错了,但我改变了核心。现在我加密没有盐的密码:/kohana/modules/auth/classes/model/auth/user.php
public function login($username, $password, $remember = FALSE)
{
if (empty($password))
return FALSE;
if (is_string($password))
{
// Get the salt from the stored password
//$salt = $this->find_salt($this->password($username));
// Create a hashed password using the salt from the stored password
//$password = $this->hash_password($password, $salt);
$password = sha1($password);
}
return $this->_login($username, $password, $remember);
}