CypherX/xAuth — Issue #26: My PhpBB plugin
Author: timaaarrreee
Created: 2012-02-23 02:20:33+00:00
State: open

I'm trying to make a phpbb plugin but i don't understand the return value of your checkPassword($realpass, $checkpass)

here is my code
```php
= strlen($realPass) ? strlen($realPass) : strlen($checkPass));

// extract salt
$salt = substr($realPass, $saltPos, 12);

$hash = hash('whirlpool', $salt . $checkPass);
error_log(substr($hash, 0, $saltPos) . $salt . substr($hash, $saltPos) == $realPass);
error_log("About to return");
return substr($hash, 0, $saltPos) . $salt . substr($hash, $saltPos) == $realPass;
}
function checkIfExists($username)
{
mysql_connect("localhost", "forums", "mcWGS2012forums");
mysql_select_db("forums");
$query = "select * from `phpbb_users` where `username` = $username";
$result = mysql_query($query);
mysql_close(); //
if(mysql_num_rows($result) == 1)
{
return true;
}
else
{
return false;
}
}
function getUserDetails($user)
{
mysql_connect("localhost", "forums", "mcWGS2012forums");
mysql_select_db("forums");
$query = "select * from `phpbb_users` where `username` = $username";
$result = mysql_query($query);
mysql_close(); //
if(mysql_num_rows($result) == 1)
{
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$userData = array();
$userData['user_id'] = $row['user_id'];
$userData['username'] = $row['username'];
return $userData;
}
else
{
return false;
}
}

?>
```