I need to check that user password is correct.
I written some code, but it throws that error: Unable to determine password encryption
PHP
<?php
require_once('global.php');
if(check_is_right($_GET['user'], $_GET['password']) )
echo "true";
else
echo "false";
function check_is_right($username, $password){
$sql = "SELECT username, password FROM wcf".WCF_N."_user WHERE username='".$username."'";
$statement = \wcf\system\WCF::getDB()->prepareStatement($sql, 1);
$statement->execute();
$row = $statement->fetchSingleRow();
if($row["password"] == null){
return false;
}
if (wcf\util\PasswordUtil::checkPassword($row["username"], $password, $row["password"])){
return true;
}
return false;
}
?>
Display More
Third argument for checkPassword is hashed password from database,
detectEncryption from PasswordUtil returns unknown, idk why.
Sorry, I don;t have permissions to post in support category :c