I'm looking at the auth class in Kohana 3 as well as a login script. When the login page calls the login function of the auth class, it is returned via a protected abstract function _login. Why would you do that out of curiosity? I can't seem to understand what would really be the difference since you'd be returning the same data either way. The one option that does swim around in my head is that by returning via a protected abstract you'd be making sure the data wasn't modified from the time it was put into the auth->login function and the time it leaves it. I'm trying to understand some of the nuances. Thanks.
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);
}
return $this->_login($username, $password, $remember);
}
and then....
abstract protected function _login($username, $password, $remember);