update multi language login site

CR: sonhh (fake)
This commit is contained in:
2021-09-23 11:38:22 +07:00
parent 61e82f68ca
commit e4829d7f78
7 changed files with 58 additions and 16 deletions

View File

@@ -43,11 +43,18 @@ class LoginForm extends Model {
if (!$this->hasErrors()) {
$user = $this->getUser();
if (!$user || !$user->validatePassword($this->password)) {
$this->addError($attribute, 'Incorrect username or password.');
$this->addError($attribute, Yii::t("app", "TEN_DANG_NHAP_HOAC_MAT_KHAU_KHONG_DUNG"));
}
}
}
public function attributeLabels() {
return [
'username' => Yii::t("app", "TEN_DANG_NHAP"),
'password' => Yii::t("app", "MAT_KHAU")
];
}
/**
* Logs in a user using the provided username and password.
* @return bool whether the user is logged in successfully