Browse Source

updated GroupModel, PermModel & UserModel

v3-dev
REJack 6 years ago
parent
commit
80f5ef6726
No known key found for this signature in database
GPG Key ID: 4A44B48700429F46
  1. 2
      application/Models/Aauth/GroupModel.php
  2. 2
      application/Models/Aauth/PermModel.php
  3. 6
      application/Models/Aauth/UserModel.php

2
application/Models/Aauth/GroupModel.php

@ -58,7 +58,7 @@ class GroupModel extends Model
$this->table = $this->config->dbTableGroups; $this->table = $this->config->dbTableGroups;
$this->DBGroup = $this->config->dbProfile; $this->DBGroup = $this->config->dbProfile;
$this->validationRules['name'] = 'required|is_unique[' . $this->table . '.name,id,{id}]'; $this->validationRules['name'] = 'required|is_unique[' . $this->table . '.name,id,{$row->id}]';
$this->validationMessages = [ $this->validationMessages = [
'name' => [ 'name' => [

2
application/Models/Aauth/PermModel.php

@ -58,7 +58,7 @@ class PermModel extends Model
$this->table = $this->config->dbTablePerms; $this->table = $this->config->dbTablePerms;
$this->DBGroup = $this->config->dbProfile; $this->DBGroup = $this->config->dbProfile;
$this->validationRules['name'] = 'required|is_unique[' . $this->table . '.name,id,{id}]'; $this->validationRules['name'] = 'required|is_unique[' . $this->table . '.name,id,{$row->id}]';
$this->validationMessages = [ $this->validationMessages = [
'name' => [ 'name' => [

6
application/Models/Aauth/UserModel.php

@ -98,9 +98,9 @@ class UserModel extends Model
$this->table = $this->config->dbTableUsers; $this->table = $this->config->dbTableUsers;
$this->DBGroup = $this->config->dbProfile; $this->DBGroup = $this->config->dbProfile;
$this->validationRules['email'] = 'required|if_exist|valid_email|is_unique[' . $this->table . '.email,id,{$id}]'; $this->validationRules['email'] = 'required|if_exist|valid_email|is_unique[' . $this->table . '.email,id,{$row->id}]';
$this->validationRules['password'] = 'required|if_exist|min_length[' . $this->config->passwordMin . ']|max_length[' . $this->config->passwordMax . ']'; $this->validationRules['password'] = 'required|if_exist|min_length[' . $this->config->passwordMin . ']|max_length[' . $this->config->passwordMax . ']';
$this->validationRules['username'] = 'if_exist|is_unique[' . $this->table . '.username,id,{$id}]|min_length[3]|regex_match[/' . $this->config->userRegexPattern . '/]'; $this->validationRules['username'] = 'if_exist|is_unique[' . $this->table . '.username,id,{$row->id}]|min_length[3]|regex_match[/' . $this->config->userRegexPattern . '/]';
$this->validationMessages = [ $this->validationMessages = [
'email' => [ 'email' => [
@ -122,7 +122,7 @@ class UserModel extends Model
if ($this->config->loginUseUsername) if ($this->config->loginUseUsername)
{ {
$this->validationRules['username'] = 'required|if_exist|is_unique[' . $this->table . '.username,id,{$id}]|min_length[3]|regex_match[/' . $this->config->userRegexPattern . '/]'; $this->validationRules['username'] = 'required|if_exist|is_unique[' . $this->table . '.username,id,{$row->id}]|min_length[3]|regex_match[/' . $this->config->userRegexPattern . '/]';
$this->validationMessages['username']['required'] = lang('Aauth.requiredUsername'); $this->validationMessages['username']['required'] = lang('Aauth.requiredUsername');
} }

Loading…
Cancel
Save