You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I needed to override the identity class that the LoginForm::validatePassword() is using ($user)
My point is I wanted to change User::ValidatePassword() to add an LDAP based password check
What is the expected result?
I expected when I add a dependency injection to change '\luya\admin\models\User' to my customer 'app\components\User' which extends the luya User and alter the password validation
What do you get instead? (A Screenshot can help us a lot!)
Always the luya code User model is loaded because the LoginForm::getUser() is returning an object based on $this->_user = User::findByEmail($this->email);
I prose to update the getUser() to this instead :
/** * @return boolean|User */publicfunctiongetUser()
{
if (!$this->_user) {
$class = Yii::$app->adminuser->identityClass;
$this->_user = $class::findByEmail($this->email);
// $this->_user = User::findByEmail($this->email); /* this is the current way of returning the user object */
}
return$this->_user;
}
this way, If I define a customer admin user class where I update the identity class to my own, it will work.
LUYA Check ouput (run this script and post the result: luyacheck.php)
Additional infos
Q
A
LUYA Version
PHP Version
Platform
Apache/XAMPP/MAMPP/etc.
Operating system
Windows/Linux Server/OSX/etc.
The text was updated successfully, but these errors were encountered:
What steps will reproduce the problem?
I needed to override the identity class that the
LoginForm::validatePassword()
is using ($user)My point is I wanted to change User::ValidatePassword() to add an LDAP based password check
What is the expected result?
I expected when I add a dependency injection to change '\luya\admin\models\User' to my customer 'app\components\User' which extends the luya User and alter the password validation
What do you get instead? (A Screenshot can help us a lot!)
Always the luya code User model is loaded because the
LoginForm::getUser()
is returning an object based on$this->_user = User::findByEmail($this->email);
I prose to update the getUser() to this instead :
this way, If I define a customer admin user class where I update the identity class to my own, it will work.
LUYA Check ouput (run this script and post the result: luyacheck.php)
Additional infos
The text was updated successfully, but these errors were encountered: