From 2d22199b1975e3d50a48af93fabc53566911bd3f Mon Sep 17 00:00:00 2001 From: REJack Date: Mon, 11 Feb 2019 18:47:07 +0100 Subject: [PATCH] Revert "updated UserModel" This reverts commit 00c0914f81bd3e0ba1d964e7138e7603a0de4c56. --- app/Models/Aauth/UserModel.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/Models/Aauth/UserModel.php b/app/Models/Aauth/UserModel.php index 10db6be..405b1c4 100644 --- a/app/Models/Aauth/UserModel.php +++ b/app/Models/Aauth/UserModel.php @@ -122,6 +122,18 @@ class UserModel extends Model } } + /** + * Update + */ + public function update($id = null, $data = null) + { + $this->validationRules['email'] = 'if_exist|valid_email|is_unique[' . $this->table . '.email,id,{id}]'; + $this->validationRules['password'] = 'if_exist|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 . '/]'; + + return parent::update($id, $data); + } + /** * Update last login by User ID *