diff options
Diffstat (limited to 'app/Model')
-rw-r--r-- | app/Model/User.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/Model/User.php b/app/Model/User.php index 36b7194c..b6804abc 100644 --- a/app/Model/User.php +++ b/app/Model/User.php @@ -377,6 +377,7 @@ class User extends Base new Validators\Unique('username', t('The username must be unique'), $this->db->getConnection(), self::TABLE, 'id'), new Validators\Email('email', t('Email address invalid')), new Validators\Integer('is_admin', t('This value must be an integer')), + new Validators\Integer('is_ldap_user', t('This value must be an integer')), ); } @@ -409,7 +410,12 @@ class User extends Base new Validators\Required('username', t('The username is required')), ); - $v = new Validator($values, array_merge($rules, $this->commonValidationRules(), $this->commonPasswordValidationRules())); + if (isset($values['is_ldap_user']) && $values['is_ldap_user'] == 1) { + $v = new Validator($values, array_merge($rules, $this->commonValidationRules())); + } + else { + $v = new Validator($values, array_merge($rules, $this->commonValidationRules(), $this->commonPasswordValidationRules())); + } return array( $v->execute(), |