From 5369c74ec0df35aa072a6067837c1d748836b96e Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 18 Jul 2015 10:02:29 -0400 Subject: Add form to create remote user --- app/Model/User.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/Model') 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(), -- cgit v1.2.3