Generated passwords causing logouts
-
I’ve setup a new install of WordPress and I’m trying to import a load of users from another site (non wordpress). The existing users data is stored in a MySQL table and the passwords aren’t encrypted.
I’ve created my own standalone script which loops through the old users data and then inserts it into the wp_users and wp_usermeta tables. All goes well when I run the script and all the data goes into the right places. The trouble I’m having though is that the passwords are working (allowing users to login) but logging the users out when they go to their ‘edit profile’ screens. I think it must have something to do with the way that they are generated using the built in ‘wp_hash_password()’ function.
If I go into any of the users profiles and update their passwords, all starts to work fine and they aren’t logged out after that which leads me to believe that it’s something wrong with the way that I’m generating the passwords.
Here’s the snippet of code that I’m using to generate the passwords:
function wp_hash_password($password) { global $wp_hasher; if ( empty($wp_hasher) ) { require_once('wp-includes/class-phpass.php'); $wp_hasher = new PasswordHash(12, true); } return $wp_hasher->HashPassword($password); } $new_pass = wp_hash_password($old_password);Anyone got any ideas on what could be going wrong?
The topic ‘Generated passwords causing logouts’ is closed to new replies.