typecho 1.2.1 重置密码 / 忘记密码

杂七杂八 · 01-02 · 449 人浏览

1、新建 pass.php 在 typecho 目录

<?php
include_once './var/Utils/PasswordHash.php';
$generatedPassword = '123456';//新密码

$hasher = new \Utils\PasswordHash(8, true);
$password = $hasher->HashPassword($generatedPassword);
print_r($password . "\n");
exit;

2、打开网址 url+pass.php 获得加密字符串
3、去数据库粘贴获得的加密字符串

读代码

install.php 1285行

        // write user
        $hasher = new \Utils\PasswordHash(8, true);
        $installDb->query(
            $installDb->insert('table.users')->rows([
                'name' => $config['userName'],
                'password' => $hasher->hashPassword($config['userPassword']),
                'mail' => $config['userMail'],
                'url' => $config['userUrl'],
                'screenName' => $config['userName'],
                'group' => 'administrator',
                'created' => \Typecho\Date::time()
            ])
        );

参考(旧版本)

https://blog.csdn.net/weixin_39857866/article/details/117694628

PHP 密码 password typecho
Theme Jasmine by Kent Liao