简体   繁体   English

使用wordpress数据库进行其他脚本

[英]Use wordpress database for other script

My website used to work on wordpress engine but now I'm writing my own script. 我的网站曾经使用过wordpress引擎,但是现在我正在编写自己的脚本。 The problem is that users passwords in wp_users table are encoded in a strange way... Can anyone please tell how should I encode it so that it worked on my new script? 问题是wp_users表中的用户密码是以一种奇怪的方式编码的。。。有人可以告诉我如何编码它,以便它可以在我的新脚本上使用吗?

The "encoded" password is called a hash. “编码”密码称为哈希。 Look through the wordpress code where it does the user insert and find how it hashes the password. 查看wordpress代码,用户在哪里插入代码,并找到如何散列密码。 Use that same type of scheme. 使用相同类型的方案。 It will probably use a salt, I am not familiar with how wordpress does this, but you will need that salt value as well to make an exact match. 它可能会使用一个盐,我对wordpress的用法不熟悉,但是您也需要该盐值才能完全匹配。

EDIT: 编辑:

Doing some research, you will want to take a look into the wp-includes/pluggable.php file around line 1200. It should have the salt and password generator techniques stored in there (or at least I think, I did not dig too deep into it). 做一些研究,您将需要看一下第1200行附近的wp-includes / pluggable.php文件。它应该在其中存储了salt和密码生成器技术(或者至少我认为,我并没有深入研究进去)。

As premiso said its a hash and you can find the class wordpress use here: Wordpress PasswordHash . 正如premiso所说的那样,它是一个哈希,您可以在此处找到wordpress使用的类: Wordpress PasswordHash If you review this class you can easily build it into your own script. 如果您查看此类,则可以轻松地将其构建到自己的脚本中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM