Kohana使用文件驱动程序更改管理员的密码


Kohana-Change password for admin using file driver

如何使用文件驱动程序在kohana中更改用户的密码?

对于Auth文件驱动程序,密码存储在Auth配置文件-modules/auth/config/auth.php中,因此如果要更改用户密码,则必须编辑该文件。默认情况下,内容如下所示:

return array(
    'driver'       => 'file',
    'hash_method'  => 'sha256',
    'hash_key'     => NULL,
    'lifetime'     => 1209600,
    'session_type' => Session::$default,
    'session_key'  => 'auth_user',
    // Username/password combinations for the Auth File driver
    'users' => array(
        // 'admin' => 'b3154acf3a344170077d11bdb5fff31532f679a1919e716a02',
    ),
);

请注意,密码是用Auth::hash方法加密的——您必须首先使用它来获得新密码的哈希值。

我认为你正在考虑让你的用户通过网站更改密码——没有好的方法可以做到这一点,我建议改用ORM驱动程序。