简体   繁体   English

在wordpress本身之外使用wordpress用户密码

[英]Using wordpress user password outside wordpress itself

My client already has a Wordpress blog/webshop. 我的客户已经有一个Wordpress博客/网上商店。 Now she wants an extra system, that requires to login using the same data she uses to login in the Wordpress CMS, but outside the system of Wordpress. 现在,她想要一个额外的系统,需要使用她用于登录Wordpress CMS的相同数据登录,但需要在Wordpress系统之外登录。

Getting the username and password from the database is not a problem, but how can I compare the inputted password with the encrypted password from the database? 从数据库获取用户名和密码不是问题,但如何将输入的密码与数据库中的加密密码进行比较? I know I need to encrypt the inputted password, but what encryption do I need to use, to make sure I can compare those 2 passwords. 我知道我需要加密输入的密码,但我需要使用什么加密,以确保我可以比较这两个密码。

Wordpress using this function to hash passwords Wordpress使用此功能来哈希密码

function wp_hash_password($password) {
        global $wp_hasher;

        if ( empty($wp_hasher) ) {
                require_once( ABSPATH . 'wp-includes/class-phpass.php');

                // By default, use the portable hash from phpass
                $wp_hasher = new PasswordHash(8, TRUE);
        }
        return $wp_hasher->HashPassword($password);
}

You can include wp-includes/class-phpass.php file to your new system or look source make your own function 您可以将wp-includes/class-phpass.php文件包含到新系统中,或者查看源代码来创建自己的函数

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

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