0

Dear friends,
I am using the XML-RPC Server to implement a simple login authentication as a web service . So I wrote a function in wp-includes\class-wp-xmlrpc-server.php like

function web_auth($host, $db, $dbuser, $dbpass, $username, $password)
{
$dbhandle = mysql_connect($host, $dbuser, $dbpass) or die("Unable to connect to MySQL");
$selected = mysql_select_db($db,$dbhandle) or die("Could not select database");
//$md5_password = md5($password);
$md5_password = wp_hash_password($password);
$result = mysql_query("SELECT count(*) AS total FROM wp_users WHERE user_login='$username' AND user_pass='$md5_password' AND user_status=0");
$data=mysql_fetch_assoc($result);
//echo "SELECT count(*) AS total FROM wp_users WHERE user_login='$username' AND user_pass='$md5_password' AND user_status=0";
//die($data['total']);
if($data['total'] == 1)
{
return true;
}
return false;
}

But the password hash mechanism is not make things proper. Please help me to find the exact password in line

$md5_password = wp_hash_password($password);

Waiting your fast reply

Thanks,
Anes

2
Contributors
1
Reply
10
Views
4 Years
Discussion Span
Last Post by LastMitch
0

But the password hash mechanism is not make things proper. Please help me to find the exact password in line

@logicslab

You should have post this question on the Wordpress forum. I don't anyone has the same Wordpress database as yours. So it's a bit hard to test it out.

It would be simplier if you post it on Wordpress forum because members over there has Wordpress already set-up with a database.

Edited by LastMitch

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.