diff --git a/application/Models/Aauth/UserModel.php b/application/Models/Aauth/UserModel.php index 9b72713..b2fd178 100644 --- a/application/Models/Aauth/UserModel.php +++ b/application/Models/Aauth/UserModel.php @@ -98,8 +98,8 @@ class UserModel extends Model $this->table = $this->config->dbTableUsers; $this->DBGroup = $this->config->dbProfile; - $this->validationRules['email'] = 'required|if_exist|valid_email|is_unique[' . $this->table . '.email,id,{id}]'; - $this->validationRules['password'] = 'required|if_exist|min_length[' . $this->config->passwordMin . ']|max_length[' . $this->config->passwordMax . ']'; + $this->validationRules['email'] = 'required_with[username,password]|valid_email|is_unique[' . $this->table . '.email,id,{id}]'; + $this->validationRules['password'] = 'required_with[email,username]|min_length[' . $this->config->passwordMin . ']|max_length[' . $this->config->passwordMax . ']'; $this->validationRules['username'] = 'if_exist|is_unique[' . $this->table . '.username,id,{id}]|regex_match[/' . $this->config->userRegexPattern . '/]'; $this->validationMessages = [ @@ -122,7 +122,7 @@ class UserModel extends Model if ($this->config->loginUseUsername) { - $this->validationRules['username'] = 'required|if_exist|is_unique[' . $this->table . '.username,id,{id}]|regex_match[/' . $this->config->userRegexPattern . '/]'; + $this->validationRules['username'] = 'required_with[email,password]|is_unique[' . $this->table . '.username,id,{id}]|regex_match[/' . $this->config->userRegexPattern . '/]'; $this->validationMessages['username']['required'] = lang('Aauth.requiredUsername'); }