Joomla password check for wordpress


Hi to All,

Today we will see about joomla password check method for wordpress side.

Normally most of joomla website owners moving to wordpress. Joomla Users Migrating to wordpress users. I think most of the developers did joomla users to wordpress users. Like Firstname, Lastname, username and all information. But when we login from wordpress site, it does not work. So we have to use joomla MD5 password with SALT method. After you migrating the joomla users and wordpress users table. You need to put these code to wordpress includes directory.

Step 1: You have to open this file – /wp-includes/class-phpass.php. Check the end of the code with function. You have to replace this.

function CheckPassword($password, $stored_hash)
{
$hash = $this->crypt_private($password, $stored_hash);
if ($hash[0] == '*')
$hash = crypt($password, $stored_hash);

return $hash == $stored_hash;
}

to replace this code.

function CheckPassword($password, $stored_hash)
{
$password_for_check = $password;
if( @count( $pass_array = @explode(':',$stored_hash) ) == 2 ){
$joomla_pass = $pass_array[0];
$joomla_salt = $pass_array[1];
if($joomla_pass == md5($password_for_check.$joomla_salt))
return 1;
}

$hash = $this->crypt_private($password, $stored_hash);
if ($hash[0] == '*')
$hash = crypt($password, $stored_hash);

return $hash == $stored_hash;
}

Thats it. Now you can login with joomla username and password.

Before you migrating the joomla users to wordpress users, you have check the wp_users table column password. Because joomla MD5 password length is little high. but wordpress table column password length is too short. You have to increase it.

Note:
If we upgrade wordpress, password length again changed to too short. You have to increase the password column limit to 256 varchar.

That’s ALL. If anything you want to know, please comment here.

Thank you.