As you an see, i am not getting the expected results from 'crypt'.
What started this problem was i have switched my development pc's operating system from win7 to Ubuntu 14, and there was a few small case-sensitive issues i had to fix while moving my site, however this is a security issue that was allowing anyone to login using the wrong password, that is before i added the 'if(strlen($newPassword)!=60)' check.
If anyone else has seen this issue, please let me know how you solved it
public function setPassword($password) {
$salt = Util::generateRndStr(<img src='http://forums.phpfreaks.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='8)' />;
$newPassword = self::encrypt($password, $salt);
echo 'pass='.$password.'<br />';
echo 'salt='.$salt.'<br />';
echo 'ePas='.$newPassword.'<br />';
if(strlen($newPassword)!=60){
trigger_error('Internal issue with Member::encrypt.',E_USER_WARNING);
return false;
}
$statement = $this->connection->prepare('UPDATE members SET passwrd = ?, sal_t = ? WHERE id = ? LIMIT 1;');
$id = $this->get('id');
$statement->bindParam(1, $newPassword, PDO::PARAM_STR);
$statement->bindParam(2, $salt, PDO::PARAM_STR);
$statement->bindParam(3, $id, PDO::PARAM_INT);
$statement->execute();
return $statement->rowCount() == 1;
}
public static function encrypt($string, $salt) {
return crypt($string, '$2y$10$' . $salt . '$');
}












