On my project I want to check the password that username wasn't present in the registration form.
That means if username: "vijay" means this "vijay" was not used in password. if the user used this error need to be occur.
eg:
username :vijay
password :vijay05 or vijay05 or 05vijay05
error: don't use username in the password.
This is the result i need.Is their any logic help me out.
public function checkPassword($attribute, $params)
{
if (strpos($this->password, $this->username) !== false)
{
$this->addError('password', 'Your password must not contain your user name.');
}
}
public function checkPassword($password, $username)
{
if (strpos($this->password, $this->username) !== false)
{
$this->addError('password', 'Your password must not contain your user name.');
}
}
and am using md5 in the password field, is that issue for not checking properly?